![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
项目总结
文章平均质量分 50
FromZeroToPerfect
小白的后端开发之路
展开
-
项目日志出现:syntax error, error in :‘it 5 LIMIT ? ‘, expect LIMIT, actual LIMIT pos 问题
今天检查项目日志时发现了这样一个问题: syntax error, error in :'it 5 LIMIT ? ', expect LIMIT, actual LIMIT pos 问题出现原因: 由于在项目中使用了PageHelper分页插件, PageHelper 方法使用了静态的 ThreadLocal 参数,分页参数和线程是绑定的。 只要你可以保证在 PageHelper 方法调用后紧跟 MyBatis 查询方法,这就是安全的。因为 PageHelper 在 finally 代码段中自动清除了 T原创 2020-12-24 11:07:57 · 3941 阅读 · 0 评论 -
Mybatis Plus主键 Could not set property ‘id‘ of ‘class xxxx with value‘‘;Cause:argument type mismatch
Mybatis Plus支持以下4种主键策略: IdType.AUTO 数据库ID自增(常用) IdType.INPUT 用户输入ID IdType.ID_WORKER 全局唯一ID,内容为空自动填充(默认配置),会返回一个Long类型值作为ID,如果id定义为Integer类型,就会报参数类型不匹配错误 IdType.UUID 全局唯一ID,内容为空自动填充 ...原创 2020-11-07 18:36:27 · 688 阅读 · 0 评论 -
两种使用list.stream().collect()方式:Collectors.toMap,Collectors.mapping
list->map键值对映射关系: List<Platform> platformList = platformService.listAll(); Map<Integer, String> platformMap = null; if (platformList != null && platformList.size() > 0) { platformMap = platformList.stream().collect(Collectors.原创 2020-11-06 13:16:07 · 4048 阅读 · 0 评论 -
使用SimpleDateFormat格式化日期
常用: SimpleDateFormat simpleDateFormat =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); System.out.println(simpleDateFormat.format(new Date())); y 四位数年份 M 月 d 日 h 时 在上午或下午 (1~12) H 时 在一天中 (0~23) m 分 s 秒 ...原创 2020-11-04 16:16:50 · 274 阅读 · 0 评论 -
SpringBoot整合Mybatis反向生成时报错
Mysql 8.0.17 mybatis-generator-maven-plugin 1.3.5 mapper-spring-boot-starter 2.0.2 druid-spring-boot-starter 1.1.10 1.错误一:数据库版本与本地版本不匹配(记住有两个,Maven插件里还有一个) 2.错误二:关于Mysql 8.x的错误 ①配置url必须加时区 &se...原创 2019-12-04 00:47:48 · 194 阅读 · 0 评论