@@ -169,51 +169,50 @@ gobatis.RegisterMapperFile(filePath)
169
169
<select id="selectTestTable">
170
170
SELECT <include refid="columns_id"> </include> FROM test_table
171
171
<where>
172
- <if test="id != nil and id != 0">AND id = #{id} </if>
173
- <if test="username != nil">AND username = #{username} </if>
174
- <if test="password != nil">AND password = #{password} </if>
175
- <if test="update_time != nil">AND update_time = #{update_time} </if>
172
+ <if test="{TestTable.id} != nil and {TestTable.id} != 0">AND id = #{TestTable. id} </if>
173
+ <if test="{TestTable. username} != nil">AND username = #{TestTable. username} </if>
174
+ <if test="{TestTable. password} != nil">AND password = #{TestTable. password} </if>
175
+ <if test="{TestTable. update_time} != nil">AND update_time = #{TestTable. update_time} </if>
176
176
</where>
177
177
</select>
178
178
179
179
<select id="selectTestTableCount">
180
180
SELECT COUNT(*) FROM test_table
181
181
<where>
182
- <if test="id != nil and id != 0">AND id = #{id} </if>
183
- <if test="username != nil">AND username = #{username} </if>
184
- <if test="password != nil">AND password = #{password} </if>
185
- <if test="update_time != nil">AND update_time = #{update_time} </if>
182
+ <if test="{TestTable.id} != nil and {TestTable.id} != 0">AND id = #{TestTable. id} </if>
183
+ <if test="{TestTable. username} != nil">AND username = #{TestTable. username} </if>
184
+ <if test="{TestTable. password} != nil">AND password = #{TestTable. password} </if>
185
+ <if test="{TestTable. update_time} != nil">AND update_time = #{TestTable. update_time} </if>
186
186
</where>
187
187
</select>
188
188
189
189
<insert id="insertTestTable">
190
190
INSERT INTO test_table (id,username,password,update_time)
191
191
VALUES(
192
- #{id},
193
- #{username},
194
- #{password},
195
- #{update_time}
192
+ #{TestTable. id},
193
+ #{TestTable. username},
194
+ #{TestTable. password},
195
+ #{TestTable. update_time}
196
196
)
197
197
</insert>
198
198
199
199
<update id="updateTestTable">
200
200
UPDATE test_table
201
201
<set>
202
- <if test="id != nil and id != 0"> id = #{id} </if>
203
- <if test="username != nil"> username = #{username} </if>
204
- <if test="password != nil"> password = #{password} </if>
205
- <if test="update_time != nil"> update_time = #{update_time} </if>
202
+ <if test="{TestTable.username} != nil"> username = #{TestTable.username} </if>
203
+ <if test="{TestTable.password} != nil"> password = #{TestTable.password} </if>
204
+ <if test="{TestTable.update_time} != nil"> update_time = #{TestTable.update_time} </if>
206
205
</set>
207
- WHERE id = #{id}
206
+ WHERE id = #{TestTable. id}
208
207
</update>
209
208
210
209
<delete id="deleteTestTable">
211
210
DELETE FROM test_table
212
211
<where>
213
- <if test="id != nil and id != 0">AND id = #{id} </if>
214
- <if test="username != nil">AND username = #{username} </if>
215
- <if test="password != nil">AND password = #{password} </if>
216
- <if test="update_time != nil">AND update_time = #{update_time} </if>
212
+ <if test="{TestTable.id} != nil and {TestTable.id} != 0">AND id = #{TestTable. id} </if>
213
+ <if test="{TestTable. username} != nil">AND username = #{TestTable. username} </if>
214
+ <if test="{TestTable. password} != nil">AND password = #{TestTable. password} </if>
215
+ <if test="{TestTable. update_time} != nil">AND update_time = #{TestTable. update_time} </if>
217
216
</where>
218
217
</delete>
219
218
</mapper>
0 commit comments