From bd3916f68a3f8971bfe8c78b0b71e87fba643e11 Mon Sep 17 00:00:00 2001 From: Administrator <1144154118@qq.com> Date: 星期四, 10 八月 2023 09:24:58 +0800 Subject: [PATCH] 巡检日历及查询优化 --- ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml b/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml index 823c329..5f3d1ed 100644 --- a/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml +++ b/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml @@ -31,6 +31,12 @@ <result property="cameraId" column="camera_id"/> </resultMap> + <resultMap type="ArdAlarmpointsWell" id="wellResult"> + <result property="id" column="id"/> + <result property="wellId" column="well_id"/> + <result property="type" column="type"/> + </resultMap> + <sql id="selectArdAlarmpointsWellVo"> select c.id, c.well_id, @@ -198,7 +204,8 @@ WHERE well_id = #{wellId} </select> - <select id="wellByPlanId" parameterType="String" resultMap="ArdAlarmpointsWellResult"> - select * from ard_alarmpoints_well where id in (select alarmpoints_id from ard_app_patrolpoint where patrolplan_id = #{id}) + <select id="wellByPlanId" parameterType="String" resultMap="wellResult"> + select ard_app_patrolpoint.alarmpoints_id as id,ard_alarmpoints_well.well_id, ard_app_patrolpoint."type" from ard_alarmpoints_well LEFT JOIN ard_app_patrolpoint on ard_app_patrolpoint.alarmpoints_id = ard_alarmpoints_well.id where ard_alarmpoints_well.id in (select alarmpoints_id from ard_app_patrolpoint where patrolplan_id = #{id}) + GROUP BY ard_app_patrolpoint.alarmpoints_id,ard_alarmpoints_well.well_id,ard_app_patrolpoint."type" </select> </mapper> \ No newline at end of file -- Gitblit v1.9.3