<update id = "testupdate" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update ka, a
<if test="item.abc != null and item.abc != ''">
set ka.abc = #{item.abc,jdbcType=VARCHAR}
</if>
<if test="item.bcd != null and item.bcd != ''">
set ka.bcd = #{item.bcd,jdbcType=VARCHAR}
</if>
where ka.id = a.id
</foreach>
</update>
AND dd.id IN
<foreach collection="idList" item="item" index="index" open="(" close=")" separator=",">
#{item, jdbcType=BIGINT}
</foreach>
VALUES
<foreach collection ="userList" item="user" separator =",">
(#{id}, #{name}, #{password})
</foreach >
Mybatis foreach 标签
最新推荐文章于 2023-05-16 15:25:27 发布