
Mybatis
Solitude_dong
这个作者很懒,什么都没留下…
展开
-
MybatisPlus常用注解
【@TableName 】 @TableName 用于定义表名 注: 常用属性: value 用于定义表名 【@TableId】 @TableId 用于定义表的主键 注: 常用属性: value 用于定义主键字段名 type 用于定义主键类型(主键策略 IdType) 主键策略: IdType.AUTO 主键自增,系统分配,不需要手动输入 IdType..原创 2021-09-23 15:38:51 · 500 阅读 · 0 评论 -
mybatis中的查询条件允许为空时的sql语句
<if test="userType != null and userType == '0'.toString()"> AND (ud.department_type = '0' or ud.department_type is null) </if>原创 2021-07-01 16:15:10 · 882 阅读 · 0 评论 -
ssm项目报错:Data truncation: Truncated incorrect DOUBLE XXX
原因:在mybatis的xml文件的sql语句中,set后面更改不止一个字段,用了and连接 <update id="updateMerchantPushedAndTimes"> update ouser.merchant_org_info <if test="pushedFlag == true"> set is_pushed = 'Y' and pushe_times = pushe_times+1原创 2021-06-24 16:53:26 · 125 阅读 · 0 评论 -
mybatis的foreach报错The expression‘idList‘ evaluated to a null value
Controller层 @PostMapping(value = "/deleteUsers") public BasicResult<Object> deleteUsers(@RequestBody List<Long> list) Service层 void deleteUsersWithTx(List<Long> ids); mapper层 int deleteUsers(List<Long> list); xml(..原创 2021-06-22 09:12:35 · 604 阅读 · 0 评论 -
Mybatis入门学习(一)
Mybatis 入门学习(一) 一、mybatis的环境搭建 创建maven工程,操作pom.xml文件导入坐标 1.1.1 加入打包方式 <packaging>jar</packaging> 1.1.2 导入mybatis的依赖 <dependencies> <dependency> <groupId>org.mybatis</groupId> <ar原创 2020-08-01 17:11:12 · 633 阅读 · 2 评论