From 3004394e96dd518e62158b1f48aced167b798eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 15 Aug 2023 20:50:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=A5=97-=E4=B8=AA=E7=A8=8E=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=AF=B9=E5=BA=94=E3=80=81=E7=B4=AF=E8=AE=A1=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=AF=B9=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202308150603.sql | 62 +++++++++++++++++++ resource/sqlupgrade/GS/sql202308150603.sql | 62 +++++++++++++++++++ resource/sqlupgrade/JC/sql202308150603.sql | 62 +++++++++++++++++++ resource/sqlupgrade/Mysql/sql202308150603.sql | 58 +++++++++++++++++ .../sqlupgrade/Oracle/sql202308150603.sql | 57 +++++++++++++++++ resource/sqlupgrade/PG/sql202308150603.sql | 61 ++++++++++++++++++ .../sqlupgrade/SQLServer/sql202308150603.sql | 58 +++++++++++++++++ resource/sqlupgrade/ST/sql202308150603.sql | 62 +++++++++++++++++++ 8 files changed, 482 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202308150603.sql create mode 100644 resource/sqlupgrade/GS/sql202308150603.sql create mode 100644 resource/sqlupgrade/JC/sql202308150603.sql create mode 100644 resource/sqlupgrade/Mysql/sql202308150603.sql create mode 100644 resource/sqlupgrade/Oracle/sql202308150603.sql create mode 100644 resource/sqlupgrade/PG/sql202308150603.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202308150603.sql create mode 100644 resource/sqlupgrade/ST/sql202308150603.sql diff --git a/resource/sqlupgrade/DM/sql202308150603.sql b/resource/sqlupgrade/DM/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /dev/null +++ b/resource/sqlupgrade/DM/sql202308150603.sql @@ -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'); +/ + diff --git a/resource/sqlupgrade/GS/sql202308150603.sql b/resource/sqlupgrade/GS/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /dev/null +++ b/resource/sqlupgrade/GS/sql202308150603.sql @@ -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'); +/ + diff --git a/resource/sqlupgrade/JC/sql202308150603.sql b/resource/sqlupgrade/JC/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /dev/null +++ b/resource/sqlupgrade/JC/sql202308150603.sql @@ -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'); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202308150603.sql b/resource/sqlupgrade/Mysql/sql202308150603.sql new file mode 100644 index 000000000..e7e16eeb1 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202308150603.sql @@ -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') +; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202308150603.sql b/resource/sqlupgrade/Oracle/sql202308150603.sql new file mode 100644 index 000000000..824a4ce82 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202308150603.sql @@ -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') +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202308150603.sql b/resource/sqlupgrade/PG/sql202308150603.sql new file mode 100644 index 000000000..001f75870 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202308150603.sql @@ -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'); +/ \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202308150603.sql b/resource/sqlupgrade/SQLServer/sql202308150603.sql new file mode 100644 index 000000000..4cf555b00 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202308150603.sql @@ -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 \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202308150603.sql b/resource/sqlupgrade/ST/sql202308150603.sql new file mode 100644 index 000000000..afa21f4ad --- /dev/null +++ b/resource/sqlupgrade/ST/sql202308150603.sql @@ -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'); +/ +