MyBatis-plus整合

@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "aaaa_info",autoResultMap = true)
@TableField(value = "aa_config",typeHandler = JacksonTypeHandler.class,updateStrategy = FieldStrategy.IGNORED)
private JSONObject aaConfig;
        <result column="aa_config" javaType="com.alibaba.fastjson.JSONObject" typeHandler ="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" />

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
非常感谢您的提问。关于mybatis-plus整合durid,您可以参考以下代码: 1.首先,在pom.xml文件中添加以下依赖: <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.0.7.1</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.10</version> </dependency> 2.在application.yml文件中添加以下配置: spring: datasource: url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8 username: root password: root driver-class-name: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource druid: initial-size: 5 min-idle: 5 max-active: 20 max-wait: 60000 time-between-eviction-runs-millis: 60000 min-evictable-idle-time-millis: 300000 validation-query: SELECT 1 FROM DUAL test-while-idle: true test-on-borrow: false test-on-return: false pool-prepared-statements: true max-pool-prepared-statement-per-connection-size: 20 filters: stat,wall,log4j 3.在MybatisPlusConfig.java文件中添加以下配置: @Configuration @MapperScan("com.example.demo.mapper") public class MybatisPlusConfig { @Bean public PaginationInterceptor paginationInterceptor() { return new PaginationInterceptor(); } @Bean public PerformanceInterceptor performanceInterceptor() { PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor(); //格式化sql语句 Properties properties = new Properties(); properties.setProperty("format", "true"); performanceInterceptor.setProperties(properties); return performanceInterceptor; } } 以上就是整合mybatis-plus和durid的配置方法,希望对您有所帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值