您现在的位置是:首页 > java技术交流java技术交流

mybatis plus3.3.2配置打印sql

上善若水2020-06-30 16:47:10【java技术交流】 3322人已围观

简介如何配置mybatis plus配置打印sql,控制台输出配置显示sql语句进行调试程序如何配置,如何配置mybatis,实测使用mybatis-plus-boot-starter3.3.2成功打印.

如何配置mybatis plus配置打印sql,控制台输出配置显示sql语句进行调试程序如何配置,如何配置mybatis,实测使用mybatis-plus-boot-starter3.3.2成功打印.
解决方案
如果是application.yml

#mybatis-plus配置控制台打印完整带参数SQL语句
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

如果是application.properties,添加

#mybatis-plus配置控制台打印完整带参数SQL语句
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

输出效果

Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@70721c12] was not registered for synchronization because synchronization is not active
JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@388d14e] will not be managed by Spring
==>  Preparing: SELECT id,category_id,cover,title,introduction,content,top,recommend,hot,browse,up,create_time,update_time FROM article 
==> Parameters: 
<==    Columns: id, category_id, cover, title, introduction, content, top, recommend, hot, browse, up, create_time, update_time
<==        Row: 1, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, thymeleaf中th:text和th:utext的区别, thymeleaf中th:text和th:utext的区别, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 2, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, 【Thymeleaf】格式化日期, 【Thymeleaf】格式化日期, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 3, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 4, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 5, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 6, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 7, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 8, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 9, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 10, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 11, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 12, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 13, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 14, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 15, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 16, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 17, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 18, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 19, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 20, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 21, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 22, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 23, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 24, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 25, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 26, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 27, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 28, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 29, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 30, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 31, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 32, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 33, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 34, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 35, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 36, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 37, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 38, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 39, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 40, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 41, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 42, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 43, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 44, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 45, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 46, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 47, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 48, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 49, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 50, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 51, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 52, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 53, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 54, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==        Row: 55, 1, https://p5.gexing.com/GSF/shaitu/20180318/1157/5aade3c1302d2.jpg, Spring Boot 2.2.7, Spring Boot 2.2.7, <<BLOB>>, 0, 0, 0, 1, 0, 2020-05-06 14:39:06, 2020-05-06 14:39:10
<==      Total: 55

Tags: mybatis plus

很赞哦! (7)

相关文章

随机图文

文章评论

站点信息

  • 建站时间:2019-10-24
  • 网站程序:Thinkphp6 Layui
  • 文章统计247篇文章
  • 标签管理标签云
  • 统计数据cnzz统计
  • 微信公众号:扫描二维码,关注我们