Mybatis
文章平均质量分 72
独一无二的VV
冲就完事了
展开
-
Mybatis学习笔记(二)动态SQL,缓存,延迟加载,逆向工程,PageHelper分页插件
动态SQL根据具体的参数条件,来对SQL语句进行动态拼接。在以前的开发中,由于不确定查询参数是否存在,许多人会使用类似于where 1 = 1来作为前缀,这样,就算要查询的参数为空,也能够正确执行查询,如果不加1 = 1,则如果查询参数为空,SQL语句就会变成SELECT * FROM student where,SQL语句不合法mybatis里的动态标签:if<!-- 示例 --><select id="find" resultType="student" paramet原创 2021-07-13 19:17:29 · 152 阅读 · 0 评论 -
MyBatis学习笔记(一)
MyBatisParameter用Map替代对象dao:User getUserById2(Map<String,Object> map);xml <select id="getUserById2" parameterType="map" resultType="com.vv.pojo.User"> select * from mybatis.user where id= #{helloid} and name = #{name} </原创 2021-07-12 22:24:21 · 103 阅读 · 0 评论 -
MyBatis 用Map作为参数,模糊查询
MyBatisParameter用Map替代对象dao:User getUserById2(Map<String,Object> map);xml <select id="getUserById2" parameterType="map" resultType="com.vv.pojo.User"> select * from mybatis.user where id= #{helloid} and name = #{name} </原创 2021-07-12 15:31:12 · 228 阅读 · 0 评论