![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Mybatis
就卤蛋吧
这个作者很懒,什么都没留下…
展开
-
Mybatis多字段关键字模糊查询
Mybatis多字段关键字模糊查询<select id="selectAll" resultType="com.test.pojo.user"> SELECT * FROM user <where> <if test="keyword!='' and keyword!=null"> and CONCAT(username,sex,nickname) like CONCAT{'%',k原创 2021-02-03 14:03:24 · 709 阅读 · 0 评论 -
MyBatis新增数据并返回主键值
在查询语句增加useGeneratedKeys="true"及keyProperty="id"<insert id="register" parameterType="com.hans.entity.User" useGeneratedKeys="true" keyProperty="id"> INSERT INTO USER ( usercode, PA...原创 2019-11-26 16:20:23 · 151 阅读 · 0 评论 -
在MyBatis中使用if标签如何判断字符是否相等
字符使用双引号即可<if test = 'key == "Y" '> and 1 = 1</if>原创 2019-11-26 16:04:25 · 214 阅读 · 0 评论 -
mybatis 一对多 嵌套一对多
实体类School学校public class School { private Integer SchoolId; private String SchoolName; private List<Student>list; ...} 学生类public class Student { private Integer...原创 2019-11-26 15:52:58 · 415 阅读 · 0 评论 -
MyBatis中大于和小于号的转义写法
mybatis 中 SQL 写在mapper.xml文件中,而xml解析 < 、>、<=、>= 时会出错,这时应该使用转义写法。符号 符号名 转义写法 < 小于 < <= 小于等于 <= > 大于 > >= 大于等于 &g...原创 2019-11-26 15:22:19 · 1913 阅读 · 0 评论 -
在MyBatis中使用模糊查询的几种方式
1.使用${...} <select id="selectAll" parameterType="map" resultMap="BaseResultMap"> SELECT * FROM insurance_base_info WHERE 1 = 1 <if test="date!=null and date!=''">...原创 2019-11-26 15:14:18 · 321 阅读 · 0 评论