Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

标签:MyBatis

Sharding-Sphere:Sharding-JDBC分库分表(基于MyBatis)

Sharding-Sphere:Sharding-JDBC分库分表(基于MyBatis)

分享了 Sharding-JDBC 搭建读写分离,本章将用 Sharding-JDBC 实现分库分表功能 为什么要分库分表? 举个栗子:当单表数据量超过1000万后,查询的速度将会慢下来,利用索引,读写分离等优化,如果当数据量超过5000万时,一些常见的优化方法将失去作用,此时把单表水平划分到多库多

Joe.Ye Joe.Ye 2023-04-01
0 0 0
MyBatis mybatis-generator自定义plugin

MyBatis mybatis-generator自定义plugin

字段添加注释 generatorConfig.xml添加自定义plugin示例 <!-- 生成的代码去掉注释 --> <commentGenerator type="com.lianpay.globalpay.remit.common.plugin.CommentGen

Joe.Ye Joe.Ye 2023-03-11
0 0 0
MyBatis根据List批量更新及删除记录

MyBatis根据List批量更新及删除记录

查询 //根据多个设备id获取设备信息 public List<Devices> getDevicesList(@Param("devicesIds") String[] devicesIds); <select id="getDevicesList

Joe.Ye Joe.Ye 2023-03-11
0 0 0
MyBatis中插入记录后获取该条记录ID

MyBatis中插入记录后获取该条记录ID

主键生成有两种方式: 主键自增长,需要得到插入成功后数据库生成的id 自定义主键,主要用于分布式开发,一般是现在java代码中生成id,然后存入数据库 MyBatis中主键回填的两种实现方式: (1)推荐方式 <insert id="insert" useGenera

Joe.Ye Joe.Ye 2023-03-11
0 0 0
Spring Boot中MyBatis打印sql

Spring Boot中MyBatis打印sql

如果使用的是application.properties文件,加入如下配置: logging.level.cn.appblog.demo=debug logging.level.*后面的路径指的是Mybatis对应的方法接口所在的包,并不是mapper.xml所在的包。 如果使用的是applica

Joe.Ye Joe.Ye 2023-03-11
0 0 0
MyBatis根据List批量查询List结果

MyBatis根据List批量查询List结果

基本使用 (1) Mapper接口 /** * 根据用户id list批量查询用户 */ public List<User> selectByIds(@Param("userIds") List<Long> userIds); (2) mapper.

Joe.Ye Joe.Ye 2023-03-11
0 0 0
MyBatis根据List批量查询List结果排序问题

MyBatis根据List批量查询List结果排序问题

MyBatis配置 public interface RouteServiceMapper { List<RouteService> selectRouteServiceList(@Param("routeServiceList") List<Map&l

Joe.Ye Joe.Ye 2023-02-26
0 0 0
使用MyBatis查询数据,按特定顺序排序

使用MyBatis查询数据,按特定顺序排序

有如下表table_city id city 1 beijing 2 shanghai 3 hanghzou 4 shenzhen 现在将查询出的数据按照id 3、4、1、2排序 先把id数据按照一定顺序放到一个List中 List<Inte

Joe.Ye Joe.Ye 2023-02-26
0 0 0
SpringBoot+Druid+MyBatis配置多数据源

SpringBoot+Druid+MyBatis配置多数据源

项目可能会遇到需要对多个数据库进行读写的需求,此时就需要配置多个数据源。 依赖配置 pom.xml配置的依赖如下: <dependencies> <dependency> <groupId>org.springframework.boot

Joe.Ye Joe.Ye 2023-02-25
0 0 0