Commit 8f9bec32c9c51df69ce965a0e5cdc2b100ba0aaa

Authored by 王富生
1 parent 7590852d

优化

urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanCommitMapper.xml
@@ -38,11 +38,9 @@ @@ -38,11 +38,9 @@
38 a.creator_name, 38 a.creator_name,
39 a.create_time 39 a.create_time
40 FROM 40 FROM
41 - garden_inspection_plan_commit a,  
42 - garden_inspection_plan b  
43 - where a.batch_no=b.batch_no  
44 - AND a.deleted = b. deleted  
45 - AND a.deleted = 0 41 + garden_inspection_plan_commit a
  42 + INNER JOIN garden_inspection_plan b ON a.batch_no = b.batch_no AND a.deleted= b.deleted
  43 + where a.deleted = 0
46 <if test="req.planNo != null and req.planNo !=''"> 44 <if test="req.planNo != null and req.planNo !=''">
47 and a.plan_no = #{req.planNo} 45 and a.plan_no = #{req.planNo}
48 </if> 46 </if>
@@ -125,15 +123,10 @@ @@ -125,15 +123,10 @@
125 c.user_name, 123 c.user_name,
126 c.finish_time, 124 c.finish_time,
127 c.remark 125 c.remark
128 - FROM  
129 - garden_inspection_plan a,  
130 - garden_inspection_plan_detail b,  
131 - garden_inspection_plan_commit c  
132 - WHERE a.batch_no = b.batch_no  
133 - AND b.plan_no=c.plan_no  
134 - AND a.dept_id =b.dept_id  
135 - AND a.deleted = b.deleted  
136 - AND a.deleted = 0 126 + FROM garden_inspection_plan_detail b
  127 + INNER JOIN garden_inspection_plan a ON a.batch_no = b.batch_no
  128 + INNER JOIN garden_inspection_plan_commit c ON c.plan_no = a.plan_no AND b.batch_no = c.batch_no
  129 + WHERE a.deleted = 0
137 AND b.plan_no = #{planNo} 130 AND b.plan_no = #{planNo}
138 <if test="busiLineList != null and busiLineList.size() > 0"> 131 <if test="busiLineList != null and busiLineList.size() > 0">
139 AND a.busi_line IN 132 AND a.busi_line IN
@@ -141,5 +134,6 @@ @@ -141,5 +134,6 @@
141 #{id} 134 #{id}
142 </foreach> 135 </foreach>
143 </if> 136 </if>
  137 + ODER BY c.id DESC
144 </select> 138 </select>
145 </mapper> 139 </mapper>
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanCommitMapper.xml
@@ -115,5 +115,6 @@ @@ -115,5 +115,6 @@
115 INNER JOIN garden_maintain_plan b ON a.batch_no = b.batch_no 115 INNER JOIN garden_maintain_plan b ON a.batch_no = b.batch_no
116 INNER JOIN garden_maintain_plan_commit c ON a.batch_no = c.batch_no AND a.plan_no = c.plan_no 116 INNER JOIN garden_maintain_plan_commit c ON a.batch_no = c.batch_no AND a.plan_no = c.plan_no
117 WHERE a.plan_no = #{req.planNo} 117 WHERE a.plan_no = #{req.planNo}
  118 + ODER BY c.id DESC
118 </select> 119 </select>
119 </mapper> 120 </mapper>