{"id":96477,"date":"2020-04-18T17:58:33","date_gmt":"2020-04-18T09:58:33","guid":{"rendered":"http:\/\/4563.org\/?p=96477"},"modified":"2020-04-18T17:58:33","modified_gmt":"2020-04-18T09:58:33","slug":"%e8%af%b7%e9%97%ae%e5%90%84%e4%bd%8d%e4%bb%8e%e6%95%b0%e6%8d%ae%e5%ba%93-select-%e6%8b%89%e5%88%b0%e7%a8%8b%e5%ba%8f%e5%86%85%e5%ad%98%e9%87%8c%e7%9a%84%e6%95%b0%e7%bb%84%ef%bc%8c%e5%a6%82%e4%bd%95","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=96477","title":{"rendered":"\u8bf7\u95ee\u5404\u4f4d\u4ece\u6570\u636e\u5e93 SELECT *\u62c9\u5230\u7a0b\u5e8f\u5185\u5b58\u91cc\u7684\u6570\u7ec4\uff0c\u5982\u4f55\u4fdd\u8bc1\u5220\u9664\u5143\u7d20\u7684\u65e0\u8bef\u548c\u9ad8\u6548\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u95ee\u5404\u4f4d\u4ece\u6570\u636e\u5e93 SELECT *\u62c9\u5230\u7a0b\u5e8f\u5185\u5b58\u91cc\u7684\u6570\u7ec4\uff0c\u5982\u4f55\u4fdd\u8bc1\u5220\u9664\u5143\u7d20\u7684\u65e0\u8bef\u548c\u9ad8\u6548\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Newyorkcity <\/span>  <span><i><\/i> 58<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6709\u4e00\u4e2a\u5b66\u751f\u8868\uff0c\u4e3b\u952e id \u662f int\uff0c\u5bf9\u5e94\u7684 java \u91cc\u7684\u6570\u636e\u5b9e\u4f53\u91cc\u7684 id \u6210\u5458\u53d8\u91cf\u4e5f\u662f int\u3002<\/p>\n<p>\u518d\u8fd9\u6837\u4e00\u4e2a mybatis \u63a5\u53e3<\/p>\n<pre><code>@Select(\"Select * from students\") List&lt;Student&gt; getAllStudents(); <\/code><\/pre>\n<p>\u7136\u540e\u7a0b\u5e8f\u5c31\u80fd\u901a\u8fc7\u8fd9\u4e2a\u65b9\u6cd5\u83b7\u5f97\u8fd9\u4e2a\u6570\u7ec4\uff0c\u5c31\u53eb\u5b83<code>studentList<\/code>\u5427\u3002\u3002<\/p>\n<p>\u73b0\u5728\u8981\u5b9e\u73b0\u54cd\u5e94\u524d\u7aef\u6309\u9000\u5b66\u6309\u94ae\uff0c\u9000\u5b66\u5bf9\u5e94\u5b66\u751f\u7684\u529f\u80fd\u3002\u4fee\u6539\u6570\u636e\u5e93\u662f\u5f88\u7b80\u5355\u7684\u3002\u4f46\u8c03\u6574\u7a0b\u5e8f\u5185\u5b58\u4e2d\u7684 studentList\uff0c\u5220\u9664\u5bf9\u5e94\u7684\u5b66\u751f\u8fd9\u4ef6\u4e8b\u4e0a\u6211\u6709\u70b9\u56f0\u60d1\uff0c\u60f3\u8bf7\u95ee\u5404\u4f4d\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u662f\u5982\u4f55\u505a\u7684\uff1f<\/p>\n<p>=======\u4ee5\u4e0b\u5185\u5bb9\u662f\u81ea\u5df1\u4e00\u4e9b\u60f3\u6cd5\uff0c\u4ee5\u514d\u4f38\u624b\u515a\u4e4b\u5acc=========<\/p>\n<p>\u7b2c\u4e00\u79cd\uff1a \u524d\u7aef\u8fd4\u56de\u7684\u5982\u679c\u662f Student.id \uff08\u5728\u6570\u636e\u5e93\u548c\u5b9e\u4f53\u5bf9\u8c61\u4e2d\u5747\u662f int \uff09\uff0c\u4e5f\u5c31\u662f\u6570\u636e\u5e93\u5b66\u751f\u8868\u4e2d\u7684\u4e3b\u952e\u5b57\u6bb5\u7684\u503c\uff0c\u7531\u4e8e\u4e4b\u524d\u53ef\u80fd\u5df2\u7ecf\u6709\u5220\u9664\u8fc7\uff08\u5373\u4e4b\u524d\u7684\u5220\u9664\u8ba9\u6570\u636e\u5e93\u4e2d\u7684\u4e3b\u952e\u5b57\u6bb5\u503c\u4e0d\u662f\u8fde\u7eed\u7684\uff09\uff0c\u6545\u76f4\u63a5<code>studentList.remove(id)<\/code>\u663e\u7136\u4e0d\u59a5\u3002<\/p>\n<p>\u90a3\u5e72\u8106\uff0c\u904d\u5386 studentList\uff0c\u6bd4\u8f83\u4e3b\u952e\u503c\uff0c\u76f4\u5230\u78b0\u5230\u5bf9\u7b49\u7684\u90a3\u4e2a\uff0c\u7136\u540e\u7528\u8fd9\u4e2a\u65f6\u5019\u8ba1\u6570\u5668<code>i<\/code>\u7684\u503c\u6765<code>studentList.remove(i)<\/code>\u3002<\/p>\n<p>\u7b2c\u4e8c\u79cd\uff1a \u4e0d\u771f\u6b63\u5730\u5728\u6570\u636e\u5e93\u4e2d\u5220\u9664\u8fd9\u6761\u8bb0\u5f55\uff0c\u800c\u662f\u6dfb\u52a0\u4e00\u4e2a<code>enable<\/code>\u4e4b\u7c7b\u529f\u80fd\u7684\u5b57\u6bb5\uff0c\u6240\u8c13\u7684\u5220\u9664\u53ea\u662f\u628a enable \u8bbe\u4e3a 0 \u6216\u8005 false\u3002<\/p>\n<p>\u4f46\u8fd9\u6837\u7684\u8bdd\uff0c\u968f\u7740\u8868\u6e10\u6e10\u589e\u5927\uff0c\u7279\u522b\u662f\u5176\u4e2d\u88ab\u5220\u6389\u7684\u8bb0\u5f55\u8d8a\u6765\u8d8a\u591a\uff0c\u7a0b\u5e8f\u5c31\u4e0d\u5f97\u4e0d\u5e26\u7740\u5927\u91cf\u65e0\u7528\u6570\u636e\u5728\u8dd1\u3002\u540c\u65f6\u8fd4\u56de\u7ed9\u524d\u7aef\u4ee5\u4f9b\u524d\u7aef\u5c55\u793a\u7684\u65f6\u5019\uff0c\u53d1\u8fc7\u53bb\u7684\u6570\u636e\u91cc\u8fd9\u79cd\u65e0\u6548\u7684\u8bb0\u5f55\u4e5f\u5f88\u591a\u3002<\/p>\n<p>\u7b2c\u4e09\u79cd\uff1a \u6570\u636e\u5e93\u91cc\u7684\u5220\u9664\u4ecd\u7136\u662f\u771f\u7684\u5220\u9664\uff0c\u4f46\u4e0d\u8ba9\u524d\u7aef\u8fd4\u56de Student.id \uff0c\u800c\u662f\u8ba9\u524d\u7aef\u5728\u5c55\u793a\u524d\u6839\u636e Student.id \u6392\u5e8f\uff0c\u7136\u540e\u6309\u4e0b\u6309\u94ae\u63d0\u4ea4\u4e0a\u6765\u7684\u6570\u636e\u4e0d\u662f student.id \uff0c\u800c\u662f student.index\uff0c\u4e5f\u5c31\u662f\u5bf9\u5e94\u7684 student \u5bf9\u8c61\u5728\u6570\u7ec4\u7684\u4f4d\u7f6e\u3002\u8fd9\u6837\u501f\u52a9\u6570\u7ec4\u7684\u6709\u5e8f\u6027\uff0c\u5c31\u80fd\u76f4\u63a5<code>studentList.remove(index)<\/code>\u4e86\u3002\u3002<\/p>\n<p>\u4f46\u8fd9\u4e2a\u65b9\u6cd5\u7684\u95ee\u9898\u5728\u4e8e\uff0c\u7f51\u9875\u5c55\u73b0\u7684\u6570\u636e\u5982\u679c\u662f\u65e7\u7684\uff0c\u5728\u8fd9\u4e2a\u65e7\u7684\u7f51\u9875\u4e0a\u8ba9\u4e00\u4e2a\u540c\u5b66\u9000\u5b66\u524d\uff0c\u522b\u7684\u7ba1\u7406\u5458\u5df2\u7ecf\u8ba9\u4e00\u4e2a\u540c\u5b66\u9000\u4e86\u5b66\uff0c\u90a3\u53ef\u80fd\u4f1a\u5bfc\u81f4\u8fd9\u6b21\u9000\u5b66\u9000\u4e86\u4e2a\u4e0d\u76f8\u5e72\u7684\u4eba\uff0c\u60f3\u60f3\u8fd8\u6709\u70b9\u725b\u903c\u3002\u3002\u3002\u90a3\u8fd9\u79cd\u95ee\u9898\u8981\u600e\u4e48\u89e3\u51b3\u5462\u3002\u3002<\/p>\n<p>\u8c22\u8c22<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"872640\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Raymon111111 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8ba9 id \u662f\u81ea\u589e\u7684, \u7528\u8fc7\u7684 id \u4e0d\u4f1a\u518d\u88ab\u7528, \u5c31\u4e0d\u4f1a\u51fa\u73b0\u90a3\u79cd\u5220\u9664-\u65b0\u589e-\u5220\u9664\u7684\u9519\u8bef\u573a\u666f<\/p>\n<p>\u662f\u4e0d\u662f\u8981\u771f\u7684\u5220\u9664? \u4e3a\u4e86\u9632\u6b62\u8868\u65e0\u9650\u589e\u957f, \u53ef\u4ee5\u8fd9\u4e48\u5e72. \u4f46\u662f\u4f60\u53ef\u4ee5\u7b97\u4e00\u4e0b\u7a76\u7adf\u4f1a\u6709\u591a\u5c11\u6570\u636e. \u5982\u679c\u4e0d\u662f\u7279\u522b\u591a, \u53ef\u4ee5\u76f4\u63a5\u7528 valid = 0\/1 \u53bb\u5224\u65ad\u662f\u4e0d\u662f\u88ab\u5220\u9664\u7684\u6570\u636e. \u5982\u679c\u5b9e\u5728\u9700\u8981, \u6700\u597d\u5f04\u4e00\u4e2a\u65b0\u7684\u8868\u8bb0\u5f55\u8fd9\u4e9b\u88ab\u5220\u9664\u7684\u6570\u636e, \u4ee5\u9632\u540e\u7eed\u60f3\u67e5\u800c\u6ca1\u6709\u67e5\u7684\u5730\u65b9<\/p>\n<p>\u67e5\u7684\u65f6\u5019\u592a\u591a\u600e\u4e48\u529e? \u5206\u9875, \u4e0d\u8981\u4e00\u6b21\u6027\u5168\u90e8\u62ff\u51fa\u6765.<\/p>\n<p>\u6700\u540e\u5bf9\u4e8e\u5b66\u751f\u8fd9\u79cd\u573a\u666f\u548c\u5177\u4f53\u7684\u4f8b\u5b50, \u53ef\u4ee5\u6709\u4e9b\u4f18\u5316\u53bb\u52a0\u901f\u67e5\u8be2(\u4e5f\u907f\u514d\u4e0a\u8ff0\u6570\u636e\u65e0\u9650\u589e\u957f\u5bfc\u81f4\u67e5\u8be2\u6162\u7684\u95ee\u9898), \u6bd4\u5982\u8868\u91cc\u53ef\u4ee5\u6709\u5165\u5b66\u65f6\u95f4, \u53bb\u62ff\u5728\u6821\u5b66\u751f\u65f6\u53ef\u4ee5\u62ff\u5165\u5b66\u65f6\u95f4\u5927\u4e8e\u67d0\u4e2a\u65f6\u95f4\u70b9\u7684\u90a3\u4e9b, \u8fd9\u6837\u5386\u53f2\u6570\u636e\u5c31\u4e0d\u4f1a\u5f71\u54cd\u67e5\u8be2\u4e86.<\/p>\n<p>\u81f3\u4e8e\u5927\u8868\u7684\u95ee\u9898, \u5b9a\u671f\u5f52\u6863\u6bd4\u5982\u5341\u5e74\u524d\u7684\u5b66\u751f\u5c31\u597d\u4e86.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"872641\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : registerrr <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5927\u54e5\u786c\u76d8\u4e0d\u503c\u94b1\u7684,\u73b0\u5728\u505a\u786c\u5220\u9664\u7684\u5f88\u5c11\u4e86\u5427.<br \/>\u786c\u5220\u9664\u91cd\u5efa\u7d22\u5f15,\u8fd8\u6d6a\u8d39\u6027\u80fd\u5462\u4f60\u4e0d\u4e5f\u5f97\u8003\u8651\u8003\u8651?                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"872642\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shenlanAZ <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3a\u5565\u8981\u8fd9\u4e48\u505a\uff1f<\/p>\n<p>\u4f60\u5220\u6389\u67d0\u4e2a\u6570\u636e\u4e4b\u540e\u9700\u8981\u5237\u65b0\u8868\u683c \u91cd\u65b0\u67e5\u8be2\u7684\u3002<\/p>\n<p>\u91cd\u8981\u7684\u6570\u636e\u662f\u8981\u505a\u5047\u5220\u9664\u7684\uff08 isDel \uff09\uff0c\u67e5\u8be2\u7684\u65f6\u5019\u5e26\u4e0a\u6761\u4ef6 and is_del = 0.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"872643\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kawowa <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6570\u636e\u5e93\u67e5\u8be2\u4e0d\u505a\u8fc7\u6ee4\u662f\u9519\u8bef\u7684\u505a\u6cd5\uff0c\u81f3\u5c11\u7684\u81f3\u5c11\u4e5f\u8981\u505a\u6570\u636e\u5e93\u5206\u9875\u67e5\u8be2<br \/>\u524d\u7aef\u8bf7\u6c42\uff1a<br \/>\u5206\u9875\u5927\u5c0f\uff0c\u5f53\u524d\u9875\u7801\uff0c\u641c\u7d22\u5173\u952e\u8bcd<br \/>\u540e\u7aef\u8fd4\u56de\uff1a<br \/>\u5f53\u524d\u9875\u7801\uff0c\u6570\u636e\u603b\u6570\uff0c\u5206\u9875\u5927\u5c0f\u7684 List                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"872644\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : EminemW <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u4e3a\u4ec0\u4e48\u4f1a\u6709\u8fd9\u79cd\u95ee\u9898\uff1f\u4f60\u5220\u6389\u4e00\u6761\u8bb0\u5f55\uff0c\u5c31\u91cd\u65b0\u67e5\u4e00\u904d\u554a\uff0c\u4e3a\u4ec0\u4e48\u8981\u4e00\u76f4\u7528\u90a3\u4e2a list                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"872645\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Newyorkcity <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Raymon111111 <br \/>@registerrr <br \/>@shenlanAZ <br \/>@kawowa <br \/>@EminemW <\/p>\n<p>\u611f\u8c22\u51e0\u4f4d\u89e3\u7b54\uff01                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"872646\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ipwx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             XYProblem                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"872647\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : msg7086 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             studentList.remove\uff0c\u627e\u5230\u4e3b\u952e\u5bf9\u5e94\u7684\u8bb0\u5f55\u5220\u9664\u5c31\u884c\u4e86\u3002<br \/>\u4f60\u4e00\u9875\u624d\u591a\u5c11\u6570\u636e\uff0c\u6211\u7b97\u4f60\u60f3\u4e0d\u5f00\u4e00\u9875\u653e\u4e00\u4e07\u4e2a\u5b66\u751f\u7684\u6570\u636e\u5427\uff0c\u4e00\u4e07\u6761\u8bb0\u5f55\u904d\u5386\u67e5\u8be2\u4e3b\u952e\u8981\u591a\u4e45\uff1f\u80fd\u7528\u5f97\u6389\u51e0\u6beb\u79d2\u5417\u3002<\/p>\n<p>\u5982\u679c\u771f\u4ecb\u610f\u8fd9\u51e0\u6beb\u79d2\uff0c\u90a3\u5c31\u5f00\u4e2a\u54c8\u5e0c\u8868\u505a\u7d22\u5f15\u5c31\u884c\u4e86\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u95ee\u5404\u4f4d\u4ece\u6570\u636e\u5e93 SELECT *&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/96477"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=96477"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/96477\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=96477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=96477"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=96477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}