669cf0a6
王富生
养护假话提交
|
1
2
3
4
5
6
7
8
9
10
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zteits.urbanops.module.garden.dal.mysql.maintainplan.MaintainPlanMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
|
04ee424b
王富生
养护计划提交
|
11
12
13
|
<delete id="deleteByBatchNo">
delete from garden_maintain_plan where batch_no =#{batchNo}
</delete>
|
95d30924
王富生
app养护计划明细提交
|
14
15
16
17
18
19
20
21
22
|
<select id="appMaintainPlanRoadPage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPageRoadRespVO">
SELECT
a.batch_no,
a.road_id,
a.road_name,
a.level_id,
a.finish_state,
|
758c32c2
王富生
app养护计划明细提交
|
23
24
|
a.plan_num,
a.plan_finish_num,
|
95d30924
王富生
app养护计划明细提交
|
25
26
27
|
a.begin_time,
a.end_time
FROM
|
758c32c2
王富生
app养护计划明细提交
|
28
|
garden_maintain_plan a
|
49862a55
王彪总
refactor(garden):...
|
29
30
31
32
33
34
|
JOIN -- 建议用显式JOIN代替隐式连接,可读性更高
garden_maintain_plan_detail b ON
a.batch_no = b.batch_no
AND a.deleted = b.deleted
WHERE a.deleted = 0
<if test="req.roadName != null and req.roadName !=''">
|
95d30924
王富生
app养护计划明细提交
|
35
36
|
AND a.road_name LIKE CONCAT('%',#{req.roadName},'%')
</if>
|
758c32c2
王富生
app养护计划明细提交
|
37
38
39
40
|
<if test="req.batchNos != null and req.batchNos.size() > 0">
AND a.batch_no IN
<foreach collection="req.batchNos" item="batchNo" open="(" separator="," close=")">
#{batchNo}
|
95d30924
王富生
app养护计划明细提交
|
41
42
43
44
45
46
47
48
49
50
|
</foreach>
</if>
<if test="req.busiLineList != null and req.busiLineList.size() > 0">
AND a.busi_line IN
<foreach collection="req.busiLineList" item="busiLine" open="(" separator="," close=")">
#{busiLine}
</foreach>
</if>
<!--状态 1:未完成;2:已完成;3:已失效-->
<if test="req.finishState == 3">
|
49862a55
王彪总
refactor(garden):...
|
51
|
and b.finish_state = #{req.finishState}
|
95d30924
王富生
app养护计划明细提交
|
52
53
54
|
<![CDATA[and a.end_time < #{req.localDate}]]>
</if>
<if test="req.finishState == 2">
|
49862a55
王彪总
refactor(garden):...
|
55
|
and b.finish_state = #{req.finishState}
|
95d30924
王富生
app养护计划明细提交
|
56
57
|
</if>
<if test="req.finishState == 1">
|
49862a55
王彪总
refactor(garden):...
|
58
|
and b.finish_state = #{req.finishState}
|
95d30924
王富生
app养护计划明细提交
|
59
|
<![CDATA[and a.end_time >= #{req.localDate}]]>
|
49862a55
王彪总
refactor(garden):...
|
60
61
|
<![CDATA[and b.end_time >= #{req.localDate}]]>
<![CDATA[and b.begin_time <= #{req.localDate}]]>
|
95d30924
王富生
app养护计划明细提交
|
62
|
</if>
|
95d30924
王富生
app养护计划明细提交
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
</select>
<select id="appMaintainPlanPlanTypePage" resultType="com.zteits.urbanops.module.garden.controller.app.maintainplan.vo.AppMaintainPlanPagePlanTypeRespVO">
SELECT
c.batch_no,
c.plan_no,
a.plan_name,
a.plan_type_id,
a.rate,
a.cycle_id,
c.plan_num,
c.finish_percent,
c.finish_state,
c.begin_time,
c.end_time
FROM
garden_maintain_plan a,
|
95d30924
王富生
app养护计划明细提交
|
80
81
|
garden_maintain_plan_detail c
WHERE
|
758c32c2
王富生
app养护计划明细提交
|
82
|
a.batch_no = c.batch_no
|
9e5481a8
王富生
修复sq当前时间格式
|
83
|
AND a.deleted=c.deleted
|
95d30924
王富生
app养护计划明细提交
|
84
|
AND a.deleted=0
|
786ff9db
王富生
app养护计划明细提交
|
85
|
AND a.plan_type_id = #{req.planTypeId}
|
95d30924
王富生
app养护计划明细提交
|
86
87
88
|
<if test="req.planName != null and req.planName !=''">
AND a.plan_type_id LIKE CONCAT('%',#{req.planName},'%')
</if>
|
758c32c2
王富生
app养护计划明细提交
|
89
90
91
92
|
<if test="req.batchNos != null and req.batchNos.size() > 0">
AND a.batch_no IN
<foreach collection="req.batchNos" item="batchNo" open="(" separator="," close=")">
#{batchNo}
|
95d30924
王富生
app养护计划明细提交
|
93
94
95
96
97
98
99
100
101
102
|
</foreach>
</if>
<if test="req.busiLineList != null and req.busiLineList.size() > 0">
AND a.busi_line IN
<foreach collection="req.busiLineList" item="busiLine" open="(" separator="," close=")">
#{busiLine}
</foreach>
</if>
<!--状态 1:未完成;2:已完成;3:已失效-->
<if test="req.finishState == 3">
|
3fdad562
王彪总
feat(garden): 添加计...
|
103
|
and c.finish_state = #{req.finishState}
|
9e5481a8
王富生
修复sq当前时间格式
|
104
|
<![CDATA[and c.end_time < #{req.localDateTime}]]>
|
95d30924
王富生
app养护计划明细提交
|
105
106
107
108
109
110
|
</if>
<if test="req.finishState == 2">
and c.finish_state = #{req.finishState}
</if>
<if test="req.finishState == 1">
and c.finish_state = #{req.finishState}
|
9e5481a8
王富生
修复sq当前时间格式
|
111
|
<![CDATA[and c.end_time >= #{req.localDateTime}]]>
|
49862a55
王彪总
refactor(garden):...
|
112
113
|
<![CDATA[and c.begin_time <= #{req.localDateTime}]]>
|
95d30924
王富生
app养护计划明细提交
|
114
115
116
|
</if>
</select>
|
3fdad562
王彪总
feat(garden): 添加计...
|
117
|
</mapper>
|