mybatis 多字段、多表批量更新,判断条件也批量改变
来源:互联网 发布:忻州网络第一传媒 编辑:程序博客网 时间:2024/05/17 06:15
<update id="updateDb2" parameterType="list">
update profile_factory_information infoLEFT JOIN basic_org_user buser ON buser.userId = info.userId
<trim prefix="set" suffixOverrides=",">
<trim prefix="company =case" suffix="end,"><foreach collection="list" item="item" index="index">
<if test="item.company!=null"> <!-- 需要更新的字段company-->
when buser.mobile=#{item.mobile} then #{item.company}
</if>
</foreach>
</trim>
<trim prefix=" classify =case" suffix="end,"><foreach collection="list" item="item" index="index">
<if test="item.classify!=null"> <!-- 需要更新的字段classify-->
when buser.mobile=#{item.mobile} then #{item.classify}
</if>
</foreach>
</trim>
<trim prefix=" userName =case" suffix="end,"><foreach collection="list" item="item" index="index">
<if test="item.userName!=null"> <!-- 需要更新的字段userName-->
when buser.mobile=#{item.mobile} then #{item.userName}
</if>
</foreach>
</trim>
</trim>
where<foreach collection="list" separator="or" item="item" index="index" >
buser.mobile=#{item.mobile} <!-- 判断条件mobile-->
</foreach>
4 0
- mybatis 多字段、多表批量更新,判断条件也批量改变
- Mybatis多条件批量更新
- Mybatis 批量增加,批量更新
- Mybatis 批量插入、批量更新
- Mybatis批量更新
- Mybatis批量更新
- Mybatis批量更新
- mybatis 批量更新
- mybatis 批量更新
- mybatis 批量更新
- Mybatis批量更新
- Mybatis批量更新
- Mybatis批量更新数据
- Mybatis批量更新
- mybatis批量更新
- Mysql+Mybatis批量更新
- Mybatis批量更新数据
- MyBatis批量新增、更新
- Ubuntu提示 /boot 分区空间不足解决方法
- 高并发Java 六 JDK并发包2
- 基于Spark UI性能优化与调试——初级篇
- hibernate 的参数绑定
- Keyboard Row问题及解法
- mybatis 多字段、多表批量更新,判断条件也批量改变
- C++ 调用 Caffe 训练好的网络(样例:LeNet)
- java 中的Stack、Queue、Deque
- jquery常用代码段
- 对spring中AOP的理解(事务管理)
- sql 生成日期序列及相关关系
- CF679A:Bear and Prime 100(交互 & 数论)
- 事件+存储过程+触发器
- 完美解决RadioGroup setOnCheckedChangedListener 多次调用问题