Commit 6f9bf12e authored by fangxinjiang's avatar fangxinjiang

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

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