随笔分类 -  mybatis

tk-mybatis
摘要:通用mapper常用的方法 插入insert(T t)与insertSelective(T t); insert方法将对象所有属性都写入sql语句中,insertSelective()方法,对象属性不为null空的属性写入sql语句中。 思考良久,大多数情况下执行sql的语句不同,就其插入数据库的数 阅读全文
posted @ 2022-01-04 16:39 15年的夏天 阅读(268) 评论(0) 推荐(0)
mybatis--where标签
摘要:SELECT * FROM book <where> <if test="name != null"> and name = #{name} </if> <if test="title != null"> and title like #{title} </if> </where> where标签知 阅读全文
posted @ 2021-08-20 10:12 15年的夏天 阅读(380) 评论(0) 推荐(0)