##基金费用表权限
INSERT INTO `custody_table_permission`(`id`, `tableName`, `service_name`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (21, 'fund_fee_data_info', 'fundFeeDataInfoService', NULL, '基金费用数据表', '2022-07-01 13:52:16', '2022-07-01 13:52:16', 0);
##新建fund_fee_data_info
DROP TABLE IF EXISTS `custody_fund_fee_data_info`;
CREATE TABLE `custody_fund_fee_data_info`  (
  `id` int(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `fund_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基金备案编码',
  `inner_fund_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基金内部编码',
  `fund_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基金名称',
  `confirm_date` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '费用计算时间',
  `subject_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '科目编码（数据字典：费用类型）',
  `subject_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '科目名称',
  `fare_debit` decimal(20, 2) NULL DEFAULT NULL COMMENT '贷方金额（应付金额/计提金额）',
  `fare_credit` decimal(20, 2) NULL DEFAULT NULL COMMENT '借方金额（已付金额/支付金额）',
  `fare_unpaid` decimal(20, 2) NULL DEFAULT NULL COMMENT '余额（未付金额）',
  `update_date` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新日期（固定格式YYYY-MM-DD HH:mm:ss）',
  `trust_no` int(2) NOT NULL COMMENT '数据字典：托管人',
  `admin` varchar(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '租户名',
  `unique_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '唯一索引：用于插入',
  `version` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '版本',
  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
  `is_deleted` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否删除(有效|0,无效|1)',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `unique_key`(`unique_key`) USING BTREE,
  INDEX `query_key`(`admin`, `confirm_date`, `subject_code`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 28975 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '基金费用数据表（fund_fee_data_info）' ROW_FORMAT = Dynamic;

##费用类型字典新增
INSERT INTO `custody_data_dictionary_types_of_fee`(`key_str`, `value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES ('KHFWF', '客户服务费', NULL, NULL, '2022-07-05 16:22:09', '2022-07-05 16:22:09', 0);
INSERT INTO `custody_data_dictionary_types_of_fee`(`key_str`, `value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES ('MJFWF', '募集监督服务费', NULL, NULL, '2022-07-05 16:22:09', '2022-07-05 16:22:09', 0);
INSERT INTO `custody_data_dictionary_types_of_fee`(`key_str`, `value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES ('YJBC2', '投资顾问业绩报酬', NULL, NULL, '2022-07-05 16:22:09', '2022-07-05 16:22:09', 0);

##国信费用类型字典
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (1, '22', '管理费本期计提', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (2, '22', '投资顾问费本期计提', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (3, '22', '销售服务费本期计提', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (4, '22', '托管费本期计提', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (5, '22', '外包服务费本期计提', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (6, '22', '管理人业绩报酬本期计提', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (10, '22', '附加税', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (11, '22', '增值税', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (15, '22', '客户服务费本期计提', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (16, '22', '募集监督服务费', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (17, '22', '投资顾问业绩报酬本期计提', NULL, NULL, '2022-07-05 16:26:51', '2022-07-05 16:26:51', 0);
##国泰君安费用类型字典
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (1, '31', '管理费', NULL, NULL, '2022-07-06 15:51:52', '2022-07-06 15:51:52', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (2, '31', '顾问费', NULL, NULL, '2022-07-06 15:51:52', '2022-07-06 15:51:52', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (3, '31', '销售费', NULL, NULL, '2022-07-06 15:51:52', '2022-07-06 15:51:52', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (4, '31', '托管费', NULL, NULL, '2022-07-06 15:51:53', '2022-07-06 15:51:53', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (6, '31', '业绩报酬', NULL, NULL, '2022-07-06 15:51:53', '2022-07-06 15:51:53', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (14, '31', '运营服务费', NULL, NULL, '2022-07-06 15:51:53', '2022-07-06 15:51:53', 0);
##招商费用类型字典
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (1, '25', '管理费', NULL, NULL, '2022-07-07 17:46:12', '2022-07-07 17:46:12', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (2, '25', '投资顾问费', NULL, NULL, '2022-07-07 17:46:12', '2022-07-07 17:46:12', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (3, '25', '销售服务费', NULL, NULL, '2022-07-07 17:46:12', '2022-07-07 17:46:12', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (4, '25', '托管费', NULL, NULL, '2022-07-07 17:46:12', '2022-07-07 17:46:12', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (6, '25', '业绩报酬费', NULL, NULL, '2022-07-07 17:46:12', '2022-07-07 17:46:12', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (14, '25', '运营服务费', NULL, NULL, '2022-07-07 17:46:12', '2022-07-07 17:46:12', 0);
INSERT INTO `custody_data_dictionary_types_of_fee_details`(`dic_id`, `trust_no`, `origin_value`, `version`, `remark`, `create_time`, `update_time`, `is_deleted`) VALUES (14, '25', '客户服务费', NULL, NULL, '2022-07-07 17:46:12', '2022-07-07 17:46:12', 0);
