trunc((select sum(count(*)) from M_TSXQ a,s_tslx b where a.tslxid = b.tslxid <iftest="year != null and year !='' "> and to_char(a.tssj,'yyyy') = #{year} </if> and b.zlx = 1 group by grzh)/(select count(*) from hg2018.wxn_user) ,6)*100
trunc((select sum(count(*)) from M_TSXQ a,s_tslx b where a.tslxid = b.tslxid <iftest="year != null and year !='' "> and to_char(a.tssj,'yyyy') = #{year} </if> and b.zlx = 1 group by grzh)/(select count(*) from gjj80..wxn_user) ,6)*100
,'999990.9999') ||'%' tslzb,
to_char(
1-trunc((select sum(count(*)) from M_TSXQ a,s_tslx b where a.tslxid = b.tslxid <iftest="year != null and year !='' "> and to_char(a.tssj,'yyyy') = #{year} </if> and b.zlx = 1 group by grzh)/(select count(*) from hg2018.wxn_user) ,6)*100
1-trunc((select sum(count(*)) from M_TSXQ a,s_tslx b where a.tslxid = b.tslxid <iftest="year != null and year !='' "> and to_char(a.tssj,'yyyy') = #{year} </if> and b.zlx = 1 group by grzh)/(select count(*) from gjj80..wxn_user) ,6)*100
,'999990.9999') ||'%' ftslzb,
trunc((select sum(count(*)) from M_TSXQ a,s_tslx b where a.tslxid = b.tslxid <iftest="year != null and year !='' "> and to_char(a.tssj,'yyyy') = #{year} </if> and b.zlx = 1 group by grzh)/(select count(*) from hg2018.wxn_user) ,6)*100
trunc((select sum(count(*)) from M_TSXQ a,s_tslx b where a.tslxid = b.tslxid <iftest="year != null and year !='' "> and to_char(a.tssj,'yyyy') = #{year} </if> and b.zlx = 1 group by grzh)/(select count(*) from gjj80..wxn_user) ,6)*100
tslsl,
1-trunc((select sum(count(*)) from M_TSXQ a,s_tslx b where a.tslxid = b.tslxid <iftest="year != null and year !='' "> and to_char(a.tssj,'yyyy') = #{year} </if> and b.zlx = 1 group by grzh)/(select count(*) from hg2018.wxn_user) ,6)*100
1-trunc((select sum(count(*)) from M_TSXQ a,s_tslx b where a.tslxid = b.tslxid <iftest="year != null and year !='' "> and to_char(a.tssj,'yyyy') = #{year} </if> and b.zlx = 1 group by grzh)/(select count(*) from gjj80..wxn_user) ,6)*100
(select count(*) from m_ywblxq a,hg2018.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 18 and to_char(sysdate,'yyyy') - substr(b.csny,1,4) <= 30 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''">and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age1830,
(select count(*) from m_ywblxq a,hg2018.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 30 and to_char(sysdate,'yyyy') - substr(b.csny,1,4) <= 40 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''">and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age3040,
(select count(*) from m_ywblxq a,hg2018.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 40 and to_char(sysdate,'yyyy') - substr(b.csny,1,4) <= 50 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''">and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age4050,
(select count(*) from m_ywblxq a,hg2018.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 50 and to_char(sysdate,'yyyy') - substr(b.csny,1,4) <= 65 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''">and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age5065,
(select count(*) from m_ywblxq a,hg2018.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 65 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''"> and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age65
(select count(*) from m_ywblxq a,gjj80.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 18 and to_char(sysdate,'yyyy') - substr(b.csny,1,4) <= 30 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''">and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age1830,
(select count(*) from m_ywblxq a,gjj80.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 30 and to_char(sysdate,'yyyy') - substr(b.csny,1,4) <= 40 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''">and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age3040,
(select count(*) from m_ywblxq a,gjj80.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 40 and to_char(sysdate,'yyyy') - substr(b.csny,1,4) <= 50 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''">and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age4050,
(select count(*) from m_ywblxq a,gjj80.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 50 and to_char(sysdate,'yyyy') - substr(b.csny,1,4) <= 65 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''">and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age5065,
(select count(*) from m_ywblxq a,gjj80.wxn_user b where a.grzh = b.grzh and to_char(sysdate,'yyyy') - substr(b.csny,1,4) > 65 <iftest="qssj != null and qssj !='' and zzsj != null and zzsj !=''"> and to_char(a.blsj,'yyyy-mm-dd') between #{qssj} and #{zzsj}</if> and a.ywlx = #{ywbm}) age65
from hg2018.wxn_user w inner join s_qdzd a on w.zcqdid = a.qdid inner join s_qdzd b on w.zhdlqdid = b.qdid and w.grzh is not null and (INSTR(w.ZJHM || ',' || w.XINGMING || ',' || w.GRZH, #{data}) > 0 OR #{data} IS NULL)
from gjj80..wxn_user w inner join s_qdzd a on w.zcqdid = a.qdid inner join s_qdzd b on w.zhdlqdid = b.qdid and w.grzh is not null and (INSTR(w.ZJHM || ',' || w.XINGMING || ',' || w.GRZH, #{data}) > 0 OR #{data} IS NULL)
<iftest="yhlb != null and yhlb !=''">and iszx = #{yhlb}</if>
<choose>
<whentest="zckssj != null and zckssj !='' and zcjssj != null and zcjssj !=''">
...
...
@@ -31,16 +31,16 @@
</select>
<updateid="userInfoUpdate">
update hg2018.wxn_user a set a.grzh = a.grzh <iftest="xingbie != null and xingbie !=''">,a.xingbie = #{xingbie}</if><iftest="xmqp != null and xmqp !=''">,a.xmqp =#{xmqp}</if><iftest="csny != null and csny !=''">,a.csny = #{csny}</if>
update gjj80..wxn_user a set a.grzh = a.grzh <iftest="xingbie != null and xingbie !=''">,a.xingbie = #{xingbie}</if><iftest="xmqp != null and xmqp !=''">,a.xmqp =#{xmqp}</if><iftest="csny != null and csny !=''">,a.csny = #{csny}</if>
where a.grzh = #{grzh}
</update>
<updateid="iszx">
update hg2018.wxn_user a set a.iszx = #{iszx},a.zxbz=#{zxbz} where a.grzh = #{grzh}
update gjj80..wxn_user a set a.iszx = #{iszx},a.zxbz=#{zxbz} where a.grzh = #{grzh}
</update>
<selectid="zxzt"resultType="string">
select iszx from hg2018.wxn_user where grzh = #{grzh}
select iszx from gjj80..wxn_user where grzh = #{grzh}