|
|
@ -7,9 +7,17 @@ |
|
|
|
<select id="selectMyReported" parameterType="map" resultType="com.epmet.dto.IcTripReportRecordDTO"> |
|
|
|
SELECT |
|
|
|
r.*, |
|
|
|
r.CREATED_TIME AS reportTime |
|
|
|
r.CREATED_TIME AS reportTime, |
|
|
|
( |
|
|
|
CASE |
|
|
|
WHEN r.USER_TYPE = 'resi' THEN IFNULL(ubi.`NAME`, '无') |
|
|
|
ELSE IFNULL(cs.REAL_NAME, '无') |
|
|
|
END |
|
|
|
) AS createdByName |
|
|
|
FROM |
|
|
|
ic_trip_report_record r |
|
|
|
LEFT JOIN customer_staff cs on r.user_type != 'resi' AND r.created_by = cs.user_id AND r.customer_id = cs.customer_id |
|
|
|
LEFT JOIN user_base_info ubi ON r.user_type = 'resi' AND r.created_by = ubi.user_id AND r.customer_id = ubi.customer_id |
|
|
|
WHERE |
|
|
|
r.DEL_FLAG = '0' |
|
|
|
AND r.CUSTOMER_ID = #{customerId} |
|
|
@ -29,11 +37,19 @@ |
|
|
|
a.ID AS epidemicId, |
|
|
|
r.CREATED_TIME AS reportTime, |
|
|
|
r.ID_CARD as realIdCard, |
|
|
|
r.MOBILE as realMobile |
|
|
|
r.MOBILE as realMobile, |
|
|
|
( |
|
|
|
CASE |
|
|
|
WHEN r.USER_TYPE = 'resi' THEN IFNULL(ubi.`NAME`, '无') |
|
|
|
ELSE IFNULL(cs.REAL_NAME, '无') |
|
|
|
END |
|
|
|
) AS createdByName |
|
|
|
FROM ic_trip_report_record r |
|
|
|
LEFT JOIN ( |
|
|
|
select * from ic_epidemic_special_attention GROUP BY id_card ORDER BY created_time DESC |
|
|
|
) a ON (a.ID_CARD = r.ID_CARD AND a.DEL_FLAG = 0 AND a.IS_ATTENTION = 1 AND a.ATTENTION_TYPE = 2) |
|
|
|
LEFT JOIN customer_staff cs on r.user_type != 'resi' AND r.created_by = cs.user_id AND r.customer_id = cs.customer_id |
|
|
|
LEFT JOIN user_base_info ubi ON r.user_type = 'resi' AND r.created_by = ubi.user_id AND r.customer_id = ubi.customer_id |
|
|
|
WHERE |
|
|
|
r.DEL_FLAG = '0' |
|
|
|
AND r.CUSTOMER_ID = #{customerId} |
|
|
@ -67,6 +83,9 @@ |
|
|
|
<if test='null != sojournHistory and "" != sojournHistory'> |
|
|
|
AND r.sojourn_history = #{sojournHistory} |
|
|
|
</if> |
|
|
|
<if test='null != isolateType and "" != isolateType'> |
|
|
|
AND r.isolate_type = #{isolateType} |
|
|
|
</if> |
|
|
|
ORDER BY |
|
|
|
r.ARRIVE_DATE DESC, r.CREATED_TIME DESC |
|
|
|
</select> |
|
|
|