Commit 6f9bf12e authored by fangxinjiang's avatar fangxinjiang

有工资无社保 & 最低工资提醒 & 代码优化

parent 9ea9c330
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
LEFT JOIN t_salary_account_item l ON l.SALARY_ACCOUNT_ID = a.id and l.JAVA_FIED_NAME = 'relaySalary' LEFT JOIN t_salary_account_item l ON l.SALARY_ACCOUNT_ID = a.id and l.JAVA_FIED_NAME = 'relaySalary'
WHERE WHERE
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
and a.SETTLEMENT_MONTH = #{settleMonth} and a.SEND_MONTH = #{settleMonth}
AND s.STATUS IN (3, 4) AND s.STATUS IN (3, 4)
GROUP BY a.EMP_IDCARD,a.SALARY_DATE GROUP BY a.EMP_IDCARD,a.SALARY_DATE
) b ) b
......
...@@ -272,40 +272,45 @@ ...@@ -272,40 +272,45 @@
<select id="getLastMonthTHaveSalaryNosocial" resultType="com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial"> <select id="getLastMonthTHaveSalaryNosocial" resultType="com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial">
select a.EMP_ID employee_id select a.EMP_ID employee_id
, a.EMP_IDCARD employee_id_card , a.EMP_IDCARD employee_id_card
, a.EMP_NAME employee_name , a.EMP_NAME employee_name
, a.relaySalary relay_salary , GROUP_CONCAT(a.relaySalary) relay_salary
, s.CREATE_USER CREATE_USER_ID , a.CREATE_BY CREATE_USER_ID
, a.SALARY_DATE month , GROUP_CONCAT(a.SALARY_MONTH) month
, a.EMP_NAME employee_name , a.EMP_NAME employee_name
, a.EMP_IDCARD employee_id_card , a.EMP_IDCARD employee_id_card
, s.DEPART_ID settle_domain_id , a.DEPT_ID settle_domain_id
, s.DEPART_NAME SETTLEMENT_ORGAN_NAME , a.DEPT_NAME SETTLEMENT_ORGAN_NAME
, s.DEPART_NO SETTLEMENT_ORGAN_NO , a.DEPT_NO SETTLEMENT_ORGAN_NO
, a.SETTLEMENT_MONTH SETTLE_MONTH , a.SETTLEMENT_MONTH SETTLE_MONTH
from ( from (
select a.id select a.id
, a.SALARY_FORM_ID , s.DEPT_ID
, a.EMP_ID , s.DEPT_NAME
, DISTINCT(a.EMP_IDCARD) , s.DEPT_NO
, a.EMP_NAME , s.CREATE_BY
, a.SALARY_DATE , a.SALARY_FORM_ID
, a.SETTLEMENT_MONTH , a.EMP_ID
, if(item.JAVA_FIED_NAME = 'relaySalary', item.SALARY_MONEY, 0) relaySalary , a.EMP_IDCARD
, sum(if(item.JAVA_FIED_NAME in , a.EMP_NAME
('unitSocial', 'personalSocial', 'withholidingUnitSocial', 'withholidingPersonSocial'), , a.SALARY_MONTH
item.SALARY_MONEY, 0)) social , a.SETTLEMENT_MONTH
from hr_salary.t_salary_account a , if(item.JAVA_FIED_NAME = 'relaySalary', item.SALARY_MONEY, 0) relaySalary
left join hr_salary.t_salary_account_item item on item.SALARY_ACCOUNT_ID = a.id , sum(if(item.JAVA_FIED_NAME in
where ('unitSocial', 'personalSocial', 'withholidingUnitSocial', 'withholidingPersonSocial'),
<!-- a.SETTLEMENT_MONTH = '202006' and EMP_ID='1242371741017026561' --> item.SALARY_MONEY, 0)) social
a.SETTLEMENT_MONTH in ( #{month} , #{month2} , #{month3}) from mvp_salary.t_salary_account a
and a.DELETE_FLAG = 0 left join mvp_salary.t_salary_account_item item on item.SALARY_ACCOUNT_ID = a.id
GROUP BY a.EMP_IDCARD, a.SALARY_DATE LEFT JOIN mvp_salary.t_salary_standard s on a.SALARY_FORM_ID = s.id
) a
LEFT JOIN hr_salary.t_salary_standard s on a.SALARY_FORM_ID = s.id
where a.relaySalary > 0
and a.social = 0
where
a.DELETE_FLAG = 0
and s.send_month in ( #{month} , #{month2} , #{month3})
AND s.STATUS IN (3, 4)
GROUP BY a.EMP_IDCARD, a.SALARY_MONTH limit 10
) a
where a.relaySalary > 0
and a.social = 0
GROUP BY a.EMP_IDCARD HAVING count(1) = 3
</select> </select>
</mapper> </mapper>
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