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

相关推荐
Z_z在努力9 小时前
【杂类】Spring 自动装配原理
java·spring·mybatis
little_xianzhong13 小时前
关于对逾期提醒的定时任务~改进完善
java·数据库·spring boot·spring·mybatis
MadPrinter16 小时前
SpringBoot学习日记 Day11:博客系统核心功能深度开发
java·spring boot·后端·学习·spring·mybatis
奔跑吧邓邓子18 小时前
【Java实战㉟】Spring Boot与MyBatis:数据库交互的进阶之旅
java·spring boot·实战·mybatis·数据库交互
lunzi_fly20 小时前
【源码解读之 Mybatis】【基础篇】-- 第1篇:MyBatis 整体架构设计
java·mybatis
摸鱼仙人~20 小时前
深入理解 MyBatis-Plus 的 `BaseMapper`
java·开发语言·mybatis
隔壁阿布都1 天前
spring boot + mybatis 使用线程池异步修改数据库数据
数据库·spring boot·mybatis
Mcband2 天前
MyBatis 拦截器让搞定监控、脱敏和权限控制
mybatis
╭╰4022 天前
苍穹外卖优化-续
java·spring·mybatis
weixin_456904272 天前
基于Spring Boot + MyBatis的用户管理系统配置
spring boot·后端·mybatis