Commit e31696ea817ff3e44a00b3d24a2b8a1b0c20958e

Authored by 王彪总
1 parent 2de94dbc

refactor(maintainplan): 优化道路维护计划查询SQL

- 移除不必要的字段查询包括批次号、计划号、完成状态等
- 将排序逻辑替换为按道路ID、道路名称、级别ID分组
- 简化查询结果结构提升查询性能
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml
@@ -15,16 +15,9 @@ @@ -15,16 +15,9 @@
15 15
16 <select id="appMaintainPlanRoadPage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO"> 16 <select id="appMaintainPlanRoadPage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO">
17 SELECT 17 SELECT
18 - a.batch_no,  
19 - b.plan_no,  
20 a.road_id, 18 a.road_id,
21 a.road_name, 19 a.road_name,
22 - a.level_id,  
23 - a.finish_state,  
24 - a.plan_num,  
25 - a.plan_finish_num,  
26 - b.begin_time,  
27 - b.end_time 20 + a.level_id
28 FROM 21 FROM
29 garden_maintain_plan_detail b 22 garden_maintain_plan_detail b
30 INNER JOIN garden_maintain_plan a ON b.batch_no = a.batch_no and a.deleted = b.deleted 23 INNER JOIN garden_maintain_plan a ON b.batch_no = a.batch_no and a.deleted = b.deleted
@@ -73,7 +66,7 @@ @@ -73,7 +66,7 @@
73 AND b.end_time >= #{req.localDateTime}]]> 66 AND b.end_time >= #{req.localDateTime}]]>
74 </when> 67 </when>
75 </choose> 68 </choose>
76 - ORDER BY b.id desc 69 + GROUP BY a.road_id, a.road_name, a.level_id
77 </select> 70 </select>
78 71
79 <select id="appMaintainPlanPlanTypePage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO"> 72 <select id="appMaintainPlanPlanTypePage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO">