赞
踩
更新例子:
参数@param(“list”)
<update id="对应方法">
<foreach collection="list" item="list" separator=";">
update 表名
set 参数A = #{list.参数A,jdbcType=类型}
where user_id = #{list.userId,jdbcType=VARCHAR} and discount_group_id=#{list.discountGroupId,jdbcType=VARCHAR}
</foreach>
</update>
新增:
<insert id="insetList">
insert into uc_user_price_config (id, user_id, create_time,update_time, price, machine_id,status,processor_type) values
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.userId}, #{item.createTime}, #{item.updateTime},#{item.price},#{item.machineId},#{item.status},#{item.processorType})
</foreach>
</insert>
数据库配置:
&allowMultiQueries=true
完整的:
spring.datasource.url =jdbc:mysql://10.23.100.70:3306/xneo?useAffectedRows=true&useUnicode=true&characterEncoding=UTF8&allowMultiQueries=true
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。