{"id":439,"date":"2017-11-30T15:07:34","date_gmt":"2017-11-30T07:07:34","guid":{"rendered":"http:\/\/luchanglong.com.cn\/?p=439"},"modified":"2017-11-30T15:08:52","modified_gmt":"2017-11-30T07:08:52","slug":"mysql-%e5%ad%98%e8%b4%ae%e8%bf%87%e7%a8%8b%e4%b8%ad%e4%bd%bf%e7%94%a8%e4%ba%8b%e5%8a%a1","status":"publish","type":"post","link":"https:\/\/blog.la998.com\/?p=439","title":{"rendered":"mysql \u5b58\u50a8\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u4e8b\u52a1"},"content":{"rendered":"<pre class=\"lang:default decode:true  \">DROP PROCEDURE IF EXISTS  repair_order_brokerage_pay;\r\nCREATE PROCEDURE repair_order_brokerage_pay()\r\n  BEGIN\r\n    DECLARE error INTEGER DEFAULT 0;\r\n    DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET error=1;\r\n\r\n    START TRANSACTION;\r\n\r\n    \/*******order_id=122*******\/\r\n    \/*\u4fee\u6539\u8ba2\u5355\u552e\u540e\u670d\u52a1\u72b6\u6001,\u4fee\u6539\u540e\u4f1a\u5728\u4e0b\u6b21\u5b9a\u65f6\u4efb\u52a1\u65f6\u81ea\u52a8\u53d1\u653e*\/\r\n    UPDATE `xm_orders` SET `is_service_over`='0' WHERE (`id`='122') LIMIT 1;\r\n    \/*\u5df2\u7ecf\u6267\u884c\u4e86\u9500\u91cf\u589e\u52a0\uff0c\u628a\u589e\u52a0\u7684\u9500\u91cf\u91cd\u65b0\u51cf\u53bb,\u65b0\u7248\u672c\u4ee3\u7801\u5c06\u4f1a\u4fee\u6539\u8fd9\u4e00\u505a\u6cd5\uff0c\u7528\u6237\u4e0d\u53d1\u5956\u52b1\u5c06\u4e0d\u4fee\u6539\u552e\u540e\u72b6\u6001\u548c\u9500\u91cf*\/\r\n    UPDATE `xm_goods` SET `sales_volume`=sales_volume-2 WHERE (`id`='17') LIMIT 1;\r\n    UPDATE `xm_goods` SET `sales_volume`=sales_volume-1 WHERE (`id`='16') LIMIT 1;\r\n    UPDATE `xm_goods` SET `sales_volume`=sales_volume-1 WHERE (`id`='14') LIMIT 1;\r\n \r\n    IF error = 1 THEN\r\n      ROLLBACK;\r\n    ELSE\r\n      COMMIT;\r\n    END IF;\r\n    select error;\r\n  END;\r\n\r\n#\u6267\u884c\r\nCALL repair_order_brokerage_pay();<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DROP PROCEDURE IF EXISTS repair_order_brokerage_pay; CR &hellip; <a href=\"https:\/\/blog.la998.com\/?p=439\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">mysql \u5b58\u50a8\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u4e8b\u52a1<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-439","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/blog.la998.com\/index.php?rest_route=\/wp\/v2\/posts\/439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.la998.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.la998.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.la998.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.la998.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=439"}],"version-history":[{"count":2,"href":"https:\/\/blog.la998.com\/index.php?rest_route=\/wp\/v2\/posts\/439\/revisions"}],"predecessor-version":[{"id":441,"href":"https:\/\/blog.la998.com\/index.php?rest_route=\/wp\/v2\/posts\/439\/revisions\/441"}],"wp:attachment":[{"href":"https:\/\/blog.la998.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.la998.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.la998.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}