{"id":1472,"date":"2026-01-12T21:49:58","date_gmt":"2026-01-12T13:49:58","guid":{"rendered":"https:\/\/www.jumoon.top\/?p=1472"},"modified":"2026-01-12T21:49:58","modified_gmt":"2026-01-12T13:49:58","slug":"%e9%bc%8e%e6%8d%b7e10%e6%89%80%e6%9c%89%e6%9c%aa%e5%a4%b1%e6%95%88%e5%93%81%e5%8f%b7%e5%9f%ba%e6%9c%ac%e4%bf%a1%e6%81%af%e6%8d%a2%e7%ae%97%e5%85%b3%e7%b3%bb%e5%8f%8a%e6%9c%80%e5%90%8e%e4%b8%80","status":"publish","type":"post","link":"https:\/\/www.jumoon.top\/?p=1472","title":{"rendered":"\u9f0e\u6377E10\u6240\u6709\u672a\u5931\u6548\u54c1\u53f7\u57fa\u672c\u4fe1\u606f\u6362\u7b97\u5173\u7cfb\u53ca\u6700\u540e\u4e00\u6b21\u91c7\u8d2d\u65e5\u671f\u7b80\u8868"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select\nA.ITEM_CODE as \u54c1\u53f7,\nA.ITEM_NAME as \u54c1\u540d,\nA.ITEM_SPECIFICATION as \u89c4\u683c,\nE.FEATURE_GROUP_NAME as \u7fa4\u7ec4\u540d\u79f0,\ncase A.UNIT_MODE when 'S' then '\u5355\u4e00\u8ba1\u91cf' when 'D' then '\u53cc\u5b58\u8d27\u8ba1\u91cf' else '' end  as \u8ba1\u91cf\u4f53\u7cfb,\nCONVERT(varchar(10),L.CreateDate,121) AS \u6700\u540e\u4e00\u6b21\u91c7\u8d2d\u65e5\u671f,\nK.UNIT_NAME as \u91c7\u8d2d\u5355\u4f4d,\nC.UNIT_NAME as \u5e93\u5b58\u5355\u4f4d,\nB.QTY_BU AS \u5e93\u5b58\u5355\u4f4d\u6570\u91cf,\nD.UNIT_NAME as \u6362\u7b97\u5355\u4f4d,\nB.QTY_CBU  as \u6362\u7b97\u5355\u4f4d\u6570\u91cf,\nF.USER_NAME as \u521b\u5efa\u8005,\nCONVERT(varchar(10),A.CreateDate,121) as \u521b\u5efa\u65e5\u671f,\nG.USER_NAME as \u6700\u540e\u4fee\u6539\u8005,\nCONVERT(varchar(10),A.LastModifiedDate,121) as \u6700\u540e\u4fee\u6539\u65e5\u671f,\nH.USER_NAME as \u4fee\u6539\u8005,\nCONVERT(varchar(10),A.ModifiedDate,121) as \u4fee\u6539\u65e5\u671f,\nI.USER_NAME as \u5ba1\u6838\u4eba,\nCONVERT(varchar(10),A.ApproveDate,121) as \u5ba1\u6838\u65e5\u671f\n\nfrom ITEM A  --\u54c1\u53f7\u4e3b\u8868\nleft join ITEM_UNITS_CONVERSION B on A.ITEM_BUSINESS_ID=B.ITEM_BUSINESS_ID  --\u53cc\u5b58\u8d27\u8ba1\u91cf\u660e\u7ec6\nleft join UNIT C on B.BASE_UNIT_ID=C.UNIT_ID  --\u5355\u4f4d\u6863\u6848 \u5173\u8054 \u5e93\u5b58\u5355\u4f4d\nleft join UNIT D on B.CONVERSION_UNIT_ID=D.UNIT_ID  --\u5355\u4f4d\u6863\u6848 \u5173\u8054 \u6362\u7b97\u5355\u4f4d\nleft join FEATURE_GROUP E on A.FEATURE_GROUP_ID=E.FEATURE_GROUP_ID --\u54c1\u53f7\u7fa4\u7ec4\nleft join &#91;USER] F ON A.CreateBy = F.USER_ID --\u7528\u6237\u6863\u6848 \u5173\u8054 \u521b\u5efa\u4eba\nleft join &#91;USER] G ON A.LastModifiedBy = G.USER_ID --\u7528\u6237\u6863\u6848 \u5173\u8054 \u6700\u540e\u4fee\u6539\u4eba\nleft join &#91;USER] H ON A.ModifiedBy = H.USER_ID --\u7528\u6237\u6863\u6848 \u5173\u8054 \u4fee\u6539\u4eba\nleft join &#91;USER] I ON A.ApproveBy= I.USER_ID --\u7528\u6237\u6863\u6848 \u5173\u8054 \u5ba1\u6838\u4eba\nleft join ITEM_PURCHASE J on A.ITEM_BUSINESS_ID=J.ITEM_ID  --\u54c1\u53f7\u91c7\u8d2d\u660e\u7ec6\nleft join UNIT K on J.PUR_UNIT_ID=K.UNIT_ID  --\u5355\u4f4d\u6863\u6848 \u5173\u8054 \u91c7\u8d2d\u5355\u4f4d\nLEFT JOIN (\n  SELECT ITEM_CODE, CreateDate FROM (\n    SELECT C.ITEM_CODE, C.ITEM_NAME, C.ITEM_SPECIFICATION, B.CreateDate,ROW_NUMBER() OVER (PARTITION BY C.ITEM_CODE ORDER BY B.CreateDate DESC) AS rn\n    FROM PURCHASE_ORDER_D A LEFT JOIN PURCHASE_ORDER B ON A.PURCHASE_ORDER_ID = B.PURCHASE_ORDER_ID LEFT JOIN ITEM C ON A.ITEM_ID = C.ITEM_BUSINESS_ID) AS T WHERE T.rn = 1\n) AS L ON A.ITEM_CODE = L.ITEM_CODE\n\nWHERE A.ApproveStatus = 'Y'\nAND (\n    (A.UNIT_MODE = 'D' AND B.BASE_UNIT_ID &lt;> B.CONVERSION_UNIT_ID)\n    OR (A.UNIT_MODE = 'S' AND B.BASE_UNIT_ID = B.CONVERSION_UNIT_ID)\n)\n--\u542f\u7528\u8fc7\u53cc\u5b58\u8d27\u8ba1\u540e\u53f0\u4fee\u6539\u540e\u53ef\u80fd\u5373\u4f7f\u662f\u53d8\u6210\u5355\u4e00\u8ba1\u91cf\u540e\u53f0\u8fd8\u662f\u6709\u8bb0\u5f55\uff0c\u6240\u4ee5\u8981\u8fc7\u6ee4\u4e0b\nORDER BY A.CreateDate DESC<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[19],"tags":[],"class_list":["post-1472","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/posts\/1472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1472"}],"version-history":[{"count":1,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/posts\/1472\/revisions"}],"predecessor-version":[{"id":1473,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=\/wp\/v2\/posts\/1472\/revisions\/1473"}],"wp:attachment":[{"href":"https:\/\/www.jumoon.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jumoon.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}