{"id":92,"date":"2025-02-15T23:54:30","date_gmt":"2025-02-15T15:54:30","guid":{"rendered":"https:\/\/uniquelu.cn\/?p=92"},"modified":"2025-02-15T23:54:31","modified_gmt":"2025-02-15T15:54:31","slug":"mybatis%e4%b8%8emybatis-plus%e7%9a%84%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"https:\/\/uniquelu.cn\/index.php\/2025\/02\/15\/mybatis%e4%b8%8emybatis-plus%e7%9a%84%e5%8c%ba%e5%88%ab\/","title":{"rendered":"MyBatis\u4e0eMyBatis-plus\u7684\u533a\u522b"},"content":{"rendered":"\n<p class=\"has-black-color has-text-color has-link-color wp-elements-96c6fa26a72dbd8720aa22109a6a9123\">1.\u5e95\u5c42\u6846\u67b6\uff1a<br>     MyBatis \u662f\u4e00\u4e2a\u6301\u4e45\u5c42\u6846\u67b6\uff0c\u5b83\u652f\u6301\u5b9a\u5236\u5316 SQL\u3001\u5b58\u50a8\u8fc7\u7a0b\u4ee5\u53ca\u9ad8\u7ea7\u6620\u5c04\u3002MyBatis \u907f\u514d\u4e86\u51e0\u4e4e\u6240\u6709\u7684 JDBC \u4ee3\u7801\u548c\u624b\u52a8\u8bbe\u7f6e\u53c2\u6570\u4ee5\u53ca\u83b7\u53d6\u7ed3\u679c\u96c6\u3002MyBatis \u53ef\u4ee5\u4f7f\u7528\u7b80\u5355\u7684 XML \u6216\u6ce8\u89e3\u8fdb\u884c\u914d\u7f6e\u548c\u539f\u751f\u6620\u5c04\u3002<br>MyBatisPlus \u662f\u4e00\u4e2a\u57fa\u4e8e MyBatis \u7684\u6269\u5c55\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u5957\u901a\u7528\u7684 CRUD \u64cd\u4f5c\u63a5\u53e3\uff0c\u81ea\u52a8\u751f\u6210 SQL \u8bed\u53e5\uff0c\u5e76\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u67e5\u8be2\u6761\u4ef6\u6784\u9020\u5668\u7b49\u529f\u80fd\u3002MyBatisPlus \u4e3b\u8981\u4f7f\u7528\u4e86\u6ce8\u89e3\u8fdb\u884c\u914d\u7f6e\u548c\u6620\u5c04\u3002<\/p>\n\n\n\n<p>2.\u4ee3\u7801\u5dee\u5f02\uff1a<br>MyBatis \u7684\u4ee3\u7801\u4e3b\u8981\u6d89\u53ca\u5230\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206\uff1a<\/p>\n\n\n\n<p>     MyBatis \u7684\u914d\u7f6e\u6587\u4ef6\uff08mybatis-config.xml\uff09\uff0c\u7528\u4e8e\u914d\u7f6e\u6570\u636e\u6e90\u3001\u6620\u5c04\u6587\u4ef6\u7b49\u3002<br>    \u6620\u5c04\u6587\u4ef6\uff08Mapper.xml\uff09\uff0c\u7528\u4e8e\u5b9a\u4e49 SQL \u8bed\u53e5\u548c\u7ed3\u679c\u6620\u5c04\u3002<br>    Mapper \u63a5\u53e3\uff0c\u7528\u4e8e\u5b9a\u4e49\u4e0e\u6620\u5c04\u6587\u4ef6\u5bf9\u5e94\u7684\u65b9\u6cd5\u3002<br>    DAO \u63a5\u53e3\uff0c\u7528\u4e8e\u5c01\u88c5 Mapper \u63a5\u53e3\uff0c\u63d0\u4f9b\u7edf\u4e00\u7684 CRUD \u65b9\u6cd5\u3002<br>MyBatisPlus \u7684\u4ee3\u7801\u4e3b\u8981\u6d89\u53ca\u5230\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206\uff1a<br>    MyBatisPlus \u7684\u914d\u7f6e\u6587\u4ef6\uff08mybatis-plus-config.xml\uff09\uff0c\u7528\u4e8e\u914d\u7f6e\u6570\u636e\u6e90\u3001\u5206\u9875\u63d2\u4ef6\u7b49\u3002<br>    \u5b9e\u4f53\u7c7b\uff08Entity\uff09\uff0c\u7528\u4e8e\u5b9a\u4e49\u6570\u636e\u5e93\u8868\u5bf9\u5e94\u7684\u5b9e\u4f53\u7c7b\u3002<br>    Mapper \u63a5\u53e3\uff0c\u7528\u4e8e\u5b9a\u4e49\u4e0e\u6570\u636e\u5e93\u8868\u5bf9\u5e94\u7684\u65b9\u6cd5\u3002<br>    Service \u63a5\u53e3\uff0c\u7528\u4e8e\u5c01\u88c5 Mapper \u63a5\u53e3\uff0c\u63d0\u4f9b\u7edf\u4e00\u7684 CRUD \u65b9\u6cd5\u3002<br>    ServiceImpl \u7c7b\uff0c\u5b9e\u73b0 Service \u63a5\u53e3\uff0c\u8c03\u7528 Mapper \u63a5\u53e3\u8fdb\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>3.\u4f7f\u7528\u5dee\u5f02\uff1a<br>      MyBatis \u9700\u8981\u624b\u52a8\u7f16\u5199 SQL \u8bed\u53e5\u548c\u7ed3\u679c\u6620\u5c04\uff0c\u4f46\u63d0\u4f9b\u4e86\u9ad8\u5ea6\u7684\u5b9a\u5236\u5316\u80fd\u529b\u3002MyBatis \u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u6c42\u7075\u6d3b\u7f16\u5199 SQL \u8bed\u53e5\uff0c\u4f46\u7f3a\u70b9\u662f\u7f16\u5199\u6620\u5c04\u6587\u4ef6\u548c\u624b\u52a8\u8bbe\u7f6e\u53c2\u6570\u6bd4\u8f83\u7e41\u7410\u3002<br>      MyBatisPlus \u63d0\u4f9b\u4e86\u4e00\u5957\u901a\u7528\u7684 CRUD \u64cd\u4f5c\u63a5\u53e3\uff0c\u81ea\u52a8\u751f\u6210 SQL \u8bed\u53e5\u3002MyBatisPlus \u7684\u4f18\u70b9\u662f\u7b80\u5316\u4e86 MyBatis \u7684\u5f00\u53d1\uff0c\u63d0\u9ad8\u4e86\u5f00\u53d1\u6548\u7387\uff0c\u4f46\u7f3a\u70b9\u662f\u5b9a\u5236\u5316\u80fd\u529b\u8f83\u5dee\uff0c\u5bf9\u4e8e\u590d\u6742\u7684 SQL \u8bed\u53e5\u53ef\u80fd\u65e0\u6cd5\u6ee1\u8db3\u9700\u6c42\u3002<\/p>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\"><\/ol>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/blog.csdn.net\/superdangbo\/article\/details\/132812107<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u5e95\u5c42\u6846\u67b6\uff1a MyBatis \u662f\u4e00\u4e2a\u6301\u4e45\u5c42\u6846\u67b6\uff0c\u5b83\u652f\u6301\u5b9a\u5236\u5316 SQL\u3001\u5b58\u50a8\u8fc7\u7a0b\u4ee5\u53ca\u9ad8\u7ea7\u6620\u5c04\u3002MyBatis  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4],"tags":[8],"class_list":["post-92","post","type-post","status-publish","format-standard","hentry","category-learn","category-4","tag-8"],"_links":{"self":[{"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/posts\/92","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":1,"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":93,"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/posts\/92\/revisions\/93"}],"wp:attachment":[{"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/uniquelu.cn\/index.php\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}