DepotMapper.xml
8.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<?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.ruoyi.service.mapper.DepotMapper">
<select id="selectGeneralAll" resultType="com.ruoyi.service.domain.General">
select * from general
</select>
<select id="selectDepot" parameterType="com.ruoyi.service.domain.Depot" resultType="com.ruoyi.service.domain.Depot">
select * from depot
<where>
<if test="id != null and id != ''">
AND id =#{id}
</if>
<if test="parentId != null and parentId != ''">
AND parentId =#{parentId}
</if>
</where>
</select>
<select id="selectRegion" parameterType="com.ruoyi.service.domain.Region" resultType="com.ruoyi.service.domain.Region">
select * from depot_region
<where>
<if test="id != null and id != ''">
AND id =#{id}
</if>
<if test="parentId != null and parentId != ''">
AND parentId =#{parentId}
</if>
</where>
</select>
<select id="selectColumn" resultType="com.ruoyi.service.domain.Column" parameterType="com.ruoyi.service.domain.Column">
select a.*,b.regionName from depot_column a,depot_region b
where a.parentId=b.id
<if test="id != null and id != ''">
AND a.id =#{id}
</if>
<if test="parentId != null and parentId != ''">
AND a.parentId =#{parentId}
</if>
</select>
<select id="selectNode" resultType="com.ruoyi.service.domain.Node" parameterType="com.ruoyi.service.domain.Node">
select * from depot_node
<where>
<if test="id != null and id != ''">
AND id =#{id}
</if>
<if test="parentId != null and parentId != ''">
AND parentId =#{parentId}
</if>
<if test="surface != null and surface != ''">
AND surface =#{surface}
</if>
<if test="nodeNo != null and nodeNo != ''">
AND nodeNo =#{nodeNo}
</if>
<if test="layerNo != null and layerNo != ''">
AND layerNo =#{layerNo}
</if>
</where>
</select>
<select id="checkDepotNameUnique" parameterType="com.ruoyi.service.domain.Depot" resultType="int">
select count(1) from depot where depotName = #{depotName}
<if test="id != null and id != ''"> and id != #{id}</if>
limit 1
</select>
<select id="checkDepotNoUnique" parameterType="com.ruoyi.service.domain.Depot" resultType="int">
select count(1) from depot where depotNo = #{depotNo}
<if test="id != null and id != ''"> and id != #{id}</if>
limit 1
</select>
<insert id="insertDepot" parameterType="com.ruoyi.service.domain.Depot">
insert into depot(
<if test="parentId != null and parentId != ''">parentId,</if>
<if test="depotNo != null and depotNo != ''">depotNo,</if>
<if test="depotName != null and depotName != ''">depotName,</if>
<if test="mark != null and mark != ''">mark,</if>
createTime
)values(
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="depotNo != null and depotNo != ''">#{depotNo},</if>
<if test="depotName != null and depotName != ''">#{depotName},</if>
<if test="mark != null and mark != ''">#{mark},</if>
sysdate()
)
</insert>
<insert id="insertRegion" parameterType="com.ruoyi.service.domain.Region">
insert into depot_region(
<if test="parentId != null and parentId != ''">parentId,</if>
<if test="regionNo != null and regionNo != ''">regionNo,</if>
<if test="regionName != null and regionName != ''">regionName,</if>
<if test="columnSize != null and columnSize != ''">columnSize,</if>
<if test="mark != null and mark != ''">mark,</if>
createTime
)values(
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="regionNo != null and regionNo != ''">#{regionNo},</if>
<if test="regionName != null and regionName != ''">#{regionName},</if>
<if test="columnSize != null and columnSize != ''">#{columnSize},</if>
<if test="mark != null and mark != ''">#{mark},</if>
sysdate()
)
</insert>
<insert id="insertColumn" parameterType="com.ruoyi.service.domain.Column">
insert into depot_column(
<if test="parentId != null and parentId != ''">parentId,</if>
<if test="type != null and type != ''">type,</if>
<if test="surfaceType != null and surfaceType != ''">surfaceType,</if>
<if test="columnNo != null and columnNo != ''">columnNo,</if>
<if test="columnName != null and columnName != ''">columnName,</if>
<if test="columnType != null and columnType != ''">columnType,</if>
<if test="nodeSize != null and nodeSize != ''">nodeSize,</if>
<if test="nodeLength != null and nodeLength != ''">nodeLength,</if>
<if test="layerSize != null and layerSize != ''">layerSize,</if>
<if test="layerHeight != null and layerHeight != ''">layerHeight,</if>
<if test="mark != null and mark != ''">mark,</if>
createTime
)values(
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="surfaceType != null and surfaceType != ''">#{surfaceType},</if>
<if test="columnNo != null and columnNo != ''">#{columnNo},</if>
<if test="columnName != null and columnName != ''">#{columnName},</if>
<if test="columnType != null and columnType != ''">#{columnType},</if>
<if test="nodeSize != null and nodeSize != ''">#{nodeSize},</if>
<if test="nodeLength != null and nodeLength != ''">#{nodeLength},</if>
<if test="layerSize != null and layerSize != ''">#{layerSize},</if>
<if test="layerHeight != null and layerHeight != ''">#{layerHeight},</if>
<if test="mark != null and mark != ''">#{mark},</if>
sysdate()
)
</insert>
<insert id="insertNode" parameterType="com.ruoyi.service.domain.Node">
insert into depot_node(
<if test="parentId != null and parentId != ''">parentId,</if>
<if test="surface != null and surface != ''">surface,</if>
<if test="nodeNo != null and nodeNo != ''">nodeNo,</if>
<if test="layerNo != null and layerNo != ''">layerNo,</if>
<if test="layerCode != null and layerCode != ''">layerCode,</if>
<if test="depotCode != null and depotCode != ''">depotCode,</if>
<if test="mark != null and mark != ''">mark,</if>
createTime
)values(
<if test="parentId != null and parentId != ''">#{parentId},</if>
<if test="surface != null and surface != ''">#{surface},</if>
<if test="nodeNo != null and nodeNo != ''">#{nodeNo},</if>
<if test="layerNo != null and layerNo != ''">#{layerNo},</if>
<if test="layerCode != null and layerCode != ''">#{layerCode},</if>
<if test="depotCode != null and depotCode != ''">#{depotCode},</if>
<if test="mark != null and mark != ''">#{mark},</if>
sysdate()
)
</insert>
<update id="updateDepot" parameterType="com.ruoyi.service.domain.Depot">
update depot
<set>
<if test="depotName != null and depotName != ''">depotName = #{depotName},</if>
<if test="mark != null">mark = #{mark},</if>
updateTime = sysdate()
</set>
where id = #{id}
</update>
<update id="updateRegion" parameterType="com.ruoyi.service.domain.Region">
update depot_region
<set>
<if test="columnSize != null and columnSize != ''">columnSize = #{columnSize},</if>
<if test="mark != null">mark = #{mark},</if>
updateTime = sysdate()
</set>
where id = #{id}
</update>
<update id="updateColumn" parameterType="com.ruoyi.service.domain.Column">
update depot_column
<set>
<if test="type != null and type != ''">type = #{type},</if>
<if test="surfaceType != null and surfaceType != ''">surfaceType = #{surfaceType},</if>
<if test="columnName != null and columnName != ''">columnName = #{columnName},</if>
<if test="columnType != null and columnType != ''">columnType = #{columnType},</if>
<if test="nodeSize != null and nodeSize != ''">nodeSize = #{nodeSize},</if>
<if test="nodeLength != null and nodeLength != ''">nodeLength = #{nodeLength},</if>
<if test="layerSize != null and layerSize != ''">layerSize = #{layerSize},</if>
<if test="layerHeight != null and layerHeight != ''">layerHeight = #{layerHeight},</if>
<if test="mark != null">mark = #{mark},</if>
updateTime = sysdate()
</set>
where id = #{id}
</update>
<select id="getDepot" resultType="com.ruoyi.service.domain.Depot" parameterType="com.ruoyi.service.domain.Depot">
select * from depot
<where>
<if test="id != null and id != ''">
AND id = #{id}
</if>
</where>
</select>
<delete id="delDepot" parameterType="Long">
delete from depot where id id in
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="delRegion" parameterType="Long">
delete from depot_region where id in
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="delColumn" parameterType="Long">
delete from depot_column where id in
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="delNode" parameterType="Long">
delete from depot_node where id in
<foreach collection="array" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>