Commit 9a7689764e32f9ec585dfdf72fa06fc6985c5354
1 parent
9c1c6b8f
优化
Showing
7 changed files
with
41 additions
and
38 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/inspectionplan/vo/AppInspectionPlanPageReqVO.java
| @@ -8,7 +8,7 @@ import jakarta.validation.constraints.Min; | @@ -8,7 +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.time.LocalDateTime; |
| 12 | import java.util.List; | 12 | import java.util.List; |
| 13 | import java.util.Set; | 13 | import java.util.Set; |
| 14 | 14 | ||
| @@ -40,6 +40,6 @@ public class AppInspectionPlanPageReqVO extends PageParam { | @@ -40,6 +40,6 @@ public class AppInspectionPlanPageReqVO extends PageParam { | ||
| 40 | 40 | ||
| 41 | @Schema(description = "系统时间") | 41 | @Schema(description = "系统时间") |
| 42 | @Hidden | 42 | @Hidden |
| 43 | - private LocalDate localDate; | 43 | + private LocalDateTime localDateTime; |
| 44 | 44 | ||
| 45 | } | 45 | } |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanPageRoadReqVO.java
| @@ -8,7 +8,7 @@ import jakarta.validation.constraints.Min; | @@ -8,7 +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.time.LocalDateTime; |
| 12 | import java.util.List; | 12 | import java.util.List; |
| 13 | import java.util.Set; | 13 | import java.util.Set; |
| 14 | 14 | ||
| @@ -44,7 +44,7 @@ public class AppMaintainPlanPageRoadReqVO extends PageParam { | @@ -44,7 +44,7 @@ public class AppMaintainPlanPageRoadReqVO extends PageParam { | ||
| 44 | 44 | ||
| 45 | @Schema(description = "当前时间") | 45 | @Schema(description = "当前时间") |
| 46 | @Hidden | 46 | @Hidden |
| 47 | - private LocalDate localDate; | 47 | + private LocalDateTime localDateTime; |
| 48 | 48 | ||
| 49 | 49 | ||
| 50 | 50 |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanServiceImpl.java
| @@ -370,7 +370,7 @@ public class InspectionPlanServiceImpl implements InspectionPlanService { | @@ -370,7 +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 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); |
| 374 | /*2.分页*/ | 374 | /*2.分页*/ |
| 375 | IPage<AppInspectionPlanRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); | 375 | IPage<AppInspectionPlanRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 376 | 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,7 +384,7 @@ public class MaintainPlanServiceImpl implements MaintainPlanService { | @@ -384,7 +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 | + pageReqVO.setLocalDateTime(LocalDateTime.now()); |
| 388 | /*2.分页*/ | 388 | /*2.分页*/ |
| 389 | IPage<AppMaintainPlanPageRoadRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); | 389 | IPage<AppMaintainPlanPageRoadRespVO> mpPage = MyBatisUtils.buildPage(pageReqVO); |
| 390 | IPage<AppMaintainPlanPageRoadRespVO> page = maintainPlanMapper.appMaintainPlanRoadPage(mpPage, pageReqVO); | 390 | IPage<AppMaintainPlanPageRoadRespVO> page = maintainPlanMapper.appMaintainPlanRoadPage(mpPage, pageReqVO); |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanDetailMapper.xml
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | <!--状态 1:未完成;2:已完成;3:已失效--> | 45 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 46 | <choose> | 46 | <choose> |
| 47 | <when test="req.finishState == 1"> | 47 | <when test="req.finishState == 1"> |
| 48 | - AND b.finish_state = 1 | 48 | + AND b.finish_state=1 |
| 49 | <![CDATA[AND b.begin_time <= #{req.localDateTime} | 49 | <![CDATA[AND b.begin_time <= #{req.localDateTime} |
| 50 | AND b.end_time >= #{req.localDateTime}]]> | 50 | AND b.end_time >= #{req.localDateTime}]]> |
| 51 | </when> | 51 | </when> |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml
| @@ -15,7 +15,8 @@ | @@ -15,7 +15,8 @@ | ||
| 15 | 15 | ||
| 16 | <select id="getInspectionPlanAppPage" resultType="com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanRespVO"> | 16 | <select id="getInspectionPlanAppPage" resultType="com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppInspectionPlanRespVO"> |
| 17 | SELECT | 17 | SELECT |
| 18 | - a.batch_no, | 18 | + b.batch_no, |
| 19 | + b.plan_no, | ||
| 19 | a.road_id, | 20 | a.road_id, |
| 20 | a.road_name, | 21 | a.road_name, |
| 21 | a.busi_line, | 22 | a.busi_line, |
| @@ -25,19 +26,19 @@ | @@ -25,19 +26,19 @@ | ||
| 25 | a.begin_time, | 26 | a.begin_time, |
| 26 | a.end_time | 27 | a.end_time |
| 27 | FROM | 28 | FROM |
| 28 | - garden_inspection_plan a | ||
| 29 | - INNER JOIN ( | ||
| 30 | - SELECT DISTINCT batch_no | ||
| 31 | - FROM garden_inspection_plan_role | ||
| 32 | - WHERE deleted = 0 | ||
| 33 | - AND dept_id = #{req.deptId} | ||
| 34 | - <if test="req.roleIds != null and req.roleIds.size() > 0"> | ||
| 35 | - AND role_id IN | ||
| 36 | - <foreach collection="req.roleIds" item="roleId" open="(" separator="," close=")"> | ||
| 37 | - #{roleId} | ||
| 38 | - </foreach> | ||
| 39 | - </if> | ||
| 40 | - ) c ON a.batch_no = c.batch_no | 29 | + garden_inspection_plan_detail b |
| 30 | + INNER JOIN garden_inspection_plan a ON a.batch_no = b.batch_no | ||
| 31 | + INNER JOIN (SELECT DISTINCT batch_no | ||
| 32 | + FROM garden_inspection_plan_role | ||
| 33 | + WHERE deleted = 0 | ||
| 34 | + AND dept_id = #{req.deptId} | ||
| 35 | + <if test="req.roleIds != null and req.roleIds.size() > 0"> | ||
| 36 | + AND role_id IN | ||
| 37 | + <foreach collection="req.roleIds" item="roleId" open="(" separator="," close=")"> | ||
| 38 | + #{roleId} | ||
| 39 | + </foreach> | ||
| 40 | + </if> | ||
| 41 | + ) c ON b.batch_no = c.batch_no | ||
| 41 | WHERE | 42 | WHERE |
| 42 | a.deleted = 0 | 43 | a.deleted = 0 |
| 43 | <if test="req.roadName != null and req.roadName !=''"> | 44 | <if test="req.roadName != null and req.roadName !=''"> |
| @@ -51,18 +52,18 @@ | @@ -51,18 +52,18 @@ | ||
| 51 | </if> | 52 | </if> |
| 52 | <!-- 状态过滤 --> | 53 | <!-- 状态过滤 --> |
| 53 | <if test="req.finishState == 1"> | 54 | <if test="req.finishState == 1"> |
| 54 | - AND a.finish_state = 1 | ||
| 55 | - <![CDATA[AND a.begin_time <= #{req.localDate} | ||
| 56 | - AND a.end_time >= #{req.localDate}]]> | 55 | + AND b.finish_state = 1 |
| 56 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | ||
| 57 | + AND b.end_time >= #{req.localDateTime}]]> | ||
| 57 | </if> | 58 | </if> |
| 58 | <if test="req.finishState == 2"> | 59 | <if test="req.finishState == 2"> |
| 59 | - AND a.finish_state = 2 | 60 | + AND b.finish_state = 2 |
| 60 | </if> | 61 | </if> |
| 61 | <if test="req.finishState == 3"> | 62 | <if test="req.finishState == 3"> |
| 62 | - AND a.finish_state = 3 | 63 | + AND b.finish_state = 3 |
| 63 | </if> | 64 | </if> |
| 64 | <if test="req.finishState == 4"> | 65 | <if test="req.finishState == 4"> |
| 65 | - AND a.finish_state = 4 | 66 | + AND b.finish_state = 4 |
| 66 | </if> | 67 | </if> |
| 67 | 68 | ||
| 68 | 69 |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml
| @@ -16,16 +16,18 @@ | @@ -16,16 +16,18 @@ | ||
| 16 | <select id="appMaintainPlanRoadPage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO"> | 16 | <select id="appMaintainPlanRoadPage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO"> |
| 17 | SELECT | 17 | SELECT |
| 18 | a.batch_no, | 18 | a.batch_no, |
| 19 | + b.plan_no, | ||
| 19 | a.road_id, | 20 | a.road_id, |
| 20 | a.road_name, | 21 | a.road_name, |
| 21 | a.level_id, | 22 | a.level_id, |
| 22 | a.finish_state, | 23 | a.finish_state, |
| 23 | a.plan_num, | 24 | a.plan_num, |
| 24 | a.plan_finish_num, | 25 | a.plan_finish_num, |
| 25 | - a.begin_time, | ||
| 26 | - a.end_time | 26 | + b.begin_time, |
| 27 | + b.end_time | ||
| 27 | FROM | 28 | FROM |
| 28 | - garden_maintain_plan a | 29 | + garden_inspection_plan_detail b |
| 30 | + INNER JOIN garden_maintain_plan a ON b.batch_no = a.batch_no and a.deleted = b.deleted | ||
| 29 | INNER JOIN ( | 31 | INNER JOIN ( |
| 30 | SELECT DISTINCT batch_no | 32 | SELECT DISTINCT batch_no |
| 31 | FROM garden_maintain_plan_role | 33 | FROM garden_maintain_plan_role |
| @@ -37,7 +39,7 @@ | @@ -37,7 +39,7 @@ | ||
| 37 | #{roleId} | 39 | #{roleId} |
| 38 | </foreach> | 40 | </foreach> |
| 39 | </if> | 41 | </if> |
| 40 | - ) c ON a.batch_no = c.batch_no | 42 | + ) c ON b.batch_no = c.batch_no |
| 41 | WHERE | 43 | WHERE |
| 42 | a.deleted = 0 | 44 | a.deleted = 0 |
| 43 | <if test="req.roadName != null and req.roadName != ''"> | 45 | <if test="req.roadName != null and req.roadName != ''"> |
| @@ -52,21 +54,21 @@ | @@ -52,21 +54,21 @@ | ||
| 52 | <!-- 状态过滤 --> | 54 | <!-- 状态过滤 --> |
| 53 | <choose> | 55 | <choose> |
| 54 | <when test="req.finishState == 1"> | 56 | <when test="req.finishState == 1"> |
| 55 | - AND a.finish_state = 1 | ||
| 56 | - <![CDATA[AND a.begin_time <= #{req.localDate} | ||
| 57 | - AND a.end_time >= #{req.localDate}]]> | 57 | + AND b.finish_state = 1 |
| 58 | + <![CDATA[AND b.begin_time <= #{req.localDateTime} | ||
| 59 | + AND b.end_time >= #{req.localDateTime}]]> | ||
| 58 | </when> | 60 | </when> |
| 59 | <when test="req.finishState == 2"> | 61 | <when test="req.finishState == 2"> |
| 60 | - AND a.finish_state = 2 | 62 | + AND b.finish_state = 2 |
| 61 | </when> | 63 | </when> |
| 62 | <when test="req.finishState == 3"> | 64 | <when test="req.finishState == 3"> |
| 63 | - AND a.finish_state = 3 | 65 | + AND b.finish_state = 3 |
| 64 | </when> | 66 | </when> |
| 65 | <when test="req.finishState == 4"> | 67 | <when test="req.finishState == 4"> |
| 66 | - AND a.finish_state = 4 | 68 | + AND b.finish_state = 4 |
| 67 | </when> | 69 | </when> |
| 68 | </choose> | 70 | </choose> |
| 69 | - ORDER BY a.id desc | 71 | + ORDER BY b.id desc |
| 70 | </select> | 72 | </select> |
| 71 | 73 | ||
| 72 | <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"> |