|
|
|
@ -134,18 +134,18 @@ |
|
|
|
<if test="mainId != null and mainId != ''">and main_id = #{mainId}</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
<!-- <resultMap type="PatrolData" id="PatrolDataResult">--> |
|
|
|
<!-- <result property="lineId" column="line_id"/>--> |
|
|
|
<!-- <result property="pointName" column="point_name"/>--> |
|
|
|
<!-- <result property="patrolTime" column="patrol_time"/>--> |
|
|
|
<!-- <result property="pointStatus" column="point_status"/>--> |
|
|
|
<!-- <result property="warnStatus" column="warn_status"/>--> |
|
|
|
<!-- <result property="desc" column="desc"/>--> |
|
|
|
<!-- <result property="img" column="img"/>--> |
|
|
|
<!-- <result property="imgType" column="img_type"/>--> |
|
|
|
<!-- <result property="dataType" column="data_type"/>--> |
|
|
|
<!-- <result property="imgAnalyse" column="img_analysis"/>--> |
|
|
|
<!-- </resultMap>--> |
|
|
|
<!-- <resultMap type="PatrolData" id="PatrolDataResult">--> |
|
|
|
<!-- <result property="lineId" column="line_id"/>--> |
|
|
|
<!-- <result property="pointName" column="point_name"/>--> |
|
|
|
<!-- <result property="patrolTime" column="patrol_time"/>--> |
|
|
|
<!-- <result property="pointStatus" column="point_status"/>--> |
|
|
|
<!-- <result property="warnStatus" column="warn_status"/>--> |
|
|
|
<!-- <result property="desc" column="desc"/>--> |
|
|
|
<!-- <result property="img" column="img"/>--> |
|
|
|
<!-- <result property="imgType" column="img_type"/>--> |
|
|
|
<!-- <result property="dataType" column="data_type"/>--> |
|
|
|
<!-- <result property="imgAnalyse" column="img_analysis"/>--> |
|
|
|
<!-- </resultMap>--> |
|
|
|
<resultMap type="PatrolData" id="PatrolDataResult"> |
|
|
|
<result property="lineId" column="line_id"/> |
|
|
|
<result property="pointName" column="point_name"/> |
|
|
|
@ -206,8 +206,8 @@ |
|
|
|
b.point_status , |
|
|
|
b.result_type as warn_status, |
|
|
|
b.description as 'desc', |
|
|
|
<if test="filter == 0 "> b.res_img_url as img, </if> |
|
|
|
<if test="filter == 1 "> b.image_normal_url_path as img, </if> |
|
|
|
<if test="filter == 0 ">b.res_img_url as img,</if> |
|
|
|
<if test="filter == 1 ">b.image_normal_url_path as img,</if> |
|
|
|
a.file_type as img_type, |
|
|
|
a.data_type, |
|
|
|
b.filter, |
|
|
|
@ -247,27 +247,44 @@ |
|
|
|
and a.task_patrolled_id=#{taskPatrolId} |
|
|
|
and b.task_patrol_id=#{taskPatrolId} |
|
|
|
</if> |
|
|
|
<if test="objectId != null and objectId != ''">and b.objectId=#{objectId} </if> |
|
|
|
<if test="objectId != null and objectId != ''">and b.objectId=#{objectId}</if> |
|
|
|
<if test="result != null and result != ''">and b.result = #{result}</if> |
|
|
|
<if test="resultType != null and resultType != '' and resultType == '1'.toString ">and b.result_type = #{resultType} </if> |
|
|
|
<if test="resultType != null and resultType != '' and resultType == '2'.toString ">and b.result_type = #{resultType} </if> |
|
|
|
<if test="filter != null and filter != '' and resCode == null">and b.filter = #{filter} and b.point_status = '0' and b.res_code='2000' </if> |
|
|
|
<if test="resCode != null and resCode != ''">and b.filter = #{filter} and b.res_code!=#{resCode} </if> |
|
|
|
<if test="pointName != null and pointName != ''">and a.device_name like concat('%', #{pointName}, '%') </if> |
|
|
|
<if test="deviceName != null and deviceName != ''">and d.device_name like concat('%', #{deviceName}, '%') </if> |
|
|
|
<if test="resultType != null and resultType != '' and resultType == '1'.toString ">and b.result_type = |
|
|
|
#{resultType} |
|
|
|
</if> |
|
|
|
<if test="resultType != null and resultType != '' and resultType == '2'.toString ">and b.result_type = |
|
|
|
#{resultType} |
|
|
|
</if> |
|
|
|
<if test="filter != null and filter != '' and resCode == null">and b.filter = #{filter} and b.point_status |
|
|
|
= '0' and b.res_code='2000' |
|
|
|
</if> |
|
|
|
<if test="resCode != null and resCode != ''">and b.filter = #{filter} and b.res_code!=#{resCode}</if> |
|
|
|
<if test="pointName != null and pointName != ''">and a.device_name like concat('%', #{pointName}, '%')</if> |
|
|
|
<if test="deviceName != null and deviceName != ''">and d.device_name like concat('%', #{deviceName}, '%') |
|
|
|
</if> |
|
|
|
<if test="posType != null and posType != '' and posType == '0'.toString"> |
|
|
|
<if test="channelName != null and channelName != ''">and g.channel_name like concat('%', #{channelName}, '%') </if> |
|
|
|
<if test="deviceSource != null and deviceSource != ''">and g.device_source like concat('%', #{deviceSource}, '%') </if> |
|
|
|
<if test="channelName != null and channelName != ''">and g.channel_name like concat('%', |
|
|
|
#{channelName}, '%') |
|
|
|
</if> |
|
|
|
<if test="deviceSource != null and deviceSource != ''">and g.device_source like concat('%', |
|
|
|
#{deviceSource}, '%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="posType != null and posType != '' and posType != '0'.toString"> |
|
|
|
<if test="channelName != null and channelName != ''">and h.patrol_device_name like concat('%', #{channelName}, '%') </if> |
|
|
|
<if test="deviceSource != null and deviceSource != ''">and h.device_source like concat('%', #{deviceSource}, '%') </if> |
|
|
|
<if test="channelName != null and channelName != ''">and h.patrol_device_name like concat('%', |
|
|
|
#{channelName}, '%') |
|
|
|
</if> |
|
|
|
<if test="deviceSource != null and deviceSource != ''">and h.device_source like concat('%', |
|
|
|
#{deviceSource}, '%') |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
<if test="desc != null and desc != ''">and b.description like concat('%', #{desc}, '%')</if> |
|
|
|
<if test="pointStatus != null and pointStatus != ''">and b.point_status like concat('%', #{pointStatus}, |
|
|
|
'%') |
|
|
|
</if> |
|
|
|
<if test="desc != null and desc != ''">and b.description like concat('%', #{desc}, '%') </if> |
|
|
|
<if test="pointStatus != null and pointStatus != ''">and b.point_status like concat('%', #{pointStatus}, '%') </if> |
|
|
|
</where> |
|
|
|
<if test="abnormal == 0"> ORDER BY d.device_name,a.device_name </if> |
|
|
|
<if test="abnormal == 1"> ORDER BY b.point_status </if> |
|
|
|
<if test="abnormal == 0">ORDER BY d.device_name,a.device_name</if> |
|
|
|
<if test="abnormal == 1">ORDER BY b.point_status</if> |
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
|
@ -387,7 +404,7 @@ |
|
|
|
<if test="deviceTypeName != null and deviceTypeName != ''">and e.device_type_name like |
|
|
|
concat('%',#{deviceTypeName},'%') |
|
|
|
</if> |
|
|
|
<if test="deviceId != null and deviceId != ''"> and a.device_id =#{deviceId} </if> |
|
|
|
<if test="deviceId != null and deviceId != ''">and a.device_id =#{deviceId}</if> |
|
|
|
<if test="mainId != null and mainId != ''">and a.main_id =#{mainId}</if> |
|
|
|
<if test="taskName != null and taskName != ''">and a.task_name like concat('%',#{taskName},'%')</if> |
|
|
|
</where> |
|
|
|
@ -457,7 +474,8 @@ |
|
|
|
from basedata_patrolpoint a |
|
|
|
left join basedata_alg_subtype b on a.alg_subtype_ids = b.alg_subtype_id |
|
|
|
left join basedata_alg c on b.alg_id = c.alg_id |
|
|
|
where CONVERT(a.patrol_point_id, CHAR) = #{lineId} OR a.patrol_point_code LIKE concat('%',#{lineId}) |
|
|
|
where CONVERT(a.patrol_point_id, CHAR) = #{lineId} |
|
|
|
OR a.patrol_point_code LIKE concat('%', #{lineId}) |
|
|
|
</select> |
|
|
|
<select id="selectAlgorithmInfo" parameterType="String" resultType="java.util.Map"> |
|
|
|
select * |
|
|
|
@ -580,7 +598,8 @@ |
|
|
|
d.area_name as jg_name, |
|
|
|
e.area_name |
|
|
|
from patrol_result f |
|
|
|
left join basedata_patrolpoint a on f.device_id = a.patrol_point_id OR f.device_name = a.patrol_point_name |
|
|
|
left join basedata_patrolpoint a |
|
|
|
on f.device_id = a.patrol_point_id OR f.device_name = a.patrol_point_name |
|
|
|
left join basedata_device b on a.device_id = b.device_id and b.power_main_equ_flag = "no" |
|
|
|
left join basedata_device c on b.parent_id = c.device_id |
|
|
|
left join basedata_area d on c.area_id = d.area_id and d.area_type = 'bayunit' |
|
|
|
@ -858,4 +877,75 @@ |
|
|
|
where task_code = #{taskCode} |
|
|
|
and to_days(create_time) = to_days(#{createTime}) |
|
|
|
</select> |
|
|
|
<resultMap type="com.inspect.partrolresult.domain.BasedataEqpBookChannel" id="channelResultMap"> |
|
|
|
<result property="channelName" column="channel_name"/> |
|
|
|
</resultMap> |
|
|
|
<select id="selectChannelName" parameterType="java.lang.String" |
|
|
|
resultMap="channelResultMap"> |
|
|
|
select channel_name channel_name |
|
|
|
from basedata_eqpbook_channel |
|
|
|
where channel_code = #{channelCode} |
|
|
|
</select> |
|
|
|
|
|
|
|
<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="taskCode" column="task_code"/> |
|
|
|
<result property="taskName" column="task_name"/> |
|
|
|
<result property="taskPatrolledId" column="task_patrolled_id"/> |
|
|
|
<result property="deviceId" column="device_id"/> |
|
|
|
<result property="deviceName" column="device_name"/> |
|
|
|
<result property="mainDevId" column="main_dev_id"/> |
|
|
|
<result property="mainDevName" column="main_dev_name"/> |
|
|
|
<result property="componentId" column="component_name"/> |
|
|
|
<result property="componentName" column="component_id"/> |
|
|
|
<result property="value" column="value"/> |
|
|
|
<result property="unit" column="unit"/> |
|
|
|
<result property="recognitionType" column="recognition_type"/> |
|
|
|
<result property="time" column="time"/> |
|
|
|
<result property="fileType" column="file_type"/> |
|
|
|
<result property="filePath" column="file_path"/> |
|
|
|
<result property="baseFilePath" column="base_file_path"/> |
|
|
|
<result property="rectangle" column="rectangle"/> |
|
|
|
<result property="alarmLevel" column="alarm_level"/> |
|
|
|
<result property="alarmType" column="alarm_type"/> |
|
|
|
<result property="content" column="content"/> |
|
|
|
<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 |
|
|
|
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 |
|
|
|
<where> |
|
|
|
<if test="startTime != null ">and pr.time >= #{startTime}</if> |
|
|
|
<if test="endTime != null ">and pr.time <= #{endTime}</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> |
|
|
|
</where> |
|
|
|
LIMIT #{pageSize} OFFSET #{offset} |
|
|
|
</select> |
|
|
|
</mapper> |