赞
踩
com.baomidou
mybatis-plus-boot-starter
${mybatis-plus.version}
org.apache.shardingsphere
sharding-jdbc-spring-boot-starter
${sharding-sphere.version}
org.apache.shardingsphere
sharding-jdbc-spring-namespace
${sharding-sphere.version}
org.projectlombok
lombok
true
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-maven-plugin
@Configuration
@MapperScan(“com.github.jianzh5.blog.mapper”)
public class MybatisPlusConfig {
/**
*/
@Bean
public PaginationInterceptor paginationInterceptor(){
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
List sqlParserList = new ArrayList<>();
sqlParserList.add(new BlockAttackSqlParser());
paginationInterceptor.setSqlParserList(sqlParserList);
return new PaginationInterceptor();
}
/**
*/
@Bean
// @Profile({“dev”,“test”})
public PerformanceInterceptor performanceInterceptor() {
return new PerformanceInterceptor();
}
}
@Data
@TableName(“t_order”)
public class Order {
private Long id;
private String name;
private String type;
private Date gmtCreate;
}<
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。