mybatis 操作全集之

mybatis xml 中的 大于、小于、等于 写法
lambdaQuery中EQ、NE、GT、LT、GE、LE的用法

mybatis 批量更新操作

单条更新

xml 复制代码
<update id="updateBatchById">
        <foreach collection="list" item="item" index="index" separator=";">
            update od_user_money set
            money = #{item.money},
            add_lng_amount = #{item.addLngAmount},
            version = version+1
            where id = #{item.id} and version = #{version}
        </foreach>
    </update>

Mapper

java 复制代码
Integer updateBatchById(List<OdUserMoney> list);

一次性更新

xml 复制代码
 <update id="updateBatchV1">
        update od_user_money
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="money=case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                    <if test="item.money!=null">
                        when id=#{item.id} then #{item.money}
                    </if>
                </foreach>
            </trim>
            <trim prefix="add_lng_amount =case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                    <if test="item.addLngAmount!=null">
                        when id=#{item.id} then #{item.addLngAmount}
                    </if>
                </foreach>
            </trim>
        </trim>
        ,version = version+1
        where id in
        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
            #{item.id}
        </foreach>
    </update>

Mapper

java 复制代码
Integer updateBatchV1(List<OdUserMoney> list);

https://github.com/macrozheng/mall-swarm springcloud学习教程

https://blog.51cto.com/youlai/4903483?articleABtest=0 鉴权参考

https://blog.51cto.com/u_13675550/6172189?articleABtest=0 鉴权参考

https://blog.51cto.com/u_15284359/4935578?articleABtest=0 鉴权参考

https://blog.51cto.com/u_15973676/6074600?articleABtest=0 鉴权参考

http://t.csdnimg.cn/IrsAh springboot+oauth2.0

keytool -genkey -alias android.key -keyalg RSA -validity 36500 -keystore D:/rsa/android.key

keytool -genkey -alias jwt -keyalg RSA -validity 36500 -keystore D:/rsa/jwt.jks

keytool -importkeystore -srckeystore D:/rsa/jwt.jks -destkeystore D:/rsa/jwt.jks -deststoretype pkcs12

已将 "D:/rsa/jwt.jks" 迁移到 Non JKS/JCEKS。将 JKS 密钥库作为 "D:/rsa/jwt.jks.old" 进行了备份

相关推荐
计算机学姐4 小时前
基于SpringBoot+Vue的高校运动会管理系统
java·vue.js·spring boot·后端·mysql·intellij-idea·mybatis
我是浮夸6 小时前
MyBatisPlus——学习笔记
java·spring boot·mybatis
编程、小哥哥12 小时前
手写mybatis之Mapper XML的解析和注册使用
xml·java·mybatis
小桑要读研14 小时前
Redis实现点赞
java·mysql·mybatis
真的想不出名儿1 天前
04-SpringBootWeb案例(下)
mybatis·spingbootweb
舞者H2 天前
如何实现Mybatis自定义插件
java·mybatis
程序员大金2 天前
基于SpringBoot+Vue+MySQL的考勤管理系统
java·javascript·vue.js·spring boot·后端·mysql·mybatis
beiback2 天前
Springboot + netty + rabbitmq + myBatis
spring boot·mysql·rabbitmq·mybatis·netty·java-rabbitmq
wclass-zhengge2 天前
Redis篇(缓存机制 - 基本介绍)(持续更新迭代)
redis·缓存·mybatis
小七的喵喵2 天前
使用Mybatis框架的主要优势
java·sql·mybatis