diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml index 9041856e1..9cfeec16e 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml @@ -1402,23 +1402,15 @@ i.LAST_HANDLE_TIME, i.CREATED_TIME from epdc_item i + left join ( + select b.ID,b.ITEM_ID,b.CREATED_TIME,b.state,b.CLOSE_CHECK_ID + from epdc_item_handle_process b where b.CREATED_TIME = ( + SELECT max(CREATED_TIME) from epdc_item_handle_process where b.ITEM_ID = ITEM_ID + ) + ) process on process.ITEM_ID = i.ID where i.DEL_FLAG='0' - and i.id in ( - SELECT - temp.ITEM_ID - FROM - ( select it.* - from epdc_item_handle_process it - inner join (select *,max(CREATED_TIME) as maxTime - from epdc_item_handle_process - where DEL_FLAG='0' - group by ITEM_ID - )max_it on it.ITEM_ID=max_it.ITEM_ID - and it.CREATED_TIME=max_it.maxTime - where it.DEL_FLAG='0' - and it.CLOSE_CHECK_ID=#{deptId} - and it.STATE=11 - ) temp) + and process.STATE=11 + and process.CLOSE_CHECK_ID=#{deptId} and i.ITEM_CONTENT like '%${itemContent}%'