Commit a7e6827a127bae74c79bc5f9778dea403aaeb66e
1 parent
579de493
优化
Showing
7 changed files
with
60 additions
and
3 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanPageReqVO.java
| ... | ... | @@ -8,6 +8,7 @@ import jakarta.validation.constraints.Min; |
| 8 | 8 | import jakarta.validation.constraints.NotNull; |
| 9 | 9 | import lombok.Data; |
| 10 | 10 | |
| 11 | +import java.time.LocalDate; | |
| 11 | 12 | import java.util.List; |
| 12 | 13 | import java.util.Set; |
| 13 | 14 | |
| ... | ... | @@ -37,4 +38,8 @@ public class AppInspectionPlanPageReqVO extends PageParam { |
| 37 | 38 | @Hidden |
| 38 | 39 | private Long deptId; |
| 39 | 40 | |
| 41 | + @Schema(description = "系统时间") | |
| 42 | + @Hidden | |
| 43 | + private LocalDate localDate; | |
| 44 | + | |
| 40 | 45 | } | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPagePlanTypeReqVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPageRoadReqVO.java
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| ... | ... | @@ -370,6 +370,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { |
| 370 | 370 | } |
| 371 | 371 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 372 | 372 | pageReqVO.setRoleIds(new HashSet<>(roleIds)); |
| 373 | + pageReqVO.setLocalDate(LocalDate.now()); | |
| 373 | 374 | /*2.分页*/ |
| 374 | 375 | IPage<AppInspectionPlanRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 375 | 376 | IPage<AppInspectionPlanRespVO> page = inspectionPlanMapper.getInspectionPlanAppPage(mpPage, pageReqVO); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/maintainplan/MaintainPlanServiceImpl.java
| ... | ... | @@ -384,6 +384,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 384 | 384 | } |
| 385 | 385 | pageReqVO.setRoleIds(new HashSet<>(roleIds)); |
| 386 | 386 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 387 | + pageReqVO.setLocalDate(LocalDate.now()); | |
| 387 | 388 | /*2.分页*/ |
| 388 | 389 | IPage<AppMaintainPlanPageRoadRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 389 | 390 | IPage<AppMaintainPlanPageRoadRespVO> page = maintainPlanMapper.appMaintainPlanRoadPage(mpPage, pageReqVO); |
| ... | ... | @@ -404,6 +405,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { |
| 404 | 405 | } |
| 405 | 406 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 406 | 407 | pageReqVO.setRoleIds(new HashSet<>(roleIds)); |
| 408 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); | |
| 407 | 409 | /*2.分页*/ |
| 408 | 410 | IPage<AppMaintainPlanPagePlanTypeRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 409 | 411 | IPage<AppMaintainPlanPagePlanTypeRespVO> page = maintainPlanMapper.appMaintainPlanPlanTypePage(mpPage, pageReqVO); | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml
| ... | ... | @@ -53,7 +53,22 @@ |
| 53 | 53 | </if> |
| 54 | 54 | <!--状态 1:未完成;2:已完成;3:已失效 4:终止--> |
| 55 | 55 | and b.finish_state = a.finish_state |
| 56 | - and b.finish_state = #{req.finishState} | |
| 56 | + <!--状态 1:未完成;2:已完成;3:已失效--> | |
| 57 | + and a.finish_state = b.finish_state | |
| 58 | + <if test="req.finishState == 1"> | |
| 59 | + and a.finish_state = 1 | |
| 60 | + <![CDATA[and a.begin_time <= #{req.localDate} | |
| 61 | + and a.end_time >= #{req.localDate}]]> | |
| 62 | + </if> | |
| 63 | + <if test="req.finishState == 2"> | |
| 64 | + and a.finish_state = 2 | |
| 65 | + </if> | |
| 66 | + <if test="req.finishState == 3"> | |
| 67 | + and a.finish_state = 3 | |
| 68 | + </if> | |
| 69 | + <if test="req.finishState == 4"> | |
| 70 | + and a.finish_state = 4 | |
| 71 | + </if> | |
| 57 | 72 | |
| 58 | 73 | </select> |
| 59 | 74 | </mapper> | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml
| ... | ... | @@ -55,7 +55,20 @@ |
| 55 | 55 | </if> |
| 56 | 56 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 57 | 57 | and a.finish_state = b.finish_state |
| 58 | - and a.finish_state = #{req.finishState} | |
| 58 | + <if test="req.finishState == 1"> | |
| 59 | + and a.finish_state = 1 | |
| 60 | + <![CDATA[and a.begin_time <= #{req.localDate} | |
| 61 | + and a.end_time >= #{req.localDate}]]> | |
| 62 | + </if> | |
| 63 | + <if test="req.finishState == 2"> | |
| 64 | + and a.finish_state = 2 | |
| 65 | + </if> | |
| 66 | + <if test="req.finishState == 3"> | |
| 67 | + and a.finish_state = 3 | |
| 68 | + </if> | |
| 69 | + <if test="req.finishState == 4"> | |
| 70 | + and a.finish_state = 4 | |
| 71 | + </if> | |
| 59 | 72 | </select> |
| 60 | 73 | |
| 61 | 74 | <select id="appMaintainPlanPlanTypePage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO"> |
| ... | ... | @@ -102,7 +115,20 @@ |
| 102 | 115 | </if> |
| 103 | 116 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 104 | 117 | and c.finish_state =a.finish_state |
| 105 | - and c.finish_state = #{req.finishState} | |
| 118 | + <if test="req.finishState == 1"> | |
| 119 | + and a.finish_state = 1 | |
| 120 | + <![CDATA[and c.begin_time <= #{req.localDateTime} | |
| 121 | + and c.end_time >= #{req.localDateTime}]]> | |
| 122 | + </if> | |
| 123 | + <if test="req.finishState == 2"> | |
| 124 | + and a.finish_state = 2 | |
| 125 | + </if> | |
| 126 | + <if test="req.finishState == 3"> | |
| 127 | + and a.finish_state = 3 | |
| 128 | + </if> | |
| 129 | + <if test="req.finishState == 4"> | |
| 130 | + and a.finish_state = 4 | |
| 131 | + </if> | |
| 106 | 132 | </select> |
| 107 | 133 | |
| 108 | 134 | </mapper> | ... | ... |