2023-09-14 10:42:23 +00:00
|
|
|
|
CREATE OR REPLACE PACKAGE telsaler_reward_pkg IS
|
|
|
|
|
|
|
|
|
|
-- Author : WANGWEI-202
|
|
|
|
|
-- Created : 2023/9/13 10:05:43
|
|
|
|
|
-- Purpose : <20><>ϯ<EFBFBD><CFAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>صİ<D8B5>
|
|
|
|
|
|
2023-09-21 08:56:34 +00:00
|
|
|
|
PROCEDURE add_telsaler_reward
|
|
|
|
|
(
|
|
|
|
|
a_reward_index VARCHAR2,
|
|
|
|
|
a_telsaler_name VARCHAR2
|
|
|
|
|
);
|
|
|
|
|
|
2023-09-25 08:23:26 +00:00
|
|
|
|
PROCEDURE update_telsaler_reward
|
2023-09-14 10:42:23 +00:00
|
|
|
|
(
|
|
|
|
|
a_rec_id INTEGER,
|
|
|
|
|
a_telsaler_name VARCHAR2,
|
|
|
|
|
a_reward_index VARCHAR2
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
PROCEDURE delete_telsaler_reward(a_rec_id INTEGER);
|
|
|
|
|
|
|
|
|
|
END telsaler_reward_pkg;
|
|
|
|
|
/
|
|
|
|
|
CREATE OR REPLACE PACKAGE BODY telsaler_reward_pkg IS
|
|
|
|
|
|
2023-09-21 08:56:34 +00:00
|
|
|
|
PROCEDURE add_telsaler_reward
|
|
|
|
|
(
|
|
|
|
|
a_reward_index VARCHAR2,
|
|
|
|
|
a_telsaler_name VARCHAR2
|
|
|
|
|
) IS
|
|
|
|
|
BEGIN
|
|
|
|
|
BEGIN
|
|
|
|
|
INSERT INTO telsaler_reward
|
|
|
|
|
(reward_index,
|
|
|
|
|
telsaler_name)
|
|
|
|
|
VALUES
|
|
|
|
|
(a_reward_index,
|
|
|
|
|
a_telsaler_name);
|
|
|
|
|
EXCEPTION
|
|
|
|
|
WHEN OTHERS THEN
|
|
|
|
|
IF SQLCODE = -00001
|
|
|
|
|
THEN
|
|
|
|
|
raise_application_error(-20001,
|
|
|
|
|
'ֵ<>ظ<EFBFBD>');
|
|
|
|
|
END IF;
|
|
|
|
|
END;
|
|
|
|
|
COMMIT;
|
|
|
|
|
END;
|
|
|
|
|
|
2023-09-25 08:23:26 +00:00
|
|
|
|
PROCEDURE update_telsaler_reward
|
2023-09-14 10:42:23 +00:00
|
|
|
|
(
|
|
|
|
|
a_rec_id INTEGER,
|
|
|
|
|
a_telsaler_name VARCHAR2,
|
|
|
|
|
a_reward_index VARCHAR2
|
|
|
|
|
) IS
|
|
|
|
|
BEGIN
|
2023-09-25 08:23:26 +00:00
|
|
|
|
/*MERGE INTO telsaler_reward r
|
2023-09-14 10:42:23 +00:00
|
|
|
|
USING (SELECT COUNT(*) COUNT
|
|
|
|
|
FROM telsaler_reward
|
|
|
|
|
WHERE rec_id = a_rec_id) a
|
|
|
|
|
ON (a.count > 0)
|
|
|
|
|
WHEN MATCHED THEN
|
|
|
|
|
UPDATE
|
|
|
|
|
SET r.reward_index = a_reward_index,
|
|
|
|
|
r.telsaler_name = a_telsaler_name
|
|
|
|
|
WHERE r.rec_id = a_rec_id
|
|
|
|
|
WHEN NOT MATCHED THEN
|
|
|
|
|
INSERT
|
|
|
|
|
(reward_index,
|
|
|
|
|
telsaler_name)
|
|
|
|
|
VALUES
|
|
|
|
|
(a_reward_index,
|
2023-09-25 08:23:26 +00:00
|
|
|
|
a_telsaler_name);*/
|
|
|
|
|
BEGIN
|
|
|
|
|
UPDATE telsaler_reward r
|
|
|
|
|
SET r.reward_index = a_reward_index,
|
|
|
|
|
r.telsaler_name = a_telsaler_name
|
|
|
|
|
WHERE r.rec_id = a_rec_id;
|
|
|
|
|
EXCEPTION
|
|
|
|
|
WHEN no_data_found THEN
|
|
|
|
|
raise_application_error(-20002,
|
|
|
|
|
'<27>˼<DEB4>¼<EFBFBD><C2BC>');
|
|
|
|
|
END;
|
2023-09-14 10:42:23 +00:00
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
|
END;
|
|
|
|
|
|
|
|
|
|
PROCEDURE delete_telsaler_reward(a_rec_id INTEGER) IS
|
|
|
|
|
BEGIN
|
|
|
|
|
DELETE telsaler_reward
|
|
|
|
|
WHERE rec_id = a_rec_id;
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
|
END;
|
|
|
|
|
|
|
|
|
|
BEGIN
|
|
|
|
|
NULL;
|
|
|
|
|
END telsaler_reward_pkg;
|
|
|
|
|
/
|