|
|
|
@ -186,6 +186,7 @@ |
|
|
|
<result property="filePath" column="file_path"/> |
|
|
|
<result property="originalValue" column="original_value"/> |
|
|
|
<result property="taskPatrolId" column="task_patrol_id"/> |
|
|
|
<result property="taskName" column="task_name"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<select id="selectPatrolDataResultByTaskCode" parameterType="PatrolResult" resultMap="PatrolDataResult"> |
|
|
|
@ -346,6 +347,76 @@ |
|
|
|
</where> |
|
|
|
ORDER BY line_id desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectDefectList" parameterType="com.inspect.analysis.domain.DefectListQuery" |
|
|
|
resultMap="PatrolDataResult"> |
|
|
|
select |
|
|
|
b.line_id, |
|
|
|
a.device_name as point_name, |
|
|
|
a.device_id as point_id, |
|
|
|
a.create_time as patrol_time, |
|
|
|
b.point_status, |
|
|
|
b.result_type as warn_status, |
|
|
|
b.description as 'desc', |
|
|
|
case when b.filter = '0' then a.file_path else b.res_img_url end as img, |
|
|
|
b.image_normal_url_path, |
|
|
|
a.file_path, |
|
|
|
a.file_type as img_type, |
|
|
|
a.data_type, |
|
|
|
b.filter, |
|
|
|
b.request_id, |
|
|
|
b.res_img_url as img_analysis, |
|
|
|
b.original_value, |
|
|
|
b.res_status, |
|
|
|
d.device_name, |
|
|
|
e.area_name, |
|
|
|
d.area_id, |
|
|
|
b.alg_type, |
|
|
|
b.objectId, |
|
|
|
b.suggestion, |
|
|
|
b.res_value, |
|
|
|
b.task_patrol_id, |
|
|
|
a.task_name |
|
|
|
from patrol_result a |
|
|
|
inner join result_analysis b |
|
|
|
on a.line_id = b.business_id |
|
|
|
and a.task_patrolled_id = b.task_patrol_id |
|
|
|
and a.device_id = b.objectId |
|
|
|
left join basedata_patrolpoint c on a.device_id = c.patrol_point_id |
|
|
|
left join basedata_device d on c.device_id = d.device_id |
|
|
|
left join basedata_area e on e.area_id = d.area_id |
|
|
|
|
|
|
|
<where> |
|
|
|
<choose> |
|
|
|
<when test="taskPatrolIds != null and !taskPatrolIds.isEmpty()"> |
|
|
|
and a.task_patrolled_id in |
|
|
|
<foreach collection="taskPatrolIds" item="id" open="(" separator="," close=")"> |
|
|
|
#{id} |
|
|
|
</foreach> |
|
|
|
and b.task_patrol_id in |
|
|
|
<foreach collection="taskPatrolIds" item="id" open="(" separator="," close=")"> |
|
|
|
#{id} |
|
|
|
</foreach> |
|
|
|
</when> |
|
|
|
</choose> |
|
|
|
and b.result_type = '0' |
|
|
|
and b.point_status = '4' or b.point_status = '5' |
|
|
|
<if test="filter != null and filter != ''">and b.filter = #{filter}</if> |
|
|
|
<if test="algType != null and algType != ''">and b.alg_type = #{algType}</if> |
|
|
|
<if test="areaId != null and areaId != ''">and d.area_id = #{areaId}</if> |
|
|
|
<if test="deviceId != null and deviceId != ''">and d.device_id = #{deviceId}</if> |
|
|
|
<if test="pointId != null and pointId != ''">and a.device_id = #{pointId}</if> |
|
|
|
<if test="taskCode != null and taskCode != ''">and a.task_code = #{taskCode}</if> |
|
|
|
<if test="pointName != null and pointName != ''">and a.device_name like concat('%', #{pointName}, '%')</if> |
|
|
|
<if test="taskName != null and taskName != ''">and a.task_name like concat('%', #{taskName}, '%')</if> |
|
|
|
<if test="deviceName != null and deviceName != ''">and d.device_name like concat('%', #{deviceName}, '%')</if> |
|
|
|
<if test="beginTime != null and beginTime != ''">and a.create_time >= concat(#{beginTime}, ' 00:00:00')</if> |
|
|
|
<if test="endTime != null and endTime != ''">and a.create_time <= concat(#{endTime}, ' 23:59:59')</if> |
|
|
|
</where> |
|
|
|
order by b.task_patrol_id, b.objectId, b.alg_type, |
|
|
|
case b.filter when '1' then 1 when '0' then 2 else 3 end, |
|
|
|
a.create_time, b.line_id |
|
|
|
</select> |
|
|
|
<resultMap type="com.inspect.system.base.openDomain.BasedataEqpBookMoMain" id="BasedataEqpBookResult"> |
|
|
|
<result property="eqpBookId" column="eqp_book_id"/> |
|
|
|
<result property="stationName" column="station_name"/> |
|
|
|
|