Commit 8f9bec32c9c51df69ce965a0e5cdc2b100ba0aaa
1 parent
7590852d
优化
Showing
2 changed files
with
9 additions
and
14 deletions
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanCommitMapper.xml
| ... | ... | @@ -38,11 +38,9 @@ |
| 38 | 38 | a.creator_name, |
| 39 | 39 | a.create_time |
| 40 | 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 | 44 | <if test="req.planNo != null and req.planNo !=''"> |
| 47 | 45 | and a.plan_no = #{req.planNo} |
| 48 | 46 | </if> |
| ... | ... | @@ -125,15 +123,10 @@ |
| 125 | 123 | c.user_name, |
| 126 | 124 | c.finish_time, |
| 127 | 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 | 130 | AND b.plan_no = #{planNo} |
| 138 | 131 | <if test="busiLineList != null and busiLineList.size() > 0"> |
| 139 | 132 | AND a.busi_line IN |
| ... | ... | @@ -141,5 +134,6 @@ |
| 141 | 134 | #{id} |
| 142 | 135 | </foreach> |
| 143 | 136 | </if> |
| 137 | + ODER BY c.id DESC | |
| 144 | 138 | </select> |
| 145 | 139 | </mapper> | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanCommitMapper.xml
| ... | ... | @@ -115,5 +115,6 @@ |
| 115 | 115 | INNER JOIN garden_maintain_plan b ON a.batch_no = b.batch_no |
| 116 | 116 | INNER JOIN garden_maintain_plan_commit c ON a.batch_no = c.batch_no AND a.plan_no = c.plan_no |
| 117 | 117 | WHERE a.plan_no = #{req.planNo} |
| 118 | + ODER BY c.id DESC | |
| 118 | 119 | </select> |
| 119 | 120 | </mapper> | ... | ... |