随笔分类 - Mybatis
摘要:在 MyBatis-Plus 中,使用updateById,null字段并不会更新,其实是和更新的策略有关,当然,也有插入策略。 1、调整全局策略(会对所有的字段都忽略判断,如果一些字段不想要修改,但是传值的时候没有传递过来,就会被更新为null) mybatis-plus: global-conf
阅读全文
摘要:mybatis-plus: type-enums-package: #对应实体类所在的包 mapper-locations: #mapper 映射文件 configuration: # 配置控制台sql打印 log-impl: org.apache.ibatis.logging.stdout.Std
阅读全文
摘要:问题描述:当传入的 status值为0 时,不进入 if 判断 <select id="selectAll" parameterType="com.imes.domain.entities.User" resultMap="BaseResultMap"> select * from user <wh
阅读全文
摘要:正确写法: <if test="userCode != null and userCode !='' and userCode !='admin'.toString()"> 或者 <if test='userCode != null and userCode !="" and userCode !=
阅读全文
摘要:spring 整合 mybatis 报错日志 Exception in thread "main" org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.Persiste
阅读全文
摘要:spring 整合 mybatis 报错信息 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.SqlSessio
阅读全文
摘要:spring 整合 mybatis 报错信息 java.lang.NoClassDefFoundError: org/apache/commons/pool/KeyedObjectPoolFactory 找不到commons-pool, 添加commons-pool-1.6依赖 <dependenc
阅读全文
摘要:spring 整合 mybatis 查询数据库报错 java.lang.NoClassDefFoundError: org/springframework/dao/support/DaoSupport 缺少jar包 添加如下jar包 <dependency> <groupId>org.springf
阅读全文
摘要:一:直接定义函数进行处理 public static String escapeStr(String str) { if (StringUtils.isEmpty(str)) { str = str.replaceAll("\\\\", "\\\\\\\\"); str = str.replaceA
阅读全文
摘要:Mybatis-Plus 使用 数据库不存在的字段,可在实体类的属性加上 @TableField 注解 @TableField(exist=false)
阅读全文
摘要:1、oracle 方式一: select name from staff <where> <if test="name != null"> name like '%'|| #{name} ||'%' </if> </where> 方式二: select name from staff <where>
阅读全文
摘要:错误代码: mapper接口: List<MeetingDeploy> resultTypeList(List<String> codes); mapper.xml: select * from meeting_deploy where meeting_code IN <foreach item="
阅读全文