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 | 1 | package com.zteits.urbanops.module.garden.controller.app.maintainplan.vo; |
| 2 | 2 | |
| 3 | 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 | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | 7 | import lombok.Data; |
| 6 | 8 | |
| ... | ... | @@ -42,6 +44,7 @@ public class AppMaintainPlanCommitDetailPageRespVO { |
| 42 | 44 | private String imgHost; |
| 43 | 45 | |
| 44 | 46 | @Schema(description = "开始照片") |
| 47 | + @TableField(typeHandler = StringListTypeHandler.class) | |
| 45 | 48 | private List<String> beginImgList; |
| 46 | 49 | |
| 47 | 50 | /** | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanCommitMapper.xml
| ... | ... | @@ -13,6 +13,8 @@ |
| 13 | 13 | <result property="beginImgList" column="begin_img" typeHandler="com.zteits.urbanops.framework.mybatis.core.type.StringArrayToListTypeHandler"/> |
| 14 | 14 | </resultMap> |
| 15 | 15 | |
| 16 | + | |
| 17 | + | |
| 16 | 18 | <select id="selectForPage" resultType="com.zteits.urbanops.module.garden.controller.admin.maintainplan.vo.MaintainPlanCommitRespVO"> |
| 17 | 19 | SELECT |
| 18 | 20 | a.batch_no, |
| ... | ... | @@ -35,15 +37,9 @@ |
| 35 | 37 | c.user_name |
| 36 | 38 | FROM |
| 37 | 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 | 43 | <if test="req.planNo != null and req.planNo !=''"> |
| 48 | 44 | and a.plan_no LIKE CONCAT('%', #{req.planNo},'%') |
| 49 | 45 | </if> |
| ... | ... | @@ -74,9 +70,6 @@ |
| 74 | 70 | <if test="req.deptId != null"> |
| 75 | 71 | and a.dept_id = #{req.deptId} |
| 76 | 72 | </if> |
| 77 | -<!-- <if test="req.roleName != null and req.roleName !=''">--> | |
| 78 | -<!-- AND c.role_name LIKE CONCAT(#{req.roleName},'%')--> | |
| 79 | -<!-- </if>--> | |
| 80 | 73 | <if test="req.userName != null and req.userName !=''"> |
| 81 | 74 | AND c.user_name LIKE CONCAT('%', #{req.userName},'%') |
| 82 | 75 | </if> |
| ... | ... | @@ -92,7 +85,7 @@ |
| 92 | 85 | order by c.id desc |
| 93 | 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 | 89 | SELECT |
| 97 | 90 | a.batch_no, |
| 98 | 91 | a.plan_no, |
| ... | ... | @@ -118,13 +111,9 @@ |
| 118 | 111 | c.user_name, |
| 119 | 112 | c.remark |
| 120 | 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 | 118 | </select> |
| 130 | 119 | </mapper> | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanDetailMapper.xml
| ... | ... | @@ -65,26 +65,25 @@ |
| 65 | 65 | |
| 66 | 66 | <select id="getMaintainNotFinishPlanCommitDetail" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainNotFinishPlanDetailRespVO"> |
| 67 | 67 | SELECT |
| 68 | - c.batch_no, | |
| 69 | - c.plan_no, | |
| 68 | + a.batch_no, | |
| 69 | + b.plan_no, | |
| 70 | 70 | a.plan_name, |
| 71 | 71 | a.plan_type_id, |
| 72 | 72 | a.rate, |
| 73 | 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 | 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 | 85 | AND a.plan_type_id = #{req.planTypeId} |
| 87 | 86 | <!--状态 1:未完成;2:已完成;3:已失效--> |
| 88 | - and c.finish_state = #{req.finishState} | |
| 87 | + and b.finish_state = #{req.finishState} | |
| 89 | 88 | </select> |
| 90 | 89 | </mapper> | ... | ... |
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml