mybatis - 日常工作踩坑

问题1 :1.8 新映入时间类使用出现的问题 :LocalDateTime

https://blog.csdn.net/hustzw07/article/details/82824358

关于不同jar 配置的关联性

 

问题2:一直提示   mysql数据库时间类型转换成java的LocalDateTime报错,

Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: Error attempting to get column 'create_time' from result set.  Cause: java.sql.SQLFeatureNotSupportedException
; ]; null; nested exception is java.sql.SQLFeatureNotSupportedException

https://mp.baomidou.com/guide/faq.html#mybatisplusexception-your-property-named-xxx-cannot-find-the-corresponding-database-column-name

   Conversion not supported for type java.time.LocalDateTime

我的问题是jar的版本问题:    mysql-connector-java   各种版本要对应:

问题3: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by id        desc       limit 0, 10' at line 6

很明显语法问题:where 不是给     order by 和 limit 用的

 

问题4: 根据 in传入的内容排序,但是,最终输出的结果还是根据 id的大小正序输出,field 没有生效???

select * from t_item_sku where id in ( 1537, 15684, 3020, 246, 536) 
order by FIELD (‘id’, 1537, 15684, 3020, 246, 536) 

原来是应为field 后面指定的规则 参数 不能加单引号 ,直接  FIELD (‘id’, 1537, 15684, 3020, 246, 536) 就可以排序成功

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值