Commit c6c11c42 authored by huyuchen's avatar huyuchen

优化修改

parent f37ad425
...@@ -841,19 +841,6 @@ ...@@ -841,19 +841,6 @@
</if> </if>
</sql> </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_socialFund_where2"> <sql id="tPaymentInfo_export_socialFund_where2">
<if test="tPaymentInfo != null"> <if test="tPaymentInfo != null">
<if test="tPaymentInfo.idList == null"> <if test="tPaymentInfo.idList == null">
...@@ -1167,6 +1154,22 @@ ...@@ -1167,6 +1154,22 @@
<!--tPaymentInfo简单分页查询--> <!--tPaymentInfo简单分页查询-->
<select id="getTPaymentInfoNewPage" resultMap="tPaymentInfoNewMap"> <select id="getTPaymentInfoNewPage" resultMap="tPaymentInfoNewMap">
SELECT SELECT
c.keyGroup,
c.EMP_IDCARD,
c.EMP_NAME,
c.UNIT_NAME,
c.SETTLE_DOMAIN_NAME,
c.SOCIAL_HOUSEHOLD,
c.SOCIAL_PAY_ADDR,
c.SOCIAL_PAY_MONTH,
c.SOCIAL_CREATE_MONTH,
c.SUM_ALL AS SUM_ALL,
c.PROVIDENT_HOUSEHOLD AS PROVIDENT_HOUSEHOLD,
c.PROVIDENT_PAY_ADDR AS PROVIDENT_PAY_ADDR,
c.SOCIAL_SUM,
c.PROVIDENT_SUM AS PROVIDENT_SUM
from (
select
w.keyGroup, w.keyGroup,
w.EMP_IDCARD, w.EMP_IDCARD,
w.EMP_NAME, w.EMP_NAME,
...@@ -1228,11 +1231,11 @@ ...@@ -1228,11 +1231,11 @@
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
) )
) w ) w
GROUP BY w.keyGroup ) c
<where> <where>
1 = 1 1 = 1
<include refid="tPaymentInfo_export_socialFund_where"/> <include refid="tPaymentInfo_export_socialFund_where2"/>
</where> </where>
GROUP BY w.keyGroup
</select> </select>
<!--tPaymentInfo简单分页查询--> <!--tPaymentInfo简单分页查询-->
...@@ -1464,11 +1467,11 @@ ...@@ -1464,11 +1467,11 @@
IFNULL(a.SOCIAL_ID,'1') != '1' IFNULL(a.SOCIAL_ID,'1') != '1'
<include refid="tPaymentInfo_export_social_where"/> <include refid="tPaymentInfo_export_social_where"/>
</where> </where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
) )
union all union all
(SELECT (SELECT
CONCAT( a.EMP_IDCARD, '_', a.SOCIAL_PAY_MONTH, '_', a.SOCIAL_CREATE_MONTH, '_', a.SETTLE_DOMAIN_CODE ) AS keyGroup, CONCAT( a.EMP_IDCARD, '_', a.PROVIDENT_PAY_MONTH, '_', a.PROVIDENT_CREATE_MONTH, '_', a.SETTLE_DOMAIN_CODE ) AS keyGroup,
a.SOCIAL_HOUSEHOLD, a.SOCIAL_HOUSEHOLD,
a.PROVIDENT_HOUSEHOLD a.PROVIDENT_HOUSEHOLD
FROM t_payment_info a FROM t_payment_info a
...@@ -1476,7 +1479,7 @@ ...@@ -1476,7 +1479,7 @@
IFNULL(a.FUND_ID,'1') != '1' IFNULL(a.FUND_ID,'1') != '1'
<include refid="tPaymentInfo_export_fund_where"/> <include refid="tPaymentInfo_export_fund_where"/>
</where> </where>
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
) )
) w ) w
GROUP BY w.keyGroup) c GROUP BY w.keyGroup) c
...@@ -1489,6 +1492,53 @@ ...@@ -1489,6 +1492,53 @@
<!--tPaymentInfo简单分页查询--> <!--tPaymentInfo简单分页查询-->
<select id="getTPaymentInfoNewExportInfo" resultMap="tPaymentInfoNewExportMap"> <select id="getTPaymentInfoNewExportInfo" resultMap="tPaymentInfoNewExportMap">
SELECT SELECT
c.keyGroup,
c.EMP_IDCARD,
c.EMP_NO,
c.EMP_NAME,
c.UNIT_NAME,
c.SETTLE_DOMAIN_CODE,
c.SETTLE_DOMAIN_NAME,
c.SOCIAL_HOUSEHOLD,
c.SOCIAL_SECURITY_NO,
c.SOCIAL_PAY_ADDR,
c.SOCIAL_PAY_MONTH,
c.SOCIAL_CREATE_MONTH,
c.PERSONAL_PROVIDENT_SUM,
c.SUM_ALL,
c.PROVIDENT_PAY_MONTH,
c.PROVIDENT_CREATE_MONTH,
c.PROVIDENT_HOUSEHOLD,
c.PROVIDENT_PAY_ADDR,
c.SOCIAL_SUM,
c.UNIT_SOCIAL_SUM,
c.SOCIAL_SECURITY_PERSONAL_SUM,
c.PROVIDENT_SUM,
c.INAUGURAL_TEAM,
c.COMPANY_ACCRUAL,
c.PERSONAL_ACCRUAL,
c.UNIT_PENSION_SET,
c.UNIT_MEDICAL_SET,
c.UNIT_UNEMPLOYMENT_SET,
c.UNIT_INJURY_SET,
c.UNIT_BIRTH_SET,
c.UNIT_PENSION_MONEY,
c.UNIT_MEDICAL_MONEY,
c.UNIT_UNEMPLOYMENT_MONEY,
c.UNIT_INJURY_MONEY,
c.UNIT_BIRTH_MONEY,
c.UNIT_BIGMAILMENT_MONEY,
c.PERSONAL_PENSION_MONEY,
c.PERSONAL_MEDICAL_MONEY,
c.PERSONAL_UNEMPLOYMENT_MONEY,
c.PERSONAL_BIGMAILMENT_MONEY,
c.PROVIDENT_NO AS PROVIDENT_NO,
c.PERSONAL_PROIDENT_SET,
c.UNIT_PROVIDENT_SET,
c.PROVIDENT_PERCENT,
c.UNIT_PROVIDENT_SUM
from (
select
w.keyGroup, w.keyGroup,
w.EMP_IDCARD, w.EMP_IDCARD,
w.EMP_NO, w.EMP_NO,
...@@ -1643,11 +1693,11 @@ ...@@ -1643,11 +1693,11 @@
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
) )
) w ) w
GROUP BY w.keyGroup) c
<where> <where>
1 = 1 1 = 1
<include refid="tPaymentInfo_export_socialFund_where"/> <include refid="tPaymentInfo_export_socialFund_where2"/>
</where> </where>
GROUP BY w.keyGroup
limit #{tPaymentInfo.limitStart},#{tPaymentInfo.limitEnd} limit #{tPaymentInfo.limitStart},#{tPaymentInfo.limitEnd}
</select> </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