weaver-hrm-salary/resource/sql/分权oracle.sql

134 lines
3.9 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

CREATE TABLE hrsa_tax_agent_emp
(
id NUMBER(38,0) primary key NOT NULL,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) DEFAULT 0,
delete_type number DEFAULT 0 ,
tenant_key varchar2(10) DEFAULT '',
tax_agent_id NUMBER(38,0) NOT NULL,
employee_id NUMBER(38,0) NOT NULL,
employee_name varchar2(255)
) ;
/
CREATE TABLE hrsa_tax_agent_emp_change
(
id NUMBER(38,0) primary key NOT NULL,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) DEFAULT 0,
delete_type number DEFAULT 0 ,
tenant_key varchar2(10) DEFAULT ''
tax_agent_id NUMBER(38,0) NOT NULL,
employee_id NUMBER(38,0) NOT NULL,
change_type number NOT NULL DEFAULT 0 ,
employee_name varchar2(255) NULL DEFAULT NULL,
module_type int(4) NOT NULL DEFAULT 0
) ;
/
CREATE TABLE hrsa_tax_agent_admin
(
id NUMBER(38,0) primary key NOT NULL,
tax_agent_id NUMBER(38,0) NOT NULL,
employee_id NUMBER(38,0) NOT NULL,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) DEFAULT 0,
delete_type number DEFAULT 0 ,
tenant_key varchar2(10) DEFAULT ''
) ;
/
CREATE TABLE hrsa_tax_agent_manage_range
(
id NUMBER(38,0) primary key NOT NULL,
tax_agent_id NUMBER(38,0) NOT NULL,
employee_id NUMBER(38,0) NOT NULL,
tax_agent_sub_admin_id NUMBER(38,0) NOT NULL,
target_type number NOT NULL DEFAULT 1,
target_id NUMBER(38,0) NOT NULL,
employee_status varchar2(100) NOT NULL,
include_type number NOT NULL DEFAULT 1,
creator NUMBER(38,0) DEFAULT '0',
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
delete_type number DEFAULT 0 ,
tenant_key varchar2(10) DEFAULT '',
range_type number NOT NULL DEFAULT 0
) ;
/
CREATE TABLE hrsa_tax_agent_base
(
id NUMBER(38,0) primary key NOT NULL,
devolution_status int(11) NOT NULL DEFAULT 0 COMMENT '分权开启状态。0关、1',
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) DEFAULT '0',
delete_type number DEFAULT 0 ,
tenant_key varchar2(10) DEFAULT ''
) ;
/
CREATE TABLE hrsa_tax_agent_sub_admin
(
id NUMBER(38,0) primary key NOT NULL,
tax_agent_id NUMBER(38,0) NOT NULL,
employee_id NUMBER(38,0) NOT NULL,
description varchar2(100) ,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) DEFAULT '0',
delete_type number DEFAULT 0 ,
tenant_key varchar2(10) DEFAULT '',
remark text
) ;
/
CREATE TABLE hrsa_tax_agent_sub_admin_emp
(
id NUMBER(38,0) primary key NOT NULL,
create_time date DEFAULT sysdate,
update_time date DEFAULT sysdate,
creator NUMBER(38,0) DEFAULT '0',
delete_type number DEFAULT 0 ,
tenant_key varchar2(10) DEFAULT '',
tax_agent_id NUMBER(38,0) NOT NULL,
tax_agent_sub_admin_id NUMBER(38,0) NOT NULL,
employee_id NUMBER(38,0) NOT NULL,
employee_name varchar2(255)
) ;
/
ALTER TABLE hrsa_tax_agent add (
payment_agency varchar2(255)
)
/
ALTER TABLE hrsa_salary_sob add (
tax_agent_id NUMBER(38,0)
)
/
INSERT INTO hrsa_tax_agent_base(id, devolution_status, create_time, update_time, creator, delete_type, tenant_key) VALUES (1653303537239, 1, to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), to_date('2022-05-10 16:03:02','yyyy-MM-dd HH24:mi:ss'), 1, 0, 'all_teams');
/
ALTER TABLE hrsa_bill_detail_temp add (
payment_organization NUMBER(38,0)
)
/
ALTER TABLE hrsa_bill_detail add (
payment_organization NUMBER(38,0)
)
/
ALTER TABLE hrsa_bill_batch add (
payment_organization NUMBER(38,0)
)
/