|
@ -12,7 +12,6 @@ |
|
|
<result property="decision" column="DECISION"/> |
|
|
<result property="decision" column="DECISION"/> |
|
|
<result property="module" column="MODULE"/> |
|
|
<result property="module" column="MODULE"/> |
|
|
<result property="content" column="CONTENT"/> |
|
|
<result property="content" column="CONTENT"/> |
|
|
<result property="url" column="URL"/> |
|
|
|
|
|
<result property="code" column="CODE"/> |
|
|
<result property="code" column="CODE"/> |
|
|
<result property="msg" column="MSG"/> |
|
|
<result property="msg" column="MSG"/> |
|
|
<result property="suggestion" column="SUGGESTION"/> |
|
|
<result property="suggestion" column="SUGGESTION"/> |
|
@ -25,6 +24,81 @@ |
|
|
<result property="updatedBy" column="UPDATED_BY"/> |
|
|
<result property="updatedBy" column="UPDATED_BY"/> |
|
|
<result property="updatedTime" column="UPDATED_TIME"/> |
|
|
<result property="updatedTime" column="UPDATED_TIME"/> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
<select id="getViolationsRecord" resultType="com.elink.esua.epdc.dto.ViolationsRecordsDTO"> |
|
|
|
|
|
SELECT evr.id, |
|
|
|
|
|
evr.name, |
|
|
|
|
|
IF(evr.CATEGORY=1,'居民','工作') category, |
|
|
|
|
|
mo.DESCRIPTION as module, |
|
|
|
|
|
evr.CONTENT, |
|
|
|
|
|
evr.RATE, |
|
|
|
|
|
la.DESCRIPTION as label, |
|
|
|
|
|
IF(evr.DECISION=1,'系统判定','人工审核') decision, |
|
|
|
|
|
date_format(evr.CREATED_TIME,'%Y-%m-%d %H:%m') as CREATED_TIME, |
|
|
|
|
|
date_format(evr.AUDIT_TIME,'%Y-%m-%d %H:%m') as AUDIT_TIME |
|
|
|
|
|
FROM `epdc_violations_records` evr |
|
|
|
|
|
left join epdc_check_code mo on evr.MODULE=mo.`CODE` |
|
|
|
|
|
left join epdc_check_code la on evr.LABEL=la.`CODE` |
|
|
|
|
|
where evr.DEL_FLAG=0 |
|
|
|
|
|
<if test="name != null and name != ''"> |
|
|
|
|
|
and evr.name like '%${name}%' |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="category != null and category != ''"> |
|
|
|
|
|
and evr.CATEGORY = #{category} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="decision != null and decision != ''"> |
|
|
|
|
|
and evr.DECISION = #{decision} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="content != null and content != ''"> |
|
|
|
|
|
and evr.CONTENT like '%${content}%' |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="module != null and module != ''"> |
|
|
|
|
|
and mo.DESCRIPTION like '%${module}%' |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> |
|
|
|
|
|
AND DATE_FORMAT( evr.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} |
|
|
|
|
|
</if> |
|
|
|
|
|
</select> |
|
|
|
|
|
<resultMap id="violations_detail" type="com.elink.esua.epdc.dto.ViolationsRecordsDTO"> |
|
|
|
|
|
<result property="id" column="id"/> |
|
|
|
|
|
<result property="name" column="name"/> |
|
|
|
|
|
<result property="category" column="category"/> |
|
|
|
|
|
<result property="decision" column="decision"/> |
|
|
|
|
|
<result property="module" column="module"/> |
|
|
|
|
|
<result property="content" column="CONTENT"/> |
|
|
|
|
|
<result property="suggestion" column="SUGGESTION"/> |
|
|
|
|
|
<result property="label" column="LABEL"/> |
|
|
|
|
|
<result property="rate" column="RATE"/> |
|
|
|
|
|
<result property="createdTime" column="CREATED_TIME"/> |
|
|
|
|
|
<result property="auditTime" column="AUDIT_TIME"/> |
|
|
|
|
|
<collection property="imgUrls" ofType="com.elink.esua.epdc.dto.ViolationsDetailsDTO"> |
|
|
|
|
|
<result property="url" column="url"/> |
|
|
|
|
|
</collection> |
|
|
|
|
|
<!-- <collection property="imgUrls" select="getImgList" column="id"></collection>--> |
|
|
|
|
|
</resultMap> |
|
|
|
|
|
<!-- <select id="getImgList" resultType="java.lang.String">--> |
|
|
|
|
|
<!-- select img. url--> |
|
|
|
|
|
<!-- from `epdc_violations_records` evr--> |
|
|
|
|
|
<!-- left join epdc_violations_records_imgs img on img.REFERENCE_ID=evr.ID--> |
|
|
|
|
|
<!-- where evr.id=#{id}--> |
|
|
|
|
|
<!-- </select>--> |
|
|
|
|
|
<select id="getDetails" resultMap="violations_detail"> |
|
|
|
|
|
SELECT evr.id, |
|
|
|
|
|
evr.name, |
|
|
|
|
|
IF(evr.CATEGORY=1,'居民','工作') category, |
|
|
|
|
|
mo.DESCRIPTION as module, |
|
|
|
|
|
evr.CONTENT, |
|
|
|
|
|
evr.RATE, |
|
|
|
|
|
la.DESCRIPTION as label, |
|
|
|
|
|
IF(evr.DECISION=1,'系统判定','人工审核') decision, |
|
|
|
|
|
date_format(evr.CREATED_TIME,'%Y-%m-%d %H:%m') as CREATED_TIME, |
|
|
|
|
|
date_format(evr.AUDIT_TIME,'%Y-%m-%d %H:%m') as AUDIT_TIME, |
|
|
|
|
|
img.URL |
|
|
|
|
|
FROM `epdc_violations_records` evr |
|
|
|
|
|
left join epdc_check_code mo on evr.MODULE=mo.`CODE` |
|
|
|
|
|
left join epdc_check_code la on evr.LABEL=la.`CODE` |
|
|
|
|
|
left join epdc_violations_records_imgs img on img.REFERENCE_ID=evr.ID |
|
|
|
|
|
where evr.ID=#{id} |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |
|
|
</mapper> |