|
|
@@ -312,7 +312,7 @@ CREATE TABLE `pi_task_history` (
|
|
|
`settle_result` varchar(20) NOT NULL COMMENT '结算结果(未结算-UNSETTLED,已结算-SETTLED)',
|
|
|
`settle_pi_task_id` bigint DEFAULT NULL COMMENT '结算时的打卡任务ID',
|
|
|
`settle_task_history_id` bigint DEFAULT NULL COMMENT '结算任务执行记录ID',
|
|
|
- `settle_points` int DEFAULT NULL COMMENT '结算奖励积分',p
|
|
|
+ `settle_points` int DEFAULT NULL COMMENT '结算奖励积分',
|
|
|
`created_by` bigint NOT NULL COMMENT '创建人',
|
|
|
`creation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
`last_updated_by` bigint NOT NULL COMMENT '最后更新人',
|
|
|
@@ -656,7 +656,7 @@ DROP TABLE IF EXISTS punch_in_settlement;
|
|
|
-- 删除无效的用户数据
|
|
|
delete from user where id not in (select created_by from pi_task group by created_by);
|
|
|
-- 初始化账户数据,account数从user导入
|
|
|
-insert into account(user_id, account_name, account_type, points, created_by, creation_time, last_updated_by, last_update_time, version, delete_flag)
|
|
|
+insert into account(user_id, account_name, account_category, points, created_by, creation_time, last_updated_by, last_update_time, version, delete_flag)
|
|
|
select id, '基本户', 'BASIC', unused_points, id, CURRENT_TIMESTAMP(), id, CURRENT_TIMESTAMP(), 1, 0
|
|
|
from user;
|
|
|
-- 初始化基本奖励数据
|
|
|
@@ -673,12 +673,12 @@ ALTER TABLE punch_settle.reward MODIFY COLUMN reward_version int NOT NULL COMMEN
|
|
|
|
|
|
ALTER TABLE punch_settle.reward_history DROP COLUMN account_name;
|
|
|
insert into reward_history(user_id, reward_id, exchange_method, exchange_count, exchange_total_points, account_id, account_points_before_exchange, account_points_after_exchange,
|
|
|
-unused_points_before_exchange, unused_points_after_exchange, userd_points_before_exchange, userd_points_after_exchange,
|
|
|
+unused_points_before_exchange, unused_points_after_exchange, used_points_before_exchange, used_points_after_exchange,
|
|
|
created_by, creation_time, last_updated_by, last_update_time, version, delete_flag)
|
|
|
select created_by,
|
|
|
(select id from reward r where r.user_id = rr.created_by and r.reward_name = '刮一次刮刮乐'),
|
|
|
'MANUAL', claim_reward_num, claim_reward_num,
|
|
|
-(SELECT ID FROM account a where a.user_id = rr.created_by and a.account_type = 'BASIC'),
|
|
|
+(SELECT ID FROM account a where a.user_id = rr.created_by and a.account_category = 'BASIC'),
|
|
|
rr.before_claim_reward_num , rr.after_claim_reward_num , rr.before_claim_reward_num , rr.after_claim_reward_num , rr.before_claim_reward_num , rr.after_claim_reward_num ,
|
|
|
created_by, creation_time, last_updated_by, last_update_time, version, delete_flag
|
|
|
from user_claim_reward_record rr;
|
|
|
@@ -694,6 +694,7 @@ pir.creation_time, pir.last_updated_by, pir.last_update_time, pir.version, pir.d
|
|
|
from punch_in_record pir
|
|
|
left join punch_in_record_settlement_rela pirsr on pir.id = pirsr.record_id;
|
|
|
|
|
|
+update pi_task_history set punch_in_result = 'DONE' where punch_in_result = '3';
|
|
|
update pi_task_history set punch_in_result = 'DONE' where punch_in_result = '1';
|
|
|
update pi_task_history set punch_in_result = 'UNDONE' where punch_in_result = '2';
|
|
|
update pi_task_history set punch_in_result = 'UNDONE' where punch_in_result = '0';
|