ALTER TABLE hrsa_tax_agent_emp
    ADD COLUMN employee_type int NULL ;


ALTER TABLE hrsa_salary_archive
    ADD COLUMN employee_type int NULL ;


ALTER TABLE hrsa_tax_agent_emp_change
    ADD COLUMN employee_type int NULL ;

ALTER TABLE hrsa_salary_acct_emp
    ADD COLUMN employee_type int NULL ;

ALTER TABLE hrsa_salary_send_info ADD COLUMN employee_type int ;

CREATE TABLE hrsa_external_employee
(
    id               bigint NOT NULL,
    username         varchar(255) NULL DEFAULT NULL ,
    department_name  varchar(255) NULL DEFAULT NULL,
    department_id    bigint NULL DEFAULT NULL ,
    subcompany_name  varchar(255) NULL DEFAULT NULL ,
    subcompany_id    bigint NULL DEFAULT NULL ,
    jobtitle_name    varchar(255) NULL DEFAULT NULL ,
    jobtitle_id      bigint NULL DEFAULT NULL ,
    companystartdate varchar(255) NULL DEFAULT NULL ,
    mobile           varchar(255) NULL DEFAULT NULL ,
    status           varchar(255) NULL DEFAULT NULL ,
    workcode         varchar(255) NULL DEFAULT NULL ,
    sex              varchar(255) NULL DEFAULT NULL ,
    email            varchar(255) NULL DEFAULT NULL ,
    telephone        varchar(255) NULL DEFAULT NULL ,
    jobcall          varchar(255) NULL DEFAULT NULL ,
    birthday         varchar(255) NULL DEFAULT NULL ,
    id_no            varchar(255) NULL DEFAULT NULL ,
    bank_card_num    varchar(255) NULL DEFAULT NULL ,
    bank_name        varchar(255) NULL DEFAULT NULL ,
    delete_type      int NULL DEFAULT NULL  ,
    creator          bigint NULL DEFAULT NULL ,
    modifier         bigint NULL DEFAULT NULL ,
    create_time      timestamp NULL DEFAULT NULL ,
    update_time      timestamp NULL DEFAULT NULL ,
    tenant_key       varchar(255) NULL DEFAULT NULL ,
    PRIMARY KEY (id)
);

CREATE TABLE hrsa_salary_sob_ext_range
(
    id            bigint NOT NULL ,
    salary_sob_id bigint NOT NULL DEFAULT 0 ,
    target_type   smallint NOT NULL DEFAULT 1 ,
    target_id     bigint NOT NULL DEFAULT 0 ,
    creator       bigint NOT NULL DEFAULT 0 ,
    create_time   timestamp ,
    update_time   timestamp,
    delete_type   int NOT NULL DEFAULT 0 ,
    tenant_key    varchar(10) NOT NULL DEFAULT '',
    PRIMARY KEY (id)
);

CREATE TABLE hrsa_tax_agent_ext_range
(
    id           bigint NOT NULL ,
    tax_agent_id bigint NOT NULL DEFAULT 0 ,
    target_type  smallint NOT NULL DEFAULT 1 ,
    target_id    bigint NOT NULL DEFAULT 0 ,
    creator      bigint NOT NULL DEFAULT 0 ,
    create_time  timestamp  ,
    update_time  timestamp ,
    delete_type  int NOT NULL DEFAULT 0 ,
    tenant_key   varchar(10) NOT NULL DEFAULT '' ,
    PRIMARY KEY (id)
);