mybatis批量删除
批量删除所选择的用户
<!-- 批量删除所选择的用户 --> <delete id="deleteSomeUser" parameterType="int"> delete from user where id in <foreach collection="array" item="user_id" open="(" separator="," close=")"> #{user_id} </foreach> </delete>
这里collection:表示类型,这里参数是数组,就写成array,如果是集合,就写成list
UserMapper.java里
写的是:
//批量删除用户
void deleteSomeUser(Integer[] user_id);