|
@@ -115,4 +115,69 @@
|
|
|
base_camera_management b on ma.camera_code = b.camera_code
|
|
|
where ma.alarm_id = #{alarmId}
|
|
|
</select>
|
|
|
+ <select id="deviceStatePage" resultType="com.ozs.service.entity.vo.DeviceStateResp" parameterType="com.ozs.service.entity.vo.DeviceStateResp">
|
|
|
+ SELECT
|
|
|
+ ca.install_mile AS installMile,
|
|
|
+ ca.measure_point_name AS measurePointName,
|
|
|
+ ra.railway_name AS railwayName,
|
|
|
+ de.dept_name AS deptName,
|
|
|
+ CASE
|
|
|
+ line_dir
|
|
|
+ WHEN 1 THEN
|
|
|
+ '上行'
|
|
|
+ WHEN 2 THEN
|
|
|
+ '下行'
|
|
|
+ END AS lineDir,
|
|
|
+ CASE
|
|
|
+ man.is_disable
|
|
|
+ WHEN 1 THEN
|
|
|
+ '正常'
|
|
|
+ WHEN 2 THEN
|
|
|
+ '故障'
|
|
|
+ END AS isDisable,
|
|
|
+ man.electricity,
|
|
|
+ ca.camera_code AS cameraCode,
|
|
|
+ ca.camera_sn AS cameraSn
|
|
|
+ FROM
|
|
|
+ base_camera_management AS ca
|
|
|
+ LEFT JOIN base_railway_management AS ra ON ca.railway_code = ra.railway_code
|
|
|
+ LEFT JOIN sys_dept AS de ON ca.dept_id = de.dept_id
|
|
|
+ LEFT JOIN base_device_dynamic_management AS man ON ca.camera_code = man.camera_code
|
|
|
+ <where>
|
|
|
+ <if test="railwayCode != null and railwayCode != ''">
|
|
|
+ and ca.railway_code=#{railwayCode}
|
|
|
+ </if>
|
|
|
+ <if test="isDisable != null and isDisable != ''">
|
|
|
+ and man.is_disable=#{isDisable}
|
|
|
+ </if>
|
|
|
+ <if test="electricity != null and electricity != ''">
|
|
|
+ and man.electricity <=#{electricity}
|
|
|
+ </if>
|
|
|
+ <if test="lineDir != null and lineDir != 0">
|
|
|
+ and a.line_dir =#{lineDir}
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null and deptId != 0">
|
|
|
+ and a.dept_id =#{deptId}
|
|
|
+ </if>
|
|
|
+ <if test="!dsFlay">
|
|
|
+ and
|
|
|
+ <trim prefix="(" prefixOverrides="or" suffix=")">
|
|
|
+ <if test="dsUserId != null and dsUserId != ''">
|
|
|
+ or a.create_by=#{dsUserId}
|
|
|
+ </if>
|
|
|
+ <if test="dsDeptId != null and dsDeptId != 0">
|
|
|
+ or a.dept_id=#{dsDeptId}
|
|
|
+ </if>
|
|
|
+ <if test="dsDeptIds != null">
|
|
|
+ or a.dept_id in
|
|
|
+ <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY
|
|
|
+ man.electricity
|
|
|
+ </select>
|
|
|
</mapper>
|