随笔分类 - Mybatis
摘要:如果example传入的值可能为Null,可能会出现删除所有数据的情况。 例子如下: 如果 userId 为空,那么实际执行的sql是不会有 where 条件的全表删除语句。 真的,好傻逼的tkmybatis,简直可以说是弱智
阅读全文
摘要:1.返回值Map mapper.xml <select id="selectUserMapLimitOne" resultType="java.util.HashMap"> select id,name from user order by id desc limit 1 </select> 接口定
阅读全文
摘要:BUG 的情况如下: <if test="a !=null and a='1'.toString()"> and a = #{a} </if> 这样写导致的就是不管a传什么值,最后都会拼接上 and a = 1 这一段SQL。 原因就是 a = '1'.toString() 而不是 a == '1'
阅读全文

浙公网安备 33010602011771号