Commit 81f94ce7 authored by hongguangwu's avatar hongguangwu

MVP1.6.6-社保士兵派单id优化

parent 1bf1ef46
......@@ -593,8 +593,8 @@
a.YGS_ADD_ID,
a.HANDLE_STATUS,
a.YGS_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE,
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE,
if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id is null and DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')),0 ,1) YGS_OVER_DUE_FLAG
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
......@@ -614,8 +614,8 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
a.YSD_ADD_ID,
a.HANDLE_STATUS,
a.YSD_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE,
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE,
if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.MEDICAL_END_DATE) or ( sd.id is null and DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')),0 ,1) YSD_OVER_DUE_FLAG
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
......@@ -635,8 +635,8 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
a.YGS_ADD_ID,
a.HANDLE_STATUS,
a.YGS_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE,
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
where a.YGS_ADD_ID is not null and d.AUTO_FLAG='0'
......@@ -653,8 +653,8 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
a.YSD_ADD_ID,
a.HANDLE_STATUS,
a.YSD_HANDLE_STATUS,
d.id as DISPATCH_ID,
d.type as DISPATCH_TYPE
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE,
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
where a.YSD_ADD_ID is not null and d.AUTO_FLAG='0'
......
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