{"id":100963,"date":"2026-09-05T21:17:07","date_gmt":"2026-09-05T13:17:07","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/100963.html"},"modified":"2026-09-05T21:17:07","modified_gmt":"2026-09-05T13:17:07","slug":"%e4%ba%8c%e3%80%81mybatis-plus-%e6%a0%b8%e5%bf%83%e5%8a%9f%e8%83%bd%e4%b9%8b%e6%9d%a1%e4%bb%b6%e6%9e%84%e9%80%a0%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/100963.html","title":{"rendered":"\u4e8c\u3001Mybatis\u2014Plus \u6838\u5fc3\u529f\u80fd\u4e4b\u6761\u4ef6\u6784\u9020\u5668"},"content":{"rendered":"<p>\u6458\u8981&#xff1a;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e3b\u8981\u4ecb\u7ecdMyBatis-Plus\u6761\u4ef6\u6784\u9020\u5668&#xff0c;\u5305\u62ec\u5b9a\u4e49\u3001\u5e38\u89c1\u6784\u9020\u5668&#xff08;QueryWrapper\u3001UpdateWrapper\u3001LambdaQueryWrapper\u3001LambdaUpdateWrapper&#xff09;\u3001\u81ea\u5b9a\u4e49SQL\u3001\u793a\u4f8b&#xff0c;\u4ee5\u53ca\u4f7f\u7528\u5efa\u8bae.<\/p>\n<h2 id=\"%E4%B8%80%E3%80%81%E6%9D%A1%E4%BB%B6%E6%9E%84%E9%80%A0%E5%99%A8\">\u4e00\u3001\u5b9a\u4e49<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0MyBatis-Plus \u63d0\u4f9b\u4e86\u4e00\u5957\u5f3a\u5927\u7684\u6761\u4ef6\u6784\u9020\u5668&#xff08;Wrapper&#xff09;&#xff0c;\u7528\u4e8e\u6784\u5efa\u590d\u6742\u7684\u00a0\u6570\u636e\u5e93\u67e5\u8be2\u6761\u4ef6\u3002Wrapper \u7c7b\u5141\u8bb8\u5f00\u53d1\u8005\u4ee5\u94fe\u5f0f\u8c03\u7528\u7684\u65b9\u5f0f\u6784\u9020\u67e5\u8be2\u6761\u4ef6&#xff0c;\u65e0\u9700\u7f16\u5199\u7e41\u7410\u7684 SQL \u8bed\u53e5&#xff0c;\u4ece\u800c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u5e76\u51cf\u5c11 SQL \u6ce8\u5165\u7684\u98ce\u9669.<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Wrapper\u7c7b\u4e0b\u9762\u7684\u66f4\u591a\u64cd\u4f5c&#xff0c;\u8be6\u60c5\u89c1\u6761\u4ef6\u6784\u9020\u5668.<\/p>\n<h2>\u4e8c\u3001\u5e38\u89c1\u7684\u6784\u9020\u5668\u53ca\u5176\u529f\u80fd<\/h2>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"222\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260905131706-6a9c1652086e9.jpg\" width=\"468\" \/><\/p>\n<ul>\n<li>\n<p>AbstractWrapper&#xff1a;\u8fd9\u662f\u4e00\u4e2a<span style=\"color:#fe2c24\">\u62bd\u8c61\u57fa\u7c7b<\/span>&#xff0c;\u63d0\u4f9b\u4e86\u6240\u6709 Wrapper \u7c7b\u5171\u6709\u7684\u65b9\u6cd5\u548c\u5c5e\u6027\u3002\u5b83\u5b9a\u4e49\u4e86\u6761\u4ef6\u6784\u9020\u7684\u57fa\u672c\u903b\u8f91&#xff0c;\u5305\u62ec\u5b57\u6bb5&#xff08;column&#xff09;\u3001\u503c&#xff08;value&#xff09;\u3001\u64cd\u4f5c\u7b26&#xff08;condition&#xff09;\u7b49\u3002\u6240\u6709\u7684 QueryWrapper\u3001UpdateWrapper\u3001LambdaQueryWrapper \u548c LambdaUpdateWrapper \u90fd\u7ee7\u627f\u81ea AbstractWrapper.<\/p>\n<\/li>\n<li>\n<p>QueryWrapper&#xff1a;\u4e13\u95e8\u7528\u4e8e<span style=\"color:#fe2c24\">\u6784\u9020\u67e5\u8be2\u6761\u4ef6<\/span>&#xff0c;\u652f\u6301\u57fa\u672c\u7684\u7b49\u4e8e&#xff08;eq&#xff09;\u3001\u4e0d\u7b49\u4e8e&#xff08;ne&#xff09;\u3001\u5927\u4e8e&#xff08;gt&#xff09;\u3001\u5c0f\u4e8e&#xff08;lt&#xff09;\u7b49\u5404\u79cd\u5e38\u89c1\u64cd\u4f5c\u3002\u5b83\u5141\u8bb8\u4f60\u4ee5\u94fe\u5f0f\u8c03\u7528\u7684\u65b9\u5f0f\u6dfb\u52a0\u591a\u4e2a\u67e5\u8be2\u6761\u4ef6&#xff0c;\u5e76\u4e14\u53ef\u4ee5\u7ec4\u5408\u4f7f\u7528\u00a0and\u00a0\u548c\u00a0or\u00a0\u903b\u8f91.<\/p>\n<\/li>\n<li>\n<p>UpdateWrapper&#xff1a;\u7528\u4e8e<span style=\"color:#fe2c24\">\u6784\u9020\u66f4\u65b0\u6761\u4ef6<\/span>&#xff0c;\u53ef\u4ee5\u5728\u66f4\u65b0\u6570\u636e\u65f6\u6307\u5b9a\u6761\u4ef6\u3002\u4e0e QueryWrapper \u7c7b\u4f3c&#xff0c;\u5b83\u4e5f\u652f\u6301\u94fe\u5f0f\u8c03\u7528\u548c\u903b\u8f91\u7ec4\u5408\u3002\u4f7f\u7528 UpdateWrapper \u53ef\u4ee5\u5728\u4e0d\u521b\u5efa\u5b9e\u4f53\u5bf9\u8c61\u7684\u60c5\u51b5\u4e0b&#xff0c;\u76f4\u63a5\u8bbe\u7f6e\u66f4\u65b0\u5b57\u6bb5\u548c\u6761\u4ef6.<\/p>\n<\/li>\n<li>\n<p>LambdaQueryWrapper&#xff1a;\u8fd9\u662f\u4e00\u4e2a\u57fa\u4e8e Lambda \u8868\u8fbe\u5f0f\u7684<span style=\"color:#fe2c24\">\u67e5\u8be2\u6761\u4ef6\u6784\u9020\u5668<\/span>&#xff0c;\u5b83\u901a\u8fc7 Lambda \u8868\u8fbe\u5f0f\u6765\u5f15\u7528\u5b9e\u4f53\u7c7b\u7684\u5c5e\u6027&#xff0c;\u4ece\u800c\u907f\u514d\u4e86\u786c\u7f16\u7801\u5b57\u6bb5\u540d\u3002\u8fd9\u79cd\u65b9\u5f0f\u63d0\u9ad8\u4e86\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u53ef\u7ef4\u62a4\u6027&#xff0c;\u5c24\u5176\u662f\u5728\u5b57\u6bb5\u540d\u53ef\u80fd\u53d1\u751f\u53d8\u5316\u7684\u60c5\u51b5\u4e0b.<\/p>\n<\/li>\n<li>\n<p>LambdaUpdateWrapper&#xff1a;\u7c7b\u4f3c\u4e8e LambdaQueryWrapper&#xff0c;LambdaUpdateWrapper \u662f\u57fa\u4e8e Lambda \u8868\u8fbe\u5f0f\u7684<span style=\"color:#fe2c24\">\u66f4\u65b0\u6761\u4ef6\u6784\u9020\u5668<\/span>\u3002\u5b83\u5141\u8bb8\u4f60\u4f7f\u7528 Lambda \u8868\u8fbe\u5f0f\u6765\u6307\u5b9a\u66f4\u65b0\u5b57\u6bb5\u548c\u6761\u4ef6&#xff0c;\u540c\u6837\u907f\u514d\u4e86\u786c\u7f16\u7801\u5b57\u6bb5\u540d\u7684\u95ee\u9898.<\/p>\n<\/li>\n<\/ul>\n<p>\u67e5\u8be2\u793a\u4f8b&#xff1a;<\/p>\n<p>\u95ee\u9898&#xff1a;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u67e5\u8be2\u4e00\u4e2a\u540d\u5b57\u5e26O\u7684&#xff0c;\u5b58\u6b3e\u5927\u4e8e\u7b49\u4e8e1000\u5143\u7684\u4eba\u7684id\u3001username\u3001info\u3001balance.<\/p>\n<hr \/>\n<p>SQL\u8bed\u53e5&#xff1a;<\/p>\n<p>SELECT id, username, info, balance FROM user WHERE username LIKE &#039;%O%&#039; AND balance &gt;&#061; 1000; <\/p>\n<p>Wrapper&#xff1a;<\/p>\n<p>&#064;Test<br \/>\nvoid QueryWrapper(){<br \/>\n    \/\/1.\u6784\u5efa\u67e5\u8be2\u6761\u4ef6<br \/>\n    QueryWrapper&lt;User&gt; wrapper &#061; new QueryWrapper&lt;User&gt;()<br \/>\n            .select(&#034;id&#034;, &#034;username&#034;, &#034;info&#034;, &#034;balance&#034;)<br \/>\n            .like(&#034;username&#034;, &#034;o&#034;)<br \/>\n            .ge(&#034;balance&#034;, &#034;1000&#034;);<\/p>\n<p>    \/\/2.\u67e5\u8be2<br \/>\n    userMapper.selectList(wrapper);<br \/>\n} <\/p>\n<p>\u66f4\u65b0\u793a\u4f8b\u4e00&#xff1a;<\/p>\n<p>\u95ee\u9898&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u66f4\u65b0\u7528\u6237\u540d\u4e3ajack\u7684\u7528\u6237\u4f59\u989d\u4e3a200.<\/p>\n<hr \/>\n<p>SQL&#xff1a;<\/p>\n<p>UPDATE user SET balance &#061; 200 WHERE(username &#061; &#034;jack&#034;) <\/p>\n<p>Wrapper&#xff1a;<\/p>\n<p>&#064;Test<br \/>\nvoid testupdateByQueryWrapper(){<br \/>\n    \/\/1.\u8981\u66f4\u65b0\u7684\u6570\u636e<br \/>\n    User user &#061; new User();<br \/>\n    user.setBalance(200);<\/p>\n<p>    \/\/2.\u66f4\u65b0\u7684\u6761\u4ef6<br \/>\n    QueryWrapper&lt;User&gt; wrapper &#061; new QueryWrapper&lt;User&gt;().eq(&#034;username&#034;, &#034;jack&#034;);<\/p>\n<p>    \/\/3.\u6267\u884c\u66f4\u65b0<br \/>\n    userMapper.update(user, wrapper);<br \/>\n) <\/p>\n<p>\u66f4\u65b0\u793a\u4f8b\u4e8c&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u66f4\u65b0id\u4e3a1\u30012\u30014\u7528\u6237\u7684\u4f59\u989d&#xff0c;\u6263200\u4f59\u989d.<\/p>\n<p>\u4e0a\u9762\u662f\u76f4\u63a5\u66f4\u65b0\u6570\u636e&#xff0c;\u5728\u66f4\u65b0\u4e2d&#xff0c;\u8fd8\u6709\u53e6\u4e00\u4e2d\u662f\u57fa\u4e8e\u539f\u6765\u7684\u6570\u636e\u8fdb\u884c\u52a0\u51cf\u4e58\u9664\u7b49\u8fd0\u7b97.<\/p>\n<hr \/>\n<p>SQL&#xff1a;<\/p>\n<p>UPDATE user SET balance &#061; balance &#8211; 200 WHERE id in (1, 2, 4) <\/p>\n<p>Wrapper&#xff1a;<\/p>\n<p>&#064;Test<br \/>\nvoid testUpdateWrapper(){<br \/>\n    \/\/1\u3001\u6784\u9020ids<br \/>\n    List&lt;long&gt; ids &#061; List.of(1L, 2L, 4L);<\/p>\n<p>    \/\/2\u3001\u66f4\u65b0\u6761\u4ef6<br \/>\n    UpdateWrapper&lt;User&gt; wrapper &#061; new UpdateWrapper&lt;User&gt;()<br \/>\n            .setSql(&#034;balance &#061; balance &#8211; 200&#034;)<br \/>\n            .in(&#034;id&#034;, ids);<\/p>\n<p>    \/\/3\u3001\u6267\u884c\u66f4\u65b0<br \/>\n    userMapper.update(null,wrapper);<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u76ee\u524d\u5927\u591a\u4f1a\u9009\u62e9\u4f7f\u7528\u00a0AbstractLambdaWrapper \u7684\u5b50\u7c7b&#xff0c;\u907f\u514d\u786c\u6027\u7f16\u7801&#xff0c;\u540c\u65f6\u65b9\u4fbf\u8fc1\u79fb\u6570\u636e\u5e93\u800c\u4e0d\u4f1a\u4f7f\u7528\u51fa\u73b0\u95ee\u9898.<\/p>\n<p>\u4f7f\u7528\u793a\u4f8b&#xff08;\u67e5\u8be2\u4e3a\u4f8b&#xff0c;\u95ee\u9898\u4f9d\u65e7\u91c7\u7528\u4e0a\u8ff0&#xff09;&#xff1a;<\/p>\n<p>\u95ee\u9898&#xff1a;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u67e5\u8be2\u4e00\u4e2a\u540d\u5b57\u5e26O\u7684&#xff0c;\u5b58\u6b3e\u5927\u4e8e\u7b49\u4e8e1000\u5143\u7684\u4eba\u7684id\u3001username\u3001info\u3001balance.<\/p>\n<p>LambdaWrapper&#xff1a;<\/p>\n<p>&#064;Test<br \/>\nvoid LambdaQueryWrapper(){<br \/>\n    \/\/1.\u6784\u5efa\u67e5\u8be2\u6761\u4ef6<br \/>\n    LambdaQueryWrapper&lt;User&gt; wrapper &#061; new LambdaQueryWrapper&lt;User&gt;()<br \/>\n            .select(User::getId, User::getUsername, User::getInfo, User::getBalance)<br \/>\n            .like(User::getUsername, &#034;o&#034;)<br \/>\n            .ge(User::getBalance, &#034;1000&#034;);<\/p>\n<p>    \/\/2.\u67e5\u8be2<br \/>\n    userMapper.selectList(wrapper);<br \/>\n} <\/p>\n<p>\u00a0 \u7efc\u4e0a\u6240\u8ff0&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 1\u3001\u5c3d\u91cf\u4f7f\u7528AbstrctLambdaWrapper\u4e0b\u9762\u7684\u5b50\u7c7b&#xff0c;\u907f\u514d\u786c\u6027\u7f16\u7801.<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 2\u3001\u5173\u4e8eUpdateWrapper\u548cLambdaUpdateWrapper\u5e38\u5e38\u53ea\u5728SET\u8bed\u53e5\u7279\u6b8a\u7684\u65f6\u5019\u624d\u4f1a\u91c7\u7528<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 3\u3001\u5927\u90e8\u5206\u90fd\u662f\u4f7f\u7528QueryWrapper\u548cLambdaQueryWrapper\u8fdb\u884cselect\u3001delete\u3001update\u7684where\u6761\u4ef6\u90e8\u5206.<\/p>\n<h2>\u4e09\u3001\u81ea\u5b9a\u4e49SQL<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0MyBatis-Plus \u63d0\u4f9b\u4e86\u5f3a\u5927\u7684 Wrapper \u6761\u4ef6\u6784\u9020\u5668&#xff0c;\u5141\u8bb8\u5f00\u53d1\u8005\u81ea\u5b9a\u4e49 SQL \u8bed\u53e5&#xff0c;\u4ee5\u6ee1\u8db3\u66f4\u590d\u6742\u7684\u6570\u636e\u5e93\u67e5\u8be2\u9700\u6c42&#xff0c;\u7b80\u5355\u6765\u8bb2\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Wrapper\u6765\u6784\u9020\u590d\u6742\u7684Where\u6761\u4ef6&#xff0c;\u7136\u540e\u81ea\u5df1\u5728\u5b9a\u4e49SQL\u7684\u5269\u4e0b\u8bed\u53e5.<\/p>\n<p>\u4f7f\u7528\u539f\u56e0&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u65e2\u6ee1\u8db3\u4e0d\u5728\u4e1a\u52a1\u5c42\u8fdb\u884cSQL\u8bed\u53e5\u7684\u7f16\u5199&#xff0c;\u9075\u5b88\u4f01\u4e1a\u89c4\u8303\u3002\u53c8\u5c06Mybatis\u2014Plus\u7684Wrappe\u7c7b\u751f\u6210SQL\u8bed\u53e5\u7684\u4fbf\u6377\u6027.<\/p>\n<p>\u4f7f\u7528\u6b65\u9aa4&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 1\u3001\u57fa\u4e8eWrapper\u6784\u5efaWhere\u6761\u4ef6.<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 2\u3001\u5728mapper\u65b9\u6cd5\u53c2\u6570\u4e2d\u7528Param\u6ce8\u89e3\u58f0\u660ewrapper\u53d8\u91cf\u540d\u79f0&#xff0c;\u5fc5\u987b\u662few&#xff08;\u56fa\u5b9a\u5199\u6cd5&#xff09;.<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 3\u3001\u81ea\u5b9a\u4e49SQL\u8bed\u53e5&#xff0c;\u5e76\u4f7f\u7528Wrapper\u6761\u4ef6.<\/p>\n<p>\u793a\u4f8b&#xff1a;<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u5c06id\u5728\u6307\u5b9a\u8303\u56f4\u7684\u7528\u6237&#xff08;\u4f8b&#xff1a;1\u30012\u30014&#xff09;\u7684\u4f59\u989d\u6263\u51cf\u6307\u5b9a\u503c.<\/p>\n<p>SQL&#xff1a;<\/p>\n<p>&lt;update id&#061;&#034;updateBalanceByIds&#034;&gt;<br \/>\n    UPDATE user<br \/>\n    SET balance &#061; balance &#8211; #{amount}<br \/>\n    WHERE id IN<br \/>\n    &lt;foreach collection&#061;&#034;ids&#034; separator&#061;&#034;,&#034; item&#061;&#034;id&#034; open&#061;&#034;(&#034;close&#061;&#034;)&#034;&gt;<br \/>\n        #{id}<br \/>\n    &lt;\/foreach&gt;<br \/>\n&lt;\/update&gt; <\/p>\n<p>Wrapper &#043; \u81ea\u5b9a\u4e49SQL&#xff1a;<\/p>\n<p>1\u3001\u57fa\u4e8eWrapper\u6784\u5efaWhere\u6761\u4ef6<\/p>\n<p>    List&lt;Long&gt; ids &#061; List.of(1L, 2L, 4L);<br \/>\n    int amount &#061; 200;<br \/>\n    \/\/1\u3001\u6784\u5efa\u6761\u4ef6<br \/>\n    LambdaQueryWrapper&lt;User&gt; wrapper &#061; new LambdaQueryWrapper&lt;User&gt;().in(User::getIds, ids);<br \/>\n    \/\/2\u3001\u81ea\u5b9a\u4e49SQL\u65b9\u6cd5\u8c03\u7528<br \/>\n    userMapper.updateBalanceByIds(wrapper, amount); <\/p>\n<p>2\u3001\u5728mapper\u65b9\u6cd5\u53c2\u6570\u4e2d\u7528Param\u6ce8\u89e3\u58f0\u660ewrapper\u53d8\u91cf\u540d\u79f0&#xff0c;\u5fc5\u987b\u662few&#xff08;\u56fa\u5b9a\u5199\u6cd5&#xff09;<\/p>\n<p>    void updateBalanceByIds(&#064;Param(&#034;ew&#034;) LambdaQueryWrapper&lt;User&gt; wrapper, &#064;Param(&#034;amount&#034;) int amount); <\/p>\n<p>3\u3001\u81ea\u5b9a\u4e49SQL\u8bed\u53e5&#xff0c;\u5e76\u4f7f\u7528Wrapper\u6761\u4ef6<\/p>\n<p>&lt;update id&#061;&#034;updateBalanceByIds&#034;&gt;<br \/>\n    UPDATE user SET balance &#061; balance &#8211; #{amount} ${ew.customSqlSegment}<br \/>\n&lt;\/update&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6458\u8981&#xff1a; \u4e3b\u8981\u4ecb\u7ecdMyBatis-Plus\u6761\u4ef6\u6784\u9020\u5668&#xff0c;\u5305\u62ec\u5b9a\u4e49\u3001\u5e38\u89c1\u6784\u9020\u5668&#xff08;QueryWrapper\u3001UpdateWrapper\u3001LambdaQueryWrapper\u3001LambdaUpdateWrapper&#xff09;\u3001\u81ea\u5b9a\u4e49SQL\u3001\u793a\u4f8b&#xff0c;\u4ee5\u53ca\u4f7f\u7528\u5efa\u8bae.<br \/>\n\u4e00\u3001\u5b9a\u4e49 MyBatis-Plus \u63d0\u4f9b\u4e86\u4e00\u5957\u5f3a\u5927\u7684\u6761\u4ef6\u6784\u9020\u5668&#xff08;Wrapper&#xff09;&#xff0c;\u7528\u4e8e\u6784\u5efa\u590d\u6742\u7684\u00a0\u6570\u636e\u5e93\u67e5\u8be2\u6761\u4ef6\u3002Wrap<\/p>\n","protected":false},"author":2,"featured_media":100962,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1769,100],"topic":[],"class_list":["post-100963","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-mybatis","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4e8c\u3001Mybatis\u2014Plus \u6838\u5fc3\u529f\u80fd\u4e4b\u6761\u4ef6\u6784\u9020\u5668 - \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\/100963.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4e8c\u3001Mybatis\u2014Plus \u6838\u5fc3\u529f\u80fd\u4e4b\u6761\u4ef6\u6784\u9020\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6458\u8981&#xff1a; \u4e3b\u8981\u4ecb\u7ecdMyBatis-Plus\u6761\u4ef6\u6784\u9020\u5668&#xff0c;\u5305\u62ec\u5b9a\u4e49\u3001\u5e38\u89c1\u6784\u9020\u5668&#xff08;QueryWrapper\u3001UpdateWrapper\u3001LambdaQueryWrapper\u3001LambdaUpdateWrapper&#xff09;\u3001\u81ea\u5b9a\u4e49SQL\u3001\u793a\u4f8b&#xff0c;\u4ee5\u53ca\u4f7f\u7528\u5efa\u8bae. \u4e00\u3001\u5b9a\u4e49 MyBatis-Plus \u63d0\u4f9b\u4e86\u4e00\u5957\u5f3a\u5927\u7684\u6761\u4ef6\u6784\u9020\u5668&#xff08;Wrapper&#xff09;&#xff0c;\u7528\u4e8e\u6784\u5efa\u590d\u6742\u7684\u00a0\u6570\u636e\u5e93\u67e5\u8be2\u6761\u4ef6\u3002Wrap\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/100963.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-05T13:17:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260905131706-6a9c1652086e9.jpg\" \/>\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\/100963.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/100963.html\",\"name\":\"\u4e8c\u3001Mybatis\u2014Plus \u6838\u5fc3\u529f\u80fd\u4e4b\u6761\u4ef6\u6784\u9020\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-05T13:17:07+00:00\",\"dateModified\":\"2026-09-05T13:17:07+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/100963.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/100963.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/100963.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4e8c\u3001Mybatis\u2014Plus \u6838\u5fc3\u529f\u80fd\u4e4b\u6761\u4ef6\u6784\u9020\u5668\"}]},{\"@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":"\u4e8c\u3001Mybatis\u2014Plus \u6838\u5fc3\u529f\u80fd\u4e4b\u6761\u4ef6\u6784\u9020\u5668 - \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\/100963.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4e8c\u3001Mybatis\u2014Plus \u6838\u5fc3\u529f\u80fd\u4e4b\u6761\u4ef6\u6784\u9020\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6458\u8981&#xff1a; \u4e3b\u8981\u4ecb\u7ecdMyBatis-Plus\u6761\u4ef6\u6784\u9020\u5668&#xff0c;\u5305\u62ec\u5b9a\u4e49\u3001\u5e38\u89c1\u6784\u9020\u5668&#xff08;QueryWrapper\u3001UpdateWrapper\u3001LambdaQueryWrapper\u3001LambdaUpdateWrapper&#xff09;\u3001\u81ea\u5b9a\u4e49SQL\u3001\u793a\u4f8b&#xff0c;\u4ee5\u53ca\u4f7f\u7528\u5efa\u8bae. \u4e00\u3001\u5b9a\u4e49 MyBatis-Plus \u63d0\u4f9b\u4e86\u4e00\u5957\u5f3a\u5927\u7684\u6761\u4ef6\u6784\u9020\u5668&#xff08;Wrapper&#xff09;&#xff0c;\u7528\u4e8e\u6784\u5efa\u590d\u6742\u7684\u00a0\u6570\u636e\u5e93\u67e5\u8be2\u6761\u4ef6\u3002Wrap","og_url":"https:\/\/www.wsisp.com\/helps\/100963.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-05T13:17:07+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260905131706-6a9c1652086e9.jpg"}],"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\/100963.html","url":"https:\/\/www.wsisp.com\/helps\/100963.html","name":"\u4e8c\u3001Mybatis\u2014Plus \u6838\u5fc3\u529f\u80fd\u4e4b\u6761\u4ef6\u6784\u9020\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-05T13:17:07+00:00","dateModified":"2026-09-05T13:17:07+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/100963.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/100963.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/100963.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4e8c\u3001Mybatis\u2014Plus \u6838\u5fc3\u529f\u80fd\u4e4b\u6761\u4ef6\u6784\u9020\u5668"}]},{"@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\/100963","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=100963"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/100963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/100962"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=100963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=100963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=100963"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=100963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}