create table c_contract_item
(
    ID               varchar(36)    not null
        primary key,
    TENANCY_ID       varchar(36)    null,
    CONTRACT_ID      varchar(36)    not null comment '协议编号',
    CATEGORY_ID      varchar(36)    not null comment '费类编号',
    ITEM_ID          varchar(36)    not null comment '费目编号',
    CREATED_BY       varchar(36)    not null,
    CREATED_ON       date           not null,
    UPDATED_BY       varchar(36)    not null,
    UPDATED_ON       date           not null,
    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=去小数）',
    FORMAT_UNIT      decimal(1)     null comment '取整单位（0=分1=角2=元3=十元）',
    CURRENCY         varchar(8)     null comment '币种（字典C_CURRENCY）',
    GL_CODE          varchar(20)    null comment '会计科目',
    FLAT_RATE        decimal(1)     null comment '计免条件（0=计费1=免费）',
    ACCOUNT_TYPE     decimal(1)     null comment '结算方式(1现金2月结)',
    NOTES            varchar(100)   null,
    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=重量吨2=体积吨）',
    DERATE_TYPE      decimal(1)     null comment '分段减免类型（0=前免1=后免）',
    DERATE_DAY       decimal(3)     null comment '分段减免天',
    UNIT             varchar(5)     null comment '计价单位',
    ENABLED          decimal(1)     null comment '是否参考价0=否1=是',
    AMOUNT_FORMAT    decimal(2)     null comment '金额取整(0=进整1=四舍五入2=去小数)',
    MIN_TON          decimal(22, 3) null comment '最小计费吨',
    RECEIVE_CODE     varchar(20)    null comment '应收对象',
    PAY_CODE         varchar(20)    null comment '应付 对象',
    ITEM_CODE        varchar(20)    null comment '费目code',
    EN_CODE          varchar(20)    null comment '英文名称',
    SOURCE_ITEM_CODE varchar(32)    null comment '来源费目编码',
    CURRENCY_RATIO   decimal(5)     null comment '兑换RMB比例',
    RECEIVE_CURRENCY varchar(8)     null comment '应收币种',
    PAY_CURRENCY     varchar(8)     null comment '应付币种',
    RECEIVE_MAN      varchar(36)    null comment '应收结算单位',
    PAY_MAN          varchar(36)    null comment '应付结算单位',
    DEL_FLAG         decimal(1)     null comment '0=未删除1=已删除',
    formula          varchar(2000)  null comment '计算公式'
);

INSERT INTO ag_devmysql.c_contract_item (ID, TENANCY_ID, CONTRACT_ID, CATEGORY_ID, ITEM_ID, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, ACCOUNT_TYPE, NOTES, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, AMOUNT_FORMAT, MIN_TON, RECEIVE_CODE, PAY_CODE, ITEM_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, RECEIVE_CURRENCY, PAY_CURRENCY, RECEIVE_MAN, PAY_MAN, DEL_FLAG, formula) VALUES ('2879e6a3707e41de803a350699d80550', 'QHD', '4a5a85b8a4fb454694d2a27dfe09d41a', '4ecc11f7edab4b3782302801d6d1aae2', '8847970953024d8fbe4a7741c6171bcb', 'feeadmin', '2022-05-18', 'feeadmin', '2022-05-18', 1, null, null, null, null, null, null, 0, null, null, null, null, 0, null, null, null, '0', null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null);
INSERT INTO ag_devmysql.c_contract_item (ID, TENANCY_ID, CONTRACT_ID, CATEGORY_ID, ITEM_ID, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, ACCOUNT_TYPE, NOTES, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, AMOUNT_FORMAT, MIN_TON, RECEIVE_CODE, PAY_CODE, ITEM_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, RECEIVE_CURRENCY, PAY_CURRENCY, RECEIVE_MAN, PAY_MAN, DEL_FLAG, formula) VALUES ('37787ad994e04cce9f6c4ca3141259fe', 'default', '870d743d9dbf4b938fca8f5586b78644', 'c397ac732d5b432db877ed8645780582', '561ad04370354c5695109bf3725207ac', 'admin', '2022-04-25', 'admin', '2022-04-25', 1, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, '0', null, null, null, '1', null, null, null, null, null, null, null, null, null, 0, '');
INSERT INTO ag_devmysql.c_contract_item (ID, TENANCY_ID, CONTRACT_ID, CATEGORY_ID, ITEM_ID, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, ACCOUNT_TYPE, NOTES, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, AMOUNT_FORMAT, MIN_TON, RECEIVE_CODE, PAY_CODE, ITEM_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, RECEIVE_CURRENCY, PAY_CURRENCY, RECEIVE_MAN, PAY_MAN, DEL_FLAG, formula) VALUES ('73a2ac0e08e6437c9f1beebac6030ffe', 'default', 'ccb1deff1086449d87106a6478f34ca4', 'c397ac732d5b432db877ed8645780582', 'd49222901a464381ab592a273cc7772e', 'admin', '2021-08-12', 'admin', '2022-01-05', 1, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, '0', null, null, null, '1', null, null, null, null, null, null, null, null, null, 0, 'if("1".equals(TYPE)){100;}');
INSERT INTO ag_devmysql.c_contract_item (ID, TENANCY_ID, CONTRACT_ID, CATEGORY_ID, ITEM_ID, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, ACCOUNT_TYPE, NOTES, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, AMOUNT_FORMAT, MIN_TON, RECEIVE_CODE, PAY_CODE, ITEM_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, RECEIVE_CURRENCY, PAY_CURRENCY, RECEIVE_MAN, PAY_MAN, DEL_FLAG, formula) VALUES ('a492dce23a524a82b11b175a78e08499', 'default', 'ccb1deff1086449d87106a6478f34ca4', 'c397ac732d5b432db877ed8645780582', '561ad04370354c5695109bf3725207ac', 'admin', '2021-08-12', 'admin', '2022-01-05', 1, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, '0', null, null, null, '1', null, null, null, null, null, null, null, null, null, 0, '');
INSERT INTO ag_devmysql.c_contract_item (ID, TENANCY_ID, CONTRACT_ID, CATEGORY_ID, ITEM_ID, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, ACCOUNT_TYPE, NOTES, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, AMOUNT_FORMAT, MIN_TON, RECEIVE_CODE, PAY_CODE, ITEM_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, RECEIVE_CURRENCY, PAY_CURRENCY, RECEIVE_MAN, PAY_MAN, DEL_FLAG, formula) VALUES ('bb7452968cf44c098caedec18a51e64e', 'default', '870d743d9dbf4b938fca8f5586b78644', 'c397ac732d5b432db877ed8645780582', '4d1facc12ea44f7a95776861b8985e06', 'admin', '2022-04-25', 'admin', '2022-04-25', 1, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, '0', null, null, null, '1', null, null, null, null, null, null, null, null, null, 0, 'alert(\'xss\');');
INSERT INTO ag_devmysql.c_contract_item (ID, TENANCY_ID, CONTRACT_ID, CATEGORY_ID, ITEM_ID, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, ACCOUNT_TYPE, NOTES, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, AMOUNT_FORMAT, MIN_TON, RECEIVE_CODE, PAY_CODE, ITEM_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, RECEIVE_CURRENCY, PAY_CURRENCY, RECEIVE_MAN, PAY_MAN, DEL_FLAG, formula) VALUES ('c31f792934a6481abac3abcaa4a1f2ce', 'default', '870d743d9dbf4b938fca8f5586b78644', 'c397ac732d5b432db877ed8645780582', 'd49222901a464381ab592a273cc7772e', 'admin', '2022-04-25', 'admin', '2022-04-25', 1, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, '0', null, null, null, '1', null, null, null, null, null, null, null, null, null, 0, 'if("1".equals(TYPE)){100;}');
INSERT INTO ag_devmysql.c_contract_item (ID, TENANCY_ID, CONTRACT_ID, CATEGORY_ID, ITEM_ID, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, ACCOUNT_TYPE, NOTES, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, AMOUNT_FORMAT, MIN_TON, RECEIVE_CODE, PAY_CODE, ITEM_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, RECEIVE_CURRENCY, PAY_CURRENCY, RECEIVE_MAN, PAY_MAN, DEL_FLAG, formula) VALUES ('f3edeb1b969c4313918ec4bcdd0e739a', 'default', 'ccb1deff1086449d87106a6478f34ca4', '1264dde8bc4c4b1ebe9157e219b74e64', 'e4b8be89c4b74a03acad186786881479', 'admin', '2021-08-02', 'admin', '2021-08-02', 1, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, '0', null, null, null, null, null, 'demo1', null, null, null, null, null, null, null, 1, null);
INSERT INTO ag_devmysql.c_contract_item (ID, TENANCY_ID, CONTRACT_ID, CATEGORY_ID, ITEM_ID, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, LIFE_STATUS, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, FORMAT_UNIT, CURRENCY, GL_CODE, FLAT_RATE, ACCOUNT_TYPE, NOTES, TONS_STERE, BYDAY, BYTON, BYAGENT, DERATE_TYPE, DERATE_DAY, UNIT, ENABLED, AMOUNT_FORMAT, MIN_TON, RECEIVE_CODE, PAY_CODE, ITEM_CODE, EN_CODE, SOURCE_ITEM_CODE, CURRENCY_RATIO, RECEIVE_CURRENCY, PAY_CURRENCY, RECEIVE_MAN, PAY_MAN, DEL_FLAG, formula) VALUES ('ff7e7cea921749e585084e19436946f6', 'default', 'ccb1deff1086449d87106a6478f34ca4', 'c397ac732d5b432db877ed8645780582', '4d1facc12ea44f7a95776861b8985e06', 'admin', '2021-08-12', 'admin', '2022-02-23', 1, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, '0', null, null, null, '1', null, null, null, null, null, null, null, null, null, 0, 'alert(\'xss\');');
