mybatis 按条件批量更新日期

需求 更新数据  根据yearRule年规则 更新etime的值  yearRule为1 自然年(契约签订之日起,到当年年末止)  yearRule为2 顺延年(契约签订之日,到下一年的今天之前一天) yearRule为3 永久

入参 是 List<Map<String, Object>>

 

大前提: 配置文件中连接数据库的url上必须加上  &allowMultiQueries=true

jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&allowMultiQueries=true

 

 mapper.xml

 

 

相关的日期操作函数:

https://www.cnblogs.com/1996swg/p/9254492.html

https://www.cnblogs.com/ggjucheng/p/3352280.html

 

posted @ 2020-08-24 15:22  ジ绯色月下ぎ  阅读(938)  评论(0编辑  收藏  举报