Commit 7590852d4997bd6aa71c6c6615b37187c0265e9e
1 parent
73dd9606
优化
Showing
4 changed files
with
26 additions
and
37 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/app/maintainplan/vo/AppMaintainPlanCommitDetailPageRespVO.java
| 1 | package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; | 1 | package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; |
| 2 | 2 | ||
| 3 | import cn.idev.excel.annotation.ExcelProperty; | 3 | import cn.idev.excel.annotation.ExcelProperty; |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 5 | +import com.zteits.urbanops.framework.mybatis.core.type.StringListTypeHandler; | ||
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | import lombok.Data; | 7 | import lombok.Data; |
| 6 | 8 | ||
| @@ -42,6 +44,7 @@ public class AppMaintainPlanCommitDetailPageRespVO { | @@ -42,6 +44,7 @@ public class AppMaintainPlanCommitDetailPageRespVO { | ||
| 42 | private String imgHost; | 44 | private String imgHost; |
| 43 | 45 | ||
| 44 | @Schema(description = "开始照片") | 46 | @Schema(description = "开始照片") |
| 47 | + @TableField(typeHandler = StringListTypeHandler.class) | ||
| 45 | private List<String> beginImgList; | 48 | private List<String> beginImgList; |
| 46 | 49 | ||
| 47 | /** | 50 | /** |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanCommitMapper.xml
| @@ -13,6 +13,8 @@ | @@ -13,6 +13,8 @@ | ||
| 13 | <result property="beginImgList" column="begin_img" typeHandler="com.zteits.urbanops.framework.mybatis.core.type.StringArrayToListTypeHandler"/> | 13 | <result property="beginImgList" column="begin_img" typeHandler="com.zteits.urbanops.framework.mybatis.core.type.StringArrayToListTypeHandler"/> |
| 14 | </resultMap> | 14 | </resultMap> |
| 15 | 15 | ||
| 16 | + | ||
| 17 | + | ||
| 16 | <select id="selectForPage" resultType="com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanCommitRespVO"> | 18 | <select id="selectForPage" resultType="com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanCommitRespVO"> |
| 17 | SELECT | 19 | SELECT |
| 18 | a.batch_no, | 20 | a.batch_no, |
| @@ -35,15 +37,9 @@ | @@ -35,15 +37,9 @@ | ||
| 35 | c.user_name | 37 | c.user_name |
| 36 | FROM | 38 | FROM |
| 37 | garden_maintain_plan_detail a, | 39 | garden_maintain_plan_detail a, |
| 38 | - garden_maintain_plan b, | ||
| 39 | - garden_maintain_plan_commit c | ||
| 40 | - WHERE | ||
| 41 | - a.batch_no = b.batch_no | ||
| 42 | - AND a.plan_no = c.plan_no | ||
| 43 | - AND b.batch_no = c.batch_no | ||
| 44 | - AND a.deleted = c.deleted | ||
| 45 | - AND a.deleted = b.deleted | ||
| 46 | - AND a.deleted = 0 | 40 | + INNER JOIN garden_maintain_plan b ON a.batch_no = b.batch_no |
| 41 | + INNER JOIN garden_maintain_plan_commit c ON a.batch_no = c.batch_no AND a.plan_no = c.plan_no | ||
| 42 | + WHERE a.deleted = 0 | ||
| 47 | <if test="req.planNo != null and req.planNo !=''"> | 43 | <if test="req.planNo != null and req.planNo !=''"> |
| 48 | and a.plan_no LIKE CONCAT('%', #{req.planNo},'%') | 44 | and a.plan_no LIKE CONCAT('%', #{req.planNo},'%') |
| 49 | </if> | 45 | </if> |
| @@ -74,9 +70,6 @@ | @@ -74,9 +70,6 @@ | ||
| 74 | <if test="req.deptId != null"> | 70 | <if test="req.deptId != null"> |
| 75 | and a.dept_id = #{req.deptId} | 71 | and a.dept_id = #{req.deptId} |
| 76 | </if> | 72 | </if> |
| 77 | -<!-- <if test="req.roleName != null and req.roleName !=''">--> | ||
| 78 | -<!-- AND c.role_name LIKE CONCAT(#{req.roleName},'%')--> | ||
| 79 | -<!-- </if>--> | ||
| 80 | <if test="req.userName != null and req.userName !=''"> | 73 | <if test="req.userName != null and req.userName !=''"> |
| 81 | AND c.user_name LIKE CONCAT('%', #{req.userName},'%') | 74 | AND c.user_name LIKE CONCAT('%', #{req.userName},'%') |
| 82 | </if> | 75 | </if> |
| @@ -92,7 +85,7 @@ | @@ -92,7 +85,7 @@ | ||
| 92 | order by c.id desc | 85 | order by c.id desc |
| 93 | </select> | 86 | </select> |
| 94 | 87 | ||
| 95 | - <select id="appMaintainPlanCommitDetailPage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanCommitDetailPageRespVO"> | 88 | + <select id="appMaintainPlanCommitDetailPage" resultMap="BaseResultMap"> |
| 96 | SELECT | 89 | SELECT |
| 97 | a.batch_no, | 90 | a.batch_no, |
| 98 | a.plan_no, | 91 | a.plan_no, |
| @@ -118,13 +111,9 @@ | @@ -118,13 +111,9 @@ | ||
| 118 | c.user_name, | 111 | c.user_name, |
| 119 | c.remark | 112 | c.remark |
| 120 | FROM | 113 | FROM |
| 121 | - garden_maintain_plan_detail a, | ||
| 122 | - garden_maintain_plan b, | ||
| 123 | - garden_maintain_plan_commit c | ||
| 124 | - WHERE | ||
| 125 | - a.batch_no = b.batch_no | ||
| 126 | - AND a.batch_no = c.batch_no | ||
| 127 | - AND a.plan_no = c.plan_no | ||
| 128 | - AND c.plan_no = #{req.planNo} | 114 | + garden_maintain_plan_detail a |
| 115 | + INNER JOIN garden_maintain_plan b ON a.batch_no = b.batch_no | ||
| 116 | + INNER JOIN garden_maintain_plan_commit c ON a.batch_no = c.batch_no AND a.plan_no = c.plan_no | ||
| 117 | + WHERE a.plan_no = #{req.planNo} | ||
| 129 | </select> | 118 | </select> |
| 130 | </mapper> | 119 | </mapper> |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanDetailMapper.xml
| @@ -65,26 +65,25 @@ | @@ -65,26 +65,25 @@ | ||
| 65 | 65 | ||
| 66 | <select id="getMaintainNotFinishPlanCommitDetail" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainNotFinishPlanDetailRespVO"> | 66 | <select id="getMaintainNotFinishPlanCommitDetail" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainNotFinishPlanDetailRespVO"> |
| 67 | SELECT | 67 | SELECT |
| 68 | - c.batch_no, | ||
| 69 | - c.plan_no, | 68 | + a.batch_no, |
| 69 | + b.plan_no, | ||
| 70 | a.plan_name, | 70 | a.plan_name, |
| 71 | a.plan_type_id, | 71 | a.plan_type_id, |
| 72 | a.rate, | 72 | a.rate, |
| 73 | a.cycle_id, | 73 | a.cycle_id, |
| 74 | - c.plan_num, | ||
| 75 | - c.plan_finish_num, | ||
| 76 | - c.finish_state, | ||
| 77 | - c.begin_time, | ||
| 78 | - c.end_time, | ||
| 79 | - c.sort_num | 74 | + b.plan_num, |
| 75 | + b.plan_finish_num, | ||
| 76 | + b.finish_state, | ||
| 77 | + b.begin_time, | ||
| 78 | + b.end_time, | ||
| 79 | + b.sort_num | ||
| 80 | FROM | 80 | FROM |
| 81 | - garden_maintain_plan a, | ||
| 82 | - garden_maintain_plan_detail c | ||
| 83 | - WHERE a.batch_no=c.batch_no | ||
| 84 | - AND a.deleted=0 | ||
| 85 | - AND c.plan_no = #{req.planNo} | 81 | + garden_maintain_plan a |
| 82 | + INNER JOIN garden_maintain_plan_detail b ON a.batch_no=b.batch_no | ||
| 83 | + WHERE a.deleted=0 | ||
| 84 | + AND b.plan_no = #{req.planNo} | ||
| 86 | AND a.plan_type_id = #{req.planTypeId} | 85 | AND a.plan_type_id = #{req.planTypeId} |
| 87 | <!--状态 1:未完成;2:已完成;3:已失效--> | 86 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 88 | - and c.finish_state = #{req.finishState} | 87 | + and b.finish_state = #{req.finishState} |
| 89 | </select> | 88 | </select> |
| 90 | </mapper> | 89 | </mapper> |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml
| @@ -95,8 +95,6 @@ | @@ -95,8 +95,6 @@ | ||
| 95 | </foreach> | 95 | </foreach> |
| 96 | </if> | 96 | </if> |
| 97 | ) d ON c.batch_no = d.batch_no and c.dept_id = d.dept_id | 97 | ) d ON c.batch_no = d.batch_no and c.dept_id = d.dept_id |
| 98 | - | ||
| 99 | - AND a.deleted=c.deleted | ||
| 100 | AND a.deleted=0 | 98 | AND a.deleted=0 |
| 101 | AND a.plan_type_id = #{req.planTypeId} | 99 | AND a.plan_type_id = #{req.planTypeId} |
| 102 | <if test="req.planName != null and req.planName !=''"> | 100 | <if test="req.planName != null and req.planName !=''"> |