Mysql 批量插入:
<insert id="batchInsert" parameterType="java.util.List">
INSERT INTO mon_alert_detail (
id,
pm_code,
alert_pm_code
) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},
#{item.pmCode},
#{item.alertPmCode}
)
</foreach>
</insert>
MySql 批量修改:
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" separator=";">
UPDATE mon_alert_detail
<set>
<if test="item.alertPmCode!=null and item.alertPmCode!=''">alert_pm_code