Commit 73dd960684ad4169096279996057aa5a3ebd4465
1 parent
e9af2e9f
优化
Showing
7 changed files
with
49 additions
and
21 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanDetailReqVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanDetailListByRoadPageReqVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanDetailServiceImpl.java
| ... | ... | @@ -101,6 +101,7 @@ public class InspectionPlanDetailServiceImpl implements InspectionPlanDetailServ |
| 101 | 101 | } |
| 102 | 102 | pageReqVO.setCompanyId(companyId); |
| 103 | 103 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 104 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); | |
| 104 | 105 | |
| 105 | 106 | /*2.明细*/ |
| 106 | 107 | return inspectionPlanDetailMapper.getInspectionPlanDetailForApp(pageReqVO); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanDetailServiceImpl.java
| ... | ... | @@ -114,11 +114,7 @@ public class MaintainPlanDetailServiceImpl implements MaintainPlanDetailService |
| 114 | 114 | if (StringUtils.isNotEmpty(busiLine)) { |
| 115 | 115 | pageReqVO.setBusiLineList(Arrays.asList(busiLine.split(","))); |
| 116 | 116 | } |
| 117 | - | |
| 118 | - /*1.查询登录用户角色*/ | |
| 119 | -// Set<String> batchNos = this.getBatchNosByLoginUserId(); | |
| 120 | -// pageReqVO.setLocalDateTime(LocalDateTime.now()); | |
| 121 | -// pageReqVO.setBatchNos(batchNos); | |
| 117 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); | |
| 122 | 118 | /*2.分页*/ |
| 123 | 119 | IPage<AppMaintainPlanDetailRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 124 | 120 | IPage<AppMaintainPlanDetailRespVO> page = maintainPlanDetailMapper.appMaintainPlanDetailListByRoadPage(mpPage, pageReqVO); |
| ... | ... | @@ -128,8 +124,6 @@ public class MaintainPlanDetailServiceImpl implements MaintainPlanDetailService |
| 128 | 124 | |
| 129 | 125 | @Override |
| 130 | 126 | public List<AppMaintainNotFinishPlanDetailRespVO> getMaintainNotFinishPlanCommitDetail(AppMaintainNotFinishPlanDetailReqVO reqVO) { |
| 131 | - //完成状态 1:未完成;2:已完成;3:已失效 | |
| 132 | -// reqVO.setFinishState(1); | |
| 133 | 127 | reqVO.setLocalDateTime(LocalDateTime.now()); |
| 134 | 128 | return maintainPlanDetailMapper.getMaintainNotFinishPlanCommitDetail(reqVO); |
| 135 | 129 | } | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanDetailMapper.xml
| ... | ... | @@ -30,12 +30,9 @@ |
| 30 | 30 | b.begin_time, |
| 31 | 31 | b.end_time |
| 32 | 32 | FROM |
| 33 | - garden_inspection_plan a, | |
| 34 | - garden_inspection_plan_detail b | |
| 35 | - WHERE | |
| 36 | - a.batch_no = b.batch_no | |
| 37 | - AND a.deleted = b.deleted | |
| 38 | - AND a.deleted = 0 | |
| 33 | + garden_inspection_plan a | |
| 34 | + INNER JOIN garden_inspection_plan_detail b ON a.batch_no = b.batch_no AND a.deleted = b.deleted | |
| 35 | + WHERE a.deleted = 0 | |
| 39 | 36 | AND a.batch_no = #{req.batchNo} |
| 40 | 37 | AND a.company_id = #{req.companyId} |
| 41 | 38 | AND a.dept_id = #{req.deptId} |
| ... | ... | @@ -46,7 +43,22 @@ |
| 46 | 43 | </foreach> |
| 47 | 44 | </if> |
| 48 | 45 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 49 | - and b.finish_state = #{req.finishState} | |
| 46 | + <choose> | |
| 47 | + <when test="req.finishState == 1"> | |
| 48 | + AND b.finish_state = 1 | |
| 49 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | |
| 50 | + AND b.end_time >= #{req.localDateTime}]]> | |
| 51 | + </when> | |
| 52 | + <when test="req.finishState == 2"> | |
| 53 | + AND b.finish_state = 2 | |
| 54 | + </when> | |
| 55 | + <when test="req.finishState == 3"> | |
| 56 | + AND b.finish_state = 3 | |
| 57 | + </when> | |
| 58 | + <when test="req.finishState == 4"> | |
| 59 | + AND b.finish_state = 4 | |
| 60 | + </when> | |
| 61 | + </choose> | |
| 50 | 62 | </select> |
| 51 | 63 | |
| 52 | 64 | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanDetailMapper.xml
| ... | ... | @@ -28,10 +28,9 @@ |
| 28 | 28 | c.end_time, |
| 29 | 29 | c.sort_num |
| 30 | 30 | FROM |
| 31 | - garden_maintain_plan a, | |
| 32 | - garden_maintain_plan_detail c | |
| 33 | - WHERE a.batch_no=c.batch_no | |
| 34 | - AND a.deleted=0 | |
| 31 | + garden_maintain_plan a | |
| 32 | + INNER JOIN garden_maintain_plan_detail c on a.batch_no=c.batch_no | |
| 33 | + WHERE a.deleted=0 | |
| 35 | 34 | AND a.road_id = #{req.roadId} |
| 36 | 35 | <if test="req.planName != null and req.planName !=''"> |
| 37 | 36 | AND a.plan_name LIKE CONCAT('%',#{req.planName},'%') |
| ... | ... | @@ -46,7 +45,22 @@ |
| 46 | 45 | AND a.batch_no= #{req.batchNo} |
| 47 | 46 | </if> |
| 48 | 47 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 49 | - and a.finish_state = #{req.finishState} | |
| 48 | + <choose> | |
| 49 | + <when test="req.finishState == 1"> | |
| 50 | + AND c.finish_state = 1 | |
| 51 | + <![CDATA[AND c.begin_time <= #{req.localDateTime} | |
| 52 | + AND c.end_time >= #{req.localDateTime}]]> | |
| 53 | + </when> | |
| 54 | + <when test="req.finishState == 2"> | |
| 55 | + AND c.finish_state = 2 | |
| 56 | + </when> | |
| 57 | + <when test="req.finishState == 3"> | |
| 58 | + AND c.finish_state = 3 | |
| 59 | + </when> | |
| 60 | + <when test="req.finishState == 4"> | |
| 61 | + AND c.finish_state = 4 | |
| 62 | + </when> | |
| 63 | + </choose> | |
| 50 | 64 | </select> |
| 51 | 65 | |
| 52 | 66 | <select id="getMaintainNotFinishPlanCommitDetail" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainNotFinishPlanDetailRespVO"> | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml
| ... | ... | @@ -53,8 +53,8 @@ |
| 53 | 53 | <choose> |
| 54 | 54 | <when test="req.finishState == 1"> |
| 55 | 55 | AND a.finish_state = 1 |
| 56 | - AND a.begin_time <![CDATA[ <= ]]> #{req.localDate} | |
| 57 | - AND a.end_time <![CDATA[ >= ]]> #{req.localDate} | |
| 56 | + <![CDATA[AND a.begin_time <= #{req.localDate} | |
| 57 | + AND a.end_time >= #{req.localDate}]]> | |
| 58 | 58 | </when> |
| 59 | 59 | <when test="req.finishState == 2"> |
| 60 | 60 | AND a.finish_state = 2 | ... | ... |