|
|
|
@ -516,18 +516,21 @@ |
|
|
|
left join epdc_item_fusing_delay_record d on d.ITEM_ID = item.ID and d.DEL_FLAG = '0' |
|
|
|
left join ( |
|
|
|
select b.ID,b.ITEM_ID,b.CREATED_TIME,b.state |
|
|
|
from epdc_item_handle_process b where b.DEL_FLAG = '0' and b.STATE != 1001 and b.CREATED_TIME = ( |
|
|
|
from epdc_item_handle_process b |
|
|
|
where b.DEL_FLAG = '0' |
|
|
|
and b.STATE != 1001 |
|
|
|
and b.CREATED_TIME = ( |
|
|
|
SELECT |
|
|
|
max(CREATED_TIME) |
|
|
|
from epdc_item_handle_process |
|
|
|
where b.ITEM_ID = ITEM_ID |
|
|
|
and (HANDLER_DEPT != '网格化平台' or (HANDLER_DEPT = '网格化平台' and STATE in (1060,1065))) |
|
|
|
and DEL_FLAG = '0' |
|
|
|
) |
|
|
|
and (b.HANDLER_DEPT != '网格化平台' or (b.HANDLER_DEPT = '网格化平台' and b.STATE in (1060,1065))) |
|
|
|
) process on process.ITEM_ID = item.ID |
|
|
|
WHERE item.DEL_FLAG = '0' |
|
|
|
and (item.IS_PEOPLE = '0' or (item.PEOPLE_FLAG = '0' and (process.state is null or process.state not in (11,15)))) |
|
|
|
and (process.state != 14 or process.state is null) |
|
|
|
and (item.IS_PEOPLE = '0' or (item.IS_PEOPLE = '1' and item.PEOPLE_FLAG = '0')) |
|
|
|
and (process.state is not null and process.state not in (11,14,15)) |
|
|
|
<if test="typeKey != null and typeKey != '' and typeKey == 'grid_party'"> |
|
|
|
and (process.state != 0 or process.state is null) |
|
|
|
</if> |
|
|
|
@ -618,17 +621,21 @@ |
|
|
|
left join epdc_item_fusing_delay_record d on d.ITEM_ID = item.ID and d.DEL_FLAG = '0' |
|
|
|
left join ( |
|
|
|
select b.ID,b.ITEM_ID,b.CREATED_TIME,b.state |
|
|
|
from epdc_item_handle_process b where b.DEL_FLAG = '0' and b.STATE != 1001 and b.CREATED_TIME = ( |
|
|
|
from epdc_item_handle_process b |
|
|
|
where b.DEL_FLAG = '0' |
|
|
|
and b.STATE != 1001 |
|
|
|
and b.CREATED_TIME = ( |
|
|
|
SELECT |
|
|
|
max(CREATED_TIME) |
|
|
|
from epdc_item_handle_process |
|
|
|
where b.ITEM_ID = ITEM_ID |
|
|
|
and HANDLER_DEPT != '网格化平台' |
|
|
|
and DEL_FLAG = '0' |
|
|
|
) |
|
|
|
and (b.HANDLER_DEPT != '网格化平台' or (b.HANDLER_DEPT = '网格化平台' and b.STATE in (1060,1065))) |
|
|
|
) process on process.ITEM_ID = item.ID |
|
|
|
WHERE item.DEL_FLAG = '0' |
|
|
|
and (item.IS_PEOPLE = '0' or (item.PEOPLE_FLAG = '0' and (process.state is null or process.state not in (11,15)))) |
|
|
|
and (item.IS_PEOPLE = '0' or (item.IS_PEOPLE = '1' and item.PEOPLE_FLAG = '0')) |
|
|
|
and (process.state is not null and process.state not in (11,15)) |
|
|
|
and process.state = 14 |
|
|
|
<if test="peopleFlag != null and peopleFlag != ''"> |
|
|
|
AND item.PEOPLE_FLAG = #{peopleFlag} |
|
|
|
|