{"id":7915,"date":"2024-11-14T10:36:59","date_gmt":"2024-11-14T02:36:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7915\/"},"modified":"2024-11-14T10:36:59","modified_gmt":"2024-11-14T02:36:59","slug":"%e5%a6%82%e4%bd%95%e6%9f%a5%e8%af%a2%e5%8c%85%e5%90%ab%e5%a4%9a%e4%b8%aa%e6%97%a5%e6%9c%9f%e5%80%bc%e7%9a%84%e5%ad%97%e6%ae%b5%ef%bc%8c%e5%b9%b6%e8%8e%b7%e5%8f%96%e5%9c%a8%e7%bb%99%e5%ae%9a%e6%97%b6","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7915\/","title":{"rendered":"\u5982\u4f55\u67e5\u8be2\u5305\u542b\u591a\u4e2a\u65e5\u671f\u503c\u7684\u5b57\u6bb5\uff0c\u5e76\u83b7\u53d6\u5728\u7ed9\u5b9a\u65f6\u95f4\u8303\u56f4\u5185\u7684\u6570\u636e\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173133037773228.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u67e5\u8be2\u5305\u542b\u591a\u4e2a\u65e5\u671f\u503c\u7684\u5b57\u6bb5\uff0c\u5e76\u83b7\u53d6\u5728\u7ed9\u5b9a\u65f6\u95f4\u8303\u56f4\u5185\u7684\u6570\u636e\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u67e5\u8be2\u5305\u542b\u591a\u4e2a\u65e5\u671f\u503c\u7684\u5b57\u6bb5\uff0c\u5e76\u83b7\u53d6\u5728\u7ed9\u5b9a\u65f6\u95f4\u8303\u56f4\u5185\u7684\u6570\u636e\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u540c\u65f6\u67e5\u8be2\u591a\u4e2a\u65e5\u671f\u503c\u7684\u540c\u4e2a\u5b57\u6bb5\u4ee5\u83b7\u53d6\u7279\u5b9a\u65f6\u95f4\u8303\u56f4\u7684\u6570\u636e\uff1f<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong><\/p>\n<p>\u5b57\u6bb5 realstarttime \u5305\u542b\u9017\u53f7\u5206\u9694\u7684\u591a\u4e2a\u65f6\u95f4\u503c\uff0c\u4f8b\u5982\uff1a2022-09-14 11:38:21,2022-09-14 18:00:00\u3002\u6211\u4eec\u9700\u8981\u6839\u636e\u7ed9\u5b9a\u7684\u65f6\u95f4\u8303\u56f4\u67e5\u8be2\u5177\u6709\u81f3\u5c11\u4e00\u4e2a realstarttime \u503c\u5728\u6b64\u8303\u56f4\u5185\u7684\u8bb0\u5f55\u3002<\/p>\n<p><strong>mybatis \u67e5\u8be2\uff08\u652f\u6301\u5355\u4e2a\u65f6\u95f4\u503c\uff09\uff1a<\/strong><\/p>\n<pre>&lt;select id=\"geteventplanbycodedatelimitsimple\" resultmap=\"eventplanrecordallmap\"&gt;\n    select\n        epr.*\n    from\n        event_plan_record epr\n    where\n        epr.realstarttime between #{startdate} and #{enddate}\n    order by epr.realstarttime desc limit #{page},#{count};\n&lt;\/select&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u4e3a\u4e86\u540c\u65f6\u67e5\u8be2\u591a\u4e2a\u65e5\u671f\u503c\uff0c\u6211\u4eec\u9700\u8981\u5c06 realstarttime \u5206\u5272\u6210\u5355\u72ec\u7684\u65e5\u671f\u503c\u5e76\u5224\u65ad\u5b83\u4eec\u4e0e\u6240\u7ed9\u65f6\u95f4\u8303\u56f4\u7684\u5173\u7cfb\u3002<\/p>\n<pre>select\n    epr.*\nfrom\n    event_plan_record epr\nwhere\n    substring_index('epr.realstarttime', ',', 1) between #{startdate} and #{enddate} \n    or substring_index('epr.realstarttime', ',', -1) between #{startdate} and #{enddate}\n    or #{startdate} between substring_index('epr.realstarttime', ',', 1) and substring_index('epr.realstarttime', ',', -1)\n    or #{enddate} between substring_index('epr.realstarttime', ',', 1) and substring_index('epr.realstarttime', ',', -1)\norder by epr.realstarttime desc limit #{page},#{count};<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u4f7f\u7528\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre>\/\/ \u5047\u8bbe startDate \u548c endDate \u5df2\u8d4b\u503c\nMap&lt;String, Object&gt; params = new HashMap&lt;&gt;();\nparams.put(\"startDate\", startDate);\nparams.put(\"endDate\", endDate);\nparams.put(\"page\", 0);\nparams.put(\"count\", 10);\n\nList&lt;EventPlanRecord&gt; result = sqlSession.selectList(\"getEventPlanByCodeDateLimit\", params);<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u67e5\u8be2\u51fa realstarttime \u5177\u6709\u81f3\u5c11\u4e00\u4e2a\u65f6\u95f4\u503c\u5728\u6b64\u65f6\u95f4\u8303\u56f4\u5185\u7684\u6240\u6709\u8bb0\u5f55\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u67e5\u8be2\u5305\u542b\u591a\u4e2a\u65e5\u671f\u503c\u7684\u5b57\u6bb5\uff0c\u5e76\u83b7\u53d6\u5728\u7ed9\u5b9a\u65f6\u95f4\u8303\u56f4\u5185\u7684\u6570\u636e\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u540c\u65f6\u67e5\u8be2\u591a\u4e2a\u65e5\u671f\u503c\u7684\u540c\u4e2a\u5b57\u6bb5\u4ee5\u83b7\u53d6\u7279\u5b9a\u65f6\u95f4\u8303\u56f4\u7684\u6570\u636e\uff1f \u95ee\u9898\uff1a \u5b57\u6bb5 realstarttime \u5305\u542b\u9017\u53f7\u5206\u9694\u7684\u591a\u4e2a\u65f6\u95f4\u503c\uff0c\u4f8b\u5982\uff1a2022-09-14 11:38:21,2022-09-14 18:00:00\u3002\u6211\u4eec\u9700\u8981\u6839\u636e\u7ed9\u5b9a\u7684\u65f6\u95f4\u8303\u56f4\u67e5\u8be2\u5177\u6709\u81f3\u5c11\u4e00\u4e2a realstarttime \u503c\u5728\u6b64\u8303\u56f4\u5185\u7684\u8bb0\u5f55\u3002 mybatis \u67e5\u8be2\uff08\u652f\u6301\u5355\u4e2a\u65f6\u95f4\u503c\uff09\uff1a &lt;select id=&#8221;geteventplanbycodedatelimitsimple&#8221; resultmap=&#8221;eventplanrecordallmap&#8221;&gt; select epr.* from event_plan_record epr where epr.realstarttime between #{startdate} and #{enddate} order by epr.realstarttime desc limit #{page},#{count}; &lt;\/select&gt; \u767b\u5f55\u540e\u590d\u5236 \u89e3\u51b3\u65b9\u6848\uff1a \u4e3a\u4e86\u540c\u65f6\u67e5\u8be2\u591a\u4e2a\u65e5\u671f\u503c\uff0c\u6211\u4eec\u9700\u8981\u5c06 realstarttime \u5206\u5272\u6210\u5355\u72ec\u7684\u65e5\u671f\u503c\u5e76\u5224\u65ad\u5b83\u4eec\u4e0e\u6240\u7ed9\u65f6\u95f4\u8303\u56f4\u7684\u5173\u7cfb\u3002 select epr.* from event_plan_record epr where substring_index(&#8216;epr.realstarttime&#8217;, &#8216;,&#8217;, 1) between #{startdate} and #{enddate} or substring_index(&#8216;epr.realstarttime&#8217;, &#8216;,&#8217;, -1) between [&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-7915","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7915","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=7915"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7915\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}