dao层
int delUser(@Param("menuId") Integer menuId,@Param("idList") List<String> idList);
xml层
<delete id="delUser" > delete FROM user_role_menu WHERE menu_id=#{menuId} AND user_id NOT IN <foreach collection="idList" index="index" item="id" open="(" separator="," close=")"> #{id} </foreach> </delete>
当我们这边传递不同的参数类型,可以不使用parameterType,避免提示类型不一致的问题
但是要保证
和
命名保持一致
标签:idList,menuId,menu,Param,查询,mybatis,id From: https://www.cnblogs.com/q202105271618/p/17822594.html