<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <mapper namespace="com.suning.pbr.mapper.InfoDefaultInputBatchMapper" > <insert id="batchInsert" parameterType="java.util.List"> insert into info_default_input (id, nc_id, content, seq, update_time, operator, op_name) values ( <foreach item="item" collection="list" open="" close="" separator="),("> #{item.id,jdbcType=BIGINT} , #{item.ncId,jdbcType=INTEGER} , #{item.content,jdbcType=VARCHAR} , #{item.seq,jdbcType=DECIMAL} , #{item.updateTime,jdbcType=TIMESTAMP} , #{item.operator,jdbcType=BIGINT} , #{item.opName,jdbcType=VARCHAR} </foreach> ) </insert> <update id="batchUpdate" parameterType="java.util.List" > update info_default_input <trim prefix="set" suffixOverrides=","> <trim prefix="content =case" suffix="end ,"> <foreach collection="list" item="item" index="index"> <if test="item.content!=null"> when id=#{item.id} then #{item.content} </if> </foreach> </trim> <trim prefix="update_time =case" suffix="end ,"> <foreach collection="list" item="item" index="index"> <if test="item.updateTime!=null"> when id=#{item.id} then #{item.updateTime} </if> </foreach> </trim> <trim prefix="seq =case" suffix="end ,"> <foreach collection="list" item="item" index="index"> <if test="item.seq!=null"> when id=#{item.id} then #{item.seq} </if> </foreach> </trim> <trim prefix="operator =case" suffix="end ,"> <foreach collection="list" item="item" index="index"> <if test="item.operator!=null"> when id=#{item.id} then #{item.operator} </if> </foreach> </trim> <trim prefix="op_name =case" suffix="end ,"> <foreach collection="list" item="item" index="index"> <if test="item.opName!=null"> when id=#{item.id} then #{item.opName} </if> </foreach> </trim> </trim> where ID in ( <foreach collection="list" item="item" open="" close="" separator=","> #{item.id,jdbcType=BIGINT} </foreach> ) </update> <delete id="batchDelete" parameterType="java.util.List" > delete from info_default_input where ID in( <foreach item="item" collection="list" open="" close="" separator=","> #{item.id,jdbcType=BIGINT} </foreach> ) </delete> </mapper>