From b1b7823aebd8f11113a67552edb4dd400970e98b Mon Sep 17 00:00:00 2001 From: htjcAdmin Date: Wed, 4 Feb 2026 16:17:30 +0800 Subject: [PATCH] =?UTF-8?q?/*=E5=8D=97=E7=91=9E=E7=A7=91=E6=8A=80openApi?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=80=9F=E5=BA=A6=E4=BC=98=E5=8C=96*/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/task/PatrolResultMapper.xml | 127 +++++++++++++++--- 1 file changed, 105 insertions(+), 22 deletions(-) diff --git a/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml b/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml index 18851b1..2ec06a8 100644 --- a/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml +++ b/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml @@ -874,45 +874,127 @@ - SELECT a.patrol_point_id, d.area_name, d.patrol_device_name, f.patrol_point_name, CASE - WHEN e.`value` = 'check image' THEN - '0' ELSE e.`value` - END `value`, - h.dict_value line_id, + WHEN e.`value` = 'check image' THEN '0' + ELSE e.`value` + END AS `value`, + h.dict_value AS line_id, e.create_time, a.channel_code - FROM - patrol_preset_pos a - LEFT JOIN patrol_result e ON a.patrol_point_id = e.device_id + FROM patrol_preset_pos a + LEFT JOIN patrol_result e + ON a.patrol_point_id = e.device_id RIGHT JOIN ( SELECT - MAX( h.line_id ) line_id - FROM - patrol_result h + MAX(h.line_id) AS line_id + FROM patrol_result h - - DATE_FORMAT( h.create_time, '%y%m%d' ) = DATE_FORMAT( #{createTime}, '%y%m%d' ) + + h.create_time =]]> DATE(#{createTime}) + AND h.create_time DATE_ADD(DATE(#{createTime}), INTERVAL 1 DAY) - GROUP BY - h.device_id + GROUP BY h.device_id ) i ON e.line_id = i.line_id - RIGHT JOIN ( SELECT g.dict_value, g.dict_label FROM sys_dict_data g WHERE g.dict_type = 'oil_api' ) h ON - h.dict_label = a.patrol_point_id - LEFT JOIN basedata_eqpbook d ON a.eqp_book_id = d.eqp_book_id - LEFT JOIN basedata_patrolpoint f ON a.patrol_point_id = f.patrol_point_id + RIGHT JOIN ( + SELECT g.dict_value, g.dict_label + FROM sys_dict_data g + WHERE g.dict_type = 'oil_api' + ) h ON h.dict_label = a.patrol_point_id + LEFT JOIN basedata_eqpbook d + ON a.eqp_book_id = d.eqp_book_id + LEFT JOIN basedata_patrolpoint f + ON a.patrol_point_id = f.patrol_point_id ORDER BY d.area_name, d.patrol_device_name - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +