Commit 2e7a0ba5 authored by huyuchen's avatar huyuchen

优化修改

parent 8bfccdad
......@@ -841,14 +841,14 @@
</if>
</sql>
<sql id="tPaymentInfo_export_socialFund_where">
<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 w.SOCIAL_HOUSEHOLD = #{tPaymentInfo.socialHousehold}
AND c.SOCIAL_HOUSEHOLD = #{tPaymentInfo.socialHousehold}
</if>
<if test="tPaymentInfo.providentHousehold != null and tPaymentInfo.providentHousehold.trim() != ''">
AND w.PROVIDENT_HOUSEHOLD = #{tPaymentInfo.providentHousehold}
AND c.PROVIDENT_HOUSEHOLD = #{tPaymentInfo.providentHousehold}
</if>
</if>
</if>
......@@ -1154,6 +1154,22 @@
<!--tPaymentInfo简单分页查询-->
<select id="getTPaymentInfoNewPage" resultMap="tPaymentInfoNewMap">
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.EMP_IDCARD,
w.EMP_NAME,
......@@ -1215,11 +1231,11 @@
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
)
) 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
</select>
<!--tPaymentInfo简单分页查询-->
......@@ -1431,9 +1447,9 @@
) w
GROUP BY w.keyGroup) k
<where>
1 = 1
<include refid="tPaymentInfo_export_socialFund_where1"/>
</where>
1 = 1
<include refid="tPaymentInfo_export_socialFund_where1"/>
</where>
</select>
<!--tPaymentInfo数量查询-->
......@@ -1441,37 +1457,88 @@
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'
<include refid="tPaymentInfo_export_social_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
(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.PROVIDENT_HOUSEHOLD
FROM t_payment_info a
<where>
IFNULL(a.FUND_ID,'1') != '1'
<include refid="tPaymentInfo_export_fund_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
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简单分页查询-->
<select id="getTPaymentInfoNewExportInfo" resultMap="tPaymentInfoNewExportMap">
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.EMP_IDCARD,
w.EMP_NO,
......@@ -1626,11 +1693,11 @@
GROUP BY a.EMP_IDCARD,a.PROVIDENT_PAY_MONTH,a.PROVIDENT_CREATE_MONTH,a.SETTLE_DOMAIN_CODE
)
) 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
limit #{tPaymentInfo.limitStart},#{tPaymentInfo.limitEnd}
</select>
......@@ -1957,8 +2024,8 @@
DATE_FORMAT(a.CREATE_TIME,'%Y-%m-%d') AS CREATE_NAME
FROM t_payment_info a
<where>
IFNULL(a.SOCIAL_ID,'1') != '1' and a.PUSH_STATUS = '1' and a.LOCK_STATUS = '1'
<include refid="tPaymentInfo_export_push_where"/>
IFNULL(a.SOCIAL_ID,'1') != '1' and a.PUSH_STATUS = '1' and a.LOCK_STATUS = '1'
<include refid="tPaymentInfo_export_push_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SOCIAL_PAY_MONTH,a.SOCIAL_CREATE_MONTH,a.SOCIAL_PAY_ADDR
limit 0,10000
......@@ -2072,11 +2139,11 @@
<!--tPaymentInfo 按ID查收缴费库包含社保和公积金明细的数据查询-->
<select id="getAllPushInfoById" resultMap="tPaymentInfoMap">
SELECT
ID,
INCOME_SETTLE_FLAG,
INCOME_COLLECT_FLAG,
PAY_COLLECT_FLAG,
PAY_SETTLE_FLAG
ID,
INCOME_SETTLE_FLAG,
INCOME_COLLECT_FLAG,
PAY_COLLECT_FLAG,
PAY_SETTLE_FLAG
FROM t_payment_info a
where a.ID in (${idStr})
</select>
......@@ -2202,14 +2269,14 @@
<update id="updatePaymentSocialAndFound">
update t_payment_info
set UNIT_ID = #{infoVo.unitId},
UNIT_NAME = #{infoVo.unitName},
SETTLE_DOMAIN_NAME = #{infoVo.settleDomainName},
SETTLE_DOMAIN_CODE = #{infoVo.settleDomainCode},
SETTLE_DOMAIN_ID = #{infoVo.settleDomainId}
UNIT_NAME = #{infoVo.unitName},
SETTLE_DOMAIN_NAME = #{infoVo.settleDomainName},
SETTLE_DOMAIN_CODE = #{infoVo.settleDomainCode},
SETTLE_DOMAIN_ID = #{infoVo.settleDomainId}
where
((SALARY_SOCIAL_FLAG = '0' and SOCIAL_CREATE_MONTH >= #{infoVo.socialCreateMonth}) or
(SALARY_FUND_FLAG = '0' and PROVIDENT_CREATE_MONTH >= #{infoVo.socialCreateMonth}))
and PUSH_STATUS = '1' and EMP_IDCARD = #{infoVo.empIdcard}
(SALARY_FUND_FLAG = '0' and PROVIDENT_CREATE_MONTH >= #{infoVo.socialCreateMonth}))
and PUSH_STATUS = '1' and EMP_IDCARD = #{infoVo.empIdcard}
</update>
<!-- 更改薪资公积金结算状态 -->
......@@ -2244,11 +2311,11 @@
<update id="changePaymentDept">
update t_payment_info p
set
p.SETTLE_DOMAIN_ID = #{dept.id}
,p.SETTLE_DOMAIN_NAME = #{dept.departName}
,p.SETTLE_DOMAIN_CODE = #{dept.departNo}
,p.UNIT_ID = #{dept.customerId}
,p.UNIT_NAME = #{dept.customerName}
p.SETTLE_DOMAIN_ID = #{dept.id}
,p.SETTLE_DOMAIN_NAME = #{dept.departName}
,p.SETTLE_DOMAIN_CODE = #{dept.departNo}
,p.UNIT_ID = #{dept.customerId}
,p.UNIT_NAME = #{dept.customerName}
where (p.SALARY_SOCIAL_FLAG = '0' and p.SALARY_FUND_FLAG = '0') and p.id in
<foreach item="item" index="index" collection="idSet" open="(" separator="," close=")">
#{item}
......@@ -2369,81 +2436,81 @@
<!--tPaymentInfo 缴费库包含明细的数据查询查询 核准表生成查询专用-->
<select id="getPaymentAllInfoList" resultMap="tPaymentAllInfoMap">
SELECT
a.ID,
a.EMP_NAME,
a.EMP_NO,
a.EMP_ID,
a.EMP_IDCARD,
a.UNIT_ID,
a.SETTLE_DOMAIN_ID,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.CREATE_BY,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.LOCK_STATUS,
a.SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.SOCIAL_ID,
a.FUND_ID,
a.SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.SOCIAL_SECURITY_PERSONAL_SUM,
a.PROVIDENT_SUM,
a.INAUGURAL_TEAM,
a.SALARY_SOCIAL_FLAG,
a.SALARY_FUND_FLAG,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
a.UNIT_PENSION_SET as PERSONAL_PENSION_SET,
a.UNIT_MEDICAL_SET as PERSONAL_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET as PERSONAL_UNEMPLOYMENT_SET,
a.UNIT_PENSION_PER,
a.UNIT_MEDICAL_PER,
a.UNIT_UNEMPLOYMENT_PER,
a.UNIT_INJURY_PER,
a.UNIT_BIRTH_PER,
a.PERSONAL_PENSION_PER,
a.PERSONAL_MEDICAL_PER,
a.PERSONAL_UNEMPLOYMENT_PER,
a.UNIT_BIGAILMENT_PER,
a.PERSONAL_BIGAILMENT_PER,
a.UNIT_PENSION_MONEY,
a.UNIT_MEDICAL_MONEY,
a.UNIT_UNEMPLOYMENT_MONEY,
a.UNIT_INJURY_MONEY,
a.UNIT_BIRTH_MONEY,
a.UNIT_BIGMAILMENT_MONEY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.UNIT_PROVIDENT_SUM,
a.PERSONAL_PROIDENT_SET,
a.PERSONAL_PROVIDENT_SUM
a.ID,
a.EMP_NAME,
a.EMP_NO,
a.EMP_ID,
a.EMP_IDCARD,
a.UNIT_ID,
a.SETTLE_DOMAIN_ID,
a.SOCIAL_HOUSEHOLD,
a.SOCIAL_SECURITY_NO,
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.CREATE_BY,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.LOCK_STATUS,
a.SUM_ALL,
a.PROVIDENT_PAY_MONTH,
a.PROVIDENT_CREATE_MONTH,
a.PROVIDENT_HOUSEHOLD,
a.PROVIDENT_PAY_ADDR,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.SOCIAL_ID,
a.FUND_ID,
a.SOCIAL_SUM,
a.UNIT_SOCIAL_SUM,
a.SOCIAL_SECURITY_PERSONAL_SUM,
a.PROVIDENT_SUM,
a.INAUGURAL_TEAM,
a.SALARY_SOCIAL_FLAG,
a.SALARY_FUND_FLAG,
a.COMPANY_ACCRUAL,
a.PERSONAL_ACCRUAL,
a.UNIT_PENSION_SET,
a.UNIT_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET,
a.UNIT_INJURY_SET,
a.UNIT_BIRTH_SET,
a.UNIT_PENSION_SET as PERSONAL_PENSION_SET,
a.UNIT_MEDICAL_SET as PERSONAL_MEDICAL_SET,
a.UNIT_UNEMPLOYMENT_SET as PERSONAL_UNEMPLOYMENT_SET,
a.UNIT_PENSION_PER,
a.UNIT_MEDICAL_PER,
a.UNIT_UNEMPLOYMENT_PER,
a.UNIT_INJURY_PER,
a.UNIT_BIRTH_PER,
a.PERSONAL_PENSION_PER,
a.PERSONAL_MEDICAL_PER,
a.PERSONAL_UNEMPLOYMENT_PER,
a.UNIT_BIGAILMENT_PER,
a.PERSONAL_BIGAILMENT_PER,
a.UNIT_PENSION_MONEY,
a.UNIT_MEDICAL_MONEY,
a.UNIT_UNEMPLOYMENT_MONEY,
a.UNIT_INJURY_MONEY,
a.UNIT_BIRTH_MONEY,
a.UNIT_BIGMAILMENT_MONEY,
a.PERSONAL_PENSION_MONEY,
a.PERSONAL_MEDICAL_MONEY,
a.PERSONAL_UNEMPLOYMENT_MONEY,
a.PERSONAL_BIGMAILMENT_MONEY,
a.PROVIDENT_NO,
a.UNIT_PROVIDENT_SET,
a.PROVIDENT_PERCENT,
a.UNIT_PROVIDENT_SUM,
a.PERSONAL_PROIDENT_SET,
a.PERSONAL_PROVIDENT_SUM
FROM t_payment_info a
<where>
1=1
......@@ -2457,8 +2524,8 @@
<!-- 按年模糊查询B端查询个人指定年费的缴费库数据 -->
<if test="tPaymentInfo.likeYear != null and tPaymentInfo.likeYear.trim() != ''">
AND (
a.SOCIAL_PAY_MONTH like CONCAT(#{tPaymentInfo.likeYear},'%')
or a.PROVIDENT_PAY_MONTH like CONCAT(#{tPaymentInfo.likeYear},'%')
a.SOCIAL_PAY_MONTH like CONCAT(#{tPaymentInfo.likeYear},'%')
or a.PROVIDENT_PAY_MONTH like CONCAT(#{tPaymentInfo.likeYear},'%')
)
</if>
<if test="tPaymentInfo.id != null and tPaymentInfo.id.trim() != ''">
......@@ -2587,26 +2654,26 @@
<select id="getSocialAndFundBusinessDataPage" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialAndFundBusinessPageVo">
SELECT
ifnull(a.SOCIAL_PAY_MONTH,a.PROVIDENT_PAY_MONTH) as 'month',
a.SETTLE_DOMAIN_ID as 'settleDomainId',
SUM(
IF(a.PERSONAL_ACCRUAL,a.PERSONAL_ACCRUAL,0) +
IF(a.PERSONAL_BIGMAILMENT_MONEY,a.PERSONAL_BIGMAILMENT_MONEY,0) +
IF(a.PERSONAL_MEDICAL_MONEY,a.PERSONAL_MEDICAL_MONEY,0) +
IF(a.PERSONAL_UNEMPLOYMENT_MONEY,a.PERSONAL_UNEMPLOYMENT_MONEY,0) +
IF(a.PERSONAL_PENSION_MONEY,a.PERSONAL_PENSION_MONEY,0) +
IF(a.PERSONAL_PROVIDENT_SUM,a.PERSONAL_PROVIDENT_SUM,0)
) AS "personalSum",
SUM(
IF(a.UNIT_BIGMAILMENT_MONEY,a.UNIT_BIGMAILMENT_MONEY,0) +
IF(a.COMPANY_ACCRUAL,a.COMPANY_ACCRUAL,0) +
IF(a.UNIT_PENSION_MONEY,a.UNIT_PENSION_MONEY,0) +
IF(a.UNIT_MEDICAL_MONEY,a.UNIT_MEDICAL_MONEY,0) +
IF(a.UNIT_INJURY_MONEY,a.UNIT_INJURY_MONEY,0) +
IF(a.UNIT_UNEMPLOYMENT_MONEY,a.UNIT_UNEMPLOYMENT_MONEY,0) +
IF(a.UNIT_BIRTH_MONEY,a.UNIT_BIRTH_MONEY,0) +
IF(a.UNIT_PROVIDENT_SUM,a.UNIT_PROVIDENT_SUM,0)
) AS "unitSum"
ifnull(a.SOCIAL_PAY_MONTH,a.PROVIDENT_PAY_MONTH) as 'month',
a.SETTLE_DOMAIN_ID as 'settleDomainId',
SUM(
IF(a.PERSONAL_ACCRUAL,a.PERSONAL_ACCRUAL,0) +
IF(a.PERSONAL_BIGMAILMENT_MONEY,a.PERSONAL_BIGMAILMENT_MONEY,0) +
IF(a.PERSONAL_MEDICAL_MONEY,a.PERSONAL_MEDICAL_MONEY,0) +
IF(a.PERSONAL_UNEMPLOYMENT_MONEY,a.PERSONAL_UNEMPLOYMENT_MONEY,0) +
IF(a.PERSONAL_PENSION_MONEY,a.PERSONAL_PENSION_MONEY,0) +
IF(a.PERSONAL_PROVIDENT_SUM,a.PERSONAL_PROVIDENT_SUM,0)
) AS "personalSum",
SUM(
IF(a.UNIT_BIGMAILMENT_MONEY,a.UNIT_BIGMAILMENT_MONEY,0) +
IF(a.COMPANY_ACCRUAL,a.COMPANY_ACCRUAL,0) +
IF(a.UNIT_PENSION_MONEY,a.UNIT_PENSION_MONEY,0) +
IF(a.UNIT_MEDICAL_MONEY,a.UNIT_MEDICAL_MONEY,0) +
IF(a.UNIT_INJURY_MONEY,a.UNIT_INJURY_MONEY,0) +
IF(a.UNIT_UNEMPLOYMENT_MONEY,a.UNIT_UNEMPLOYMENT_MONEY,0) +
IF(a.UNIT_BIRTH_MONEY,a.UNIT_BIRTH_MONEY,0) +
IF(a.UNIT_PROVIDENT_SUM,a.UNIT_PROVIDENT_SUM,0)
) AS "unitSum"
FROM t_payment_info a
<where>
1=1
......@@ -2616,40 +2683,40 @@
</if>
<if test="socialAndFundBusinessPageVo.year != null and socialAndFundBusinessPageVo.year.trim() != ''">
AND (
(
a.SOCIAL_PAY_MONTH in(
CONCAT(#{socialAndFundBusinessPageVo.year},'01'),
CONCAT(#{socialAndFundBusinessPageVo.year},'02'),
CONCAT(#{socialAndFundBusinessPageVo.year},'03'),
CONCAT(#{socialAndFundBusinessPageVo.year},'04'),
CONCAT(#{socialAndFundBusinessPageVo.year},'05'),
CONCAT(#{socialAndFundBusinessPageVo.year},'06'),
CONCAT(#{socialAndFundBusinessPageVo.year},'07'),
CONCAT(#{socialAndFundBusinessPageVo.year},'08'),
CONCAT(#{socialAndFundBusinessPageVo.year},'09'),
CONCAT(#{socialAndFundBusinessPageVo.year},'10'),
CONCAT(#{socialAndFundBusinessPageVo.year},'11'),
CONCAT(#{socialAndFundBusinessPageVo.year},'12')
)
AND a.SOCIAL_PAY_MONTH >= CONCAT(#{socialAndFundBusinessPageVo.year},'01')
) or
(
a.PROVIDENT_PAY_MONTH in (
CONCAT(#{socialAndFundBusinessPageVo.year},'01'),
CONCAT(#{socialAndFundBusinessPageVo.year},'02'),
CONCAT(#{socialAndFundBusinessPageVo.year},'03'),
CONCAT(#{socialAndFundBusinessPageVo.year},'04'),
CONCAT(#{socialAndFundBusinessPageVo.year},'05'),
CONCAT(#{socialAndFundBusinessPageVo.year},'06'),
CONCAT(#{socialAndFundBusinessPageVo.year},'07'),
CONCAT(#{socialAndFundBusinessPageVo.year},'08'),
CONCAT(#{socialAndFundBusinessPageVo.year},'09'),
CONCAT(#{socialAndFundBusinessPageVo.year},'10'),
CONCAT(#{socialAndFundBusinessPageVo.year},'11'),
CONCAT(#{socialAndFundBusinessPageVo.year},'12')
)
AND a.PROVIDENT_PAY_MONTH >= CONCAT(#{socialAndFundBusinessPageVo.year},'01')
)
(
a.SOCIAL_PAY_MONTH in(
CONCAT(#{socialAndFundBusinessPageVo.year},'01'),
CONCAT(#{socialAndFundBusinessPageVo.year},'02'),
CONCAT(#{socialAndFundBusinessPageVo.year},'03'),
CONCAT(#{socialAndFundBusinessPageVo.year},'04'),
CONCAT(#{socialAndFundBusinessPageVo.year},'05'),
CONCAT(#{socialAndFundBusinessPageVo.year},'06'),
CONCAT(#{socialAndFundBusinessPageVo.year},'07'),
CONCAT(#{socialAndFundBusinessPageVo.year},'08'),
CONCAT(#{socialAndFundBusinessPageVo.year},'09'),
CONCAT(#{socialAndFundBusinessPageVo.year},'10'),
CONCAT(#{socialAndFundBusinessPageVo.year},'11'),
CONCAT(#{socialAndFundBusinessPageVo.year},'12')
)
AND a.SOCIAL_PAY_MONTH >= CONCAT(#{socialAndFundBusinessPageVo.year},'01')
) or
(
a.PROVIDENT_PAY_MONTH in (
CONCAT(#{socialAndFundBusinessPageVo.year},'01'),
CONCAT(#{socialAndFundBusinessPageVo.year},'02'),
CONCAT(#{socialAndFundBusinessPageVo.year},'03'),
CONCAT(#{socialAndFundBusinessPageVo.year},'04'),
CONCAT(#{socialAndFundBusinessPageVo.year},'05'),
CONCAT(#{socialAndFundBusinessPageVo.year},'06'),
CONCAT(#{socialAndFundBusinessPageVo.year},'07'),
CONCAT(#{socialAndFundBusinessPageVo.year},'08'),
CONCAT(#{socialAndFundBusinessPageVo.year},'09'),
CONCAT(#{socialAndFundBusinessPageVo.year},'10'),
CONCAT(#{socialAndFundBusinessPageVo.year},'11'),
CONCAT(#{socialAndFundBusinessPageVo.year},'12')
)
AND a.PROVIDENT_PAY_MONTH >= CONCAT(#{socialAndFundBusinessPageVo.year},'01')
)
)
</if>
</if>
......@@ -2742,49 +2809,49 @@
<select id="getPaymentBusinessPageVo" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.PaymentBusinessPageVo">
SELECT
a.EMP_NAME as 'empName',
a.EMP_ID as 'empId',
ifnull(a.SOCIAL_PAY_MONTH,a.PROVIDENT_PAY_MONTH) as 'month',
SUM(
IF(a.PERSONAL_ACCRUAL,a.PERSONAL_ACCRUAL,0) +
IF(a.PERSONAL_BIGMAILMENT_MONEY,a.PERSONAL_BIGMAILMENT_MONEY,0) +
IF(a.PERSONAL_MEDICAL_MONEY,a.PERSONAL_MEDICAL_MONEY,0) +
IF(a.PERSONAL_UNEMPLOYMENT_MONEY,a.PERSONAL_UNEMPLOYMENT_MONEY,0) +
IF(a.PERSONAL_PENSION_MONEY,a.PERSONAL_PENSION_MONEY,0) +
IF(a.PERSONAL_PROVIDENT_SUM,a.PERSONAL_PROVIDENT_SUM,0)
) AS "personalSum",
SUM(
IF(a.UNIT_BIGMAILMENT_MONEY,a.UNIT_BIGMAILMENT_MONEY,0) +
IF(a.COMPANY_ACCRUAL,a.COMPANY_ACCRUAL,0) +
IF(a.UNIT_PENSION_MONEY,a.UNIT_PENSION_MONEY,0) +
IF(a.UNIT_MEDICAL_MONEY,a.UNIT_MEDICAL_MONEY,0) +
IF(a.UNIT_INJURY_MONEY,a.UNIT_INJURY_MONEY,0) +
IF(a.UNIT_UNEMPLOYMENT_MONEY,a.UNIT_UNEMPLOYMENT_MONEY,0) +
IF(a.UNIT_BIRTH_MONEY,a.UNIT_BIRTH_MONEY,0) +
IF(a.UNIT_PROVIDENT_SUM,a.UNIT_PROVIDENT_SUM,0)
) AS "unitSum",
SUM(
IF(a.PERSONAL_PROVIDENT_SUM,a.PERSONAL_PROVIDENT_SUM,0)
) AS "fundPersonalSum",
SUM(
IF(a.UNIT_PROVIDENT_SUM,a.UNIT_PROVIDENT_SUM,0)
) AS "fundUnitSum",
SUM(
IF(a.PERSONAL_ACCRUAL,a.PERSONAL_ACCRUAL,0) +
IF(a.PERSONAL_BIGMAILMENT_MONEY,a.PERSONAL_BIGMAILMENT_MONEY,0) +
IF(a.PERSONAL_MEDICAL_MONEY,a.PERSONAL_MEDICAL_MONEY,0) +
IF(a.PERSONAL_UNEMPLOYMENT_MONEY,a.PERSONAL_UNEMPLOYMENT_MONEY,0) +
IF(a.PERSONAL_PENSION_MONEY,a.PERSONAL_PENSION_MONEY,0)
) AS "socialPersonalSum",
SUM(
IF(a.UNIT_BIGMAILMENT_MONEY,a.UNIT_BIGMAILMENT_MONEY,0) +
IF(a.COMPANY_ACCRUAL,a.COMPANY_ACCRUAL,0) +
IF(a.UNIT_PENSION_MONEY,a.UNIT_PENSION_MONEY,0) +
IF(a.UNIT_MEDICAL_MONEY,a.UNIT_MEDICAL_MONEY,0) +
IF(a.UNIT_INJURY_MONEY,a.UNIT_INJURY_MONEY,0) +
IF(a.UNIT_UNEMPLOYMENT_MONEY,a.UNIT_UNEMPLOYMENT_MONEY,0) +
IF(a.UNIT_BIRTH_MONEY,a.UNIT_BIRTH_MONEY,0)
) AS "socialUnitSum"
a.EMP_NAME as 'empName',
a.EMP_ID as 'empId',
ifnull(a.SOCIAL_PAY_MONTH,a.PROVIDENT_PAY_MONTH) as 'month',
SUM(
IF(a.PERSONAL_ACCRUAL,a.PERSONAL_ACCRUAL,0) +
IF(a.PERSONAL_BIGMAILMENT_MONEY,a.PERSONAL_BIGMAILMENT_MONEY,0) +
IF(a.PERSONAL_MEDICAL_MONEY,a.PERSONAL_MEDICAL_MONEY,0) +
IF(a.PERSONAL_UNEMPLOYMENT_MONEY,a.PERSONAL_UNEMPLOYMENT_MONEY,0) +
IF(a.PERSONAL_PENSION_MONEY,a.PERSONAL_PENSION_MONEY,0) +
IF(a.PERSONAL_PROVIDENT_SUM,a.PERSONAL_PROVIDENT_SUM,0)
) AS "personalSum",
SUM(
IF(a.UNIT_BIGMAILMENT_MONEY,a.UNIT_BIGMAILMENT_MONEY,0) +
IF(a.COMPANY_ACCRUAL,a.COMPANY_ACCRUAL,0) +
IF(a.UNIT_PENSION_MONEY,a.UNIT_PENSION_MONEY,0) +
IF(a.UNIT_MEDICAL_MONEY,a.UNIT_MEDICAL_MONEY,0) +
IF(a.UNIT_INJURY_MONEY,a.UNIT_INJURY_MONEY,0) +
IF(a.UNIT_UNEMPLOYMENT_MONEY,a.UNIT_UNEMPLOYMENT_MONEY,0) +
IF(a.UNIT_BIRTH_MONEY,a.UNIT_BIRTH_MONEY,0) +
IF(a.UNIT_PROVIDENT_SUM,a.UNIT_PROVIDENT_SUM,0)
) AS "unitSum",
SUM(
IF(a.PERSONAL_PROVIDENT_SUM,a.PERSONAL_PROVIDENT_SUM,0)
) AS "fundPersonalSum",
SUM(
IF(a.UNIT_PROVIDENT_SUM,a.UNIT_PROVIDENT_SUM,0)
) AS "fundUnitSum",
SUM(
IF(a.PERSONAL_ACCRUAL,a.PERSONAL_ACCRUAL,0) +
IF(a.PERSONAL_BIGMAILMENT_MONEY,a.PERSONAL_BIGMAILMENT_MONEY,0) +
IF(a.PERSONAL_MEDICAL_MONEY,a.PERSONAL_MEDICAL_MONEY,0) +
IF(a.PERSONAL_UNEMPLOYMENT_MONEY,a.PERSONAL_UNEMPLOYMENT_MONEY,0) +
IF(a.PERSONAL_PENSION_MONEY,a.PERSONAL_PENSION_MONEY,0)
) AS "socialPersonalSum",
SUM(
IF(a.UNIT_BIGMAILMENT_MONEY,a.UNIT_BIGMAILMENT_MONEY,0) +
IF(a.COMPANY_ACCRUAL,a.COMPANY_ACCRUAL,0) +
IF(a.UNIT_PENSION_MONEY,a.UNIT_PENSION_MONEY,0) +
IF(a.UNIT_MEDICAL_MONEY,a.UNIT_MEDICAL_MONEY,0) +
IF(a.UNIT_INJURY_MONEY,a.UNIT_INJURY_MONEY,0) +
IF(a.UNIT_UNEMPLOYMENT_MONEY,a.UNIT_UNEMPLOYMENT_MONEY,0) +
IF(a.UNIT_BIRTH_MONEY,a.UNIT_BIRTH_MONEY,0)
) AS "socialUnitSum"
FROM t_payment_info a
<where>
1=1
......
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