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" 进行了备份

相关推荐
柯南二号7 小时前
【Java后端】MyBatis-Plus 原理解析
java·开发语言·mybatis
Easocen8 小时前
Mybatis学习笔记(五)
笔记·学习·mybatis
qq_三哥啊14 小时前
【IDEA】设置Debug调试时调试器不进入特定类(Spring框架、Mybatis框架)
spring·intellij-idea·mybatis
柯南二号16 小时前
【Java后端】Spring Boot 集成 MyBatis-Plus 全攻略
java·spring boot·mybatis
记忆不曾留1 天前
Mybatis 源码解读-SqlSession 会话源码和Executor SQL操作执行器源码
mybatis·二级缓存·sqlsession会话·executor执行器·一级缓存localcache
昵称为空C2 天前
SpringBoot 实现DataSource接口实现多租户数据源切换方案
后端·mybatis
isyangli_blog2 天前
(2-10-1)MyBatis的基础与基本使用
java·开发语言·mybatis
_码农121382 天前
Mybatis简单练习注解sql和配置文件sql+注解形式加载+配置文件加载
mybatis
期待のcode3 天前
Maven
java·spring·maven·mybatis
独泪了无痕3 天前
一文搞懂MyBatis中的TypeHandler
数据库·后端·mybatis