diff --git a/urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml b/urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml index 561997d..d6ae343 100644 --- a/urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml +++ b/urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml @@ -24,11 +24,12 @@ a.finish_state, a.begin_time, a.end_time - FROM garden_inspection_plan a, - garden_inspection_plan_detail b, - (select distinct batch_no, dept_id - from garden_maintain_plan_role - where deleted = 0 + FROM + garden_inspection_plan a + INNER JOIN ( + SELECT DISTINCT batch_no + FROM garden_inspection_plan_role + WHERE deleted = 0 AND dept_id = #{req.deptId} AND role_id IN @@ -36,14 +37,11 @@ #{roleId} - ) c - WHERE a.batch_no = b.batch_no - AND a.batch_no = c.batch_no - AND a.dept_id = c.dept_id - AND a.deleted = b.deleted - AND a.deleted = 0 + ) c ON a.batch_no = c.batch_no + WHERE + a.deleted = 0 - AND a.road_name LIKE CONCAT('%',#{req.roadName},'%') + AND a.road_name LIKE CONCAT('%', #{req.roadName}, '%') AND a.busi_line IN @@ -51,24 +49,22 @@ #{busiLine} - - and b.finish_state = a.finish_state - - and a.finish_state = b.finish_state + - and a.finish_state = 1 - = #{req.localDate}]]> + AND a.finish_state = 1 + = #{req.localDate}]]> - and a.finish_state = 2 + AND a.finish_state = 2 - and a.finish_state = 3 + AND a.finish_state = 3 - and a.finish_state = 4 + AND a.finish_state = 4 + diff --git a/urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml b/urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml index 28915ff..6c220f0 100644 --- a/urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml +++ b/urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml @@ -25,11 +25,11 @@ a.begin_time, a.end_time FROM - garden_maintain_plan a, - garden_maintain_plan_detail b, - (select distinct batch_no, dept_id - from garden_maintain_plan_role - where deleted = 0 + garden_maintain_plan a + INNER JOIN ( + SELECT DISTINCT batch_no + FROM garden_maintain_plan_role + WHERE deleted = 0 AND dept_id = #{req.deptId} AND role_id IN @@ -37,38 +37,35 @@ #{roleId} - ) c - WHERE a.batch_no = b.batch_no - AND a.batch_no = c.batch_no - AND a.dept_id = c.dept_id - AND a.deleted = b.deleted - AND a.deleted = 0 - - AND a.road_name LIKE CONCAT('%',#{req.roadName},'%') + ) c ON a.batch_no = c.batch_no + WHERE + a.deleted = 0 + + AND a.road_name LIKE CONCAT('%', #{req.roadName}, '%') - AND a.busi_line IN #{busiLine} - - and a.finish_state = b.finish_state - - and a.finish_state = 1 - = #{req.localDate}]]> - - - and a.finish_state = 2 - - - and a.finish_state = 3 - - - and a.finish_state = 4 - + + + + AND a.finish_state = 1 + AND a.begin_time #{req.localDate} + AND a.end_time = ]]> #{req.localDate} + + + AND a.finish_state = 2 + + + AND a.finish_state = 3 + + + AND a.finish_state = 4 + +