账套-个税字段对应、累计字段对应

This commit is contained in:
钱涛 2023-08-15 20:50:47 +08:00
parent cf22685fca
commit 3004394e96
8 changed files with 482 additions and 0 deletions

View File

@ -0,0 +1,62 @@
create table hrsa_sob_add_up_rule
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_sob_id number,
income_category varchar2(100),
salary_item_id number,
add_up_column_data_index varchar2(100)
);
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal',
'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome',
'addUpAllowedDonation', 'addUpTaxSavings');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpAdvanceTax';
/
delete from hrsa_sob_add_up_rule
where income_category = 1
and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpTaxPayable';
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpTaxableIncome');
/

View File

@ -0,0 +1,62 @@
create table hrsa_sob_add_up_rule
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_sob_id number,
income_category varchar2(100),
salary_item_id number,
add_up_column_data_index varchar2(100)
);
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal',
'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome',
'addUpAllowedDonation', 'addUpTaxSavings');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpAdvanceTax';
/
delete from hrsa_sob_add_up_rule
where income_category = 1
and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpTaxPayable';
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpTaxableIncome');
/

View File

@ -0,0 +1,62 @@
create table hrsa_sob_add_up_rule
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_sob_id number,
income_category varchar2(100),
salary_item_id number,
add_up_column_data_index varchar2(100)
);
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal',
'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome',
'addUpAllowedDonation', 'addUpTaxSavings');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpAdvanceTax';
/
delete from hrsa_sob_add_up_rule
where income_category = 1
and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpTaxPayable';
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpTaxableIncome');
/

View File

@ -0,0 +1,58 @@
create table hrsa_sob_add_up_rule
(
id bigint primary key comment 'ID' ,
create_time datetime comment '创建时间' ,
update_time datetime comment '修改时间' ,
creator bigint comment '创建人id' ,
delete_type int default 0 comment '是否删除' ,
tenant_key varchar(10) comment '租户KEY' ,
salary_sob_id bigint comment '薪资账套的id' ,
income_category varchar(100) comment '收入所得项目' ,
salary_item_id bigint comment '薪资项目的id' ,
add_up_column_data_index varchar(100) comment '往期累计情况的字段索引'
)
;
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal',
'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome',
'addUpAllowedDonation', 'addUpTaxSavings')
;
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpAdvanceTax'
;
delete from hrsa_sob_add_up_rule
where income_category = 1
and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax')
;
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpTaxPayable'
;
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpTaxableIncome')
;

View File

@ -0,0 +1,57 @@
create table hrsa_sob_add_up_rule
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_sob_id number,
income_category varchar2(100),
salary_item_id number,
add_up_column_data_index varchar2(100)
)
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal',
'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome',
'addUpAllowedDonation', 'addUpTaxSavings')
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpAdvanceTax'
/
delete from hrsa_sob_add_up_rule
where income_category = 1
and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax')
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpTaxPayable'
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpTaxableIncome')
/

View File

@ -0,0 +1,61 @@
create table hrsa_sob_add_up_rule
(
id bigint primary key ,
create_time timestamp,
update_time timestamp,
creator bigint,
delete_type int default 0,
tenant_key varchar(10),
salary_sob_id bigint,
income_category varchar(100),
salary_item_id bigint,
add_up_column_data_index varchar(100)
);
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal',
'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome',
'addUpAllowedDonation', 'addUpTaxSavings');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpAdvanceTax';
/
delete from hrsa_sob_add_up_rule
where income_category = 1
and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpTaxPayable';
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpTaxableIncome');
/

View File

@ -0,0 +1,58 @@
create table hrsa_sob_add_up_rule
(
id bigint primary key ,
create_time datetime,
update_time datetime,
creator bigint,
delete_type int default 0,
tenant_key nvarchar(10),
salary_sob_id bigint,
income_category nvarchar(100),
salary_item_id bigint,
add_up_column_data_index nvarchar(100)
)
GO
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal',
'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome',
'addUpAllowedDonation', 'addUpTaxSavings')
GO
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpAdvanceTax'
GO
delete from hrsa_sob_add_up_rule
where income_category = 1
and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax')
GO
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpTaxPayable'
GO
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpTaxableIncome')
GO

View File

@ -0,0 +1,62 @@
create table hrsa_sob_add_up_rule
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
salary_sob_id number,
income_category varchar2(100),
salary_item_id number,
add_up_column_data_index varchar2(100)
);
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpIncome', 'addUpSubtraction', 'addUpSocialSecurityTotal', 'addUpAccumulationFundTotal',
'addUpEnterpriseAndOther', 'addUpOtherDeduction', 'addUpTaxExemptIncome',
'addUpAllowedDonation', 'addUpTaxSavings');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpTaxPayable' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpAdvanceTax';
/
delete from hrsa_sob_add_up_rule
where income_category = 1
and add_up_column_data_index in ('addUpTaxPayable', 'addUpAdvanceTax');
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, 'addUpAdvanceTax' as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code = 'addUpTaxPayable';
/
insert into hrsa_sob_add_up_rule(id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, add_up_column_data_index)
select id, create_time, update_time, creator, delete_type, tenant_key, salary_sob_id,
income_category, salary_item_id, salary_item_code as add_up_column_data_index
from hrsa_salary_sob_item
where delete_type = 0
and income_category = 1
and salary_item_code in ('addUpTaxableIncome');
/