|
|
@ -38,5 +38,50 @@ |
|
|
|
AND m.DEL_FLAG = '0' |
|
|
|
</select> |
|
|
|
|
|
|
|
<resultMap id="pcWorkListMap" type="com.epmet.dto.result.PcWorkListResultDTO$PcWorkListResult"> |
|
|
|
<result property="title" column="title"/> |
|
|
|
<result property="isNormal" column="isNormal"/> |
|
|
|
<result property="happenAddress" column="happenAddress"/> |
|
|
|
<result property="happenTime" column="happenTime"/> |
|
|
|
<result property="staffId" column="staffId"/> |
|
|
|
<result property="gridId" column="gridId"/> |
|
|
|
<result property="createdTime" column="createdTime"/> |
|
|
|
<result property="workContent" column="workContent"/> |
|
|
|
<collection property="workTypeCode" ofType="java.lang.String" select="pcWorkTypeCodeList" column="wid"> |
|
|
|
<result column="workTypeCode"/> |
|
|
|
</collection> |
|
|
|
</resultMap> |
|
|
|
<select id="pcWorkList" resultMap="pcWorkListMap"> |
|
|
|
SELECT |
|
|
|
w.ID AS wid, |
|
|
|
w.TITLE as title, |
|
|
|
(CASE WHEN w.IS_NORMAL = 1 THEN '有' ELSE '无' END) AS isNormal, |
|
|
|
w.ADDRESS AS happenAddress, |
|
|
|
w.HAPPEN_TIME AS happenTime, |
|
|
|
w.USER_ID AS staffId, |
|
|
|
w.GRID_ID AS gridId, |
|
|
|
DATE_FORMAT(w.CREATED_TIME,'%Y-%m-%d %H:%i:%s') AS createdTime, |
|
|
|
w.WORK_CONTENT AS workContent |
|
|
|
FROM patrol_routine_work w |
|
|
|
WHERE w.DEL_FLAG = 0 |
|
|
|
<if test="staffId != null and staffId != '' "> |
|
|
|
AND w.USER_ID = #{staffId} |
|
|
|
</if> |
|
|
|
<if test='orgType == "grid" '> |
|
|
|
AND w.GRID_ID = #{orgId} |
|
|
|
</if> |
|
|
|
<if test='orgType == "agency" '> |
|
|
|
AND w.PIDS LIKE CONCAT('%',#{orgId},'%') |
|
|
|
</if> |
|
|
|
AND DATE_FORMAT(w.CREATED_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endTime} |
|
|
|
<if test="startTime != '' and startTime != null"> |
|
|
|
AND DATE_FORMAT(w.CREATED_TIME,'%Y%m%d') >= #{startTime} |
|
|
|
</if> |
|
|
|
ORDER BY w.CREATED_TIME DESC |
|
|
|
</select> |
|
|
|
<select id="pcWorkTypeCodeList" resultType="java.lang.String"> |
|
|
|
SELECT WORK_TYPE_CODE AS workTypeCode FROM patrol_routine_work_type WHERE DEL_FLAG = 0 AND ROUTINE_WORK_ID = #{wid} |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
|