{"id":63626,"date":"2026-01-22T06:56:28","date_gmt":"2026-01-21T22:56:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/63626.html"},"modified":"2026-01-22T06:56:28","modified_gmt":"2026-01-21T22:56:28","slug":"moosql%e7%b3%bb%e5%88%97%e6%95%99%e7%a8%8b%ef%bc%88%e4%ba%8c%ef%bc%89-sqlbuilder%e5%ae%8c%e6%95%b4%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/63626.html","title":{"rendered":"mooSQL\u7cfb\u5217\u6559\u7a0b\uff08\u4e8c\uff09\u2014\u2014SQLBuilder\u5b8c\u6574\u6559\u7a0b"},"content":{"rendered":"<h2>SQLBuilder \u5b8c\u6574\u6559\u7a0b<\/h2>\n<h3>\u76ee\u5f55<\/h3>\n<li>\u6982\u8ff0<\/li>\n<li>\u5feb\u901f\u5f00\u59cb<\/li>\n<li>SELECT \u67e5\u8be2\u8bed\u53e5<\/li>\n<li>WHERE \u6761\u4ef6\u6784\u5efa<\/li>\n<li>INSERT\/UPDATE\/DELETE \u64cd\u4f5c<\/li>\n<li>\u5206\u9875\u67e5\u8be2<\/li>\n<li>\u5b50\u67e5\u8be2\u4e0e\u8fde\u63a5<\/li>\n<li>UNION \u67e5\u8be2<\/li>\n<li>MERGE INTO \u8bed\u53e5<\/li>\n<li>CTE \u9012\u5f52\u67e5\u8be2<\/li>\n<li>\u67e5\u8be2\u7ed3\u679c\u8f6c\u6362<\/li>\n<li>\u9ad8\u7ea7\u7279\u6027<\/li>\n<li>\u6700\u4f73\u5b9e\u8df5<\/li>\n<hr \/>\n<h3>\u6982\u8ff0<\/h3>\n<p>SQLBuilder \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u94fe\u5f0f SQL \u6784\u5efa\u5668&#xff0c;\u91c7\u7528\u6d41\u7545\u7684 API \u8bbe\u8ba1&#xff0c;\u8ba9 SQL \u8bed\u53e5\u7684\u6784\u5efa\u53d8\u5f97\u7b80\u5355\u3001\u76f4\u89c2\u4e14\u5b89\u5168\u3002\u5b83\u652f\u6301\u53c2\u6570\u5316\u67e5\u8be2&#xff0c;\u6709\u6548\u9632\u6b62 SQL \u6ce8\u5165\u653b\u51fb&#xff0c;\u540c\u65f6\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u6765\u6ee1\u8db3\u5404\u79cd\u590d\u6742\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u9700\u6c42\u3002<\/p>\n<h4>\u6838\u5fc3\u7279\u6027<\/h4>\n<ul>\n<li>\u94fe\u5f0f\u8bed\u6cd5&#xff1a;\u6d41\u7545\u7684 API \u8bbe\u8ba1&#xff0c;\u4ee3\u7801\u53ef\u8bfb\u6027\u5f3a<\/li>\n<li>\u53c2\u6570\u5316\u67e5\u8be2&#xff1a;\u81ea\u52a8\u53c2\u6570\u5316&#xff0c;\u9632\u6b62 SQL \u6ce8\u5165<\/li>\n<li>\u4e0a\u4e0b\u6587\u7ba1\u7406&#xff1a;\u6bcf\u4e2a\u5b9e\u4f8b\u4ee3\u8868\u4e00\u4e2a SQL \u4e0a\u4e0b\u6587<\/li>\n<li>\u7c7b\u578b\u5b89\u5168&#xff1a;\u652f\u6301\u5f3a\u7c7b\u578b\u8f6c\u6362<\/li>\n<li>\u529f\u80fd\u4e30\u5bcc&#xff1a;\u652f\u6301 SELECT\u3001INSERT\u3001UPDATE\u3001DELETE\u3001MERGE INTO \u7b49\u64cd\u4f5c<\/li>\n<li>\u590d\u6742\u67e5\u8be2&#xff1a;\u652f\u6301\u5b50\u67e5\u8be2\u3001UNION\u3001CTE \u9012\u5f52\u7b49\u9ad8\u7ea7\u7279\u6027<\/li>\n<\/ul>\n<h4>\u91cd\u8981\u63d0\u793a<\/h4>\n<p>::: warning \u4e0a\u4e0b\u6587\u7ba1\u7406 \u7531\u4e8e SQLBuilder \u91c7\u7528\u94fe\u5f0f\u8bed\u6cd5&#xff0c;\u57fa\u4e8e\u4e0a\u4e0b\u6587\u6700\u7ec8\u521b\u5efa\u6216\u6267\u884c SQL \u8bed\u53e5&#xff0c;\u56e0\u6b64\u5f53\u7ed3\u675f\u4e00\u6bb5 SQL&#xff0c;\u91cd\u65b0\u5f00\u59cb\u53e6\u5916\u4e00\u6bb5 SQL \u7684\u7f16\u5199\u65f6&#xff0c;\u9700\u8981\u6267\u884c clear() \u65b9\u6cd5\u3002<\/p>\n<p>\u6ce8\u610f&#xff1a;<\/p>\n<ul>\n<li>\u5728 update\/insert\/delete \u7b49\u8bed\u53e5\u6267\u884c\u540e&#xff0c;\u4f1a\u81ea\u52a8\u6e05\u7a7a\u4e0a\u4e0b\u6587<\/li>\n<li>select \u8bed\u53e5\u4e0d\u4f1a\u81ea\u52a8\u6e05\u7a7a&#xff0c;\u56e0\u6b64\u591a\u6b21\u67e5\u8be2\u5fc5\u987b\u624b\u52a8\u8c03\u7528 clear()<\/li>\n<li>\u4e00\u4e2a SQLBuilder \u7c7b\u7684\u5b9e\u4f8b\u4ee3\u8868\u4e00\u4e2a\u4e0a\u4e0b\u6587&#xff0c;\u4e0d\u80fd\u540c\u65f6\u5bf9\u4e00\u4e2a\u5b9e\u4f8b\u7f16\u7ec7\u4e0d\u540c\u7684 SQL :::<\/li>\n<\/ul>\n<hr \/>\n<h3>\u5feb\u901f\u5f00\u59cb<\/h3>\n<h4>\u83b7\u53d6 SQLBuilder \u5b9e\u4f8b<\/h4>\n<p>\u901a\u5e38\u901a\u8fc7 DBCash \u5de5\u5382\u7c7b\u83b7\u53d6 SQLBuilder \u5b9e\u4f8b&#xff1a;<\/p>\n<p>var kit &#061; DBCash.newKit(0);  \/\/ 0 \u8868\u793a\u6570\u636e\u5e93\u7d22\u5f15<\/p>\n<h4>\u6700\u7b80\u5355\u7684\u67e5\u8be2\u793a\u4f8b<\/h4>\n<p>var dt &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n    .query();<\/p>\n<p>\u8fd9\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u5c55\u793a\u4e86 SQLBuilder \u7684\u57fa\u672c\u7528\u6cd5&#xff1a;<\/p>\n<ul>\n<li>select() \u6307\u5b9a\u67e5\u8be2\u7684\u5217<\/li>\n<li>from() \u6307\u5b9a\u6570\u636e\u6e90<\/li>\n<li>where() \u6dfb\u52a0\u67e5\u8be2\u6761\u4ef6<\/li>\n<li>query() \u6267\u884c\u67e5\u8be2\u5e76\u8fd4\u56de DataTable<\/li>\n<\/ul>\n<hr \/>\n<h3>SELECT \u67e5\u8be2\u8bed\u53e5<\/h3>\n<h4>select() \u65b9\u6cd5<\/h4>\n<p>select() \u65b9\u6cd5\u7528\u4e8e\u521b\u5efa SELECT \u8bed\u53e5\u540e\u9762\u8ddf\u968f\u7684\u5217\u4fe1\u606f\u3002\u8c03\u7528\u591a\u6b21\u65f6&#xff0c;\u4f1a\u81ea\u52a8\u7528\u9017\u53f7\u62fc\u63a5\u3002\u4e3a\u7a7a\u65f6&#xff0c;\u81ea\u52a8\u4e3a *\u3002<\/p>\n<p>\/\/ \u67e5\u8be2\u6240\u6709\u5217<br \/>\nvar dt &#061; kit.select()<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .query();<\/p>\n<p>\/\/ \u67e5\u8be2\u6307\u5b9a\u5217<br \/>\nvar dt &#061; kit.select(&#034;Id&#034;, &#034;Name&#034;, &#034;Email&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .query();<\/p>\n<p>\/\/ \u591a\u6b21\u8c03\u7528\u4f1a\u81ea\u52a8\u62fc\u63a5<br \/>\nvar dt &#061; kit.select(&#034;Id&#034;)<br \/>\n    .select(&#034;Name&#034;)<br \/>\n    .select(&#034;Email&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .query();<br \/>\n\/\/ \u751f\u6210\u7684 SQL: SELECT Id, Name, Email FROM Users<\/p>\n<h4>distinct() \u65b9\u6cd5<\/h4>\n<p>distinct() \u65b9\u6cd5\u4ee3\u8868 SQL \u7684 DISTINCT \u5173\u952e\u5b57&#xff0c;\u7528\u4e8e\u53bb\u9664\u91cd\u590d\u8bb0\u5f55\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;Name&#034;)<br \/>\n    .distinct()<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .query();<br \/>\n\/\/ \u751f\u6210\u7684 SQL: SELECT DISTINCT Name FROM Users<\/p>\n<h4>top() \u65b9\u6cd5<\/h4>\n<p>top() \u65b9\u6cd5\u7528\u4e8e\u53d6\u524d n \u6761\u6570\u636e\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;Id&#034;, &#034;Name&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .orderby(&#034;CreateTime desc&#034;)<br \/>\n    .top(10)<br \/>\n    .query();<br \/>\n\/\/ \u751f\u6210\u7684 SQL: SELECT TOP 10 Id, Name FROM Users ORDER BY CreateTime desc<\/p>\n<h4>from() \u65b9\u6cd5<\/h4>\n<p>from() \u65b9\u6cd5\u7528\u4e8e\u521b\u5efa FROM \u8bed\u53e5\u8ddf\u968f\u7684\u8868\u5b9a\u4e49\u90e8\u5206&#xff0c;\u53ef\u4ee5\u662f\u8868\u3001\u8fde\u63a5\u8bed\u53e5\u3001\u5b50\u67e5\u8be2\u7b49\u3002<\/p>\n<h5>\u57fa\u672c\u7528\u6cd5<\/h5>\n<p>\/\/ \u5355\u8868\u67e5\u8be2<br \/>\nvar dt &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .query();<\/p>\n<p>\/\/ \u591a\u8868\u8fde\u63a5<br \/>\nvar dt &#061; kit.select(&#034;u.Name&#034;, &#034;o.OrgName&#034;)<br \/>\n    .from(&#034;Users u left join Organizations o on u.OrgId &#061; o.Id&#034;)<br \/>\n    .query();<\/p>\n<h5>\u8fde\u7eed from \u7684\u7528\u6cd5<\/h5>\n<p>\u8fde\u7eed\u8c03\u7528 from() \u65f6&#xff0c;\u591a\u4e2a from \u5b57\u7b26\u4e32\u4e4b\u95f4\u4f1a\u7528\u9017\u53f7\u8fde\u63a5&#xff0c;\u5f62\u6210 SELECT FROM table a, table b \u8fd9\u6837\u7684\u683c\u5f0f\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;a.Name&#034;, &#034;b.Title&#034;)<br \/>\n    .from(&#034;Users a&#034;)<br \/>\n    .from(&#034;Posts b&#034;)<br \/>\n    .where(&#034;a.Id &#061; b.UserId&#034;)<br \/>\n    .query();<\/p>\n<h5>from \u5b50\u67e5\u8be2<\/h5>\n<p>from() \u65b9\u6cd5\u652f\u6301\u5b50\u67e5\u8be2&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u59d4\u6258\u6765\u6784\u5efa\u5b50\u67e5\u8be2&#xff1a;<\/p>\n<p>int cc &#061; kit<br \/>\n    .from(&#034;a&#034;, (d) &#061;&gt; {<br \/>\n        d.select(&#034;d.IsFocused&#034;, &#034;r.RiskId&#034;)<br \/>\n        .from(&#034;DealRecords d join RiskInfo r on d.RiskIssueId &#061; r.Id&#034;);<br \/>\n    })<br \/>\n    .join(&#034;join DangerInfo g on a.RiskId&#061;g.SourceRiskId&#034;)<br \/>\n    .where(&#034;a.Index&#061;1&#034;)<br \/>\n    .where(&#034;g.DangerType&#061;&#039;2&#039;&#034;)<br \/>\n    .setTable(&#034;g&#034;)<br \/>\n    .set(&#034;DangerLevel&#034;, &#034;(case when a.IsFocused&#061;&#039;1&#039; then &#039;3&#039; else &#039;1&#039; end) &#034;, false)<br \/>\n    .doUpdate();<\/p>\n<h4>join() \u65b9\u6cd5<\/h4>\n<p>join() \u65b9\u6cd5\u7528\u4e8e\u6dfb\u52a0\u8fde\u63a5\u8bed\u53e5\u3002\u6ce8\u610f&#xff0c;join() \u65b9\u6cd5\u4e0d\u4f1a\u81ea\u52a8\u62fc\u63a5\u4efb\u4f55 left join \u8fd9\u6837\u7684\u524d\u7f00&#xff0c;\u9700\u8981\u81ea\u884c\u5199\u5b8c\u6574\u7684 join \u8fde\u63a5\u8bed\u53e5\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;u.Name&#034;, &#034;d.DeptName&#034;)<br \/>\n    .from(&#034;Users u&#034;)<br \/>\n    .join(&#034;left join Departments d on u.DeptId &#061; d.Id&#034;)<br \/>\n    .where(&#034;u.Status&#034;, &#034;1&#034;)<br \/>\n    .query();<\/p>\n<h4>orderby() \u65b9\u6cd5<\/h4>\n<p>orderby() \u65b9\u6cd5\u7528\u4e8e\u5b9a\u4e49\u6392\u5e8f\u90e8\u5206\u3002<\/p>\n<p>\/\/ \u5355\u5b57\u6bb5\u6392\u5e8f<br \/>\nvar dt &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .orderby(&#034;CreateTime desc&#034;)<br \/>\n    .query();<\/p>\n<p>\/\/ \u591a\u5b57\u6bb5\u6392\u5e8f&#xff08;\u591a\u6b21\u8c03\u7528&#xff09;<br \/>\nvar dt &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .orderby(&#034;Status&#034;)<br \/>\n    .orderby(&#034;CreateTime desc&#034;)<br \/>\n    .query();<\/p>\n<h4>groupBy() \u65b9\u6cd5<\/h4>\n<p>groupBy() \u65b9\u6cd5\u7528\u4e8e\u5b9a\u4e49\u5206\u7ec4\u90e8\u5206\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;DepartmentId&#034;, &#034;COUNT(*) as UserCount&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .groupBy(&#034;DepartmentId&#034;)<br \/>\n    .orderby(&#034;UserCount desc&#034;)<br \/>\n    .query();<\/p>\n<h4>having() \u65b9\u6cd5<\/h4>\n<p>having() \u65b9\u6cd5\u7528\u4e8e\u5b9a\u4e49\u5206\u7ec4\u7684\u6761\u4ef6\u90e8\u5206&#xff0c;\u901a\u5e38\u4e0e groupBy() \u4e00\u8d77\u4f7f\u7528\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;DepartmentId&#034;, &#034;COUNT(*) as UserCount&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .groupBy(&#034;DepartmentId&#034;)<br \/>\n    .having(&#034;COUNT(*) &gt; 10&#034;)<br \/>\n    .query();<\/p>\n<hr \/>\n<h3>WHERE \u6761\u4ef6\u6784\u5efa<\/h3>\n<p>WHERE \u6761\u4ef6\u662f SQLBuilder \u4e2d\u6700\u91cd\u8981\u548c\u6700\u7075\u6d3b\u7684\u90e8\u5206&#xff0c;\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u5f0f\u6765\u6784\u5efa\u67e5\u8be2\u6761\u4ef6\u3002<\/p>\n<h4>where() \u65b9\u6cd5\u7684\u57fa\u672c\u7528\u6cd5<\/h4>\n<p>where() \u65b9\u6cd5\u6709\u591a\u79cd\u91cd\u8f7d\u5f62\u5f0f&#xff0c;\u53ef\u4ee5\u6ee1\u8db3\u5404\u79cd\u67e5\u8be2\u9700\u6c42\u3002<\/p>\n<h5>1. \u56fa\u5b9a\u6761\u4ef6&#xff08;\u76f4\u63a5\u62fc\u63a5&#xff09;<\/h5>\n<p>kit.where(&#034;IsDeleted&#061;0&#034;)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE IsDeleted&#061;0<\/p>\n<p>::: warning \u5b89\u5168\u63d0\u793a \u76f4\u63a5\u62fc\u63a5\u5b57\u7b26\u4e32\u5b58\u5728 SQL \u6ce8\u5165\u98ce\u9669&#xff0c;\u5e94\u8c28\u614e\u4f7f\u7528&#xff0c;\u7279\u522b\u662f\u5f53\u6761\u4ef6\u4e2d\u5305\u542b\u7528\u6237\u8f93\u5165\u65f6\u3002 :::<\/p>\n<h5>2. \u53c2\u6570\u5316\u7b49\u4e8e\u6761\u4ef6<\/h5>\n<p>kit.where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE Status &#061; &#064;wh_01<br \/>\n\/\/ \u53c2\u6570 &#064;wh_01 \u7684\u503c\u4e3a &#034;1&#034;<\/p>\n<p>\u8fd9\u662f\u6700\u5e38\u7528\u548c\u6700\u5b89\u5168\u7684\u65b9\u5f0f&#xff0c;\u4f1a\u81ea\u52a8\u8fdb\u884c\u53c2\u6570\u5316\u5904\u7406\u3002<\/p>\n<h5>3. \u81ea\u5b9a\u4e49\u64cd\u4f5c\u7b26<\/h5>\n<p>\/\/ \u5927\u4e8e\u6761\u4ef6<br \/>\nkit.where(&#034;Age&#034;, 18, &#034;&gt;&#034;)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE Age &gt; &#064;wh_01<\/p>\n<p>\/\/ \u5c0f\u4e8e\u7b49\u4e8e\u6761\u4ef6<br \/>\nkit.where(&#034;CreateTime&#034;, DateTime.Now, &#034;&lt;&#061;&#034;)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE CreateTime &lt;&#061; &#064;wh_01<\/p>\n<p>\/\/ \u4e0d\u7b49\u4e8e\u6761\u4ef6<br \/>\nkit.where(&#034;Status&#034;, &#034;0&#034;, &#034;&lt;&gt;&#034;)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE Status &lt;&gt; &#064;wh_01<\/p>\n<h5>4. \u63a7\u5236\u53c2\u6570\u5316<\/h5>\n<p>\/\/ \u4f7f\u7528 SQL \u51fd\u6570&#xff0c;\u4e0d\u53c2\u6570\u5316<br \/>\nkit.where(&#034;CreateTime&#034;, &#034;getdate()&#034;, &#034;&gt;&#034;, false)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE CreateTime &gt; getdate()<\/p>\n<p>\/\/ \u53c2\u6570\u5316\u65b9\u5f0f<br \/>\nkit.where(&#034;CreateTime&#034;, DateTime.Now, &#034;&gt;&#034;, true)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE CreateTime &gt; &#064;wh_01<\/p>\n<h5>5. \u59d4\u6258\u6784\u5efa&#xff08;\u5d4c\u5957\u6761\u4ef6&#xff09;<\/h5>\n<p>\u4f7f\u7528\u59d4\u6258\u6765\u6784\u5efa\u590d\u6742\u7684\u5d4c\u5957\u6761\u4ef6&#xff0c;\u59d4\u6258\u5185\u7684\u6761\u4ef6\u4f1a\u81ea\u52a8\u7528\u62ec\u53f7\u5305\u88f9\u3002<\/p>\n<p>kit.where((w) &#061;&gt; {<br \/>\n    w.where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n     .where(&#034;Age&#034;, 18, &#034;&gt;&#061;&#034;);<br \/>\n})<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE (Status &#061; &#064;wh_01 AND Age &gt;&#061; &#064;wh_02)<\/p>\n<h4>whereIn() \u65b9\u6cd5<\/h4>\n<p>whereIn() \u65b9\u6cd5\u7528\u4e8e\u6784\u5efa WHERE field IN (value1, value2, &#8230;) \u6761\u4ef6\u3002<\/p>\n<p>var ids &#061; new List&lt;int&gt; { 1, 2, 3, 4, 5 };<br \/>\nkit.whereIn(&#034;UserId&#034;, ids)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE UserId IN (1, 2, 3, 4, 5)<\/p>\n<h5>whereIn \u7684\u667a\u80fd\u7279\u6027<\/h5>\n<p>whereIn() \u65b9\u6cd5\u5177\u6709\u4ee5\u4e0b\u667a\u80fd\u7279\u6027&#xff08;2024-6-21 \u66f4\u65b0&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\u53c2\u6570\u503c\u4e3a null \u65f6&#xff1a;\u5ffd\u7565\u672c\u6b21\u6761\u4ef6<\/li>\n<li>\u53c2\u6570\u503c\u4e3a\u6709\u6548\u96c6\u5408&#xff0c;\u4f46 Count &#061;&#061; 0&#xff1a;\u8f6c\u4e3a 1&#061;2 \u6761\u4ef6&#xff08;\u6c38\u8fdc\u4e0d\u6210\u7acb&#xff09;<\/li>\n<li>\u53c2\u6570\u503c\u4e3a\u6cdb\u578b\u96c6\u5408\u65f6&#xff1a;\n<ul>\n<li>\u6570\u503c\u578b\u6cdb\u578b&#xff08;int\/float\/double&#xff09;&#xff1a;\u62fc\u63a5\u4e3a WHERE IN (10,50,&#8230;) \u683c\u5f0f&#xff0c;\u4e0d\u53c2\u6570\u5316<\/li>\n<li>\u5176\u4ed6\u975e\u6570\u503c\u578b\u6cdb\u578b&#xff1a;\n<ul>\n<li>GUID \u4ee5\u53ca\u7531\u5b57\u6bcd\u3001\u6570\u503c\u3001\u4e0b\u5212\u7ebf\u7ec4\u6210\u7684\u7b80\u5355\u5b57\u7b26\u4e32&#xff1a;\u76f4\u63a5\u62fc\u63a5&#xff0c;\u4e0d\u53c2\u6570\u5316<\/li>\n<li>\u5176\u4ed6\u590d\u6742\u5b57\u7b26\u4e32&#xff08;\u542b\u7279\u6b8a\u5b57\u7b26\u6216\u6c49\u5b57&#xff09;&#xff1a;\u4e00\u5f8b\u53c2\u6570\u5316<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\/\/ \u6570\u503c\u578b&#xff0c;\u4e0d\u53c2\u6570\u5316<br \/>\nvar ids &#061; new List&lt;int&gt; { 1, 2, 3 };<br \/>\nkit.whereIn(&#034;UserId&#034;, ids)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE UserId IN (1, 2, 3)<\/p>\n<p>\/\/ \u5b57\u7b26\u4e32\u578b&#xff0c;\u7b80\u5355\u5b57\u7b26\u4e32\u4e0d\u53c2\u6570\u5316<br \/>\nvar codes &#061; new List&lt;string&gt; { &#034;A001&#034;, &#034;A002&#034;, &#034;A003&#034; };<br \/>\nkit.whereIn(&#034;Code&#034;, codes)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE Code IN (&#039;A001&#039;, &#039;A002&#039;, &#039;A003&#039;)<\/p>\n<p>\/\/ \u590d\u6742\u5b57\u7b26\u4e32&#xff0c;\u53c2\u6570\u5316<br \/>\nvar names &#061; new List&lt;string&gt; { &#034;\u5f20\u4e09&#034;, &#034;\u674e\u56db&#034;, &#034;\u738b\u4e94&#034; };<br \/>\nkit.whereIn(&#034;Name&#034;, names)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE Name IN (&#064;wh_01, &#064;wh_02, &#064;wh_03)<\/p>\n<p>::: warning \u53c2\u6570\u6570\u91cf\u9650\u5236 \u4e00\u4e2a SQL \u7684\u53c2\u6570\u5b58\u5728\u4e0a\u9650&#xff0c;SQL Server \u4e3a 2000\u3002\u5f53 whereIn \u7684\u53c2\u6570\u6570\u91cf\u8d85\u8fc7\u9650\u5236\u65f6&#xff0c;\u53ef\u80fd\u9700\u8981\u5206\u6279\u5904\u7406\u3002 :::<\/p>\n<h4>whereInGuid() \u65b9\u6cd5<\/h4>\n<p>whereInGuid() \u65b9\u6cd5\u4e13\u95e8\u7528\u4e8e GUID \u4e3b\u952e\u7684 WHERE IN \u6761\u4ef6&#xff0c;\u5fc5\u987b\u662f\u6709\u6548\u7684 GUID&#xff0c;\u5426\u5219\u6761\u4ef6\u5c06\u8f6c\u4e3a\u6c38\u8fdc\u4e0d\u6210\u7acb\u7684 1&#061;2\u3002<\/p>\n<p>var oids &#061; new List&lt;string&gt; {<br \/>\n    &#034;00000000-0000-0000-0000-000000000001&#034;,<br \/>\n    &#034;00000000-0000-0000-0000-000000000002&#034;<br \/>\n};<br \/>\nvar dt &#061; kit.clear()<br \/>\n    .select(&#034;*&#034;)<br \/>\n    .from(&#034;DangerInfo&#034;)<br \/>\n    .whereInGuid(&#034;SourceRiskId&#034;, oids)<br \/>\n    .query();<\/p>\n<h4>whereGuid() \u65b9\u6cd5<\/h4>\n<p>whereGuid() \u65b9\u6cd5\u7528\u4e8e GUID \u4e3b\u952e\u6761\u4ef6&#xff0c;\u81ea\u52a8\u8fdb\u884c GUID \u7684\u6b63\u5219\u6838\u9a8c&#xff0c;\u6838\u9a8c\u5931\u8d25\u65f6\u6761\u4ef6\u8f6c\u4e3a 1&#061;2\u3002<\/p>\n<p>var danger &#061; kit.select(&#034;d.*&#034;)<br \/>\n    .from(&#034;DangerInfo d&#034;)<br \/>\n    .whereGuid(&#034;DangerId&#034;, dangerId)<br \/>\n    .where(&#034;DangerType&#034;, &#034;4&#034;)<br \/>\n    .queryRow();<\/p>\n<h4>whereLike() \u65b9\u6cd5<\/h4>\n<p>whereLike() \u65b9\u6cd5\u7528\u4e8e\u6784\u5efa\u5168\u6a21\u7cca\u7684 LIKE \u67e5\u8be2&#xff0c;\u5373\u4e24\u4fa7 %%&#xff0c;\u4ea7\u751f WHERE field LIKE &#039;%value%&#039; \u683c\u5f0f\u7684\u6761\u4ef6\u3002<\/p>\n<p>kit.whereLike(&#034;Title&#034;, &#034;\u6d4b\u8bd5&#034;)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE Title LIKE &#039;%\u6d4b\u8bd5%&#039;<\/p>\n<h4>whereNotLike() \u65b9\u6cd5<\/h4>\n<p>whereNotLike() \u65b9\u6cd5\u7528\u4e8e\u6784\u5efa NOT LIKE \u6761\u4ef6\u3002<\/p>\n<p>kit.whereNotLike(&#034;Title&#034;, &#034;\u6d4b\u8bd5&#034;)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE Title NOT LIKE &#039;%\u6d4b\u8bd5%&#039;<\/p>\n<h4>whereExist() \u65b9\u6cd5<\/h4>\n<p>whereExist() \u65b9\u6cd5\u7528\u4e8e\u6784\u5efa WHERE EXISTS \u6761\u4ef6&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u5b57\u7b26\u4e32\u6216\u59d4\u6258\u3002<\/p>\n<p>\/\/ \u4f7f\u7528\u5b57\u7b26\u4e32<br \/>\nkit.whereExist(&#034;SELECT 1 FROM Orders WHERE Orders.UserId &#061; Users.Id&#034;)<\/p>\n<p>\/\/ \u4f7f\u7528\u59d4\u6258&#xff08;\u63a8\u8350&#xff09;<br \/>\nkit.whereExist((s) &#061;&gt; {<br \/>\n    s.select(&#034;1&#034;)<br \/>\n    .from(&#034;Orders o&#034;)<br \/>\n    .where(&#034;o.UserId &#061; Users.Id&#034;);<br \/>\n})<\/p>\n<h4>whereNotExist() \u65b9\u6cd5<\/h4>\n<p>whereNotExist() \u65b9\u6cd5\u7528\u4e8e\u6784\u5efa WHERE NOT EXISTS \u6761\u4ef6\u3002<\/p>\n<p>kit.whereNotExist((s) &#061;&gt; {<br \/>\n    s.select(&#034;1&#034;)<br \/>\n    .from(&#034;Orders o&#034;)<br \/>\n    .where(&#034;o.UserId &#061; Users.Id&#034;);<br \/>\n})<\/p>\n<h4>whereFormat() \u65b9\u6cd5<\/h4>\n<p>whereFormat() \u65b9\u6cd5\u4f7f\u7528\u5b57\u7b26\u4e32\u6a21\u677f\u8fdb\u884c\u683c\u5f0f\u5316&#xff0c;\u53c2\u6570\u653e\u5165\u5230 SQL \u53c2\u6570\u4e2d\u3002\u683c\u5f0f\u4e3a {0} {1} {2} \u7b49\u6807\u51c6\u5316\u7684 C# String.Format \u8bed\u6cd5\u3002<\/p>\n<p>kit.whereFormat(&#034;(a.field &#061; {0} OR b.field &#061; {1})&#034;, contactId, param2)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: WHERE (a.field &#061; &#064;wh_01 OR b.field &#061; &#064;wh_02)<\/p>\n<h4>\u590d\u6742\u6761\u4ef6\u6784\u5efa&#xff1a;sink() \u548c rise()<\/h4>\n<p>\u5bf9\u4e8e\u590d\u6742\u7684\u6761\u4ef6&#xff08;\u7efc\u5408\u591a\u4e2a AND\/OR&#xff09;&#xff0c;\u53ef\u4ee5\u4f7f\u7528 sink() \u548c rise() \u65b9\u6cd5\u6765\u7ba1\u7406\u6761\u4ef6\u5206\u7ec4\u3002<\/p>\n<ul>\n<li>sink()&#xff1a;\u5f00\u542f\u4e00\u4e2a\u65b0\u7684\u6761\u4ef6\u5206\u7ec4&#xff0c;\u6761\u4ef6\u4e4b\u95f4\u9ed8\u8ba4 AND \u8fde\u63a5&#xff0c;\u53ef\u4f20\u5165 \u201cOR\u201d \u53c2\u6570\u6539\u53d8\u8fde\u63a5<\/li>\n<li>sinkOR()&#xff1a;\u5f00\u542f\u4e00\u4e2a\u65b0\u7684\u6761\u4ef6\u5206\u7ec4&#xff0c;\u6761\u4ef6\u4e4b\u95f4 OR \u8fde\u63a5&#xff0c;\u662f sink(&#034;OR&#034;) \u7684\u5feb\u6377\u7248<\/li>\n<li>rise()&#xff1a;\u5173\u95ed\u5f53\u524d\u6761\u4ef6\u5206\u7ec4&#xff0c;\u56de\u5230\u4e0a\u4e00\u5c42\u6761\u4ef6\u5206\u7ec4<\/li>\n<\/ul>\n<h5>\u63a8\u8350\u5199\u6cd5 1&#xff1a;\u624b\u52a8\u5b9a\u4e49\u8fb9\u754c<\/h5>\n<p>kit.sinkOR()<br \/>\n    .whereLikeLeft(&#034;d.DeptCode&#034;, deptCode)<br \/>\n    .whereLikeLeft(&#034;j.DeptCode&#034;, deptCode)<br \/>\n    .rise();<\/p>\n<h5>\u63a8\u8350\u5199\u6cd5 2&#xff1a;\u51fd\u6570\u5f0f\u5199\u6cd5<\/h5>\n<p>kit.or((k) &#061;&gt; {<br \/>\n    k.where(&#034;IsPublic&#034;, &#034;1&#034;)<br \/>\n     .where(&#034;DeptId&#034;, orgId);<br \/>\n});<\/p>\n<h4>whereOR() \u65b9\u6cd5<\/h4>\n<p>whereOR() \u65b9\u6cd5\u7528\u4e8e\u6784\u5efa OR \u6761\u4ef6\u7ec4\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;l.LandId&#034;, &#034;d.ScheduleStatus&#034;)<br \/>\n    .from(&#034;LandSchedule d join LandInfo l on d.LandId&#061;l.LandId&#034;)<br \/>\n    .where(&#034;d.IsEnabled&#034;, &#034;1&#034;)<br \/>\n    .whereOR((k) &#061;&gt; {<br \/>\n        k.where(&#034;d.AccessLevel&#034;, &#034;1&#034;)  \/\/ \u5168\u516c\u5f00\u7684<br \/>\n        .whereIn(&#034;l.LandId&#034;, (u) &#061;&gt; {  \/\/ \u4f5c\u4e3a\u5de1\u67e5\u5458\u6307\u5b9a\u7684<br \/>\n            u.select(&#034;w.LandId&#034;)<br \/>\n            .from(&#034;LandWatcher w&#034;)<br \/>\n            .where(&#034;w.UserId&#034;, userManager.UserId)<br \/>\n            .where(&#034;w.IsEnabled&#034;, &#034;1&#034;);  \/\/ \u542f\u7528\u7684<br \/>\n        });<br \/>\n    })<br \/>\n    .query();<\/p>\n<h4>whereNotIn() \u65b9\u6cd5<\/h4>\n<p>whereNotIn() \u65b9\u6cd5\u7528\u4e8e\u6784\u5efa WHERE NOT IN \u6761\u4ef6&#xff0c;\u652f\u6301\u96c6\u5408\u6216\u5b50\u67e5\u8be2\u3002<\/p>\n<p>\/\/ \u4f7f\u7528\u96c6\u5408<br \/>\nvar excludeIds &#061; new List&lt;int&gt; { 1, 2, 3 };<br \/>\nkit.whereNotIn(&#034;UserId&#034;, excludeIds)<\/p>\n<p>\/\/ \u4f7f\u7528\u5b50\u67e5\u8be2<br \/>\nkit.whereNotIn(&#034;UserId&#034;, (s) &#061;&gt; {<br \/>\n    s.select(&#034;Id&#034;)<br \/>\n    .from(&#034;BlockedUsers&#034;);<br \/>\n})<\/p>\n<h4>\u81ea\u5b9a\u4e49\u590d\u6742 WHERE \u6761\u4ef6\u7684 4 \u79cd\u65b9\u5f0f<\/h4>\n<p>\u8981\u70b9&#xff1a;\u9694\u79bb SQL \u6ce8\u5165\u98ce\u9669\u3002<\/p>\n<h5>\u65b9\u5f0f 1&#xff1a;\u76f4\u63a5\u62fc\u63a5 &#043; \u6b63\u5219\u8fc7\u6ee4<\/h5>\n<p>param1 &#061; RegexUtils.SqlFilter(param1, false);<br \/>\nkit.where(&#034;a&#061;&#034; &#043; param1)<\/p>\n<h5>\u65b9\u5f0f 2&#xff1a;\u76f4\u63a5\u62fc\u63a5 &#043; \u624b\u52a8\u53c2\u6570\u5316<\/h5>\n<p>kit.where(&#034;TaskId in (select TaskId from TaskType c where c.TypeCode&#061;&#034; &#043;<br \/>\n    kit.addPara(&#034;code&#034;, typeCode) &#043; &#034;)&#034;)<\/p>\n<h5>\u65b9\u5f0f 3&#xff1a;\u4f7f\u7528 whereFormat<\/h5>\n<p>kit.whereFormat(&#034;TaskId in (select TaskId from TaskType c where c.TypeCode&#061;{0})&#034;, typeCode)<\/p>\n<h5>\u65b9\u5f0f 4&#xff1a;\u4f7f\u7528\u5b50\u67e5\u8be2\u7f16\u7ec7\u5668&#xff08;\u63a8\u8350&#xff09;<\/h5>\n<p>kit.whereIn(&#034;TaskId&#034;, (c) &#061;&gt; {<br \/>\n    c.select(&#034;TaskId&#034;)<br \/>\n    .from(&#034;TaskType c&#034;)<br \/>\n    .where(&#034;c.TypeCode&#034;, typeCode);<br \/>\n})<\/p>\n<hr \/>\n<h3>INSERT\/UPDATE\/DELETE \u64cd\u4f5c<\/h3>\n<h4>setTable() \u65b9\u6cd5<\/h4>\n<p>setTable() \u65b9\u6cd5\u7528\u4e8e\u8bbe\u7f6e INSERT\u3001UPDATE\u3001DELETE \u8bed\u53e5\u8981\u64cd\u4f5c\u7684\u76ee\u6807\u8868\u3002\u6839\u636e\u4e0a\u4e0b\u6587\u60c5\u51b5\u53ef\u4ee5\u662f\u8868\u540d\u6216\u8005\u522b\u540d\u3002<\/p>\n<p>kit.setTable(&#034;Users&#034;)<\/p>\n<h4>set() \u65b9\u6cd5<\/h4>\n<p>set() \u65b9\u6cd5\u7528\u4e8e\u8bbe\u7f6e\u5b57\u6bb5\u540d\u548c\u5bf9\u5e94\u7684\u503c\u3002\u5f53\u4f20\u5165 3 \u4e2a\u53c2\u6570\u65f6&#xff0c;\u6807\u8bc6\u662f\u5426\u53c2\u6570\u5316&#xff0c;\u9ed8\u8ba4\u4e3a\u53c2\u6570\u5316\u3002\u5f53\u9700\u8981\u624b\u52a8\u4f7f\u7528 SQL \u51fd\u6570\u6216\u5b50\u67e5\u8be2\u65f6&#xff0c;\u4f20 false\u3002<\/p>\n<p>\/\/ \u53c2\u6570\u5316\u65b9\u5f0f&#xff08;\u63a8\u8350&#xff09;<br \/>\nkit.set(&#034;Name&#034;, &#034;\u5f20\u4e09&#034;)<br \/>\nkit.set(&#034;Age&#034;, 25)<br \/>\nkit.set(&#034;CreateTime&#034;, DateTime.Now)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: SET Name &#061; &#064;sp_01, Age &#061; &#064;sp_02, CreateTime &#061; &#064;sp_03<\/p>\n<p>\/\/ \u975e\u53c2\u6570\u5316\u65b9\u5f0f&#xff08;\u4f7f\u7528 SQL \u51fd\u6570&#xff09;<br \/>\nkit.set(&#034;CreateTime&#034;, &#034;getdate()&#034;, false)<br \/>\n\/\/ \u751f\u6210\u7684 SQL: SET CreateTime &#061; getdate()<\/p>\n<p>\/\/ \u4f7f\u7528\u5b50\u67e5\u8be2<br \/>\nkit.set(&#034;TotalCount&#034;, &#034;(SELECT COUNT(*) FROM Orders WHERE Orders.UserId &#061; Users.Id)&#034;, false)<\/p>\n<h4>INSERT \u64cd\u4f5c<\/h4>\n<h5>\u57fa\u672c INSERT<\/h5>\n<p>int count &#061; kit.setTable(&#034;Users&#034;)<br \/>\n    .set(&#034;Id&#034;, IdHelper.NextId())<br \/>\n    .set(&#034;Name&#034;, &#034;\u5f20\u4e09&#034;)<br \/>\n    .set(&#034;Email&#034;, &#034;zhangsan&#064;example.com&#034;)<br \/>\n    .set(&#034;CreateTime&#034;, DateTime.Now)<br \/>\n    .doInsert();<\/p>\n<h5>\u6279\u91cf INSERT<\/h5>\n<p>\u4f7f\u7528 newRow() \u65b9\u6cd5\u53ef\u4ee5\u4e00\u6b21\u63d2\u5165\u591a\u7ec4\u503c\u3002<\/p>\n<p>kit.setTable(&#034;DeptWorker&#034;);<br \/>\nforeach (DataRow man in dt.Rows)<br \/>\n{<br \/>\n    kit.newRow()<br \/>\n        .set(&#034;DeptWorkerId&#034;, Guid.NewGuid())<br \/>\n        .set(&#034;OrgId&#034;, row.OrgId)<br \/>\n        .set(&#034;TaskFlag&#034;, &#034;1&#034;)<br \/>\n        .set(&#034;BelongFlag&#034;, &#034;1&#034;, false)<br \/>\n        .set(&#034;LastUpdated&#034;, DateTime.Now)<br \/>\n        .set(&#034;IsDeleted&#034;, &#034;0&#034;, false);<br \/>\n}<br \/>\nvar count &#061; kit.doInsert();<\/p>\n<p>::: tip \u6ce8\u610f\u4e8b\u9879 \u6bcf\u6b21\u8c03\u7528 newRow() \u4f1a\u5f00\u542f\u4e00\u7ec4\u65b0\u7684 set\u3002\u9700\u8fde\u7eed\u6267\u884c\u76f4\u5230 doInsert()&#xff0c;\u4e0d\u80fd\u4e2d\u65ad\u6267\u884c\u3002\u5982\u679c\u9700\u8981\u6df7\u7528 INSERT\/UPDATE&#xff0c;\u4f7f\u7528 batchSQL \u5904\u7406\u3002 :::<\/p>\n<h4>UPDATE \u64cd\u4f5c<\/h4>\n<h5>\u57fa\u672c UPDATE<\/h5>\n<p>int count &#061; kit.setTable(&#034;Users&#034;)<br \/>\n    .set(&#034;Name&#034;, &#034;\u674e\u56db&#034;)<br \/>\n    .set(&#034;UpdateTime&#034;, DateTime.Now)<br \/>\n    .where(&#034;Id&#034;, userId)<br \/>\n    .doUpdate();<\/p>\n<h5>UPDATE FROM \u8bed\u53e5<\/h5>\n<p>\u521b\u5efa\u5e76\u6267\u884c UPDATE FROM \u8bed\u53e5\u3002<\/p>\n<p>kit.set(&#034;ClassYear&#034;, &#034;2022&#034;)<br \/>\n    .set(&#034;EndTime&#034;, DateTime.Now)<br \/>\n    .set(&#034;TrainType&#034;, &#034;p.PostTrainType&#034;, false)<br \/>\n    .set(&#034;Days&#034;, &#034;p.PostDay&#034;, false)<br \/>\n    .setTable(&#034;c&#034;)<br \/>\n    .from(&#034;ClassInfo as c left join PostClass p on c.PostClassId&#061;p.PostClassId&#034;)<br \/>\n    .where(&#034;c.ClassId in (&#039;&#034; &#043; newClassIds &#043; &#034;&#039;)&#034;)<br \/>\n    .doUpdate();<\/p>\n<p>::: tip \u6570\u636e\u5e93\u5dee\u5f02 \u6ce8\u610f&#xff0c;SQL Server \u4e0b\u548c MySQL \u4e0b\u7684 UPDATE FROM \u8bed\u53e5\u7684\u8bed\u6cd5\u6709\u6240\u533a\u522b&#xff0c;\u56e0\u4e3a MySQL \u53ea\u652f\u6301\u5bf9 INNER JOIN \u8fdb\u884c\u66f4\u65b0&#xff0c;SQL Server \u5141\u8bb8\u4efb\u610f\u7684 JOIN\u3002 :::<\/p>\n<h4>DELETE \u64cd\u4f5c<\/h4>\n<p>int count &#061; kit.setTable(&#034;Users&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;0&#034;)<br \/>\n    .where(&#034;CreateTime&#034;, DateTime.Now.AddYears(-1), &#034;&lt;&#034;)<br \/>\n    .doDelete();<\/p>\n<h5>DELETE \u4e0e\u5b50\u67e5\u8be2<\/h5>\n<p>cc &#043;&#061; kit.setTable(&#034;WorkerScope&#034;)<br \/>\n    .where(&#034;SourceType&#034;, &#034;1&#034;)<br \/>\n    .where(&#034;WorkerId&#034;, &#034; not in&#034;, (ckit) &#061;&gt; {<br \/>\n        ckit.select(&#034;WorkerId&#034;)<br \/>\n            .from(&#034;Worker w&#034;)<br \/>\n            .where(&#034;( w.IsEnabled &#061; 1 and w.IsDeleted &#061; 0)&#034;);<br \/>\n    })<br \/>\n    .doDelete();<\/p>\n<hr \/>\n<h3>\u5206\u9875\u67e5\u8be2<\/h3>\n<h4>setPage() \u65b9\u6cd5<\/h4>\n<p>setPage() \u65b9\u6cd5\u7528\u4e8e\u8bbe\u7f6e\u7ffb\u9875\u53c2\u6570\u3002<\/p>\n<p>kit.setPage(10, 1)  \/\/ \u6bcf\u9875 10 \u6761&#xff0c;\u7b2c 1 \u9875<\/p>\n<h4>rowNumber() \u65b9\u6cd5<\/h4>\n<p>rowNumber() \u65b9\u6cd5\u662f\u884c\u53f7\u5f00\u7a97\u51fd\u6570&#xff0c;\u4e00\u822c\u7ed3\u5408\u5206\u9875\u4f7f\u7528\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;a.AreaId&#034;, &#034;a.CreatedTime&#034;)<br \/>\n    .from(&#034;DangerArea a&#034;)<br \/>\n    .where(&#034;(a.IsDeleted is null or a.IsDeleted&#061;0)&#034;)<br \/>\n    .setPage(pageSize, pageNum)<br \/>\n    .rowNumber(&#034;AreaIndex&#034;, &#034;rowm&#034;)<br \/>\n    .orderby(&#034;rowm asc&#034;)<br \/>\n    .query();<\/p>\n<p>::: tip \u7ffb\u9875\u67e5\u8be2\u6ce8\u610f\u4e8b\u9879 \u7ffb\u9875\u67e5\u8be2\u65f6&#xff0c;orderby \u6761\u4ef6\u5e94\u5199\u5165\u5230 rowNumber() \u65f6&#xff0c;\u6392\u5e8f\u6761\u4ef6\u624d\u4f1a\u88ab\u5e94\u7528\u5230\u5b50\u67e5\u8be2\u4e2d\u3002<\/p>\n<p>\u7ffb\u9875\u67e5\u8be2\u6784\u5efa\u4e86\u5f62\u5982&#xff1a;<\/p>\n<p><span class=\"token keyword\">WITH<\/span> tmp <span class=\"token keyword\">AS<\/span> <span class=\"token punctuation\">(<\/span><br \/>\n    <span class=\"token keyword\">SELECT<\/span> ROW_NUMBER<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">OVER<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">PARTITION<\/span> <span class=\"token keyword\">BY<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span> <span class=\"token keyword\">ORDER<\/span> <span class=\"token keyword\">BY<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">AS<\/span> rowm<span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><br \/>\n<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">SELECT<\/span> <span class=\"token operator\">*<\/span> <span class=\"token keyword\">FROM<\/span> tmp <span class=\"token keyword\">WHERE<\/span> rowm <span class=\"token operator\">&gt;<\/span> ${pageSize<span class=\"token operator\">*<\/span>pageNum} <span class=\"token keyword\">ORDER<\/span> <span class=\"token keyword\">BY<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><\/p>\n<p>\u56e0\u6b64&#xff0c;ORDER BY \u88ab\u653e\u7f6e\u5230\u4e86\u5916\u5c42&#xff0c;\u4f1a\u4ea7\u751f\u5f02\u4e8e\u975e\u7ffb\u9875\u67e5\u8be2\u7684\u7ed3\u679c\u3002 :::<\/p>\n<h4>queryPaged() \u65b9\u6cd5<\/h4>\n<p>queryPaged() \u65b9\u6cd5\u6267\u884c\u5206\u9875\u67e5\u8be2&#xff0c;\u5e76\u8fd4\u56de\u5206\u9875\u4fe1\u606f\u3002<\/p>\n<p>\/\/ \u8fd4\u56de PagedDataTable<br \/>\nPagedDataTable paged &#061; kit.queryPaged();<\/p>\n<p>\/\/ \u8fd4\u56de PageOutput&lt;T&gt;<br \/>\nPageOutput&lt;Task&gt; paged &#061; kit.queryPaged&lt;Task&gt;();<\/p>\n<hr \/>\n<h3>\u5b50\u67e5\u8be2\u4e0e\u8fde\u63a5<\/h3>\n<h4>\u5b50\u67e5\u8be2\u4f5c\u4e3a\u6570\u636e\u6e90<\/h4>\n<p>var dt &#061; kit.select(&#034;a.*&#034;)<br \/>\n    .from(&#034;a&#034;, (d) &#061;&gt; {<br \/>\n        d.select(&#034;d.IsFocused&#034;, &#034;r.RiskId&#034;)<br \/>\n        .from(&#034;DealRecords d join RiskInfo r on d.RiskIssueId &#061; r.Id&#034;);<br \/>\n    })<br \/>\n    .join(&#034;join DangerInfo g on a.RiskId&#061;g.SourceRiskId&#034;)<br \/>\n    .where(&#034;a.Index&#061;1&#034;)<br \/>\n    .query();<\/p>\n<h4>\u5b50\u67e5\u8be2\u4f5c\u4e3a\u6761\u4ef6<\/h4>\n<p>\/\/ WHERE IN \u5b50\u67e5\u8be2<br \/>\nkit.whereIn(&#034;UserId&#034;, (s) &#061;&gt; {<br \/>\n    s.select(&#034;Id&#034;)<br \/>\n    .from(&#034;ActiveUsers&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;1&#034;);<br \/>\n})<\/p>\n<p>\/\/ WHERE EXISTS \u5b50\u67e5\u8be2<br \/>\nkit.whereExist((s) &#061;&gt; {<br \/>\n    s.select(&#034;1&#034;)<br \/>\n    .from(&#034;Orders o&#034;)<br \/>\n    .where(&#034;o.UserId &#061; Users.Id&#034;);<br \/>\n})<\/p>\n<p>\/\/ WHERE NOT IN \u5b50\u67e5\u8be2<br \/>\nkit.where(&#034;WorkerId&#034;, &#034; not in&#034;, (ckit) &#061;&gt; {<br \/>\n    ckit.select(&#034;WorkerId&#034;)<br \/>\n    .from(&#034;Worker w&#034;)<br \/>\n    .where(&#034;( w.IsEnabled &#061; 1 and w.IsDeleted &#061; 0)&#034;);<br \/>\n})<\/p>\n<hr \/>\n<h3>UNION \u67e5\u8be2<\/h3>\n<h4>union() \u65b9\u6cd5<\/h4>\n<p>union() \u65b9\u6cd5\u7528\u4e8e\u5f00\u59cb\u4e00\u4e2a\u65b0\u7684 SELECT \u8bed\u53e5\u5206\u7ec4\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;&#039;\u5df2\u5b8c\u6210&#039; as status&#034;, &#034;count(*) as count&#034;)<br \/>\n    .from(&#034;Task&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;2&#034;)<br \/>\n    .where(&#034;TaskType&#034;, taskParam.type)<br \/>\n    .union()<br \/>\n    .select(&#034;&#039;\u8fdb\u884c\u4e2d&#039; as status&#034;, &#034;count(*) as count&#034;)<br \/>\n    .from(&#034;Task&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n    .where(&#034;TaskType&#034;, taskParam.type)<br \/>\n    .query();<\/p>\n<h4>unionAs() \u65b9\u6cd5<\/h4>\n<p>unionAs() \u65b9\u6cd5\u7528\u4e8e\u8bbe\u7f6e UNION \u8bed\u53e5\u5916\u5c42\u5305\u88f9\u540e AS \u7684\u5b50\u67e5\u8be2\u522b\u540d&#xff0c;\u662f\u5426\u4f7f\u7528 UNION ALL&#xff0c;\u662f\u5426\u5305\u88f9\u7b49\u3002<\/p>\n<p>var dt &#061; kit.select(&#034;&#039;\u5df2\u5b8c\u6210&#039; as status&#034;, &#034;count(*) as count&#034;)<br \/>\n    .from(&#034;Task&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;2&#034;)<br \/>\n    .union()<br \/>\n    .select(&#034;&#039;\u8fdb\u884c\u4e2d&#039; as status&#034;, &#034;count(*) as count&#034;)<br \/>\n    .from(&#034;Task&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n    .unionAs(wrapAsName: &#034;a&#034;, isUnionAll: false, wrapSelect: true)<br \/>\n    .selectUnioned(&#034;a.status&#034;, &#034;a.count&#034;)<br \/>\n    .query();<\/p>\n<p>::: tip UNION \u4e0e\u7ffb\u9875 union() \u548c\u7ffb\u9875\u540c\u65f6\u4f7f\u7528\u65f6&#xff0c;\u4f1a\u5148\u6267\u884c UNION \u7684\u8bed\u53e5\u7ec4\u88c5&#xff0c;\u6700\u540e\u6267\u884c\u7ffb\u9875\u7ec4\u88c5\u3002\u56e0\u6b64&#xff0c;\u9ed8\u8ba4\u60c5\u51b5\u4e0b UNION \u8bed\u53e5\u4f1a\u7f6e\u4e8e\u7ffb\u9875\u7684\u8868\u8868\u8fbe\u5f0f\u5185\u90e8&#xff0c;\u5373\u4f4d\u4e8e WITH AS \u8bed\u53e5\u4e2d\u3002 :::<\/p>\n<hr \/>\n<h3>MERGE INTO \u8bed\u53e5<\/h3>\n<p>MERGE INTO \u8bed\u53e5\u7528\u4e8e\u6839\u636e\u6e90\u8868\u7684\u6570\u636e\u5bf9\u76ee\u6807\u8868\u8fdb\u884c\u63d2\u5165\u6216\u66f4\u65b0\u64cd\u4f5c\u3002<\/p>\n<p>::: warning \u6570\u636e\u5e93\u652f\u6301 \u503c\u5f97\u6ce8\u610f\u7684\u662f&#xff0c;\u53ea\u6709 SQL Server \/ Oracle \u6570\u636e\u5e93\u539f\u751f\u652f\u6301\u5b8c\u6574\u7684 MERGE INTO \u8bed\u53e5\u3002 :::<\/p>\n<h4>\u57fa\u672c MERGE INTO<\/h4>\n<p>int count &#061; kit.setTable(&#034;SysRole&#034;)<br \/>\n    .from(&#034;Responsibility as r&#034;)<br \/>\n    .mergeOn(&#034;SysRole.Code&#061;r.RespCode&#034;)<br \/>\n    .set(&#034;Name&#034;, &#034;r.RespName&#034;, false)<br \/>\n    .set(&#034;Remark&#034;, &#034;r.Description&#034;, false)<br \/>\n    .set(&#034;OrderNo&#034;, &#034;r.[Level]&#034;, false)<br \/>\n    .set(&#034;DataScope&#034;, &#034;r.AccessType&#034;, false)<br \/>\n    .setI(&#034;Code&#034;, &#034;r.RespCode&#034;, false)  \/\/ setI \u7528\u4e8e INSERT \u65f6\u7684\u5b57\u6bb5<br \/>\n    .setI(&#034;TenantId&#034;, &#034;1300000000001&#034;)<br \/>\n    .setI(&#034;IsDeleted&#034;, &#034;0&#034;, false)<br \/>\n    .doMergeInto();<\/p>\n<h4>\u5e26 WHERE \u6761\u4ef6\u7684 MERGE INTO<\/h4>\n<p>\u5f53\u6765\u6e90\u8868\u5e26\u6709 WHERE \u6761\u4ef6\u65f6&#xff0c;\u9700\u8981\u81ea\u5b9a\u4e49\u6765\u6e90\u8868\u7684\u522b\u540d&#xff08;mergeAs&#xff09;&#xff0c;\u9ed8\u8ba4\u522b\u540d\u4e3a src\u3002<\/p>\n<p>var count &#061; kit.setTable(&#034;DangerInfo&#034;)<br \/>\n    .from(&#034;RiskInfo as a&#034;)<br \/>\n    .whereInGuid(&#034;a.RiskId&#034;, oids)<br \/>\n    .mergeAs(&#034;r&#034;)<br \/>\n    .mergeOn(&#034;DangerInfo.SourceRiskId&#061;r.RiskId&#034;)<br \/>\n    .setU(&#034;Title&#034;, &#034;r.IssueName&#034;, false)  \/\/ setU \u7528\u4e8e UPDATE \u65f6\u7684\u5b57\u6bb5<br \/>\n    .setU(&#034;DangerLevel&#034;, &#034;(case when r.IsFocused&#061;&#039;1&#039; then &#039;3&#039; else &#039;1&#039; end) &#034;, false)<br \/>\n    .doMergeInto();<\/p>\n<hr \/>\n<h3>CTE \u9012\u5f52\u67e5\u8be2<\/h3>\n<p>CTE&#xff08;Common Table Expression&#xff0c;\u516c\u7528\u8868\u8868\u8fbe\u5f0f&#xff09;\u9012\u5f52\u67e5\u8be2\u7528\u4e8e\u5904\u7406\u6811\u5f62\u7ed3\u6784\u6570\u636e\u3002<\/p>\n<h4>withRecurTo() \u65b9\u6cd5<\/h4>\n<p>\u521b\u5efa\u9012\u5f52 CTE \u8868\u8fbe\u5f0f\u3002<\/p>\n<p>::: warning \u4e0a\u4e0b\u6587\u5207\u6362 \u6ce8\u610f&#xff1a;withRecurTo() \u5c06\u5207\u6362\u5f53\u524d this \u5230\u9012\u5f52 CTE \u6784\u9020\u5668&#xff0c;\u76f4\u5230\u6267\u884c apply() \u8fd4\u56de SQLBuilder\u3002 :::<\/p>\n<p>var dt &#061; kit.withRecurTo(&#034;o&#034;)<br \/>\n    .select(commonFields)<br \/>\n    .selectDeep(&#034;Depth&#034;)<br \/>\n    .fromRoot(&#034;Organization&#034;)<br \/>\n    .joinOn(&#034;OrgId&#034;, &#034;ParentId&#034;)<br \/>\n    .whereRoot((r, cur) &#061;&gt; {<br \/>\n        r.where(cur.RootAs &#043; &#034;.OrgId&#034;, rootId);<br \/>\n    })<br \/>\n    .whereNext((n, cur) &#061;&gt; {<br \/>\n        n.where(cur.CTEJoinAs &#043; &#034;.Depth&lt;&#034; &#043; depth);<br \/>\n    })<br \/>\n    .apply()<br \/>\n    .select(&#034;*&#034;, &#034;(select COUNT(*) from Organization n where n.ParentId&#061;o.OrgId) as childCount&#034;)<br \/>\n    .from(&#034;o&#034;)<br \/>\n    .where(&#034;o.OrgId&#034;, rootId, &#034;&lt;&gt;&#034;)<br \/>\n    .query();<\/p>\n<p>\u4ee5\u4e0a\u8bed\u53e5\u7684\u542b\u4e49&#xff1a;<\/p>\n<ul>\n<li>\u8bbe\u7f6e WITH AS \u7684 CTE \u522b\u540d<\/li>\n<li>\u8bbe\u7f6e\u516c\u7528\u5b57\u6bb5&#xff0c;\u8bbe\u7f6e\u5c42\u6df1\u5b57\u6bb5\u540d&#xff0c;\u8bbe\u7f6e\u6839\u8868&#xff0c;\u8bbe\u7f6e\u540c\u6b65\u9012\u5f52\u7684\u5916\u952e\u5173\u7cfb<\/li>\n<li>\u8bbe\u7f6e\u6839\u8868\u7684 WHERE \u6761\u4ef6<\/li>\n<li>\u8bbe\u7f6e\u9012\u5f52\u8868\u7684 WHERE \u6761\u4ef6<\/li>\n<li>\u5e94\u7528\u5e76\u8fd4\u56de SQLBuilder \u7c7b<\/li>\n<\/ul>\n<hr \/>\n<h3>\u67e5\u8be2\u7ed3\u679c\u8f6c\u6362<\/h3>\n<h4>query() \u65b9\u6cd5<\/h4>\n<p>query() \u65b9\u6cd5\u6267\u884c\u67e5\u8be2&#xff0c;\u5e76\u8fd4\u56de\u4e00\u4e2a DataTable \u7c7b\u5b9e\u4f8b\u3002<\/p>\n<p>DataTable dt &#061; kit.query();<\/p>\n<h4>\u624b\u52a8\u8f6c\u6362\u67e5\u8be2\u7ed3\u679c<\/h4>\n<p>var tar &#061; kit.select(&#034;TableName&#034;, &#034;TableId&#034;, &#034;TableType&#034;, &#034;ModifyDate&#034;)<br \/>\n    .from(&#034;SystemTables&#034;)<br \/>\n    .where(&#034;TableType &#061; &#039;U&#039;&#034;)<br \/>\n    .orderby(&#034;TableName&#034;)<br \/>\n    .query((row) &#061;&gt; {<br \/>\n        return new TableOutput {<br \/>\n            ConfigId &#061; configId,<br \/>\n            EntityName &#061; row[&#034;TableName&#034;].ToString(),<br \/>\n            TableName &#061; row[&#034;TableName&#034;].ToString(),<br \/>\n            TableComment &#061; row[&#034;TableName&#034;].ToString()<br \/>\n        };<br \/>\n    });<\/p>\n<h4>\u81ea\u52a8\u8f6c\u6362\u4e3a\u5b9e\u4f53\u7c7b<\/h4>\n<p>var list &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n    .query&lt;Task&gt;();<\/p>\n<p>\u5c06\u81ea\u52a8\u4f7f\u7528\u7c7b\u578b\u8f6c\u6362\u5668&#xff0c;\u5c06\u67e5\u8be2\u7ed3\u679c\u8f6c\u6362\u4e3a\u7c7b\u578b\u7684\u96c6\u5408\u3002<\/p>\n<h4>queryRow() \u65b9\u6cd5<\/h4>\n<p>\u8fd4\u56de\u4e00\u884c\u6570\u636e&#xff0c;\u975e\u4e00\u884c\u5219\u4e3a null\u3002\u67e5\u8be2\u4e00\u884c\u65f6&#xff0c;\u7ed3\u679c\u5fc5\u987b\u4e3a\u4e00\u884c&#xff0c;\u5426\u5219\u8fd4\u56de Null\u3002<\/p>\n<p>var wsRow &#061; kit.clear()<br \/>\n    .select(&#034;SUM(m.TotalAmount) as totalOut&#034;, &#034;SUM(m.TotalUsage) as totalUsed&#034;)<br \/>\n    .from(&#034;WaterSource m&#034;)<br \/>\n    .where(&#034;m.Year&#034;, year)<br \/>\n    .queryRow();<\/p>\n<h4>queryRowValue() \u65b9\u6cd5<\/h4>\n<p>\u8fd4\u56de\u4e00\u884c\u4e00\u5217\u7684\u7ed3\u679c&#xff0c;\u975e\u4e00\u884c\u5219\u8fd4\u56de null\u3002<\/p>\n<p>var value &#061; kit.select(&#034;COUNT(*)&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .queryRowValue();<\/p>\n<h4>queryRowString() \u65b9\u6cd5<\/h4>\n<p>\u67e5\u8be2\u4e00\u884c\u4e00\u5217\u7684\u67d0\u4e2a\u503c\u3002\u4e0d\u5b58\u5728\u65f6\u8fd4\u56de\u9ed8\u8ba4\u503c\u3002<\/p>\n<p>var value &#061; kit.select(&#034;Name&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .where(&#034;Id&#034;, userId)<br \/>\n    .queryRowString(&#034;\u9ed8\u8ba4\u503c&#034;);<\/p>\n<h4>queryFirst() \u65b9\u6cd5<\/h4>\n<p>\u67e5\u8be2\u7ed3\u679c\u4e00\u884c\u8f6c\u5b9e\u4f53\u7c7b\u3002<\/p>\n<p>var user &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .where(&#034;Id&#034;, userId)<br \/>\n    .queryFirst&lt;User&gt;();<\/p>\n<h4>queryScalar() \u65b9\u6cd5<\/h4>\n<p>\u67e5\u8be2\u5355\u4e2a\u503c&#xff0c;\u5e76\u8f6c\u6362\u3002<\/p>\n<p>var count &#061; kit.select(&#034;COUNT(*)&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .queryScalar&lt;int&gt;();<\/p>\n<h4>count() \u65b9\u6cd5<\/h4>\n<p>\u8fd4\u56de\u67e5\u8be2\u7684\u884c\u6570&#xff0c;\u81ea\u52a8\u4f7f\u7528 SELECT COUNT(*) \u67e5\u8be2\u3002<\/p>\n<p>int count &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n    .count();<\/p>\n<hr \/>\n<h3>\u9ad8\u7ea7\u7279\u6027<\/h3>\n<h4>\u83b7\u53d6 SQL \u8bed\u53e5<\/h4>\n<p>\u4ee5\u4e0b\u65b9\u6cd5\u8f93\u51fa\u7ed3\u679c\u4e3a SQLCmd \u5bf9\u8c61&#xff0c;\u5305\u542b SQL \u6587\u672c\u3001\u53c2\u6570\u96c6\u5408\u3002<\/p>\n<h5>toSelect() \u65b9\u6cd5<\/h5>\n<p>var sqlCmd &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n    .toSelect();<br \/>\n\/\/ sqlCmd.SQL \u5305\u542b SQL \u6587\u672c<br \/>\n\/\/ sqlCmd.Params \u5305\u542b\u53c2\u6570\u96c6\u5408<\/p>\n<h5>toSelectCount() \u65b9\u6cd5<\/h5>\n<p>var sqlCmd &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n    .toSelectCount();<\/p>\n<h5>toUpdate() \u65b9\u6cd5<\/h5>\n<p>var sqlCmd &#061; kit.setTable(&#034;Users&#034;)<br \/>\n    .set(&#034;Name&#034;, &#034;\u5f20\u4e09&#034;)<br \/>\n    .where(&#034;Id&#034;, userId)<br \/>\n    .toUpdate();<\/p>\n<h5>toDelete() \u65b9\u6cd5<\/h5>\n<p>var sqlCmd &#061; kit.setTable(&#034;Users&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;0&#034;)<br \/>\n    .toDelete();<\/p>\n<h5>toMergeInto() \u65b9\u6cd5<\/h5>\n<p>var sqlCmd &#061; kit.setTable(&#034;TargetTable&#034;)<br \/>\n    .from(&#034;SourceTable&#034;)<br \/>\n    .mergeOn(&#034;TargetTable.Id &#061; SourceTable.Id&#034;)<br \/>\n    .toMergeInto();<\/p>\n<h4>exeQuery() \u65b9\u6cd5<\/h4>\n<p>\u6267\u884c\u4e00\u4e2a\u81ea\u5b9a\u4e49\u7684 SQL \u67e5\u8be2&#xff0c;\u501f\u7528 db \u5b9e\u4f8b\u6267\u884c\u3002<\/p>\n<p>var dt &#061; kit.exeQuery(&#034;SELECT * FROM Users WHERE Status &#061; &#064;status&#034;,<br \/>\n    new Paras { { &#034;&#064;status&#034;, &#034;1&#034; } });<\/p>\n<hr \/>\n<h3>\u6700\u4f73\u5b9e\u8df5<\/h3>\n<h4>1. \u4e0a\u4e0b\u6587\u7ba1\u7406<\/h4>\n<ul>\n<li>\u6bcf\u6b21\u5f00\u59cb\u65b0\u7684 SQL \u8bed\u53e5\u524d&#xff0c;\u8c03\u7528 clear() \u65b9\u6cd5<\/li>\n<li>SELECT \u67e5\u8be2\u4e0d\u4f1a\u81ea\u52a8\u6e05\u7a7a\u4e0a\u4e0b\u6587&#xff0c;\u9700\u8981\u624b\u52a8 clear()<\/li>\n<li>INSERT\/UPDATE\/DELETE \u6267\u884c\u540e\u4f1a\u81ea\u52a8\u6e05\u7a7a<\/li>\n<\/ul>\n<p>\/\/ \u9519\u8bef\u793a\u4f8b<br \/>\nvar dt1 &#061; kit.select(&#034;*&#034;).from(&#034;Table1&#034;).query();<br \/>\nvar dt2 &#061; kit.select(&#034;*&#034;).from(&#034;Table2&#034;).query();  \/\/ \u9519\u8bef&#xff01;\u4f1a\u5305\u542b Table1 \u7684\u4e0a\u4e0b\u6587<\/p>\n<p>\/\/ \u6b63\u786e\u793a\u4f8b<br \/>\nvar dt1 &#061; kit.select(&#034;*&#034;).from(&#034;Table1&#034;).query();<br \/>\nvar dt2 &#061; kit.clear().select(&#034;*&#034;).from(&#034;Table2&#034;).query();  \/\/ \u6b63\u786e<\/p>\n<h4>2. \u53c2\u6570\u5316\u67e5\u8be2<\/h4>\n<p>\u4f18\u5148\u4f7f\u7528\u53c2\u6570\u5316\u67e5\u8be2&#xff0c;\u9632\u6b62 SQL \u6ce8\u5165\u653b\u51fb\u3002<\/p>\n<p>\/\/ \u63a8\u8350&#xff1a;\u53c2\u6570\u5316<br \/>\nkit.where(&#034;Name&#034;, userName)<\/p>\n<p>\/\/ \u4e0d\u63a8\u8350&#xff1a;\u76f4\u63a5\u62fc\u63a5<br \/>\nkit.where(&#034;Name &#061; &#039;&#034; &#043; userName &#043; &#034;&#039;&#034;)<\/p>\n<h4>3. \u590d\u6742\u6761\u4ef6\u6784\u5efa<\/h4>\n<p>\u5bf9\u4e8e\u590d\u6742\u7684 AND\/OR \u6761\u4ef6&#xff0c;\u4f7f\u7528 sink()\/rise() \u6216\u59d4\u6258\u65b9\u5f0f\u3002<\/p>\n<p>\/\/ \u63a8\u8350&#xff1a;\u4f7f\u7528\u59d4\u6258<br \/>\nkit.where((w) &#061;&gt; {<br \/>\n    w.where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n     .or((o) &#061;&gt; {<br \/>\n         o.where(&#034;Type&#034;, &#034;A&#034;)<br \/>\n          .where(&#034;Type&#034;, &#034;B&#034;);<br \/>\n     });<br \/>\n})<\/p>\n<p>\/\/ \u4e0d\u63a8\u8350&#xff1a;\u76f4\u63a5\u62fc\u63a5\u590d\u6742\u5b57\u7b26\u4e32<br \/>\nkit.where(&#034;Status &#061; &#039;1&#039; AND (Type &#061; &#039;A&#039; OR Type &#061; &#039;B&#039;)&#034;)<\/p>\n<h4>4. \u6027\u80fd\u4f18\u5316<\/h4>\n<ul>\n<li>\u4f7f\u7528 top() \u9650\u5236\u8fd4\u56de\u8bb0\u5f55\u6570<\/li>\n<li>\u5408\u7406\u4f7f\u7528\u7d22\u5f15\u5b57\u6bb5\u4f5c\u4e3a WHERE \u6761\u4ef6<\/li>\n<li>\u907f\u514d\u5728 WHERE \u5b50\u53e5\u4e2d\u4f7f\u7528\u51fd\u6570<\/li>\n<li>\u5bf9\u4e8e\u5927\u91cf\u6570\u636e\u7684 whereIn&#xff0c;\u6ce8\u610f\u53c2\u6570\u6570\u91cf\u9650\u5236&#xff08;2000&#xff09;<\/li>\n<\/ul>\n<h4>5. \u4ee3\u7801\u53ef\u8bfb\u6027<\/h4>\n<ul>\n<li>\u4f7f\u7528\u94fe\u5f0f\u8c03\u7528&#xff0c;\u4fdd\u6301\u4ee3\u7801\u6d41\u7545<\/li>\n<li>\u5408\u7406\u6362\u884c&#xff0c;\u63d0\u9ad8\u53ef\u8bfb\u6027<\/li>\n<li>\u4f7f\u7528\u6709\u610f\u4e49\u7684\u53d8\u91cf\u540d<\/li>\n<\/ul>\n<p>\/\/ \u63a8\u8350&#xff1a;\u6e05\u6670\u6613\u8bfb<br \/>\nvar users &#061; kit.clear()<br \/>\n    .select(&#034;Id&#034;, &#034;Name&#034;, &#034;Email&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .where(&#034;Status&#034;, &#034;1&#034;)<br \/>\n    .where(&#034;CreateTime&#034;, DateTime.Now.AddYears(-1), &#034;&gt;&#034;)<br \/>\n    .orderby(&#034;CreateTime desc&#034;)<br \/>\n    .top(100)<br \/>\n    .query&lt;User&gt;();<\/p>\n<p>\/\/ \u4e0d\u63a8\u8350&#xff1a;\u96be\u4ee5\u9605\u8bfb<br \/>\nvar users &#061; kit.clear().select(&#034;Id&#034;,&#034;Name&#034;,&#034;Email&#034;).from(&#034;Users&#034;).where(&#034;Status&#034;,&#034;1&#034;).where(&#034;CreateTime&#034;,DateTime.Now.AddYears(-1),&#034;&gt;&#034;).orderby(&#034;CreateTime desc&#034;).top(100).query&lt;User&gt;();<\/p>\n<h4>6. \u9519\u8bef\u5904\u7406<\/h4>\n<ul>\n<li>\u5bf9\u4e8e\u53ef\u80fd\u8fd4\u56de null \u7684\u67e5\u8be2&#xff08;\u5982 queryRow()&#xff09;&#xff0c;\u8fdb\u884c null \u68c0\u67e5<\/li>\n<li>\u5bf9\u4e8e\u53ef\u80fd\u629b\u51fa\u5f02\u5e38\u7684\u6570\u636e\u5e93\u64cd\u4f5c&#xff0c;\u4f7f\u7528 try-catch<\/li>\n<\/ul>\n<p>var user &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .where(&#034;Id&#034;, userId)<br \/>\n    .queryRow();<\/p>\n<p>if (user !&#061; null) {<br \/>\n    \/\/ \u5904\u7406\u7528\u6237\u6570\u636e<br \/>\n} else {<br \/>\n    \/\/ \u7528\u6237\u4e0d\u5b58\u5728<br \/>\n}<\/p>\n<h4>7. \u4f7f\u7528\u7c7b\u578b\u8f6c\u6362<\/h4>\n<p>\u5145\u5206\u5229\u7528\u7c7b\u578b\u8f6c\u6362\u529f\u80fd&#xff0c;\u51cf\u5c11\u624b\u52a8\u6620\u5c04\u4ee3\u7801\u3002<\/p>\n<p>\/\/ \u63a8\u8350&#xff1a;\u81ea\u52a8\u8f6c\u6362<br \/>\nvar users &#061; kit.select(&#034;*&#034;)<br \/>\n    .from(&#034;Users&#034;)<br \/>\n    .query&lt;User&gt;();<\/p>\n<p>\/\/ \u4e0d\u63a8\u8350&#xff1a;\u624b\u52a8\u8f6c\u6362<br \/>\nvar dt &#061; kit.select(&#034;*&#034;).from(&#034;Users&#034;).query();<br \/>\nvar users &#061; new List&lt;User&gt;();<br \/>\nforeach (DataRow row in dt.Rows) {<br \/>\n    users.Add(new User {<br \/>\n        Id &#061; Convert.ToInt32(row[&#034;Id&#034;]),<br \/>\n        Name &#061; row[&#034;Name&#034;].ToString(),<br \/>\n        \/\/ &#8230;<br \/>\n    });<br \/>\n}<\/p>\n<hr \/>\n<h3>\u603b\u7ed3<\/h3>\n<p>SQLBuilder \u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u3001\u6613\u4e8e\u4f7f\u7528\u7684 SQL \u6784\u5efa\u5668&#xff0c;\u901a\u8fc7\u94fe\u5f0f\u8bed\u6cd5\u548c\u4e30\u5bcc\u7684 API&#xff0c;\u8ba9\u6570\u636e\u5e93\u64cd\u4f5c\u53d8\u5f97\u7b80\u5355\u3001\u5b89\u5168\u3001\u9ad8\u6548\u3002\u638c\u63e1 SQLBuilder \u7684\u4f7f\u7528&#xff0c;\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u5f00\u53d1\u6548\u7387&#xff0c;\u540c\u65f6\u4fdd\u8bc1\u4ee3\u7801\u7684\u5b89\u5168\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<p>\u672c\u6587\u6863\u6db5\u76d6\u4e86 SQLBuilder \u7684\u4e3b\u8981\u529f\u80fd\u548c\u4f7f\u7528\u65b9\u6cd5&#xff0c;\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>SELECT \u67e5\u8be2\u7684\u5404\u79cd\u7528\u6cd5<\/li>\n<li>WHERE \u6761\u4ef6\u7684\u591a\u79cd\u6784\u5efa\u65b9\u5f0f<\/li>\n<li>INSERT\/UPDATE\/DELETE \u64cd\u4f5c<\/li>\n<li>\u5206\u9875\u67e5\u8be2<\/li>\n<li>\u5b50\u67e5\u8be2\u548c\u8fde\u63a5<\/li>\n<li>UNION \u67e5\u8be2<\/li>\n<li>MERGE INTO \u8bed\u53e5<\/li>\n<li>CTE \u9012\u5f52\u67e5\u8be2<\/li>\n<li>\u67e5\u8be2\u7ed3\u679c\u8f6c\u6362<\/li>\n<li>\u6700\u4f73\u5b9e\u8df5<\/li>\n<\/ul>\n<p>\u5e0c\u671b\u672c\u6587\u6863\u80fd\u591f\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528 SQLBuilder&#xff0c;\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u53d1\u6325\u5176\u5f3a\u5927\u7684\u529f\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQLBuilder \u5b8c\u6574\u6559\u7a0b<br \/>\n\u76ee\u5f55<br \/>\n\u6982\u8ff0\u5feb\u901f\u5f00\u59cbSELECT \u67e5\u8be2\u8bed\u53e5WHERE \u6761\u4ef6\u6784\u5efaINSERT\/UPDATE\/DELETE \u64cd\u4f5c\u5206\u9875\u67e5\u8be2\u5b50\u67e5\u8be2\u4e0e\u8fde\u63a5UNION \u67e5\u8be2MERGE INTO \u8bed\u53e5CTE \u9012\u5f52\u67e5\u8be2\u67e5\u8be2\u7ed3\u679c\u8f6c\u6362\u9ad8\u7ea7\u7279\u6027\u6700\u4f73\u5b9e\u8df5 \u6982\u8ff0<br \/>\nSQLBuilder \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u94fe\u5f0f SQL \u6784\u5efa\u5668&#xff0c;\u91c7\u7528\u6d41\u7545\u7684 API \u8bbe\u8ba1&#xff0c;\u8ba9 SQL \u8bed\u53e5\u7684\u6784\u5efa\u53d8\u5f97\u7b80\u5355\u3001\u76f4\u89c2\u4e14\u5b89\u5168\u3002\u5b83\u652f\u6301\u53c2\u6570\u5316\u67e5\u8be2&#xff0c;\u6709\u6548\u9632\u6b62 SQL \u6ce8\u5165\u653b\u51fb&amp;#xff<\/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":[895,6712,55,100],"topic":[],"class_list":["post-63626","post","type-post","status-publish","format-standard","hentry","category-server","tag-net","tag-orm","tag-c","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>mooSQL\u7cfb\u5217\u6559\u7a0b\uff08\u4e8c\uff09\u2014\u2014SQLBuilder\u5b8c\u6574\u6559\u7a0b - \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\/63626.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"mooSQL\u7cfb\u5217\u6559\u7a0b\uff08\u4e8c\uff09\u2014\u2014SQLBuilder\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"SQLBuilder \u5b8c\u6574\u6559\u7a0b \u76ee\u5f55 \u6982\u8ff0\u5feb\u901f\u5f00\u59cbSELECT \u67e5\u8be2\u8bed\u53e5WHERE \u6761\u4ef6\u6784\u5efaINSERT\/UPDATE\/DELETE \u64cd\u4f5c\u5206\u9875\u67e5\u8be2\u5b50\u67e5\u8be2\u4e0e\u8fde\u63a5UNION \u67e5\u8be2MERGE INTO \u8bed\u53e5CTE \u9012\u5f52\u67e5\u8be2\u67e5\u8be2\u7ed3\u679c\u8f6c\u6362\u9ad8\u7ea7\u7279\u6027\u6700\u4f73\u5b9e\u8df5 \u6982\u8ff0 SQLBuilder \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u94fe\u5f0f SQL \u6784\u5efa\u5668&#xff0c;\u91c7\u7528\u6d41\u7545\u7684 API \u8bbe\u8ba1&#xff0c;\u8ba9 SQL \u8bed\u53e5\u7684\u6784\u5efa\u53d8\u5f97\u7b80\u5355\u3001\u76f4\u89c2\u4e14\u5b89\u5168\u3002\u5b83\u652f\u6301\u53c2\u6570\u5316\u67e5\u8be2&#xff0c;\u6709\u6548\u9632\u6b62 SQL \u6ce8\u5165\u653b\u51fb&amp;#xff\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/63626.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-21T22:56:28+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=\"11 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/63626.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/63626.html\",\"name\":\"mooSQL\u7cfb\u5217\u6559\u7a0b\uff08\u4e8c\uff09\u2014\u2014SQLBuilder\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-21T22:56:28+00:00\",\"dateModified\":\"2026-01-21T22:56:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/63626.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/63626.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/63626.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"mooSQL\u7cfb\u5217\u6559\u7a0b\uff08\u4e8c\uff09\u2014\u2014SQLBuilder\u5b8c\u6574\u6559\u7a0b\"}]},{\"@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":"mooSQL\u7cfb\u5217\u6559\u7a0b\uff08\u4e8c\uff09\u2014\u2014SQLBuilder\u5b8c\u6574\u6559\u7a0b - \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\/63626.html","og_locale":"zh_CN","og_type":"article","og_title":"mooSQL\u7cfb\u5217\u6559\u7a0b\uff08\u4e8c\uff09\u2014\u2014SQLBuilder\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"SQLBuilder \u5b8c\u6574\u6559\u7a0b \u76ee\u5f55 \u6982\u8ff0\u5feb\u901f\u5f00\u59cbSELECT \u67e5\u8be2\u8bed\u53e5WHERE \u6761\u4ef6\u6784\u5efaINSERT\/UPDATE\/DELETE \u64cd\u4f5c\u5206\u9875\u67e5\u8be2\u5b50\u67e5\u8be2\u4e0e\u8fde\u63a5UNION \u67e5\u8be2MERGE INTO \u8bed\u53e5CTE \u9012\u5f52\u67e5\u8be2\u67e5\u8be2\u7ed3\u679c\u8f6c\u6362\u9ad8\u7ea7\u7279\u6027\u6700\u4f73\u5b9e\u8df5 \u6982\u8ff0 SQLBuilder \u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u94fe\u5f0f SQL \u6784\u5efa\u5668&#xff0c;\u91c7\u7528\u6d41\u7545\u7684 API \u8bbe\u8ba1&#xff0c;\u8ba9 SQL \u8bed\u53e5\u7684\u6784\u5efa\u53d8\u5f97\u7b80\u5355\u3001\u76f4\u89c2\u4e14\u5b89\u5168\u3002\u5b83\u652f\u6301\u53c2\u6570\u5316\u67e5\u8be2&#xff0c;\u6709\u6548\u9632\u6b62 SQL \u6ce8\u5165\u653b\u51fb&amp;#xff","og_url":"https:\/\/www.wsisp.com\/helps\/63626.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-21T22:56:28+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"11 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/63626.html","url":"https:\/\/www.wsisp.com\/helps\/63626.html","name":"mooSQL\u7cfb\u5217\u6559\u7a0b\uff08\u4e8c\uff09\u2014\u2014SQLBuilder\u5b8c\u6574\u6559\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-21T22:56:28+00:00","dateModified":"2026-01-21T22:56:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/63626.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/63626.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/63626.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"mooSQL\u7cfb\u5217\u6559\u7a0b\uff08\u4e8c\uff09\u2014\u2014SQLBuilder\u5b8c\u6574\u6559\u7a0b"}]},{"@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\/63626","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=63626"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/63626\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=63626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=63626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=63626"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=63626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}