|
|
|
@ -966,8 +966,8 @@ |
|
|
|
<resultMap type="com.inspect.partrolresult.domain.InspectionPointResultVo" id="InspectionPointResultMap"> |
|
|
|
<result property="id" column="id"/> |
|
|
|
<!-- <result property="deviceName" column="device_name"/>--> |
|
|
|
<result property="patroldeviceCode" column="patrol_device_code"/> |
|
|
|
<result property="patroldeviceName" column="patrol_device_name"/> |
|
|
|
<result property="patroldeviceCode" column="patroldevice_code"/> |
|
|
|
<result property="patroldeviceName" column="patroldevice_name"/> |
|
|
|
<result property="taskCode" column="task_code"/> |
|
|
|
<result property="taskName" column="task_name"/> |
|
|
|
<result property="taskPatrolledId" column="task_patrolled_id"/> |
|
|
|
@ -989,42 +989,56 @@ |
|
|
|
<result property="alarmType" column="alarm_type"/> |
|
|
|
<result property="content" column="content"/> |
|
|
|
<result property="vaild" column="vaild"/> |
|
|
|
<result property="filter" column="filter"/> |
|
|
|
<result property="resultType" column="result_type"/> |
|
|
|
|
|
|
|
</resultMap> |
|
|
|
<select id="inspectResult" parameterType="com.inspect.partrolresult.domain.InspectionPointParam" resultMap="InspectionPointResultMap"> |
|
|
|
SELECT pr.line_id id, |
|
|
|
pr.task_code task_code, |
|
|
|
pr.task_name task_name, |
|
|
|
pr.task_patrolled_id task_patrolled_id, |
|
|
|
pr.device_id, |
|
|
|
pr.device_name, |
|
|
|
bd.device_name AS component_name, |
|
|
|
bd.device_id AS component_id, |
|
|
|
pr.value, |
|
|
|
pr.unit, |
|
|
|
pr.recognition_type, |
|
|
|
pr.time, |
|
|
|
pr.file_type, |
|
|
|
pr.file_path, |
|
|
|
pr.file_path base_file_path, |
|
|
|
pr.rectangle, |
|
|
|
ra.result_type, |
|
|
|
ra.description content, |
|
|
|
pr.valid valid |
|
|
|
select pr.line_id id, |
|
|
|
bec.channel_code patroldevice_code, |
|
|
|
bec.channel_name patroldevice_name, |
|
|
|
pr.task_code, |
|
|
|
pr.task_name, |
|
|
|
pr.line_id task_patrolled_id, |
|
|
|
bp.patrol_point_name device_name, |
|
|
|
bp.patrol_point_id device_id, |
|
|
|
bd.device_name main_dev_name, |
|
|
|
bd.device_id main_dev_id , |
|
|
|
bdb.device_name component_name, |
|
|
|
bdb.device_id component_id , |
|
|
|
ra.res_value value , |
|
|
|
pr.unit unit, |
|
|
|
bas.alg_subtype_id recognition_type, |
|
|
|
pr.time, |
|
|
|
pr.file_type, |
|
|
|
ra.res_img_url file_path, |
|
|
|
CASE |
|
|
|
WHEN ra.image_normal_url_path IS NOT NULL THEN CONCAT('/', ra.image_normal_url_path) |
|
|
|
ELSE ra.image_normal_url_path |
|
|
|
END base_file_path, |
|
|
|
pr.rectangle, |
|
|
|
pr.valid valid, |
|
|
|
ra.filter filter |
|
|
|
FROM patrol_result pr |
|
|
|
LEFT JOIN result_analysis ra on pr.line_id = ra.business_id |
|
|
|
LEFT JOIN basedata_patrolpoint bp ON pr.device_id = bp.patrol_point_id |
|
|
|
LEFT JOIN basedata_device bd ON bp.device_id = bd.device_id |
|
|
|
LEFT JOIN basedata_patrolpoint bp on bp.patrol_point_id = pr.device_id |
|
|
|
LEFT JOIN patrol_preset_pos bpp ON bp.patrol_point_id = bpp.patrol_point_id |
|
|
|
LEFT JOIN basedata_eqpbook_channel bec on bpp.channel_code = bec.channel_code |
|
|
|
LEFT JOIN basedata_device bd on bp.main_device_id = bd.device_id |
|
|
|
LEFT JOIN result_analysis ra on ra.business_id = pr.line_id |
|
|
|
LEFT JOIN basedata_device bdb on bdb.device_id = bp.device_id |
|
|
|
LEFT JOIN basedata_alg_subtype bas on ra.alg_type = bas.alg_subtype_code |
|
|
|
<where> |
|
|
|
<if test="startTime != null ">and pr.time >= CONCAT(#{startTime}, ' 00:00:00')</if> |
|
|
|
<if test="endTime != null ">and pr.time <= CONCAT(#{endTime}, ' 23:59:59')</if> |
|
|
|
<if test="deviceId != null ">and pr.device_id = #{deviceId}</if> |
|
|
|
<if test="taskPatrolledId != null ">and pr.task_patrolled_id = #{taskPatrolledId}</if> |
|
|
|
<if test="componentId != null ">and bd.device_id = #{componentId}</if> |
|
|
|
<if test="resultType != null ">and ra.result_type = #{resultType}</if> |
|
|
|
<if test="startTime != null and startTime != ''"> and pr.time >= CONCAT(#{startTime}, ' 00:00:00') </if> |
|
|
|
<if test="endTime != null and endTime != ''"> and pr.time <= CONCAT(#{endTime}, ' 23:59:59') </if> |
|
|
|
<if test="patroldeviceCode != null and patroldeviceCode != ''"> and bec.channel_code = #{patroldeviceCode} </if> |
|
|
|
<if test="deviceId != null and deviceId != ''"> and bp.patrol_point_id = #{deviceId} </if> |
|
|
|
<if test="mainDevId != null and mainDevId != ''"> and bd.device_id = #{mainDevId} </if> |
|
|
|
<if test="componentId != null and componentId != ''"> and bdb.device_id = #{componentId} </if> |
|
|
|
<if test="taskPatrolledId != null and taskPatrolledId != ''"> and pr.line_id = #{taskPatrolledId} </if> |
|
|
|
<if test="filter != null and filter != ''"> and ra.filter = #{filter} </if> |
|
|
|
<if test="resultType != null and resultType != ''"> and ra.result_type = #{resultType} and filter = 0 </if> |
|
|
|
</where> |
|
|
|
order by pr.time desc LIMIT #{pageSize} OFFSET #{offset} |
|
|
|
order by pr.time desc LIMIT #{pageSize} OFFSET #{offset} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectPatrolResultListByMainIds" resultMap="PatrolResultResult"> |
|
|
|
|