重写mybatis-plus的saveUpdate方法 1.问题出现 同步外部数据的时候,如果需要同步逻辑删除的数据,mybatis-plus的saveOrUpdate||saveOrUpdateBath方法底层根据先查出数据数据是否存在,存在则更新不存在则新增,数据逻辑删除时,mybatis-plus查询不出来会执行插入造成主键冲突异常 2.问题解决(重写方法) Mapper.java public interface MdmCustomerBankInfoMapper extends Bas
在查询时发生了什么(When QuerySets are evaluated) QuerySet 可以被构造,过滤,切片,做为参数传递,这些行为都不会对数据库进行操作.只要你查询的时候才真正的操作数据库. 下面的 QuerySet 行为会导致执行查询的操作: 循环(Iteration):QuerySet 是可迭代的,在你遍历对象时就会执行数据库操作.例如,打印出所有博文的大标题: for e in Entry.objects.all(): print(e.headline) 切片(Slicing
Django文档阅读 - Day2 Writing your first Django app, part 1 You can tell Django is installed and which version by running the following command in a shell prompt. $ python -m django --version Creating a project If this is your first time using Django, yo