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,6 +8,7 @@ import jakarta.validation.constraints.Min; | ||
| 8 | import jakarta.validation.constraints.NotNull; | 8 | import jakarta.validation.constraints.NotNull; |
| 9 | import lombok.Data; | 9 | import lombok.Data; |
| 10 | 10 | ||
| 11 | +import java.time.LocalDate; | ||
| 11 | import java.util.List; | 12 | import java.util.List; |
| 12 | import java.util.Set; | 13 | import java.util.Set; |
| 13 | 14 | ||
| @@ -37,4 +38,8 @@ public class AppInspectionPlanPageReqVO extends PageParam { | @@ -37,4 +38,8 @@ public class AppInspectionPlanPageReqVO extends PageParam { | ||
| 37 | @Hidden | 38 | @Hidden |
| 38 | private Long deptId; | 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
| @@ -46,5 +46,9 @@ public class AppMaintainPlanPagePlanTypeReqVO extends PageParam { | @@ -46,5 +46,9 @@ public class AppMaintainPlanPagePlanTypeReqVO extends PageParam { | ||
| 46 | @Hidden | 46 | @Hidden |
| 47 | private Long deptId; | 47 | private Long deptId; |
| 48 | 48 | ||
| 49 | + @Schema(description = "开始时间") | ||
| 50 | + @Hidden | ||
| 51 | + private LocalDateTime localDateTime; | ||
| 52 | + | ||
| 49 | 53 | ||
| 50 | } | 54 | } |
| 51 | \ No newline at end of file | 55 | \ No newline at end of file |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPageRoadReqVO.java
| @@ -42,6 +42,10 @@ public class AppMaintainPlanPageRoadReqVO extends PageParam { | @@ -42,6 +42,10 @@ public class AppMaintainPlanPageRoadReqVO extends PageParam { | ||
| 42 | @Hidden | 42 | @Hidden |
| 43 | private Long deptId; | 43 | private Long deptId; |
| 44 | 44 | ||
| 45 | + @Schema(description = "当前时间") | ||
| 46 | + @Hidden | ||
| 47 | + private LocalDate localDate; | ||
| 48 | + | ||
| 45 | 49 | ||
| 46 | 50 | ||
| 47 | } | 51 | } |
| 48 | \ No newline at end of file | 52 | \ No newline at end of file |
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,6 +370,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | ||
| 370 | } | 370 | } |
| 371 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | 371 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 372 | pageReqVO.setRoleIds(new HashSet<>(roleIds)); | 372 | pageReqVO.setRoleIds(new HashSet<>(roleIds)); |
| 373 | + pageReqVO.setLocalDate(LocalDate.now()); | ||
| 373 | /*2.分页*/ | 374 | /*2.分页*/ |
| 374 | IPage<AppInspectionPlanRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); | 375 | IPage<AppInspectionPlanRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 375 | IPage<AppInspectionPlanRespVO> page = inspectionPlanMapper.getInspectionPlanAppPage(mpPage, pageReqVO); | 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,6 +384,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | ||
| 384 | } | 384 | } |
| 385 | pageReqVO.setRoleIds(new HashSet<>(roleIds)); | 385 | pageReqVO.setRoleIds(new HashSet<>(roleIds)); |
| 386 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | 386 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 387 | + pageReqVO.setLocalDate(LocalDate.now()); | ||
| 387 | /*2.分页*/ | 388 | /*2.分页*/ |
| 388 | IPage<AppMaintainPlanPageRoadRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); | 389 | IPage<AppMaintainPlanPageRoadRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 389 | IPage<AppMaintainPlanPageRoadRespVO> page = maintainPlanMapper.appMaintainPlanRoadPage(mpPage, pageReqVO); | 390 | IPage<AppMaintainPlanPageRoadRespVO> page = maintainPlanMapper.appMaintainPlanRoadPage(mpPage, pageReqVO); |
| @@ -404,6 +405,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | @@ -404,6 +405,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | ||
| 404 | } | 405 | } |
| 405 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); | 406 | pageReqVO.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 406 | pageReqVO.setRoleIds(new HashSet<>(roleIds)); | 407 | pageReqVO.setRoleIds(new HashSet<>(roleIds)); |
| 408 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); | ||
| 407 | /*2.分页*/ | 409 | /*2.分页*/ |
| 408 | IPage<AppMaintainPlanPagePlanTypeRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); | 410 | IPage<AppMaintainPlanPagePlanTypeRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 409 | IPage<AppMaintainPlanPagePlanTypeRespVO> page = maintainPlanMapper.appMaintainPlanPlanTypePage(mpPage, pageReqVO); | 411 | IPage<AppMaintainPlanPagePlanTypeRespVO> page = maintainPlanMapper.appMaintainPlanPlanTypePage(mpPage, pageReqVO); |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml
| @@ -53,7 +53,22 @@ | @@ -53,7 +53,22 @@ | ||
| 53 | </if> | 53 | </if> |
| 54 | <!--状态 1:未完成;2:已完成;3:已失效 4:终止--> | 54 | <!--状态 1:未完成;2:已完成;3:已失效 4:终止--> |
| 55 | and b.finish_state = a.finish_state | 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 | </select> | 73 | </select> |
| 59 | </mapper> | 74 | </mapper> |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml
| @@ -55,7 +55,20 @@ | @@ -55,7 +55,20 @@ | ||
| 55 | </if> | 55 | </if> |
| 56 | <!--状态 1:未完成;2:已完成;3:已失效--> | 56 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 57 | and a.finish_state = b.finish_state | 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 | </select> | 72 | </select> |
| 60 | 73 | ||
| 61 | <select id="appMaintainPlanPlanTypePage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO"> | 74 | <select id="appMaintainPlanPlanTypePage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO"> |
| @@ -102,7 +115,20 @@ | @@ -102,7 +115,20 @@ | ||
| 102 | </if> | 115 | </if> |
| 103 | <!--状态 1:未完成;2:已完成;3:已失效--> | 116 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 104 | and c.finish_state =a.finish_state | 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 | </select> | 132 | </select> |
| 107 | 133 | ||
| 108 | </mapper> | 134 | </mapper> |