Commit f37ad425 authored by huyuchen's avatar huyuchen

优化修改

parent 63dc7349
......@@ -854,6 +854,19 @@
</if>
</sql>
<sql id="tPaymentInfo_export_socialFund_where2">
<if test="tPaymentInfo != null">
<if test="tPaymentInfo.idList == null">
<if test="tPaymentInfo.socialHousehold != null and tPaymentInfo.socialHousehold.trim() != ''">
AND c.SOCIAL_HOUSEHOLD = #{tPaymentInfo.socialHousehold}
</if>
<if test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != ''">
AND c.PROVIDENT_HOUSEHOLD = #{tPaymentInfo.providentHousehold}
</if>
</if>
</if>
</sql>
<sql id="tPaymentInfo_export_socialFund_where1">
<if test="tPaymentInfo != null">
<if test="tPaymentInfo.idList == null">
......@@ -1441,9 +1454,11 @@
SELECT
count(1)
FROM (
select * from (
select w.SOCIAL_HOUSEHOLD,w.PROVIDENT_HOUSEHOLD from (
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH, '_', a.SETTLE_DOMAIN_CODE ) AS keyGroup
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH, '_', a.SETTLE_DOMAIN_CODE ) AS keyGroup,
a.SOCIAL_HOUSEHOLD,
a.PROVIDENT_HOUSEHOLD
FROM t_payment_info a
<where>
IFNULL(a.SOCIAL_ID,'1') != '1'
......@@ -1453,7 +1468,9 @@
)
union all
(SELECT
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH, '_', a.SETTLE_DOMAIN_CODE ) AS keyGroup
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH, '_', a.SETTLE_DOMAIN_CODE ) AS keyGroup,
a.SOCIAL_HOUSEHOLD,
a.PROVIDENT_HOUSEHOLD
FROM t_payment_info a
<where>
IFNULL(a.FUND_ID,'1') != '1'
......@@ -1462,11 +1479,11 @@
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH
)
) w
GROUP BY w.keyGroup) c
<where>
1 = 1
<include refid="tPaymentInfo_export_socialFund_where"/>
<include refid="tPaymentInfo_export_socialFund_where2"/>
</where>
GROUP BY w.keyGroup) c
</select>
<!--tPaymentInfo简单分页查询-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment