|
|
@ -34,6 +34,7 @@ |
|
|
|
ecr.RATE, |
|
|
|
la.DESCRIPTION as label, |
|
|
|
st.DESCRIPTION as SUGGESTION, |
|
|
|
st.code as suggestionCode, |
|
|
|
date_format(ecr.CREATED_TIME,'%Y-%m-%d %H:%m') as CREATED_TIME, |
|
|
|
date_format(ecr.AUDIT_TIME,'%Y-%m-%d %H:%m') as AUDIT_TIME |
|
|
|
FROM `epdc_check_records` ecr |
|
|
@ -41,8 +42,65 @@ |
|
|
|
left join epdc_check_code la on ecr.LABEL=la.`CODE` |
|
|
|
left join epdc_check_code st on ecr.SUGGESTION=st.`CODE` |
|
|
|
where ecr.DEL_FLAG=0 |
|
|
|
<if test="name != null and name != ''"> |
|
|
|
and ecr.name like '%${name}%' |
|
|
|
</if> |
|
|
|
<if test="category != null and category != ''"> |
|
|
|
and ecr.CATEGORY = #{category} |
|
|
|
</if> |
|
|
|
<!-- <if test="decision != null and decision != ''">--> |
|
|
|
<!-- and evr.DECISION = #{decision}--> |
|
|
|
<!-- </if>--> |
|
|
|
<if test="content != null and content != ''"> |
|
|
|
and ecr.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( ecr.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} |
|
|
|
</if> |
|
|
|
order by st.SORT asc,ecr.CREATED_TIME desc |
|
|
|
</select> |
|
|
|
<resultMap id="CheckRecords_detail" type="com.elink.esua.epdc.dto.CheckRecordsDTO"> |
|
|
|
<result property="id" column="id"/> |
|
|
|
<result property="name" column="name"/> |
|
|
|
<result property="category" column="category"/> |
|
|
|
<result property="checkState" column="checkState"/> |
|
|
|
<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.CheckImgsDetailsDTO"> |
|
|
|
<result property="url" column="url"/> |
|
|
|
</collection> |
|
|
|
</resultMap> |
|
|
|
<select id="getDetails" resultMap="CheckRecords_detail"> |
|
|
|
SELECT ecr.id, |
|
|
|
ecr.name, |
|
|
|
IF(ecr.CATEGORY=1,'居民','工作') category, |
|
|
|
mo.DESCRIPTION as module, |
|
|
|
ecr.CONTENT, |
|
|
|
ecr.RATE, |
|
|
|
la.DESCRIPTION as label, |
|
|
|
st.DESCRIPTION as checkState, |
|
|
|
st.code as suggestionCode, |
|
|
|
re.SUGGESTION, |
|
|
|
date_format(ecr.CREATED_TIME,'%Y-%m-%d %H:%m') as CREATED_TIME, |
|
|
|
date_format(ecr.AUDIT_TIME,'%Y-%m-%d %H:%m') as AUDIT_TIME, |
|
|
|
img.URL |
|
|
|
FROM `epdc_check_records` ecr |
|
|
|
left join epdc_check_code mo on ecr.MODULE=mo.`CODE` |
|
|
|
left join epdc_check_code la on ecr.LABEL=la.`CODE` |
|
|
|
left join epdc_check_code st on ecr.SUGGESTION=st.`CODE` |
|
|
|
left join epdc_check_result re on re.RECORD_ID=ecr.ID |
|
|
|
left join epdc_check_records_imgs img on img.REFERENCE_ID=ecr.ID |
|
|
|
where ecr.DEL_FLAG=0 and ecr.id=#{id} |
|
|
|
order by img.sort asc |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |