mybatis多参数传递(包括数组)

时间:2018-05-29 20:22:56   收藏:0   阅读:1231

mapper接口的方法:

public void batchDelete(@Param(value = "activityId") Integer activityId, @Param(value = "userIds") Integer[] userIds);

mapper.xml的配置:

<insert id="batchDelete">
        delete from T_ACT_USERS where ACTIVITY_ID = #{activityId}
        and USER_ID in
        <foreach collection="userIds" item="item" index="index" open="("
            separator="," close=")">
            #{item}
        </foreach>
 </insert>

 

原文:https://www.cnblogs.com/mituxiaogaoyang/p/9107446.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!