2021
03-05
03-05
Mybatis 如何批量删除数据的实现示例
本期以最常用的根据id批量删除数据为例:接口设计1:List类型单参数IntegerdeleteByIds(List<Integer>ids);接口设计2:Array数组类型单参数IntegerdeleteByIds(Integer[]ids);接口设计3:可变长度参数IntegerdeleteByIds(Integer...ids);此以接口2为例子mapper.xml配置如下:<deleteid="deleteByIds">DELETEFROMt_userWHEREidIN(<foreachcollection="array"item="id"separator=",">#{id}</foreach>)</d...
继续阅读 >