//新增 <insert id="insertSelectiveList" useGeneratedKeys="true" parameterType="java.util.List"> insert into common_user (user_id, user_account, user_name, password, nick_name, avatar, salt, mobile, tel, email, status, isdel, create_time, last_mod_time, create_user_id, mod_user_id, open_id, region_code, region_name ) values <foreach collection="list" item="item" index="index" separator="," close=";"> (#{item.userId,jdbcType=BIGINT}, #{item.userAccount,jdbcType=VARCHAR}, #{item.userName,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR}, #{item.nickName,jdbcType=VARCHAR}, #{item.avatar,jdbcType=VARCHAR}, #{item.salt,jdbcType=VARCHAR}, #{item.mobile,jdbcType=VARCHAR}, #{item.tel,jdbcType=VARCHAR}, #{item.email,jdbcType=VARCHAR}, #{item.status,jdbcType=CHAR}, #{item.isdel,jdbcType=CHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.lastModTime,jdbcType=TIMESTAMP}, #{item.createUserId,jdbcType=BIGINT}, #{item.modUserId,jdbcType=BIGINT}, #{item.openId,jdbcType=VARCHAR}, #{item.regionCode,jdbcType=VARCHAR}, #{item.regionName,jdbcType=VARCHAR} ) </foreach> </insert> //删除 <delete id="deluserByaccount" parameterType="java.util.ArrayList" > delete from common_user <where> user_account in ( <foreach collection="list" item="code" index="index" separator=","> #{code} </foreach> ) </where> </delete>
原文:https://www.cnblogs.com/yyjspace/p/14807325.html