|
|
|
@ -1812,6 +1812,102 @@ |
|
|
|
</if> |
|
|
|
order by i.CREATED_TIME desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getItemAppealPageUnsatisfactory" resultType="com.elink.esua.epdc.dto.item.result.ItemAppealPageResultDTO"> |
|
|
|
SELECT i.id, |
|
|
|
i.NICK_NAME, |
|
|
|
i.CREATED_TIME, |
|
|
|
i.ITEM_STATE, |
|
|
|
i.SERIAL_NUM, |
|
|
|
i.GRID as gridName, |
|
|
|
SUBSTRING_INDEX(REPLACE(i.PARENT_DEPT_NAMES,'市北区委-',''),'-',1) as streetName, |
|
|
|
SUBSTRING_INDEX(REPLACE(i.PARENT_DEPT_NAMES,'市北区委-',''),'-',-1) as communityName, |
|
|
|
CASE i.ITEM_STATE |
|
|
|
WHEN '0' THEN '处理中' |
|
|
|
WHEN '10' THEN '已结案' |
|
|
|
ELSE '' |
|
|
|
END AS itemStateName, |
|
|
|
i.ITEM_CONTENT, |
|
|
|
i.PEOPLE_FLAG, |
|
|
|
CASE i.PEOPLE_FLAG |
|
|
|
WHEN '0' THEN '民生诉求' |
|
|
|
WHEN '1' THEN '发展诉求' |
|
|
|
WHEN '2' THEN '执法诉求' |
|
|
|
ELSE '' |
|
|
|
END AS peopleFlagName, |
|
|
|
i.EVALUATION_SCORE, |
|
|
|
case i.EVALUATION_SCORE |
|
|
|
when '0' then '不满意' |
|
|
|
when '1' then '基本满意' |
|
|
|
when '2' then '非常满意' |
|
|
|
else '' |
|
|
|
end as evaluationScoreName, |
|
|
|
i.EVALUATION_CONTENT, |
|
|
|
i.EVALUATION_TIME, |
|
|
|
(case when (process.STATE = 1001 and HOUR( timediff( now(), i.CREATED_TIME) ) >= 24) then '1' else '' end) as isRemind |
|
|
|
FROM epdc_item i |
|
|
|
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.CREATED_TIME = ( |
|
|
|
SELECT |
|
|
|
max(CREATED_TIME) |
|
|
|
from epdc_item_handle_process |
|
|
|
where b.ITEM_ID = ITEM_ID |
|
|
|
and DEL_FLAG = '0' |
|
|
|
) |
|
|
|
and (b.HANDLER_DEPT != '网格化平台' or (b.HANDLER_DEPT = '网格化平台' and b.STATE in (1060,1065))) |
|
|
|
) process on process.ITEM_ID = i.ID |
|
|
|
where |
|
|
|
i.DEL_FLAG='0' |
|
|
|
and i.EVALUATION_SCORE = '0' |
|
|
|
and IS_PEOPLE = '1' |
|
|
|
<if test="appealType != null and appealType != ''"> |
|
|
|
and i.PEOPLE_FLAG = #{appealType} |
|
|
|
</if> |
|
|
|
<if test="itemState != null and itemState != ''"> |
|
|
|
and i.ITEM_STATE = #{itemState} |
|
|
|
</if> |
|
|
|
<if test="deptIdList != null and deptIdList.size() > 0"> |
|
|
|
AND i.GRID_ID IN |
|
|
|
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")"> |
|
|
|
#{deptId} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="gridId != null and gridId != ''"> |
|
|
|
AND (i.GRID_ID = #{gridId} |
|
|
|
OR find_in_set(#{gridId},i.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
<if test="streetId != null and streetId != ''"> |
|
|
|
AND (i.GRID_ID = #{streetId} |
|
|
|
OR find_in_set(#{streetId},i.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
<if test="communityId != null and communityId != ''"> |
|
|
|
AND (find_in_set(#{communityId},i.PARENT_DEPT_IDS) |
|
|
|
OR find_in_set(#{communityId},i.ALL_DEPT_IDS)) |
|
|
|
</if> |
|
|
|
<if test="userId != null and userId != ''"> |
|
|
|
and i.USER_ID = #{userId} |
|
|
|
</if> |
|
|
|
<if test="mobile != null and mobile != ''"> |
|
|
|
and i.MOBILE = #{mobile} |
|
|
|
</if> |
|
|
|
<if test="itemContent != null and itemContent != ''"> |
|
|
|
and i.ITEM_CONTENT like '%${itemContent}%' |
|
|
|
</if> |
|
|
|
<if test="serialNum != null and serialNum != ''"> |
|
|
|
and i.SERIAL_NUM like '%${serialNum}%' |
|
|
|
</if> |
|
|
|
<if test="evaluationScore != null and evaluationScore != ''"> |
|
|
|
and i.EVALUATION_SCORE = #{evaluationScore} |
|
|
|
</if> |
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> |
|
|
|
AND DATE_FORMAT( i.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} |
|
|
|
</if> |
|
|
|
order by i.CREATED_TIME desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<resultMap id="appealDetailMap" type="com.elink.esua.epdc.dto.item.result.ItemAppealDetailResultDTO"> |
|
|
|
<result property="id" column="ID"/> |
|
|
|
<result property="nickName" column="NICK_NAME"/> |
|
|
|
|