Commit a4b30006 authored by huyuchen's avatar huyuchen

优化修改

parent 1675d947
......@@ -786,35 +786,27 @@
<if test='tPaymentInfo.areaFlag == null || tPaymentInfo.areaFlag == "1"'>
<if test="tPaymentInfo.socialTown == null">
<if test="tPaymentInfo.socialCity != null">
AND (a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' or a.FUND_CITY = '${tPaymentInfo.socialCity}')
AND a.SOCIAL_CITY = '${tPaymentInfo.socialCity}'
</if>
<if test="tPaymentInfo.socialCity == null">
<if test="tPaymentInfo.socialProvince != null">
AND (a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}' or a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}')
AND a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}'
</if>
</if>
</if>
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
AND a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}'
</if>
</if>
<if test='tPaymentInfo.areaFlag == "0"'>
<if test="tPaymentInfo.socialProvince != null and tPaymentInfo.socialProvince.trim() != '' and tPaymentInfo.socialCity == null">
AND (
(a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}' and (a.SOCIAL_CITY is null or a.SOCIAL_CITY =''))
or
(a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}' and (a.FUND_CITY is null or a.FUND_CITY =''))
)
AND a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}' and (a.SOCIAL_CITY is null or a.SOCIAL_CITY ='')
</if>
<if test="tPaymentInfo.socialCity != null and tPaymentInfo.socialCity.trim() != '' and tPaymentInfo.socialTown == null">
AND (
(a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' and (a.SOCIAL_TOWN is null or a.SOCIAL_TOWN =''))
or
(a.FUND_CITY = '${tPaymentInfo.socialCity}' and (a.FUND_TOWN is null or a.FUND_TOWN =''))
)
AND a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' and (a.SOCIAL_TOWN is null or a.SOCIAL_TOWN ='')
</if>
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
AND a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}'
</if>
</if>
<!-- 区域 默认精准查询 0 包含下级查询 1 结束 2023-03-02 fxj -->
......@@ -822,6 +814,19 @@
</if>
</sql>
<sql id="tPaymentInfo_export_socialFund_where">
<if test="tPaymentInfo != null">
<if test="tPaymentInfo.idList == null">
<if test="tPaymentInfo.socialHousehold != null and tPaymentInfo.socialHousehold.trim() != ''">
AND w.SOCIAL_HOUSEHOLD = #{tPaymentInfo.socialHousehold}
</if>
<if test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != ''">
AND w.PROVIDENT_HOUSEHOLD = #{tPaymentInfo.providentHousehold}
</if>
</if>
</if>
</sql>
<sql id="tPaymentInfo_export_fund_where">
<if test="tPaymentInfo != null">
<if test="tPaymentInfo.idList == null">
......@@ -850,35 +855,27 @@
<if test='tPaymentInfo.areaFlag == null || tPaymentInfo.areaFlag == "1"'>
<if test="tPaymentInfo.socialTown == null">
<if test="tPaymentInfo.socialCity != null">
AND (a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' or a.FUND_CITY = '${tPaymentInfo.socialCity}')
AND a.FUND_CITY = '${tPaymentInfo.socialCity}'
</if>
<if test="tPaymentInfo.socialCity == null">
<if test="tPaymentInfo.socialProvince != null">
AND (a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}' or a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}')
AND a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}'
</if>
</if>
</if>
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
AND a.FUND_TOWN = '${tPaymentInfo.socialTown}'
</if>
</if>
<if test='tPaymentInfo.areaFlag == "0"'>
<if test="tPaymentInfo.socialProvince != null and tPaymentInfo.socialProvince.trim() != '' and tPaymentInfo.socialCity == null">
AND (
(a.SOCIAL_PROVINCE = '${tPaymentInfo.socialProvince}' and (a.SOCIAL_CITY is null or a.SOCIAL_CITY =''))
or
(a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}' and (a.FUND_CITY is null or a.FUND_CITY =''))
)
AND a.FUND_PROVINCE = '${tPaymentInfo.socialProvince}' and (a.FUND_CITY is null or a.FUND_CITY ='')
</if>
<if test="tPaymentInfo.socialCity != null and tPaymentInfo.socialCity.trim() != '' and tPaymentInfo.socialTown == null">
AND (
(a.SOCIAL_CITY = '${tPaymentInfo.socialCity}' and (a.SOCIAL_TOWN is null or a.SOCIAL_TOWN =''))
or
(a.FUND_CITY = '${tPaymentInfo.socialCity}' and (a.FUND_TOWN is null or a.FUND_TOWN =''))
)
AND a.FUND_CITY = '${tPaymentInfo.socialCity}' and (a.FUND_TOWN is null or a.FUND_TOWN ='')
</if>
<if test="tPaymentInfo.socialTown != null and tPaymentInfo.socialTown.trim() != ''">
AND (a.SOCIAL_TOWN = '${tPaymentInfo.socialTown}' or a.FUND_TOWN = '${tPaymentInfo.socialTown}')
AND a.FUND_TOWN = '${tPaymentInfo.socialTown}'
</if>
</if>
<!-- 区域 默认精准查询 0 包含下级查询 1 结束 2023-03-02 fxj -->
......@@ -1169,6 +1166,10 @@
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
)
) w
<where>
1 = 1
<include refid="tPaymentInfo_export_socialFund_where"/>
</where>
GROUP BY w.keyGroup
</select>
......
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