积水点列表添加液位深度字段

This commit is contained in:
wuweida 2022-08-12 17:06:25 +08:00
parent 5e3db658b0
commit c9768455d2
3 changed files with 22 additions and 2 deletions

View File

@ -57,4 +57,6 @@ public class WaterPointDto {
private String pointLevel;//积水点等级1重度2中度3轻度4无积水 private String pointLevel;//积水点等级1重度2中度3轻度4无积水
private String waterPointDepth;//积水点深度
} }

View File

@ -15,7 +15,6 @@ import java.util.List;
@Repository @Repository
public interface WaterPointMapper extends BaseMapper<WaterPoint> { public interface WaterPointMapper extends BaseMapper<WaterPoint> {
@Select("select * from water_point wp LEFT JOIN water_point_report wpr ON wp.water_point_id = wpr.water_point_id WHERE wp.audit_flag = '2' and wp.disp_flag in (0,1)")
List<WaterPointDto> selectWaterPoint(); List<WaterPointDto> selectWaterPoint();
@Select("select * from water_point wp LEFT JOIN water_point_report wpr ON wp.water_point_id = wpr.water_point_id where audit_flag = '2' and disp_flag in (0,1) and report_origin = #{reportOrigin}") @Select("select * from water_point wp LEFT JOIN water_point_report wpr ON wp.water_point_id = wpr.water_point_id where audit_flag = '2' and disp_flag in (0,1) and report_origin = #{reportOrigin}")

View File

@ -1,5 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hisense.monitormanage.mapper.WaterPointMapper"> <mapper namespace="com.hisense.monitormanage.mapper.WaterPointMapper">
<select id="selectWaterPoint" resultType="com.hisense.monitormanage.dto.WaterPointDto">
SELECT a.*,b.updated_date AS waterPointDepth
FROM
(SELECT wp.*,wpr.point_level
FROM water_point wp
LEFT JOIN water_point_report wpr
ON wp.water_point_id = wpr.water_point_id
WHERE wp.audit_flag = '2' AND wp.disp_flag IN (0,1)) a
LEFT JOIN
(SELECT c.*,wps.updated_date
FROM water_point_sensor wps
JOIN
(SELECT water_point_id,MAX(water_point_area) AS water_point_area
FROM water_point_sensor
GROUP BY water_point_id) c
ON wps.water_point_area = c.water_point_area
AND wps.water_point_id = c.water_point_id) b
ON a.water_point_id = b.water_point_id
ORDER BY waterPointDepth DESC
</select>
</mapper> </mapper>