清库存储过程(清库注意使用EXISTS)
1.接收入参的存储过程(一)
2.接收入参的存储过程(二)
CREATE OR REPLACE
PROCEDURE CLEAR_ACCOUNT_PLATFORM_DATA(P_platformId IN VARCHAR) AS
BEGIN
DELETE FROM T_ACCOUNT_FREEZE t WHERE EXISTS
(SELECT 1 FROM T_ACCOUNT t1 WHERE t1.ID = t.ACCOUNT_ID AND t1.MERCHANT_NO = P_platformId);
DELETE FROM T_ACCOUNT_HISTORY t WHERE EXISTS
(SELECT 1 FROM T_ACCOUNT t1 WHERE t1.ID = t.ACCOUNT_ID AND t1.MERCHANT_NO = P_platformId);
DELETE FROM T_ACCOUNT_SNAPSHOT t WHERE EXISTS
(SELECT 1 FROM T_ACCOUNT t1 WHERE t1.ID = t.ACCOUNT_ID AND t1.MERCHANT_NO = P_platformId);
DELETE FROM T_ACCOUNT WHERE MERCHANT_NO = P_platformId;
COMMIT;
END;
#### 1.mapperxml文件
2.mapper
void callClearPlatformData(@Param(“platformId”) long platformId);
这样就可以直接使用了!!!