SUBSTRING_INDEX(REPLACE (item.parent_dept_names, '市北区委-', ''), '-', 1) AS streetName,
SUBSTRING_INDEX(REPLACE (item.parent_dept_names, '市北区委-', ''), '-' ,- 1) AS communityName,
item.people_flag
from epdc_item item
inner join epdc_item_report_interface_log log1 on log1.ITEM_ID = item.ID and log1.INTERFACE_NAME = '响应接收'
<iftest="reply =='1'">
inner join epdc_item_report_interface_log log2 on log2.ITEM_ID = log1.ITEM_ID and log2.INTERFACE_NAME LIKE '诉求登记%' and getworkminute(log2.CREATED_TIME,log1.CREATED_TIME) <= 480
</if>
<iftest="reply =='0'">
inner join epdc_item_report_interface_log log2 on log2.ITEM_ID = log1.ITEM_ID and log2.INTERFACE_NAME LIKE '诉求登记%' and getworkminute(log2.CREATED_TIME,log1.CREATED_TIME) > 480
</if>
where
log2.CREATED_TIME IS NOT NULL
<iftest="startTime != null and startTime != ''">
and item.CREATED_TIME >= #{startTime}
</if>
<iftest="endTime != null and endTime != ''">
and item.CREATED_TIME <= #{endTime}
</if>
<iftest="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
<iftest="peopleFlag != null and peopleFlag != ''">