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

相关推荐
4154119 小时前
MyBatis-Plus + PostGIS 实战(四):GeoJSON 序列化与前端地图对接,全局 WKT + 局部 GeoJSON,两种格式优雅共存
java·mybatis·postgis·geojson
Full Stack Developme12 小时前
MyBatis-Plus(MP)AST 抽象语法树 设计原理
java·tomcat·mybatis
han_hanker1 天前
mybatis-plus service层拥有的方法
mybatis
ruleslol2 天前
Mybatis11-不同的数据库连接池的配置
数据库·mybatis
干到60岁退休的码农2 天前
整合Mybatis-Plus分页插件并实现分页api方法
java·mybatis
han_hanker2 天前
mybatis-plus 常用方法
java·tomcat·mybatis
李少兄2 天前
MyBatis、MyBatis-Plus 与全自动 ORM 的本质区别
mybatis
干到60岁退休的码农2 天前
SpringBoot整合Mybatis-plus
spring boot·后端·mybatis
4154112 天前
MyBatis-Plus + PostGIS 实战(二):空间查询与空间索引
java·mybatis·gis·postgis
AgCl232 天前
JavaWeb个人笔记01--Maven到MyBatis
笔记·maven·mybatis