MyBatis批量更新,update设置多个字段值,where条件为集合

2023-05-16

import org.apache.ibatis.annotations.Param;

//接口
void setStaff(@Param("channels")List<ChatChannel> channels, @Param("staffId") String staffId, @Param("staffName") String staffName);

 

	<update id="setStaff" >
		UPDATE chat_channel SET 	
			staff_id = #{staffId},
			staff_name = #{staffName}
		WHERE id IN
		    <foreach collection="channels" index="index" item="item" open="(" separator="," close=")">
		        #{item.id}
		    </foreach>
	</update>

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

MyBatis批量更新,update设置多个字段值,where条件为集合 的相关文章

  • ubuntu程序运行缓慢的一个可能原因

    之前是做windows c 43 43 软件开发的 xff0c 现在转为linux c 43 43 最近在做一款人脸识别软件 xff0c 发现在测试中 xff0c 检查人脸时 xff0c 摄像头界面就变得很卡顿 但是cmake第三方库运行没
  • 微信沙盒Key获取

    lt php php 获取沙盒sandbox signkey header 34 Content type text xml 34 include once 34 application vendor wechat pay WxMp Con

随机推荐