Commit 10017a3d authored by huyuchen's avatar huyuchen

huych-商险到期提醒优化修改

parent 7f8d678b
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceWarnMapper"> <mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceWarnMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert"> <resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert">
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
a.DIE_DISABLE_QUOTA, a.DIE_DISABLE_QUOTA,
a.DEPT_ID, a.DEPT_ID,
a.POLICY_NO, a.POLICY_NO,
if(a.POLICY_END >= curdate(),0,1) IS_OVERDUE, IF( a.POLICY_END >= curdate(), 0, 1 ) IS_OVERDUE,
a.REMARK, a.REMARK,
a.CREATE_BY, a.CREATE_BY,
a.DELETE_FLAG, a.DELETE_FLAG,
...@@ -89,10 +89,11 @@ ...@@ -89,10 +89,11 @@
a.CREATE_USER_DEPT_NAME a.CREATE_USER_DEPT_NAME
FROM FROM
t_insurance_detail a t_insurance_detail a
WHERE INNER JOIN (
a.id IN (
SELECT SELECT
l.id h.endTime,
max( l.POLICY_START ) POLICY_START,
l.EMP_IDCARD_NO
FROM FROM
( (
SELECT SELECT
...@@ -101,8 +102,10 @@ ...@@ -101,8 +102,10 @@
FROM FROM
t_insurance_detail b t_insurance_detail b
WHERE WHERE
b.POLICY_START >= date_sub( date_add( curdate(), INTERVAL 1 DAY ), INTERVAL 1 YEAR ) b.POLICY_START BETWEEN date_sub( date_add( curdate(), INTERVAL 1 DAY ), INTERVAL 1 YEAR )
AND curdate()
AND b.IS_EFFECT = 0 AND b.IS_EFFECT = 0
AND b.DELETE_FLAG = '0'
AND NOT EXISTS ( AND NOT EXISTS (
SELECT SELECT
1 1
...@@ -111,8 +114,11 @@ ...@@ -111,8 +114,11 @@
WHERE WHERE
ea.POLICY_START >= date_sub( date_add( curdate(), INTERVAL 1 DAY ), INTERVAL 1 YEAR ) ea.POLICY_START >= date_sub( date_add( curdate(), INTERVAL 1 DAY ), INTERVAL 1 YEAR )
AND ea.IS_EFFECT = 0 AND ea.IS_EFFECT = 0
AND ea.DELETE_FLAG = '0'
AND ea.POLICY_END >= date_add( curdate(), INTERVAL 1 MONTH ) AND ea.POLICY_END >= date_add( curdate(), INTERVAL 1 MONTH )
AND ea.EMP_IDCARD_NO = b.EMP_IDCARD_NO AND ea.EMP_IDCARD_NO = b.EMP_IDCARD_NO
AND ea.INSURANCE_COMPANY_NAME = b.INSURANCE_COMPANY_NAME
AND ea.INSURANCE_TYPE_NAME = b.INSURANCE_TYPE_NAME
) )
GROUP BY GROUP BY
b.EMP_IDCARD_NO, b.EMP_IDCARD_NO,
...@@ -120,9 +126,20 @@ ...@@ -120,9 +126,20 @@
b.INSURANCE_TYPE_NAME b.INSURANCE_TYPE_NAME
) h ) h
INNER JOIN t_insurance_detail l ON h.EMP_IDCARD_NO = l.EMP_IDCARD_NO INNER JOIN t_insurance_detail l ON h.EMP_IDCARD_NO = l.EMP_IDCARD_NO
AND l.DELETE_FLAG = '0'
AND h.endTime = l.POLICY_END AND h.endTime = l.POLICY_END
AND l.POLICY_START BETWEEN date_sub( date_add( curdate(), INTERVAL 1 DAY ), INTERVAL 1 YEAR )
AND curdate()
WHERE WHERE
l.EXPIRE_IGNORE_FLAG = '1' l.EXPIRE_IGNORE_FLAG = '1'
) GROUP BY
l.EMP_IDCARD_NO,
l.INSURANCE_COMPANY_NAME,
l.INSURANCE_TYPE_NAME,
l.POLICY_END
) ll ON ll.EMP_IDCARD_NO = a.EMP_IDCARD_NO
AND ll.POLICY_START = a.POLICY_START
AND ll.endTime = a.POLICY_END
where a.DELETE_FLAG = '0'
</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