|
|
@@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
7
|
7
|
<resultMap type="TaskCheckItem" id="TaskCheckItemResult">
|
|
8
|
8
|
<result property="id" column="id" />
|
|
9
|
9
|
<result property="checkId" column="check_id" />
|
|
10
|
|
- <result property="subitemId" column="subitem_id" />
|
|
|
10
|
+ <result property="subItemId" column="sub_item_id" />
|
|
11
|
11
|
<result property="itemName" column="item_name" />
|
|
12
|
12
|
<result property="isRandom" column="is_random" />
|
|
13
|
13
|
<result property="tag" column="tag" />
|
|
|
@@ -28,17 +28,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
28
|
28
|
<result property="photo" column="photo" />
|
|
29
|
29
|
<result property="score" column="score" />
|
|
30
|
30
|
<result property="limitScore" column="limit_score" />
|
|
|
31
|
+ <result property="inputItem" column="input_item" />
|
|
|
32
|
+ <result property="result" column="result" />
|
|
31
|
33
|
</resultMap>
|
|
32
|
34
|
|
|
33
|
35
|
<sql id="selectTaskCheckItemVo">
|
|
34
|
|
- select id, check_id, subitem_id, item_name, is_random, tag, has_input, input_content, has_photo, photo_prompt, check_result, example_image, check_description, sort_order, status, create_by, update_by, update_time, create_time, del_flag, photo, score, limit_score from task_check_item
|
|
|
36
|
+ select id, check_id, sub_item_id, item_name, is_random, tag, has_input, input_content,
|
|
|
37
|
+ has_photo, photo_prompt, check_result, example_image, check_description, sort_order,
|
|
|
38
|
+ status, create_by, update_by, update_time, create_time, del_flag, photo, score,
|
|
|
39
|
+ limit_score, input_item, result from task_check_item
|
|
35
|
40
|
</sql>
|
|
36
|
41
|
|
|
37
|
42
|
<select id="selectTaskCheckItemList" parameterType="TaskCheckItem" resultMap="TaskCheckItemResult">
|
|
38
|
43
|
<include refid="selectTaskCheckItemVo"/>
|
|
39
|
44
|
<where>
|
|
40
|
45
|
<if test="checkId != null "> and check_id = #{checkId}</if>
|
|
41
|
|
- <if test="subitemId != null "> and subitem_id = #{subitemId}</if>
|
|
|
46
|
+ <if test="subItemId != null "> and sub_item_id = #{subItemId}</if>
|
|
42
|
47
|
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
|
|
43
|
48
|
<if test="isRandom != null "> and is_random = #{isRandom}</if>
|
|
44
|
49
|
<if test="tag != null and tag != ''"> and tag = #{tag}</if>
|
|
|
@@ -54,6 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
54
|
59
|
<if test="delFlag != null "> and del_flag = #{delFlag}</if>
|
|
55
|
60
|
<if test="score != null "> and score = #{score}</if>
|
|
56
|
61
|
<if test="limitScore != null "> and limit_score = #{limitScore}</if>
|
|
|
62
|
+ <if test="inputItem != null and inputItem != ''"> and input_item = #{inputItem}</if>
|
|
|
63
|
+ <if test="result != null "> and result = #{result}</if>
|
|
57
|
64
|
<!-- 如果有station_id字段,则增加站点集合查询条件 -->
|
|
58
|
65
|
</where>
|
|
59
|
66
|
</select>
|
|
|
@@ -67,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
67
|
74
|
insert into task_check_item
|
|
68
|
75
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
69
|
76
|
<if test="checkId != null">check_id,</if>
|
|
70
|
|
- <if test="subitemId != null">subitem_id,</if>
|
|
|
77
|
+ <if test="subItemId != null">sub_item_id,</if>
|
|
71
|
78
|
<if test="itemName != null and itemName != ''">item_name,</if>
|
|
72
|
79
|
<if test="isRandom != null">is_random,</if>
|
|
73
|
80
|
<if test="tag != null">tag,</if>
|
|
|
@@ -88,10 +95,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
88
|
95
|
<if test="photo != null">photo,</if>
|
|
89
|
96
|
<if test="score != null">score,</if>
|
|
90
|
97
|
<if test="limitScore != null">limit_score,</if>
|
|
|
98
|
+ <if test="inputItem != null and inputItem != ''">input_item,</if>
|
|
|
99
|
+ <if test="result != null">result,</if>
|
|
91
|
100
|
</trim>
|
|
92
|
101
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
93
|
102
|
<if test="checkId != null">#{checkId},</if>
|
|
94
|
|
- <if test="subitemId != null">#{subitemId},</if>
|
|
|
103
|
+ <if test="subItemId != null">#{subItemId},</if>
|
|
95
|
104
|
<if test="itemName != null and itemName != ''">#{itemName},</if>
|
|
96
|
105
|
<if test="isRandom != null">#{isRandom},</if>
|
|
97
|
106
|
<if test="tag != null">#{tag},</if>
|
|
|
@@ -112,6 +121,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
112
|
121
|
<if test="photo != null">#{photo},</if>
|
|
113
|
122
|
<if test="score != null">#{score},</if>
|
|
114
|
123
|
<if test="limitScore != null">#{limitScore},</if>
|
|
|
124
|
+ <if test="inputItem != null and inputItem != ''">#{inputItem},</if>
|
|
|
125
|
+ <if test="result != null">#{result},</if>
|
|
115
|
126
|
</trim>
|
|
116
|
127
|
</insert>
|
|
117
|
128
|
|
|
|
@@ -119,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
119
|
130
|
update task_check_item
|
|
120
|
131
|
<trim prefix="SET" suffixOverrides=",">
|
|
121
|
132
|
<if test="checkId != null">check_id = #{checkId},</if>
|
|
122
|
|
- <if test="subitemId != null">subitem_id = #{subitemId},</if>
|
|
|
133
|
+ <if test="subItemId != null">sub_item_id = #{subItemId},</if>
|
|
123
|
134
|
<if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
|
|
124
|
135
|
<if test="isRandom != null">is_random = #{isRandom},</if>
|
|
125
|
136
|
<if test="tag != null">tag = #{tag},</if>
|
|
|
@@ -140,18 +151,83 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
140
|
151
|
<if test="photo != null">photo = #{photo},</if>
|
|
141
|
152
|
<if test="score != null">score = #{score},</if>
|
|
142
|
153
|
<if test="limitScore != null">limit_score = #{limitScore},</if>
|
|
|
154
|
+ <if test="inputItem != null and inputItem != ''">input_item = #{inputItem},</if>
|
|
|
155
|
+ <if test="result != null">result = #{result},</if>
|
|
143
|
156
|
</trim>
|
|
144
|
157
|
where id = #{id} and del_flag = 0
|
|
145
|
158
|
</update>
|
|
146
|
159
|
|
|
147
|
|
- <delete id="deleteTaskCheckItemById" parameterType="Long">
|
|
148
|
|
- delete from task_check_item where id = #{id} and del_flag = 0
|
|
149
|
|
- </delete>
|
|
150
|
160
|
|
|
151
|
|
- <delete id="deleteTaskCheckItemByIds" parameterType="String">
|
|
152
|
|
- delete from task_check_item where id in
|
|
|
161
|
+ <sql id="insertBatchSql">
|
|
|
162
|
+ insert into task_check_item(
|
|
|
163
|
+ check_id,
|
|
|
164
|
+ sub_item_id,
|
|
|
165
|
+ item_name,
|
|
|
166
|
+ is_random,
|
|
|
167
|
+ tag,
|
|
|
168
|
+ has_input,
|
|
|
169
|
+ input_content,
|
|
|
170
|
+ has_photo,
|
|
|
171
|
+ photo_prompt,
|
|
|
172
|
+ check_result,
|
|
|
173
|
+ example_image,
|
|
|
174
|
+ check_description,
|
|
|
175
|
+ sort_order,
|
|
|
176
|
+ status,
|
|
|
177
|
+ create_by,
|
|
|
178
|
+ update_by,
|
|
|
179
|
+ update_time,
|
|
|
180
|
+ create_time,
|
|
|
181
|
+ del_flag,
|
|
|
182
|
+ photo,
|
|
|
183
|
+ score,
|
|
|
184
|
+ limit_score,
|
|
|
185
|
+ input_item,
|
|
|
186
|
+ result
|
|
|
187
|
+ )
|
|
|
188
|
+ values
|
|
|
189
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
190
|
+ (
|
|
|
191
|
+ #{item.checkId},
|
|
|
192
|
+ #{item.subItemId},
|
|
|
193
|
+ #{item.itemName},
|
|
|
194
|
+ #{item.isRandom},
|
|
|
195
|
+ #{item.tag},
|
|
|
196
|
+ #{item.hasInput},
|
|
|
197
|
+ #{item.inputContent},
|
|
|
198
|
+ #{item.hasPhoto},
|
|
|
199
|
+ #{item.photoPrompt},
|
|
|
200
|
+ #{item.checkResult},
|
|
|
201
|
+ #{item.exampleImage},
|
|
|
202
|
+ #{item.checkDescription},
|
|
|
203
|
+ #{item.sortOrder},
|
|
|
204
|
+ #{item.status},
|
|
|
205
|
+ #{item.createBy},
|
|
|
206
|
+ #{item.updateBy},
|
|
|
207
|
+ #{item.updateTime},
|
|
|
208
|
+ #{item.createTime},
|
|
|
209
|
+ #{item.delFlag},
|
|
|
210
|
+ #{item.photo},
|
|
|
211
|
+ #{item.score},
|
|
|
212
|
+ #{item.limitScore},
|
|
|
213
|
+ #{item.inputItem},
|
|
|
214
|
+ #{item.result},
|
|
|
215
|
+ )
|
|
|
216
|
+ </foreach>
|
|
|
217
|
+ </sql>
|
|
|
218
|
+
|
|
|
219
|
+ <insert id="insertBatchTaskCheckItem" useGeneratedKeys="true" keyProperty="id">
|
|
|
220
|
+ <include refid="insertBatchSql"/>
|
|
|
221
|
+ </insert>
|
|
|
222
|
+
|
|
|
223
|
+ <update id="deleteTaskCheckItemById" parameterType="Long">
|
|
|
224
|
+ update task_check_item set del_flag = 1 where id = #{id} and del_flag = 0
|
|
|
225
|
+ </update>
|
|
|
226
|
+
|
|
|
227
|
+ <update id="deleteTaskCheckItemByIds" parameterType="String">
|
|
|
228
|
+ update task_check_item set del_flag = 1 where id in
|
|
153
|
229
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
154
|
230
|
#{id}
|
|
155
|
231
|
</foreach>
|
|
156
|
|
- </delete>
|
|
|
232
|
+ </update>
|
|
157
|
233
|
</mapper>
|