{"id":25346,"date":"2024-11-24T08:29:17","date_gmt":"2024-11-24T00:29:17","guid":{"rendered":"https:\/\/fwq.ai\/blog\/25346\/"},"modified":"2024-11-24T08:29:17","modified_gmt":"2024-11-24T00:29:17","slug":"spring-boot-%e6%9f%a5%e8%af%a2-sql-%e4%b8%ba%e7%a9%ba%ef%bc%8c%e4%b8%ba%e4%bd%95-idea-%e8%bf%94%e5%9b%9e%e7%a9%ba%e7%bb%93%e6%9e%9c%ef%bc%8cnavicat-%e5%8d%b4%e8%83%bd%e6%88%90%e5%8a%9f%e6%9f%a5-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/25346\/","title":{"rendered":"Spring Boot \u67e5\u8be2 SQL \u4e3a\u7a7a\uff0c\u4e3a\u4f55 IDEA \u8fd4\u56de\u7a7a\u7ed3\u679c\uff0cNavicat \u5374\u80fd\u6210\u529f\u67e5\u8be2\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173059686415608.jpg\" class=\"aligncenter\" title=\"Spring Boot \u67e5\u8be2 SQL \u4e3a\u7a7a\uff0c\u4e3a\u4f55 IDEA \u8fd4\u56de\u7a7a\u7ed3\u679c\uff0cNavicat \u5374\u80fd\u6210\u529f\u67e5\u8be2\uff1f\u63d2\u56fe\" alt=\"Spring Boot \u67e5\u8be2 SQL \u4e3a\u7a7a\uff0c\u4e3a\u4f55 IDEA \u8fd4\u56de\u7a7a\u7ed3\u679c\uff0cNavicat \u5374\u80fd\u6210\u529f\u67e5\u8be2\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>Spring Boot \u67e5\u8be2 SQL \u4e3a\u7a7a\uff0c\u95ee\u9898\u6839\u6e90\u5728\u54ea\u91cc\uff1f<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 Spring Boot \u67e5\u8be2\u6570\u636e\u5e93\u65f6\uff0c\u9047\u5230\u4e86\u5982\u4e0b\u95ee\u9898\uff1a\u4f7f\u7528 IDEA \u6267\u884c\u67e5\u8be2\u8fd4\u56de\u7a7a\u7ed3\u679c\uff0c\u800c\u4f7f\u7528 Navicat \u6267\u884c\u76f8\u540c SQL \u8bed\u53e5\u5374\u80fd\u6210\u529f\u8fd4\u56de\u6570\u636e\u3002\u6392\u67e5\u95ee\u9898\u539f\u56e0\u5982\u4e0b\uff1a<\/p>\n<p><strong>#\u548c$\u7684<\/strong><\/p>\n<p>\u5728 Spring Boot \u4e2d\uff0c\u4f7f\u7528 #{} \u7ed1\u5b9a\u53c2\u6570\uff0c\u8868\u793a <strong>\u52a8\u6001\u53c2\u6570<\/strong>\uff0c\u4f1a\u81ea\u52a8\u8fdb\u884c SQL \u6ce8\u5165\u9632\u5fa1\u3002\u800c\u4f7f\u7528 $() \u7ed1\u5b9a\u53c2\u6570\uff0c\u8868\u793a <strong>\u9759\u6001\u53c2\u6570<\/strong>\uff0c\u4e0d\u4f1a\u8fdb\u884c SQL \u6ce8\u5165\u9632\u5fa1\u3002<\/p>\n<p><strong>\u5728\u672c\u4f8b\u4e2d\uff0c\u4f7f\u7528 #{} \u7ed1\u5b9a\u7a7a\u53c2\u6570\uff0c\u5bfc\u81f4 SQL \u6ce8\u5165\u9632\u5fa1\u673a\u5236\u8fc7\u6ee4\u4e86\u8be5\u53c2\u6570\uff0c\u5bfc\u81f4\u67e5\u8be2\u6761\u4ef6\u65e0\u6548\uff0c\u8fd4\u56de\u7a7a\u7ed3\u679c\u3002<\/strong><\/p>\n<p><strong>mybatis log\u63d2\u4ef6<\/strong><\/p>\n<p>\u4f7f\u7528 IDEA \u5f00\u53d1\u65f6\uff0c\u53ef\u4ee5\u5b89\u88c5 mybatis log \u63d2\u4ef6\u3002\u542f\u7528\u8be5\u63d2\u4ef6\u540e\uff0c\u53ef\u4ee5\u5728 IDEA \u63a7\u5236\u53f0\u67e5\u770b MyBatis \u6267\u884c\u7684 SQL \u8bed\u53e5\uff0c\u4ece\u800c\u65b9\u4fbf\u6392\u67e5\u95ee\u9898\u3002<\/p>\n<p><strong>\u6392\u67e5\u6b65\u9aa4:<\/strong><\/p>\n<ol>\n<li>\u5b89\u88c5 mybatis log \u63d2\u4ef6<\/li>\n<li>\u8bbe\u7f6e IDEA \u65e5\u5fd7\u7ea7\u522b\u4e3a DEBUG<\/li>\n<li>\u91cd\u65b0\u8fd0\u884c\u67e5\u8be2\u64cd\u4f5c<\/li>\n<li>\u67e5\u770b\u63a7\u5236\u53f0\u6253\u5370\u7684 SQL \u8bed\u53e5\uff0c\u627e\u51fa\u95ee\u9898\u6240\u5728<\/li>\n<\/ol>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6392\u67e5\u6b65\u9aa4\uff0c\u53ef\u4ee5\u5feb\u901f\u5b9a\u4f4d\u95ee\u9898\u539f\u56e0\uff0c\u5e76\u89e3\u51b3\u67e5\u8be2\u4e3a\u7a7a\u7684\u95ee\u9898\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fSpring Boot \u67e5\u8be2 SQL \u4e3a\u7a7a\uff0c\u4e3a\u4f55 IDEA \u8fd4\u56de\u7a7a\u7ed3\u679c\uff0cNavicat \u5374\u80fd\u6210\u529f\u67e5\u8be2\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Boot \u67e5\u8be2 SQL \u4e3a\u7a7a\uff0c\u95ee\u9898\u6839\u6e90\u5728\u54ea\u91cc\uff1f \u5728\u4f7f\u7528 Spring Boot \u67e5\u8be2\u6570\u636e\u5e93\u65f6\uff0c\u9047\u5230\u4e86\u5982\u4e0b\u95ee\u9898\uff1a\u4f7f\u7528 IDEA \u6267\u884c\u67e5\u8be2\u8fd4\u56de\u7a7a\u7ed3\u679c\uff0c\u800c\u4f7f\u7528 Navicat \u6267\u884c\u76f8\u540c SQL \u8bed\u53e5\u5374\u80fd\u6210\u529f\u8fd4\u56de\u6570\u636e\u3002\u6392\u67e5\u95ee\u9898\u539f\u56e0\u5982\u4e0b\uff1a #\u548c$\u7684 \u5728 Spring Boot \u4e2d\uff0c\u4f7f\u7528 #{} \u7ed1\u5b9a\u53c2\u6570\uff0c\u8868\u793a \u52a8\u6001\u53c2\u6570\uff0c\u4f1a\u81ea\u52a8\u8fdb\u884c SQL \u6ce8\u5165\u9632\u5fa1\u3002\u800c\u4f7f\u7528 $() \u7ed1\u5b9a\u53c2\u6570\uff0c\u8868\u793a \u9759\u6001\u53c2\u6570\uff0c\u4e0d\u4f1a\u8fdb\u884c SQL \u6ce8\u5165\u9632\u5fa1\u3002 \u5728\u672c\u4f8b\u4e2d\uff0c\u4f7f\u7528 #{} \u7ed1\u5b9a\u7a7a\u53c2\u6570\uff0c\u5bfc\u81f4 SQL \u6ce8\u5165\u9632\u5fa1\u673a\u5236\u8fc7\u6ee4\u4e86\u8be5\u53c2\u6570\uff0c\u5bfc\u81f4\u67e5\u8be2\u6761\u4ef6\u65e0\u6548\uff0c\u8fd4\u56de\u7a7a\u7ed3\u679c\u3002 mybatis log\u63d2\u4ef6 \u4f7f\u7528 IDEA \u5f00\u53d1\u65f6\uff0c\u53ef\u4ee5\u5b89\u88c5 mybatis log \u63d2\u4ef6\u3002\u542f\u7528\u8be5\u63d2\u4ef6\u540e\uff0c\u53ef\u4ee5\u5728 IDEA \u63a7\u5236\u53f0\u67e5\u770b MyBatis \u6267\u884c\u7684 SQL \u8bed\u53e5\uff0c\u4ece\u800c\u65b9\u4fbf\u6392\u67e5\u95ee\u9898\u3002 \u6392\u67e5\u6b65\u9aa4: \u5b89\u88c5 mybatis log \u63d2\u4ef6 \u8bbe\u7f6e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-25346","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=25346"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25346\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=25346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=25346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=25346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}