create table hrsa_salary_send_range
(
    id             bigint                                not null comment '主键id' auto_increment primary key,
    salary_send_id bigint      default 0                 not null comment '发放id',
    grant_type     varchar(64)                           not null comment '发放=grant;撤回=withdraw',
    creator        bigint      default 0                 not null comment '创建人',
    create_time    datetime    default CURRENT_TIMESTAMP not null comment '创建时间',
    update_time    datetime    default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
    delete_type    int         default 0                 not null comment '是否已删除。0：未删除、1：已删除',
    tenant_key     varchar(10) default ''                not null comment '租户ID'
)
;

create table hrsa_salary_send_range_obj
(
    id                   bigint auto_increment comment '主键id' primary key,
    salary_send_id       bigint      default 0                 not null comment '发放id',
    salary_send_range_id bigint      default 0                 not null,
    range_type           int                                   not null comment '范围类型;对象=1;对象中排除=2',
    target_type          int                                   not null comment '目标类型，人员=1,部门=2,分部=3,岗位=4,个税扣缴义务人=5,所有人=0',
    target_id            bigint                                not null comment '目标id',
    creator              bigint      default 0                 not null comment '创建人',
    create_time          datetime    default CURRENT_TIMESTAMP not null comment '创建时间',
    update_time          datetime    default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
    delete_type          int         default 0                 not null comment '是否已删除。0：未删除、1：已删除',
    tenant_key           varchar(10) default ''                not null comment '租户ID'
)
;