<!-- 执行成功返回 增加的记录数 -->
<insert id="insertBatch" parameterType="list" >
insert all
<foreach collection="list" item="CALENDAR" separator=" ">
into GPTRM_CALENDAR_INFO
( <include refid="Base_Column_List"></include>)
values
(#{CALENDAR.periodno,jdbcType=VARCHAR}, #{CALENDAR.reportingstartdate,jdbcType=VARCHAR})
</foreach>
select 1 from dual
</insert>
<!-- 执行成功返回-1 -->
<update id="updateBatch" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="begin" close=";end;" separator=";" >
update GPTRM_CONFIG_INFO
set
C_VALUE=#{item.cValue},
MODTIME=#{item.modtime},
MOD_USERID=#{item.modUserid}
where C_ID = #{item.cId} and FORECAST_TYPE=#{item.forecastType}
</foreach>
</update>
Mybatis 批量增加,批量更新
最新推荐文章于 2022-05-12 15:55:38 发布