{"id":99057,"date":"2026-09-01T22:33:57","date_gmt":"2026-09-01T14:33:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/99057.html"},"modified":"2026-09-01T22:33:57","modified_gmt":"2026-09-01T14:33:57","slug":"%e5%9f%ba%e4%ba%8espringboot%e7%9a%84%e4%bb%93%e5%ba%93%e7%ae%a1%e7%90%86%e7%b3%bb%e7%bb%9f%e5%ae%9e%e7%8e%b0%e7%9a%84%e5%9f%ba%e6%9c%ac%e7%9f%a5%e8%af%86%e7%82%b9%e5%8f%8a%e7%b3%bb%e7%bb%9f%e5%bc%80","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/99057.html","title":{"rendered":"\u57fa\u4e8eSpringBoot\u7684\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u5b9e\u73b0\u7684\u57fa\u672c\u77e5\u8bc6\u70b9\u53ca\u7cfb\u7edf\u5f00\u53d1\u5fc3\u5f97\uff08\u6bd5\u4e1a\u8bbe\u8ba1\u56de\u5fc6\u5f551\uff09"},"content":{"rendered":"<h3 id=\"NCYsH\">\u4e00\u3001MyBatis\u4f5c\u4e3a\u6301\u4e45\u5c42\u6846\u67b6\u7684\u6838\u5fc3\u804c\u8d23<\/h3>\n<p id=\"ubeaf68b4\">\u5728SpringBoot\u9879\u76ee\u4e2d&#xff0c;MyBatis\u4f5c\u4e3a\u6301\u4e45\u5c42\u6846\u67b6\u7684\u6838\u5fc3\u4ef7\u503c\u5728\u4e8e**\u201c\u5e73\u8861\u7075\u6d3b\u6027\u4e0e\u5f00\u53d1\u6548\u7387\u201d**&#xff0c;\u4f53\u73b0\u5728&#xff1a;<\/p>\n<p>1. \u6570\u636e\u5e93\u8bbf\u95ee\u5c42\u7684\u57fa\u7840\u7ec4\u4ef6&#xff1b;<\/p>\n<p>2. \u5c06SQL\u8bed\u53e5\u4e0eJava\u65b9\u6cd5\u6620\u5c04&#xff1b;<\/p>\n<p>3. \u63d0\u4f9b\u52a8\u6001SQL\u80fd\u529b&#xff1b;<\/p>\n<p>4. \u81ea\u52a8\u914d\u7f6eSqlSessionFactory\u548cMapper\u626b\u63cf&#xff1b;<\/p>\n<p>5. \u4e0eSpring\u4e8b\u52a1\u7ba1\u7406\u534f\u540c&#xff1b;<\/p>\n<p>6. \u964d\u4f4eJDBC\u6837\u677f\u4ee3\u7801&#xff1b;<\/p>\n<p>7. \u652f\u6301\u7075\u6d3b\u7684\u7ed3\u679c\u6620\u5c04&#xff1b;<\/p>\n<p>8. \u4fbf\u4e8e\u7ef4\u62a4\u548c\u8c03\u4f18SQL\u3002\u6574\u5408\u540e\u5f00\u53d1\u4eba\u5458\u53ea\u9700\u5b9a\u4e49Mapper\u63a5\u53e3\u548cXML\/\u6ce8\u89e3SQL&#xff0c;SpringBoot\u8d1f\u8d23bean\u6ce8\u518c\u3001\u4e8b\u52a1\u3001\u8fde\u63a5\u6c60\u7b49<\/p>\n<p>\u4ee5\u4e0b\u4ece\u5b9e\u6218\u89d2\u5ea6\u89e3\u6790\u5176\u5177\u4f53\u4f5c\u7528&#xff1a;<\/p>\n<h5 id=\"JsL2O\">1. \u5f00\u7bb1\u5373\u7528\u7684SQL\u81ea\u7531&#xff0c;\u7a81\u7834ORM\u7684\u201c\u81ea\u52a8\u5316\u67b7\u9501\u201d<\/h5>\n<ul>\n<li id=\"u0d191003\">\u5bf9\u6bd4JPA&#xff1a;SpringBoot\u6574\u5408JPA\u65f6&#xff0c;\u81ea\u52a8\u751f\u6210\u7684SQL\u5728\u590d\u6742\u67e5\u8be2&#xff08;\u5982\u591a\u8868\u5173\u8054\u3001\u52a8\u6001\u8fc7\u6ee4<\/li>\n<li>&#xff09;\u573a\u666f\u4e0b\u6027\u80fd\u4e0d\u8db3\u3002MyBatis\u5141\u8bb8\u624b\u5199SQL&#xff0c;\u76f4\u63a5\u9488\u5bf9\u6570\u636e\u5e93\u4f18\u5316\u3002<br \/>\n\u573a\u666f&#xff1a;<\/li>\n<li>\u5546\u54c1\u8ba2\u5355\u7edf\u8ba1\u9700\u6309\u201c\u7528\u6237\u7b49\u7ea7&#043;\u4e0b\u5355\u65f6\u95f4&#043;\u5546\u54c1\u7c7b\u76ee\u201d\u591a\u7ef4\u5ea6\u805a\u5408&#xff0c;MyBatis\u7684XML\u4e2d\u53ef\u7f16\u5199\u5b9a\u5236\u5316SQL&#xff0c;\u907f\u514dJPA\u7684&#064;Query\u62fc\u63a5\u590d\u6742SQL\u7684\u7ef4\u62a4\u6210\u672c\u3002<\/li>\n<li id=\"ufabb38fe\">\u52a8\u6001SQL\u80fd\u529b&#xff1a;\u901a\u8fc7if\u3001choose\u3001foreach\u7b49\u6807\u7b7e&#xff0c;\u5b9e\u73b0\u53c2\u6570\u52a8\u6001\u62fc\u63a5\u3002\u4f8b\u5982&#xff1a;2<\/li>\n<li>\n<p>&lt;!&#8211; \u6839\u636e\u7528\u6237\u72b6\u6001\u8fc7\u6ee4\u8ba2\u5355&#xff0c;SpringBoot\u8bf7\u6c42\u53c2\u6570\u76f4\u63a5\u6620\u5c04 &#8211;&gt;<br \/>\n&lt;select id&#061;&#034;selectOrders&#034; resultType&#061;&#034;Order&#034;&gt;<br \/>\n  SELECT * FROM orders<br \/>\n  &lt;where&gt;<br \/>\n    &lt;if test&#061;&#034;userId !&#061; null&#034;&gt;user_id &#061; #{userId}&lt;\/if&gt;<br \/>\n    &lt;if test&#061;&#034;status !&#061; null&#034;&gt;AND status &#061; #{status}&lt;\/if&gt;<br \/>\n    &lt;if test&#061;&#034;createTime !&#061; null&#034;&gt;AND create_time &amp;gt; #{createTime}&lt;\/if&gt;<br \/>\n  &lt;\/where&gt;<br \/>\n&lt;\/select&gt;<\/p>\n<\/li>\n<\/ul>\n<h5>2.Spring\u751f\u6001\u6df1\u5ea6\u878d\u5408&#xff0c;\u7b80\u5316\u57fa\u7840\u8bbe\u65bd\u5efa\u8bbe<\/h5>\n<ul>\n<li id=\"u759079e7\">\u81ea\u52a8\u914d\u7f6e\u6d88\u9664\u6837\u677f\u4ee3\u7801&#xff1a;SpringBoot\u7684mybatis-spring-boot-starter\u81ea\u52a8\u6ce8\u5165SqlSessionFactory\u3001\u626b\u63cfMapper\u63a5\u53e3&#xff0c;\u65e0\u9700\u624b\u52a8\u914d\u7f6e\u6570\u636e\u6e90\u3001\u4e8b\u52a1\u7ba1\u7406\u5668\u3002<br \/>\n\u5bf9\u6bd4\u4f20\u7edfSSM&#xff1a;\u7701\u53bbSqlSessionFactoryBean\u3001MapperScannerConfigurer\u7b49XML\u914d\u7f6e&#xff0c;\u5f00\u53d1\u6548\u7387\u63d0\u534740%&#043;\u3002<\/li>\n<li id=\"uc49edd98\">\u65e0\u7f1d\u96c6\u6210Spring\u4e8b\u52a1&#xff1a;\u901a\u8fc7&#064;Transactional\u6ce8\u89e3&#xff0c;MyBatis\u7684Mapper\u65b9\u6cd5\u53ef\u76f4\u63a5\u7eb3\u5165Spring\u7684\u4e8b\u52a1\u7ba1\u7406\u3002\u4f8b\u5982&#xff1a;<\/li>\n<li>\n<p>&#064;Service<br \/>\npublic class OrderService {<br \/>\n    &#064;Autowired<br \/>\n    -OrderMapper orderMapper;<\/p>\n<p>    &#064;Transactional \/\/ MyBatis\u64cd\u4f5c\u81ea\u52a8\u53c2\u4e0e\u4e8b\u52a1<br \/>\n    public void updateOrderStatus(Long orderId,  status) {<br \/>\n        orderMapper.updateStatus(orderId, status);<br \/>\n        \/\/ \u82e5\u629b\u5f02\u5e38&#xff0c;\u81ea\u52a8\u56de\u6edaSQL<br \/>\n    }<br \/>\n}<\/p>\n<p id=\"u431c5511\">\u65e0\u9700\u624b\u52a8\u7ba1\u7406SqlSession\u7684\u63d0\u4ea4\/\u56de\u6eda&#xff0c;\u4e0eSpringBoot\u7684AOP\u673a\u5236\u5b8c\u7f8e\u534f\u540c\u3002<\/p>\n<\/li>\n<\/ul>\n<h5>3.\u7ed3\u679c\u6620\u5c04\u7cbe\u7ec6\u5316&#xff0c;\u5c4f\u853d\u6570\u636e\u5e93\u5b57\u6bb5\u5dee\u5f02<\/h5>\n<ul>\n<li id=\"uac754d11\">ResultMap\u5b9a\u5236\u5316\u6620\u5c04&#xff1a;\u6570\u636e\u5e93\u5b57\u6bb5&#xff08;\u5982user_name&#xff09;\u4e0eJava\u5bf9\u8c61&#xff08;\u5982userName&#xff09;\u7684\u9a7c\u5cf0\u6620\u5c04\u9ed8\u8ba4\u652f\u6301&#xff0c;\u590d\u6742\u573a\u666f\u53ef\u901a\u8fc7ResultMap\u81ea\u5b9a\u4e49\u3002<br \/>\n\u573a\u666f&#xff1a;\u5386\u53f2\u8868\u5b57\u6bb5create_time_v1\u9700\u6620\u5c04\u5230User\u5bf9\u8c61\u7684registerTime&#xff0c;MyBatis\u53ef\u901a\u8fc7columnPrefix\u6216association\u5904\u7406&#xff0c;\u907f\u514d\u4ee3\u7801\u4e2d\u5199&#064;Column\u6ce8\u89e3&#xff08;\u5c24\u5176\u9002\u5408\u9057\u7559\u7cfb\u7edf\u6539\u9020&#xff09;\u3002<\/li>\n<li id=\"ud0eae7f2\">\u591a\u8868\u8054\u5408\u67e5\u8be2\u5c01\u88c5&#xff1a;\u590d\u6742\u4e1a\u52a1\u5e38\u9700\u805a\u5408\u591a\u8868\u6570\u636e&#xff08;\u5982\u7528\u6237&#043;\u8ba2\u5355&#043;\u5730\u5740&#xff09;&#xff0c;MyBatis\u7684ResultMap\u652f\u6301\u5d4c\u5957\u67e5\u8be2\u6216\u5173\u8054\u67e5\u8be2&#xff0c;\u8fd4\u56de\u81ea\u5b9a\u4e49VO\u5bf9\u8c61&#xff1a;<\/li>\n<li>\n<p>&lt;resultMap id&#061;&#034;UserOrderVO&#034; type&#061;&#034;UserOrderVO&#034;&gt;<br \/>\n  &lt;association property&#061;&#034;user&#034; column&#061;&#034;user_id&#034; select&#061;&#034;selectUser&#034;\/&gt;<br \/>\n  &lt;collection property&#061;&#034;orders&#034; column&#061;&#034;user_id&#034; select&#061;&#034;selectOrdersByUserId&#034;\/&gt;<br \/>\n&lt;\/resultMap&gt;<\/p>\n<p id=\"ucc906dae\">\u76f8\u6bd4JPA\u7684&#064;One\/&#064;Many&#xff0c;SQL\u6267\u884c\u8ba1\u5212\u66f4\u53ef\u63a7&#xff08;\u907f\u514dN&#043;1\u95ee\u9898&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<h5 id=\"HlYwQ\">4.\u603b\u7ed3&#xff1a;MyBatis\u5728SpringBoot\u4e2d\u7684\u4e0d\u53ef\u66ff\u4ee3\u6027<\/h5>\n<table id=\"MA4BS\">\n<tbody>\n<tr>\n<td>\n<p id=\"uef85fe79\">\u573a\u666f\u9700\u6c42<\/p>\n<\/td>\n<td>\n<p id=\"u82f40b19\">MyBatis\u4f18\u52bf<\/p>\n<\/td>\n<td>\n<p id=\"u5851b1f6\">JPA\/\u5176\u4ed6ORM\u7684\u5c40\u9650<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"ub0320cf6\">\u590d\u6742\u591a\u8868\u67e5\u8be2<\/p>\n<\/td>\n<td>\n<p id=\"u758a2e06\">\u624b\u5199SQL\u7cbe\u51c6\u63a7\u5236\u8fde\u63a5\u6761\u4ef6\u3001\u805a\u5408\u903b\u8f91<\/p>\n<\/td>\n<td>\n<p id=\"u6bf42805\">\u81ea\u52a8\u751f\u6210SQL\u6027\u80fd\u5dee&#xff0c;\u590d\u6742\u67e5\u8be2\u9700\u5199NativeQuery<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"u830ecb3d\">\u9057\u7559\u6570\u636e\u5e93\u5b57\u6bb5\u4e0d\u89c4\u8303<\/p>\n<\/td>\n<td>\n<p id=\"uc6e30c92\">ResultMap\u7075\u6d3b\u6620\u5c04&#xff0c;\u517c\u5bb9\u65e7\u8868\u7ed3\u6784<\/p>\n<\/td>\n<td>\n<p id=\"u817169e5\">\u5f3a\u4f9d\u8d56\u6ce8\u89e3&#xff0c;\u5b57\u6bb5\u53d8\u66f4\u9700\u6539\u4ee3\u7801<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"ue514950b\">\u9ad8\u9891SQL\u6027\u80fd\u4f18\u5316<\/p>\n<\/td>\n<td>\n<p id=\"u29f52e61\">\u652f\u6301SQL\u5c42\u9762\u7684\u7d22\u5f15\u4f18\u5316\u3001\u5206\u9875\u4f18\u5316<\/p>\n<\/td>\n<td>\n<p id=\"u1afaa282\">\u81ea\u52a8\u5316SQL\u96be\u4f18\u5316&#xff0c;\u6613\u5f15\u53d1\u6027\u80fd\u95ee\u9898<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p id=\"u0ff31df3\">\u524d\u540e\u7aef\u8054\u8c03\u5feb\u901f\u8fed\u4ee3<\/p>\n<\/td>\n<td>\n<p id=\"ua61b7d8f\">\u52a8\u6001SQL\u9002\u914d\u53c2\u6570\u53d8\u5316&#xff0c;XML\u70ed\u66f4\u65b0&#xff08;\u65e0\u9700\u91cd\u542fSpringBoot&#xff09;<\/p>\n<\/td>\n<td>\n<p id=\"ud6b42f94\">\u6ce8\u89e3\u4fee\u6539\u9700\u91cd\u542f&#xff0c;\u52a8\u6001\u6761\u4ef6\u62fc\u63a5\u6613\u51fa\u9519<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"u292b018a\">\u9002\u5408\u9879\u76ee\u7c7b\u578b&#xff1a;<\/p>\n<ul>\n<li id=\"uec217bff\">\u4e2d\u540e\u53f0\u7ba1\u7406\u7cfb\u7edf&#xff08;\u590d\u6742\u67e5\u8be2&#043;\u6743\u9650\u8fc7\u6ee4&#xff09;&#xff1b;<\/li>\n<li id=\"uf8f57a8f\">\u7535\u5546\/\u91d1\u878d\u7b49\u9ad8\u5e76\u53d1\u573a\u666f&#xff08;SQL\u6027\u80fd\u654f\u611f&#xff09;&#xff1b;<\/li>\n<li id=\"u4c9f3e9f\">\u9057\u7559\u7cfb\u7edf\u6539\u9020&#xff08;\u517c\u5bb9\u5386\u53f2\u8868\u7ed3\u6784&#xff09;\u3002<\/li>\n<\/ul>\n<p id=\"ud4fa6e22\">\u4e0d\u9002\u5408\u573a\u666f&#xff1a;<\/p>\n<ul>\n<li id=\"uf8eed8b5\">\u7b80\u5355CRUD\u4e3a\u4e3b\u7684\u8f7b\u91cf\u5316\u9879\u76ee&#xff08;JPA\u66f4\u9ad8\u6548&#xff09;&#xff1b;<\/li>\n<li id=\"u71d0d779\">\u65e0SQL\u7ecf\u9a8c\u7684\u65b0\u624b\u56e2\u961f&#xff08;XML\u5b66\u4e60\u6210\u672c\u9ad8\u4e8e\u6ce8\u89e3&#xff09;\u3002<\/li>\n<\/ul>\n<p id=\"u252ec1fe\">\u5728SpringBoot\u751f\u6001\u4e2d&#xff0c;MyBatis\u5e76\u975e\u201c\u6700\u4f18\u89e3\u201d&#xff0c;\u800c\u662f\u201c\u6700\u7075\u6d3b\u7684\u89e3\u201d\u3002\u5b83\u8ba9\u5f00\u53d1\u8005\u5728\u201c\u81ea\u52a8\u5316\u201d\u4e0e\u201c\u63a7\u5236\u529b\u201d\u4e4b\u95f4\u81ea\u7531\u9009\u62e9&#xff0c;\u8fd9\u6b63\u662f\u590d\u6742\u4e1a\u52a1\u573a\u666f\u4e0b\u6301\u4e45\u5c42\u6846\u67b6\u7684\u6838\u5fc3\u4ef7\u503c\u3002<\/p>\n<p>\u4e8c\u3001\u524d\u540e\u7aef\u5b9e\u73b0\u529f\u80fd\u7684\u65b9\u6cd5<\/p>\n<ul>\n<li id=\"ufe967d8b\">\u540e\u7aef&#xff1a;\u501f\u52a9\u5b9e\u4f53\u7c7b\u3001\u6570\u636e\u8bbf\u95ee\u5c42\u3001\u670d\u52a1\u5c42\u548c\u63a7\u5236\u5668&#xff0c;\u6784\u5efa RESTful API \u63a5\u53e3\u4ee5\u8fd4\u56de\u7edf\u8ba1\u6570\u636e\u3002<\/li>\n<li id=\"ub3ae09e9\">\u524d\u7aef&#xff1a;\u4f7f\u7528 axios \u53d1\u9001\u8bf7\u6c42\u83b7\u53d6\u6570\u636e&#xff0c;\u5229\u7528 echarts \u7ed8\u5236\u997c\u72b6\u56fe&#xff0c;\u5e76\u901a\u8fc7 watchEffect \u76d1\u542c\u6570\u636e\u53d8\u5316\u6765\u66f4\u65b0\u56fe\u8868\u3002<\/li>\n<\/ul>\n<p id=\"ub77468c7\">&#xff08;\u540e\u7aef&#xff09;<\/p>\n<li id=\"ucc3a15d9\">\u6784\u5efa\u5b9e\u4f53\u7c7b&#xff1a;\u5b9a\u4e49\u4ed3\u5e93\u548c\u914d\u9001\u5546\u54c1\u7684\u5b9e\u4f53\u7c7b\u3002<\/li>\n<li id=\"uf096a432\">\u521b\u5efa\u6570\u636e\u8bbf\u95ee\u5c42&#xff1a;\u4f7f\u7528 Spring Data JPA \u7b49\u5de5\u5177\u6765\u64cd\u4f5c\u6570\u636e\u5e93\u3002<\/li>\n<li id=\"u7c0889e4\">\u7f16\u5199\u670d\u52a1\u5c42&#xff1a;\u7f16\u5199\u670d\u52a1\u65b9\u6cd5&#xff0c;\u7528\u4e8e\u7edf\u8ba1\u6bcf\u4e2a\u4ed3\u5e93\u5bf9\u5e94\u7684\u914d\u9001\u5feb\u9012\u6570\u91cf\u548c\u79cd\u7c7b\u5bf9\u5e94\u7684\u6570\u91cf\u3002<\/li>\n<li id=\"u1eae0f06\">\u521b\u5efa\u63a7\u5236\u5668&#xff1a;\u521b\u5efa RESTful API \u63a5\u53e3&#xff0c;\u5c06\u7edf\u8ba1\u6570\u636e\u8fd4\u56de\u7ed9\u524d\u7aef\u3002<\/li>\n<p id=\"u5dc30eef\">&#xff08;\u524d\u7aef&#xff09;<\/p>\n<li id=\"uf54d7643\">\u5b89\u88c5\u4f9d\u8d56&#xff1a;\u4f7f\u7528 axios \u53d1\u9001 HTTP \u8bf7\u6c42&#xff0c;\u4f7f\u7528 echarts \u7ed8\u5236\u997c\u72b6\u56fe\u3002<\/li>\n<li id=\"u46ff13ac\">\u521b\u5efa\u7ec4\u4ef6&#xff1a;\u521b\u5efa\u4e00\u4e2a\u7ec4\u4ef6\u6765\u663e\u793a\u997c\u72b6\u56fe\u3002<\/li>\n<li id=\"uc959f8d3\">\u53d1\u9001\u8bf7\u6c42&#xff1a;\u5728\u7ec4\u4ef6\u7684 setup \u51fd\u6570\u4e2d\u4f7f\u7528 axios \u53d1\u9001\u8bf7\u6c42\u83b7\u53d6\u6570\u636e\u3002<\/li>\n<li id=\"u0c4126ac\">\u66f4\u65b0\u56fe\u8868&#xff1a;\u4f7f\u7528 watchEffect \u76d1\u542c\u6570\u636e\u53d8\u5316&#xff0c;\u66f4\u65b0\u56fe\u8868\u3002<\/li>\n<p>\u4e09\u3001\u7cfb\u7edf\u5f00\u53d1\u7684\u5fc3\u5f97<\/p>\n<p>\u7cfb\u7edf\u5f00\u53d1\u524d\u671f&#xff0c;\u501f\u52a9\u6d41\u7a0b\u56fe\u6216\u8005\u601d\u7ef4\u5bfc\u56fe\u6765\u68b3\u7406\u7cfb\u7edf\u8981\u5b9e\u73b0\u7684\u4e3b\u8981\u529f\u80fd\u6a21\u5757\u7684\u5b9e\u73b0\u601d\u8def&#xff0c;\u8bb0\u8f7d\u597d\u5b9e\u73b0\u8fdb\u5ea6&#xff08;\u5f85\u5f00\u53d1&#8211;\u5b9e\u73b0\u4e2d&#8211;\u5df2\u5b9e\u73b0&#xff09;&#xff0c;\u7cfb\u7edf\u5f00\u53d1\u8fc7\u7a0b\u4e2d&#xff0c;\u9047\u5230\u77ed\u65f6\u95f4\u89e3\u51b3\u4e0d\u4e86\u7684\u95ee\u9898&#xff0c;\u5148\u6682\u505c&#xff0c;\u5148\u53bb\u522b\u7684\u6a21\u5757&#xff0c;\u7136\u540e\u518d\u8fd4\u56de\u89e3\u51b3\u4e0d\u4e86\u7684\u6a21\u5757&#xff0c;\u82e5\u653e\u4e4b-\u62ff\u8d77-\u653e\u4e4b-\u62ff\u8d77\u597d\u51e0\u4e2a\u56de\u5408\u8fd8\u662f\u89e3\u51b3\u4e0d\u4e86\u7684&#xff0c;\u8bf7\u7acb\u9a6c\u653e\u5f03&#xff0c;\u91cd\u65b0\u89c4\u5212\u5f53\u524d\u6a21\u5757\u3002\u540c\u65f6&#xff0c;\u4e5f\u53ef\u4ee5\u5c06\u8fdb\u5ea6\u8bb0\u5f55\u5728\u5e73\u53f0\u4e0a&#xff0c;\u53ef\u80fd\u90a3\u4e2a\u65f6\u5019\u4e0d\u89c9\u5f97\u5565&#xff0c;\u4f46\u5f53\u65f6\u95f4\u957f\u5ea6\u5230\u4e00\u5b9a\u7684\u7a0b\u5ea6&#xff0c;\u518d\u56de\u9996&#xff0c;\u81ea\u5df1\u4e5f\u201c\u8d70\u4e86\u5f88\u8fdc\u7684\u8def\u4e86\u201d~<\/p>\n<p>\u5176\u4ed6\u7684\u5177\u4f53\u529f\u80fd\u6a21\u5757\u4e0b\u6b21\u5f97\u7a7a\u4f1a\u7ee7\u7eed\u5206\u4eab&#xff0c;\u8bb0\u5f55\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001MyBatis\u4f5c\u4e3a\u6301\u4e45\u5c42\u6846\u67b6\u7684\u6838\u5fc3\u804c\u8d23\u5728SpringBoot\u9879\u76ee\u4e2d&#xff0c;MyBatis\u4f5c\u4e3a\u6301\u4e45\u5c42\u6846\u67b6\u7684\u6838\u5fc3\u4ef7\u503c\u5728\u4e8e**\u201c\u5e73\u8861\u7075\u6d3b\u6027\u4e0e\u5f00\u53d1\u6548\u7387\u201d**&#xff0c;\u4f53\u73b0\u5728&#xff1a;1. \u6570\u636e\u5e93\u8bbf\u95ee\u5c42\u7684\u57fa\u7840\u7ec4\u4ef6&#xff1b;2. \u5c06SQL\u8bed\u53e5\u4e0eJava\u65b9\u6cd5\u6620\u5c04&#xff1b;3. \u63d0\u4f9b\u52a8\u6001SQL\u80fd\u529b&#xff1b;4. \u81ea\u52a8\u914d\u7f6eSqlSessionFactory\u548cMapper\u626b\u63cf&#xff1b;5. \u4e0eSpring\u4e8b\u52a1\u7ba1\u7406\u534f\u540c&#xff1b;6. \u964d\u4f4eJDB<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[98,292,938],"topic":[],"class_list":["post-99057","post","type-post","status-publish","format-standard","hentry","category-server","tag-spring-boot","tag-292","tag-938"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u57fa\u4e8eSpringBoot\u7684\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u5b9e\u73b0\u7684\u57fa\u672c\u77e5\u8bc6\u70b9\u53ca\u7cfb\u7edf\u5f00\u53d1\u5fc3\u5f97\uff08\u6bd5\u4e1a\u8bbe\u8ba1\u56de\u5fc6\u5f551\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/99057.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u57fa\u4e8eSpringBoot\u7684\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u5b9e\u73b0\u7684\u57fa\u672c\u77e5\u8bc6\u70b9\u53ca\u7cfb\u7edf\u5f00\u53d1\u5fc3\u5f97\uff08\u6bd5\u4e1a\u8bbe\u8ba1\u56de\u5fc6\u5f551\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001MyBatis\u4f5c\u4e3a\u6301\u4e45\u5c42\u6846\u67b6\u7684\u6838\u5fc3\u804c\u8d23\u5728SpringBoot\u9879\u76ee\u4e2d&#xff0c;MyBatis\u4f5c\u4e3a\u6301\u4e45\u5c42\u6846\u67b6\u7684\u6838\u5fc3\u4ef7\u503c\u5728\u4e8e**\u201c\u5e73\u8861\u7075\u6d3b\u6027\u4e0e\u5f00\u53d1\u6548\u7387\u201d**&#xff0c;\u4f53\u73b0\u5728&#xff1a;1. \u6570\u636e\u5e93\u8bbf\u95ee\u5c42\u7684\u57fa\u7840\u7ec4\u4ef6&#xff1b;2. \u5c06SQL\u8bed\u53e5\u4e0eJava\u65b9\u6cd5\u6620\u5c04&#xff1b;3. \u63d0\u4f9b\u52a8\u6001SQL\u80fd\u529b&#xff1b;4. \u81ea\u52a8\u914d\u7f6eSqlSessionFactory\u548cMapper\u626b\u63cf&#xff1b;5. \u4e0eSpring\u4e8b\u52a1\u7ba1\u7406\u534f\u540c&#xff1b;6. \u964d\u4f4eJDB\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/99057.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-01T14:33:57+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99057.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/99057.html\",\"name\":\"\u57fa\u4e8eSpringBoot\u7684\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u5b9e\u73b0\u7684\u57fa\u672c\u77e5\u8bc6\u70b9\u53ca\u7cfb\u7edf\u5f00\u53d1\u5fc3\u5f97\uff08\u6bd5\u4e1a\u8bbe\u8ba1\u56de\u5fc6\u5f551\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-01T14:33:57+00:00\",\"dateModified\":\"2026-09-01T14:33:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/99057.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/99057.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99057.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u57fa\u4e8eSpringBoot\u7684\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u5b9e\u73b0\u7684\u57fa\u672c\u77e5\u8bc6\u70b9\u53ca\u7cfb\u7edf\u5f00\u53d1\u5fc3\u5f97\uff08\u6bd5\u4e1a\u8bbe\u8ba1\u56de\u5fc6\u5f551\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u57fa\u4e8eSpringBoot\u7684\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u5b9e\u73b0\u7684\u57fa\u672c\u77e5\u8bc6\u70b9\u53ca\u7cfb\u7edf\u5f00\u53d1\u5fc3\u5f97\uff08\u6bd5\u4e1a\u8bbe\u8ba1\u56de\u5fc6\u5f551\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/99057.html","og_locale":"zh_CN","og_type":"article","og_title":"\u57fa\u4e8eSpringBoot\u7684\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u5b9e\u73b0\u7684\u57fa\u672c\u77e5\u8bc6\u70b9\u53ca\u7cfb\u7edf\u5f00\u53d1\u5fc3\u5f97\uff08\u6bd5\u4e1a\u8bbe\u8ba1\u56de\u5fc6\u5f551\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001MyBatis\u4f5c\u4e3a\u6301\u4e45\u5c42\u6846\u67b6\u7684\u6838\u5fc3\u804c\u8d23\u5728SpringBoot\u9879\u76ee\u4e2d&#xff0c;MyBatis\u4f5c\u4e3a\u6301\u4e45\u5c42\u6846\u67b6\u7684\u6838\u5fc3\u4ef7\u503c\u5728\u4e8e**\u201c\u5e73\u8861\u7075\u6d3b\u6027\u4e0e\u5f00\u53d1\u6548\u7387\u201d**&#xff0c;\u4f53\u73b0\u5728&#xff1a;1. \u6570\u636e\u5e93\u8bbf\u95ee\u5c42\u7684\u57fa\u7840\u7ec4\u4ef6&#xff1b;2. \u5c06SQL\u8bed\u53e5\u4e0eJava\u65b9\u6cd5\u6620\u5c04&#xff1b;3. \u63d0\u4f9b\u52a8\u6001SQL\u80fd\u529b&#xff1b;4. \u81ea\u52a8\u914d\u7f6eSqlSessionFactory\u548cMapper\u626b\u63cf&#xff1b;5. \u4e0eSpring\u4e8b\u52a1\u7ba1\u7406\u534f\u540c&#xff1b;6. \u964d\u4f4eJDB","og_url":"https:\/\/www.wsisp.com\/helps\/99057.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-01T14:33:57+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/99057.html","url":"https:\/\/www.wsisp.com\/helps\/99057.html","name":"\u57fa\u4e8eSpringBoot\u7684\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u5b9e\u73b0\u7684\u57fa\u672c\u77e5\u8bc6\u70b9\u53ca\u7cfb\u7edf\u5f00\u53d1\u5fc3\u5f97\uff08\u6bd5\u4e1a\u8bbe\u8ba1\u56de\u5fc6\u5f551\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-01T14:33:57+00:00","dateModified":"2026-09-01T14:33:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/99057.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/99057.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/99057.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u57fa\u4e8eSpringBoot\u7684\u4ed3\u5e93\u7ba1\u7406\u7cfb\u7edf\u5b9e\u73b0\u7684\u57fa\u672c\u77e5\u8bc6\u70b9\u53ca\u7cfb\u7edf\u5f00\u53d1\u5fc3\u5f97\uff08\u6bd5\u4e1a\u8bbe\u8ba1\u56de\u5fc6\u5f551\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=99057"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99057\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=99057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=99057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=99057"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=99057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}