其他分享
首页 > 其他分享> > mapper.xml-foreach应用场景: curd-批量处理, 拼接等

mapper.xml-foreach应用场景: curd-批量处理, 拼接等

作者:互联网

mapper.java

 int deleteRelationsByRoleids(@Param("roleids") Integer[] roleids);

mapper.xml

    <delete id="deleteRelationsByRoleids">
        DELETE FROM user_role
        WHERE
        role_id in
        <foreach collection="roleids" item="item" index="index" open="(" separator="," close=")">
            #{item,jdbcType=INTEGER}
        </foreach>
    </delete>

标签:xml,mapper,Param,curd,role,roleids
来源: https://www.cnblogs.com/jxtpro/p/15507414.html