您现在的位置是:首页 > java技术交流java技术交流
mybatis plus3.3.2配置打印sql
上善若水2020-06-30 16:47:10【java技术交流】 3442人已围观
简介如何配置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)
相关文章
随机图文
-
冠状病毒科普 什么是冠状病毒
冠状病毒在分类层级上是科,冠状病毒科拉丁文名Coronaviridae, 简称CoV,因为外形呈球状,具有花瓣状的刺突,因此根据其形状,国际病毒命名委员会在1975年正式命名为“冠状病毒科”。目前已知 -
幽默故事二
-01-父亲丢了块表,他抱怨着翻腾着四处寻找,可半天也找不到。等他出去了,儿子悄悄进屋,不一会儿就找到了表。父亲问:怎么找到的?儿子说:我就安静地坐着,一会儿就能听到滴答滴答的声音,表就找到了。我们越 -
java Map删除值为null的元素 lamada表达式一行代码就搞定
由于map在使用foreach循环中删除元素的话会报空指针异常,只能采用迭代器的方式删除元素,写好代码后编译器竟然意外的提示我将代码改成lamada表达式,瞬间代码精简,idea牛逼!map.entr -
如何判断一个人是否适合做程序员?
软件蚕食一切,未来是属于程序员。人人都想学编程,但并非人人都适合编程。有人说:IT行业只有高智商的人才能进得去,而且以男性居多,还必须专业对口。事实上呢?很多计算机专业的大学生毕业后并没有从事本专业的