create table c_base_charging_item
(
    ID               varchar(36)    not null
        primary key,
    TENANCY_ID       varchar(36)    null,
    DESCRIPTION      varchar(300)   not null comment '费目名称',
    CATEGORY_ID      varchar(36)    null comment '费类编号',
    LIFE_STATUS      decimal(1)     null comment '启用状态（0=不启用1=启用）',
    MIN_AMOUNT       decimal(10, 2) null comment '最小金额',
    MAX_AMOUNT       decimal(10, 2) null comment '最大金额',
    IS_FORMAT        decimal(1)     null comment '计费吨取整（0=进整1=四舍五入2=去小数）',
    NOTES            varchar(600)   null,
    CREATED_BY       varchar(36)    null,
    CREATED_ON       datetime       null,
    UPDATED_BY       varchar(36)    null,
    UPDATED_ON       datetime       null,
    ACCOUNT_TYPE     decimal(1)     null comment '结算方式(1现金2月结)',
    FORMAT_UNIT      decimal(1)     null comment '取整单位（0=分1=角2=元3=十元）',
    CURRENCY         varchar(36)    null comment '币种（字典C_CURRENCY）',
    GL_CODE          varchar(20)    null comment '会计科目',
    FLAT_RATE        decimal(1)     null comment '计免条件（0=计费1=免费）',
    TONS_STERE       decimal(5, 2)  null comment '体积吨换算率',
    BYDAY            decimal(1)     null comment '按天数计算（0=否1=是）',
    BYTON            decimal(1)     null comment '择大计收（0=计费吨1=重量吨2=体积吨）',
    BYAGENT          decimal(1)     null comment '是否收船公司(0=货主1=船方)',
    DERATE_TYPE      decimal(1)     null comment '分段减免类型（0=前免1=后免）',
    DERATE_DAY       decimal(3)     null comment '分段减免天',
    UNIT             varchar(5)     null comment '计价单位（0=箱1=超重吨2=计费吨3=件4票5箱*天6吨*天）',
    ENABLED          decimal(1)     null comment '是否参考价0=否1=是',
    ITEM_CODE        varchar(20)    null comment '费目编号（ZSG_SH01）',
    ITEM_GROUP       varchar(20)    null comment '费目分组',
    AMOUNT_FORMAT    decimal(2)     null comment '金额取整(0=进整1=四舍五入2=去小数)',
    PAY_CODE         varchar(20)    null comment '应付对象',
    RECEIVE_CODE     varchar(20)    null comment '应收对象',
    EN_CODE          varchar(50)    null comment '英文名称',
    SOURCE_ITEM_CODE varchar(32)    null comment '来源费目编码',
    CURRENCY_RATIO   decimal(5)     null comment '币种兑换比例',
    PARENT_CODE      varchar(32)    null,
    DEL_FLAG         decimal(1)     null comment '0=未删除1=已删除'
)
    comment '基础费目';

INSERT INTO ag_devmysql.c_base_charging_item (ID, TENANCY_ID, DESCRIPTION, CATEGORY_ID, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, ACCOUNT_TYPE, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, ITEM_CODE, ITEM_GROUP, AMOUNT_FORMAT, PAY_CODE, RECEIVE_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, PARENT_CODE, DEL_FLAG) VALUES ('4d1facc12ea44f7a95776861b8985e06', 'default', '港务费', 'c397ac732d5b432db877ed8645780582', 1, null, null, null, null, 'admin', '2021-08-12 09:38:30', 'admin', '2021-08-12 09:39:21', null, null, null, null, 0, null, null, null, null, null, null, '0', null, null, null, null, null, null, null, null, null, null, 0);
INSERT INTO ag_devmysql.c_base_charging_item (ID, TENANCY_ID, DESCRIPTION, CATEGORY_ID, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, ACCOUNT_TYPE, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, ITEM_CODE, ITEM_GROUP, AMOUNT_FORMAT, PAY_CODE, RECEIVE_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, PARENT_CODE, DEL_FLAG) VALUES ('561ad04370354c5695109bf3725207ac', 'default', '港口设施保安费', 'c397ac732d5b432db877ed8645780582', 1, null, null, null, null, 'admin', '2021-08-12 09:40:31', 'admin', '2022-06-02 17:22:54', null, null, null, null, 0, null, null, null, null, null, null, '0', null, null, null, null, null, null, null, null, null, null, 0);
INSERT INTO ag_devmysql.c_base_charging_item (ID, TENANCY_ID, DESCRIPTION, CATEGORY_ID, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, ACCOUNT_TYPE, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, ITEM_CODE, ITEM_GROUP, AMOUNT_FORMAT, PAY_CODE, RECEIVE_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, PARENT_CODE, DEL_FLAG) VALUES ('8847970953024d8fbe4a7741c6171bcb', 'QHD', 'testTenancy', '4ecc11f7edab4b3782302801d6d1aae2', 1, null, null, null, null, 'feeadmin', '2022-05-17 17:43:30', 'feeadmin', '2022-05-17 17:43:30', null, null, null, null, 0, null, null, null, null, null, null, '0', null, null, null, null, null, null, null, null, null, null, 0);
INSERT INTO ag_devmysql.c_base_charging_item (ID, TENANCY_ID, DESCRIPTION, CATEGORY_ID, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, ACCOUNT_TYPE, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, ITEM_CODE, ITEM_GROUP, AMOUNT_FORMAT, PAY_CODE, RECEIVE_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, PARENT_CODE, DEL_FLAG) VALUES ('d49222901a464381ab592a273cc7772e', 'default', '港口作业包干费', 'c397ac732d5b432db877ed8645780582', 1, null, null, 0, null, 'admin', '2021-08-12 09:30:58', 'admin', '2022-06-02 17:32:45', 1, 2, null, null, 0, null, null, 0, null, null, null, '0', 1, null, null, 0, null, null, null, null, null, null, 0);
INSERT INTO ag_devmysql.c_base_charging_item (ID, TENANCY_ID, DESCRIPTION, CATEGORY_ID, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, ACCOUNT_TYPE, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, ITEM_CODE, ITEM_GROUP, AMOUNT_FORMAT, PAY_CODE, RECEIVE_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, PARENT_CODE, DEL_FLAG) VALUES ('e4b8be89c4b74a03acad186786881479', 'default', 'demo1', '1264dde8bc4c4b1ebe9157e219b74e64', 1, null, null, null, null, 'admin', '2021-06-08 17:38:30', 'admin', '2021-11-13 15:51:20', null, null, null, null, 0, null, null, null, null, null, null, '0', null, 'demo1', null, null, null, null, null, null, null, null, 0);
INSERT INTO ag_devmysql.c_base_charging_item (ID, TENANCY_ID, DESCRIPTION, CATEGORY_ID, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, ACCOUNT_TYPE, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, ITEM_CODE, ITEM_GROUP, AMOUNT_FORMAT, PAY_CODE, RECEIVE_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, PARENT_CODE, DEL_FLAG) VALUES ('f8199c8db73749c7b6c71f1ba1854509', 'default', 'dem', '1264dde8bc4c4b1ebe9157e219b74e64', 1, null, null, null, null, 'admin', '2022-02-08 16:55:27', 'admin', '2022-02-08 17:28:32', null, null, null, null, 0, null, null, null, null, null, null, '0', null, null, null, null, null, null, null, null, null, null, 0);
