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

相关推荐
Full Stack Developme2 小时前
MyBatis-Plus 流式查询教程
前端·python·mybatis
ccice012 小时前
全面掌握Spring Boot + MyBatis + Maven + MySQL:从开发到部署的后端技术详解
spring boot·maven·mybatis
消失的旧时光-19434 小时前
Spring Boot + MyBatis 从 0 到 1 跑通查询接口(含全部踩坑)
spring boot·后端·spring·mybatis
1.14(java)6 小时前
MyBatis 操作数据库
数据库·mybatis
杰克尼1 天前
天机学堂项目总结(day1~day2)
大数据·jvm·spring·elasticsearch·搜索引擎·spring cloud·mybatis
Java成神之路-1 天前
SpringBoot 整合 SSM 全流程详解(含 JUnit+MyBatis 实战)(Spring系列18)
spring boot·junit·mybatis
时间静止不是简史1 天前
当MyBatis-Plus的like遇上SQL通配符:下划线翻车记
java·sql·mybatis
夕除1 天前
javaweb--10
mybatis
MaCa .BaKa1 天前
52-考研备考服务平台系统-考研系统
java·spring boot·mysql·考研·tomcat·maven·mybatis
计算机学姐1 天前
基于SpringBoot的社区服务平台
java·spring boot·后端·spring·信息可视化·tomcat·mybatis