|
|
@ -519,6 +519,7 @@ |
|
|
|
) 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) |
|
|
|
<if test="peopleFlag != null and peopleFlag != ''"> |
|
|
|
AND item.PEOPLE_FLAG = #{peopleFlag} |
|
|
|
</if> |
|
|
@ -578,6 +579,100 @@ |
|
|
|
item.CREATED_TIME DESC |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="listOfItemsForPCReject" resultType="com.elink.esua.epdc.dto.item.ItemPendingHandleDTO"> |
|
|
|
SELECT |
|
|
|
item.ID, |
|
|
|
item.ITEM_CONTENT, |
|
|
|
item.ITEM_CODE, |
|
|
|
item.CREATED_TIME, |
|
|
|
item.NICK_NAME, |
|
|
|
item.MOBILE, |
|
|
|
CASE item.EVALUATION_SCORE |
|
|
|
WHEN 0 THEN '不满意' |
|
|
|
WHEN 1 THEN '基本满意' |
|
|
|
WHEN 2 THEN '非常满意' |
|
|
|
ELSE '' |
|
|
|
END AS evaluationScore, |
|
|
|
eve.APPROVE_NUM, |
|
|
|
eve.OPPOSE_NUM, |
|
|
|
eve.COMMENT_NUM, |
|
|
|
eve.BROWSE_NUM, |
|
|
|
<if test="isRemind != null and isRemind != ''"> |
|
|
|
(case when (process.ID is null and HOUR( timediff( now(), item.CREATED_TIME) ) >= 24) then '1' else '' end) as isRemind, |
|
|
|
</if> |
|
|
|
( eve.APPROVE_NUM + eve.OPPOSE_NUM + eve.COMMENT_NUM + eve.BROWSE_NUM ) AS participantsNum, |
|
|
|
(case when d.ID is not null then '1' else '0' end) as isDelay |
|
|
|
FROM epdc_item item |
|
|
|
LEFT JOIN epdc_events eve ON item.EVENT_ID = eve.ID AND eve.DEL_FLAG = '0' |
|
|
|
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.STATE != 1001 and b.CREATED_TIME = ( |
|
|
|
SELECT max(CREATED_TIME) from epdc_item_handle_process where b.ITEM_ID = ITEM_ID |
|
|
|
) |
|
|
|
) 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 |
|
|
|
<if test="peopleFlag != null and peopleFlag != ''"> |
|
|
|
AND item.PEOPLE_FLAG = #{peopleFlag} |
|
|
|
</if> |
|
|
|
<if test="itemState != null and itemState != ''"> |
|
|
|
AND item.ITEM_STATE = #{itemState} |
|
|
|
</if> |
|
|
|
<if test="associatedType != null and associatedType != ''"> |
|
|
|
AND item.ITEM_STATE in (0,10) |
|
|
|
</if> |
|
|
|
<if test="keyword != null and keyword != ''"> |
|
|
|
AND item.ITEM_CONTENT like concat('%', trim(#{keyword}), '%') |
|
|
|
</if> |
|
|
|
AND item.ID IN ( |
|
|
|
SELECT |
|
|
|
temp.ITEM_ID |
|
|
|
FROM |
|
|
|
( SELECT dept.ITEM_ID FROM epdc_item_dept dept WHERE dept.DEL_FLAG = '0' |
|
|
|
<if test="deptIdList != null"> |
|
|
|
AND dept.DEPT_ID IN |
|
|
|
<foreach item="deptId" collection="deptIdList" open="(" separator="," close=")"> |
|
|
|
#{deptId} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="districtDeptId != null and districtDeptId != ''"> |
|
|
|
AND dept.DEPT_ID = #{districtDeptId} |
|
|
|
</if> |
|
|
|
) temp |
|
|
|
) |
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> |
|
|
|
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} |
|
|
|
</if> |
|
|
|
<if test="gridId != null and gridId != ''"> |
|
|
|
AND (item.GRID_ID = #{gridId} |
|
|
|
OR find_in_set(#{gridId},item.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
<if test="streetId != null and streetId != ''"> |
|
|
|
AND (find_in_set(#{streetId},item.PARENT_DEPT_IDS) |
|
|
|
OR find_in_set(#{streetId},item.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
<if test="communityId != null and communityId != ''"> |
|
|
|
AND (find_in_set(#{communityId},item.PARENT_DEPT_IDS) |
|
|
|
OR find_in_set(#{communityId},item.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
<if test="itemCode != null and itemCode != ''"> |
|
|
|
AND item.ITEM_CODE like concat('%', #{itemCode}, '%') |
|
|
|
</if> |
|
|
|
<if test="itemContent != null and itemContent != ''"> |
|
|
|
AND item.ITEM_CONTENT like concat('%', #{itemContent}, '%') |
|
|
|
</if> |
|
|
|
<if test="nickName != null and nickName != ''"> |
|
|
|
AND item.NICK_NAME like concat('%', #{nickName}, '%') |
|
|
|
</if> |
|
|
|
<if test="mobile != null and mobile != ''"> |
|
|
|
AND item.MOBILE like concat('%', #{mobile}, '%') |
|
|
|
</if> |
|
|
|
ORDER BY |
|
|
|
item.CREATED_TIME DESC |
|
|
|
</select> |
|
|
|
|
|
|
|
<resultMap id="itemDetailPCEndMap" type="com.elink.esua.epdc.dto.item.result.ItemDetailForPCEndResultDTO"> |
|
|
|
<result property="id" column="ID"/> |
|
|
|
<result property="nickName" column="NICK_NAME"/> |
|
|
|