
DROP TABLE IF EXISTS  `c_sys_file`;
CREATE TABLE `c_sys_file` (
                              `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                              `storage_type` varchar(50) DEFAULT NULL COMMENT 'disk/oss',
                              `original_name` varchar(255) DEFAULT NULL COMMENT '文件原始名称',
                              `path` varchar(255) DEFAULT NULL COMMENT '访问路径',
                              `absolute_path` varchar(255) DEFAULT NULL COMMENT '绝对路径',
                              `type` varchar(255) DEFAULT NULL COMMENT '文件类型',
                              `size` bigint(20) DEFAULT NULL COMMENT '大小(kb)',
                              `business_id` bigint(20) DEFAULT NULL COMMENT '绑定的业务id',
                              `business_type` varchar(255) DEFAULT NULL COMMENT '绑定的业务类型',
                              `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                              `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                              `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                              `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                              PRIMARY KEY (`id`)
) COMMENT='c端文件表';

INSERT INTO `t_dictionary`( `name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ( '供应商授信管理', 252, 'supplierInfo', NULL, 4, now(), now());

INSERT INTO `t_dictionary`( `name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ( '项目核心企业审核', 252, 'ProjectCoreEnterprise', NULL, 4, now(), now());

INSERT INTO `t_dictionary`( `name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ( '项目审核', 252, 'ProjectInformation', NULL, 4, now(), now());

INSERT INTO `t_dictionary`( `name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ( '授信决议', 252, 'CreditResolution', NULL, 4, now(), now());

DROP TABLE IF EXISTS  `due_diligence_allocation`;
CREATE TABLE `due_diligence_allocation` (
                                                `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                                `name` varchar(1000) NOT NULL COMMENT '供应商企业名称',
                                                `social_credit_code` varchar(20) DEFAULT NULL COMMENT '统一社会信用代码',
                                                `risk_manager_id` bigint(20) DEFAULT NULL COMMENT '风险经理',
                                                `assign_date` timestamp null DEFAULT NULL COMMENT '分配日期',
                                                `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                                `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                                `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                                `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                                PRIMARY KEY (`id`)
) COMMENT='尽调分配';

DROP TABLE IF EXISTS  `confirmation_due_diligence_time`;
CREATE TABLE `confirmation_due_diligence_time` (
                                                `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                                `due_diligence_time` timestamp null DEFAULT NULL COMMENT '尽调时间',
                                                `contact_name` varchar(50) DEFAULT NULL COMMENT '联系人姓名',
                                                `mobile` varchar(50) DEFAULT NULL COMMENT '联系电话',
                                                `remark` text DEFAULT NULL COMMENT '备注',
                                                `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                                `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                                `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                                `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                                PRIMARY KEY (`id`)
) COMMENT='尽调时间确认';

DROP TABLE IF EXISTS  `credit_situation`;
CREATE TABLE `credit_situation` (
                                            `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                            `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                            `c_credit_investigation_info_history_id` bigint(20) DEFAULT NULL COMMENT 'c端 征信相关情况 企业负责人',
                                            `number_of_overdue_accounts` bigint(20) DEFAULT NULL COMMENT '近两年发生过逾期的账户数',
                                            `total_overdue_amount` decimal(17,4) DEFAULT NULL COMMENT '近两年发生过逾期的合计金额',
                                            `overdue` tinyint(3) DEFAULT NULL COMMENT '账户是否发生过90天以上逾期 0否 1是',
                                            `consecutive_overdue_month` bigint(20) DEFAULT NULL COMMENT '近两年贷款、信用卡连续逾期的月数',
                                            `accumulated_overdue_times` bigint(20) DEFAULT NULL COMMENT '近两年逾期还款记录累计次数',
                                            `number_of_approval_queries` bigint(20) DEFAULT NULL COMMENT '近半年来贷款审批查询次数',
                                            `amount_of_guarantee_liability` decimal(17,4) NOT NULL COMMENT '相关还款担保责任金额（为非授信主体的担保）',
                                            `bad_records` tinyint(3) DEFAULT NULL COMMENT '关注类和不良类贷款记录 0无 1有',
                                            `record_of_dishonesty_execution` tinyint(3) DEFAULT NULL COMMENT '失信被执行记录 0无 1有',
                                            `executed_record` tinyint(3) DEFAULT NULL COMMENT '被执行记录 0无 1有',
                                            `ST_count` tinyint(3) DEFAULT NULL COMMENT '限高消费情况（个人） 0无 1有',
                                            `file_id` bigint(20) DEFAULT NULL COMMENT '征信报告id',

                                            `number_of_overdue_accounts_score` decimal(17,4) DEFAULT NULL COMMENT '近两年发生过逾期的账户数得分',
                                            `overdue_score` decimal(17,4) DEFAULT NULL COMMENT '账户是否发生过90天以上逾期得分',
                                            `consecutive_overdue_month_score` decimal(17,4) DEFAULT NULL COMMENT '近两年贷款、信用卡连续逾期的月数得分',
                                            `number_of_approval_queries_score` decimal(17,4) DEFAULT NULL COMMENT '近半年来贷款审批查询次数得分',
                                            `amount_of_guarantee_liability_score` decimal(17,4) DEFAULT NULL COMMENT '相关还款担保责任金额（为非授信主体的担保）得分',
                                            `bad_records_score` decimal(17,4) DEFAULT NULL COMMENT '关注类和不良类贷款记录得分',
                                            `shi_xin_score` decimal(17,4) DEFAULT NULL COMMENT '失信被执行记录得分',
                                            `zhi_xing_score` decimal(17,4) DEFAULT NULL COMMENT '被执行记录得分',
                                            `ST_count_score` decimal(17,4) DEFAULT NULL COMMENT '限高消费情况（个人）得分',

                                            `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                            `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                            `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                            `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                            PRIMARY KEY (`id`)
) COMMENT='企业主要人员征信情况';

DROP TABLE IF EXISTS  `corporate_goodwill`;
CREATE TABLE `corporate_goodwill` (
                                    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                    `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                    `c_enterprise_id` bigint(20) NOT NULL COMMENT 'c端 企业信息id',
                                    `file_id` bigint(20) DEFAULT NULL COMMENT '征信报告id',
                                    `recovered_balance` tinyint(3) DEFAULT NULL COMMENT '是否存在被追偿余额、关注类余额、不良类余额 0否 1是',
                                    `concerned_accounts_with_outstanding_credit` tinyint(3) DEFAULT NULL COMMENT '是否存在未结清信贷的关注类账户 0无 1有',
                                    `outstanding_non_performing_accounts` tinyint(3) DEFAULT NULL COMMENT '是否存在未结清信贷的不良类账户 0无 1有',
                                    `outstanding_balance` decimal(17,4) DEFAULT NULL COMMENT '未结清短期借款余额（单位万元）',

                                    `recovered_balance_score` decimal(17,4) DEFAULT NULL COMMENT '是否存在被追偿余额、关注类余额、不良类余额得分',
                                    `concerned_accounts_with_outstanding_credit_score` decimal(17,4) DEFAULT NULL COMMENT '是否存在未结清信贷的关注类账户得分',
                                    `outstanding_non_performing_accounts_score` decimal(17,4) DEFAULT NULL COMMENT '是否存在未结清信贷的不良类账户得分',
                                    `outstanding_balance_score` decimal(17,4) DEFAULT NULL COMMENT '未结清短期借款余额得分',
                                    `shi_xin_score` decimal(17,4) DEFAULT NULL COMMENT '失信被执行信息得分',
                                    `zhi_xing_score` decimal(17,4) DEFAULT NULL COMMENT '被执行人信息得分',
                                    `sumptuary_score` decimal(17,4) DEFAULT NULL COMMENT '限制高消费信息得分',
                                    `administrative_penalty_score` decimal(17,4) DEFAULT NULL COMMENT '行政处罚数量得分',
                                    `involving_lawsuits_score` decimal(17,4) DEFAULT NULL COMMENT '涉诉得分',
                                    `serious_illegality_score` decimal(17,4) DEFAULT NULL COMMENT '严重违法得分',
                                    `tax_owe_notice_score` decimal(17,4) DEFAULT NULL COMMENT '欠税公告得分',
                                    `tax_illegal_data_score` decimal(17,4) DEFAULT NULL COMMENT '税收违法得分',
                                    `blacklist_score` decimal(17,4) DEFAULT NULL COMMENT '黑名单得分',
                                    `exception_data_score` decimal(17,4) DEFAULT NULL COMMENT '经营异常得分',
                                    `News_score` decimal(17,4) DEFAULT NULL COMMENT '重大负面新闻舆情得分',
                                    `shi_xin` int DEFAULT NULL COMMENT '失信被执行',
                                    `history_shi_xin` int DEFAULT NULL COMMENT '历史失信被执行',
                                    `zhi_xing` int DEFAULT NULL COMMENT '被执行人',
                                    `history_zhi_xing` int DEFAULT NULL COMMENT '历史被执行人',
                                    `goa_xiao` int DEFAULT NULL COMMENT '限制高消费',
                                    `history_gao_xiao` int DEFAULT NULL COMMENT '历史限制高消费',
                                    `punish` int DEFAULT NULL COMMENT '近两年行政处罚',
                                    `punish_amount` decimal(17,4) DEFAULT NULL COMMENT '近两年行政处罚金额',
                                    `document_total` int DEFAULT NULL COMMENT '涉诉',
                                    `documnet_bei_gao` int DEFAULT NULL COMMENT '涉诉（被告）',
                                    `documnet_yuan_gao` int DEFAULT NULL COMMENT '涉诉（原告）',
                                    `document_finance` int DEFAULT NULL COMMENT '金融机构涉诉',
                                    PRIMARY KEY (`id`)
) COMMENT='企业商誉';

DROP TABLE IF EXISTS  `private_lending`;
CREATE TABLE `private_lending` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                      `c_enterprise_id` bigint(20) NOT NULL COMMENT 'c端 企业信息id',
                                      `c_judgment_documents_id` bigint(20) NOT NULL COMMENT 'sop端 裁判文书信息id',
                                      `case_name` varchar(3000) DEFAULT NULL COMMENT '文书标题',
                                      `case_reason` varchar(1000) DEFAULT NULL COMMENT '案由',
                                      `case_No` varchar(100) DEFAULT NULL COMMENT '案号',
                                      `amount` varchar(100) DEFAULT NULL COMMENT '案件金额（元）',
                                      `judge_result` text DEFAULT NULL COMMENT '裁判结果',
                                      `judge_date` varchar(100) DEFAULT NULL COMMENT '裁判日期',
                                      `personName` varchar(200) DEFAULT NULL COMMENT '当事人',
                                      `publish_date` varchar(100) DEFAULT NULL COMMENT '发布日期',
                                      `private_lending` tinyint(3) DEFAULT NULL COMMENT '是否民间借贷调整 0 否 1 是',
                                      `video_due_diligence_private_lending` tinyint(3) DEFAULT NULL COMMENT '视频尽调-是否民间借贷调整 0 否 1 是',
                                      PRIMARY KEY (`id`)
) COMMENT='民间借贷';

DROP TABLE IF EXISTS  `serious_illegality`;
CREATE TABLE `serious_illegality` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                      `c_enterprise_id` bigint(20) NOT NULL COMMENT 'c端 企业信息id',
                                      `c_serious_illegal_data_id` bigint(20) NOT NULL COMMENT 'sop端 严重违法明细id',
                                      `add_date` varchar(100) DEFAULT NULL COMMENT '列入日期，精确到天，如“2022-01-01',
                                      `add_office` varchar(500) DEFAULT NULL COMMENT '作出决定机关(列入)',
                                      `add_reason` varchar(1000) DEFAULT NULL COMMENT '列入严重违法失信企业名单原因',
                                      `serious_illegality` tinyint(3) DEFAULT NULL COMMENT '严重违法 0 否 1 是',
                                      `video_due_diligence_serious_illegality` tinyint(3) DEFAULT NULL COMMENT '视频尽调-严重违法 0 否 1 是',
                                      PRIMARY KEY (`id`)
) COMMENT='严重违法';

DROP TABLE IF EXISTS  `tax_owe_notice`;
CREATE TABLE `tax_owe_notice` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                      `c_enterprise_id` bigint(20) NOT NULL COMMENT 'c端 企业信息id',
                                      `c_tax_owe_notice_data_id` bigint(20) NOT NULL COMMENT 'sop端 欠税公告明细id',
                                      `title` varchar(1000) DEFAULT NULL COMMENT '欠税税种',
                                      `amount` varchar(100) DEFAULT NULL COMMENT '欠税余额（元）',
                                      `new_amount` varchar(100) DEFAULT NULL COMMENT '当前新发生的欠税金额（元）',
                                      `punish_office` varchar(1000) DEFAULT NULL COMMENT '发布单位',
                                      `punish_date` varchar(100) DEFAULT NULL COMMENT '发布日期，精确到天，如“2022-01-01”',
                                      `tax_owe_notice` tinyint(3) DEFAULT NULL COMMENT '欠税公告 0 否 1 是',
                                      `video_due_diligence_tax_owe_notice` tinyint(3) DEFAULT NULL COMMENT '视频尽调-欠税公告 0 否 1 是',
                                      PRIMARY KEY (`id`)
) COMMENT='欠税公告';

DROP TABLE IF EXISTS  `tax_illegal_data`;
CREATE TABLE `tax_illegal_data` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                      `c_enterprise_id` bigint(20) NOT NULL COMMENT 'c端 企业信息id',
                                      `c_tax_illegal_data_id` bigint(20) NOT NULL COMMENT 'sop端 税收违法明细id',
                                      `punish_date` varchar(100) DEFAULT NULL COMMENT '发布日期，精确到天，如“2022-01-01”',
                                      `case_nature` varchar(100) DEFAULT NULL COMMENT '案件性质',
                                      `tax_gov` varchar(500) DEFAULT NULL COMMENT '所属税务机关',
                                      `illegal_content` varchar(1000) DEFAULT NULL COMMENT '主要违法事实',
                                      `punish_content` varchar(1000) DEFAULT NULL COMMENT '法律依据及处理处罚情况',
                                      `tax_illegal` tinyint(3) DEFAULT NULL COMMENT '税收违法 0 否 1 是',
                                      `video_due_diligence_tax_illegal` tinyint(3) DEFAULT NULL COMMENT '视频尽调-税收违法 0 否 1 是',
                                      PRIMARY KEY (`id`)
) COMMENT='税收违法';

DROP TABLE IF EXISTS  `blacklist`;
CREATE TABLE `blacklist` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                      `c_enterprise_id` bigint(20) NOT NULL COMMENT 'c端 企业信息id',
                                      `c_blacklist_id` bigint(20) NOT NULL COMMENT 'sop端 黑名单id',
                                      `punish_type` varchar(100) DEFAULT NULL COMMENT '类型',
                                      `case_reason` varchar(1000) DEFAULT NULL COMMENT '列入原因',
                                      `decision_office` varchar(500) DEFAULT NULL COMMENT '列入机关',
                                      `decision_date` varchar(100) DEFAULT NULL COMMENT '列入日期，精确到天，如“2022-01-01”',
                                      `removed_date` varchar(100) DEFAULT NULL COMMENT '移出日期，精确到天，如“2022-01-01”',
                                      `blacklist` tinyint(3) DEFAULT NULL COMMENT '黑名单 0 否 1 是',
                                      `video_due_diligence_blacklist` tinyint(3) DEFAULT NULL COMMENT '视频尽调-黑名单 0 否 1 是',
                                      PRIMARY KEY (`id`)
) COMMENT='黑名单';

DROP TABLE IF EXISTS  `exception_data`;
CREATE TABLE `exception_data` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                      `c_enterprise_id` bigint(20) NOT NULL COMMENT 'c端 企业信息id',
                                      `c_exception_data_id` bigint(20) NOT NULL COMMENT 'sop端 经营异常id',
                                      `add_date` varchar(100) DEFAULT NULL COMMENT '列入日期，精确到天，如“2022-01-01”',
                                      `add_office` varchar(500) DEFAULT NULL COMMENT '作出决定机关(列入)',
                                      `add_reason` varchar(1000) DEFAULT NULL COMMENT '列入经营异常名录原因',
                                      `exception` tinyint(3) DEFAULT NULL COMMENT '经营异常 0 否 1 是',
                                      `video_due_diligence_exception` tinyint(3) DEFAULT NULL COMMENT '视频尽调-其他经营异常 0 否 1 是',
                                      PRIMARY KEY (`id`)
) COMMENT='其他经营异常';

DROP TABLE IF EXISTS  `News`;
CREATE TABLE `News` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                      `c_enterprise_id` bigint(20) NOT NULL COMMENT 'c端 企业信息id',
                                      `c_News_id` bigint(20) NOT NULL COMMENT 'sop端 新闻舆情id',
                                      `title` varchar(1000) DEFAULT NULL COMMENT '新闻标题',
                                      `publish_time` varchar(100) DEFAULT NULL COMMENT '发布时间',
                                      `News` tinyint(3) DEFAULT NULL COMMENT '重大负面新闻舆情 0 否 1 是',
                                      `video_due_diligence_News` tinyint(3) DEFAULT NULL COMMENT '视频尽调-重大负面新闻舆情 0 否 1 是',
                                      PRIMARY KEY (`id`)
) COMMENT='重大负面新闻舆情';

DROP TABLE IF EXISTS  `supplier_approval_first`;
CREATE TABLE `supplier_approval_first` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                      `c_supplier_info_history_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业历史信息id',
                                      `main_enterprise_count` bigint(20) NOT NULL COMMENT '主企业红线否决项',
                                      `main_enterprise_result` varchar(32) NOT NULL COMMENT '主企业测算结论',
                                      `guarantee_enterprise_count` bigint(20) DEFAULT NULL COMMENT '担保企业红线否决项',
                                      `guarantee_enterprise_result` varchar(32) DEFAULT NULL COMMENT '担保企业测算结论',
                                      `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                      `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                      `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                      `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                      PRIMARY KEY (`id`)
) COMMENT='供应商审核第一步 综合评估';

DROP TABLE IF EXISTS  `supplier_approval_second`;
CREATE TABLE `supplier_approval_second` (
                                            `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                            `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                            `c_supplier_info_history_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业历史信息id',
                                            `c_enterprise_history_id` bigint(20) NOT NULL COMMENT 'c端 企业信息历史id',
                                            `scope` varchar(1024) DEFAULT '' COMMENT '经营范围',
                                            `scope_compliance` tinyint(3) DEFAULT null COMMENT '经营范围是否达标 0不达标 1达标',
                                            `business_address` varchar(500) NOT NULL COMMENT '经营地址',
                                            `address_compliance` tinyint(3) DEFAULT null COMMENT '经营地址是否达标 0不达标 1达标',
                                            `approval_comment` varchar(3000) DEFAULT '' COMMENT '审批意见',
                                            `approval_conclusion` varchar(50) NOT NULL COMMENT '审批结论',
                                            `shareholder_score` decimal(17,4) NOT NULL COMMENT '股东得分',
                                            `establishment_period_score` decimal(17,4) NOT NULL COMMENT '成立年限得分',
                                            `registered_capital_score` decimal(17,4) NOT NULL COMMENT '注册资本得分',
                                            `registered_address_score` decimal(17,4) NOT NULL COMMENT '注册地址得分',
                                            `business_address_score` decimal(17,4) NOT NULL COMMENT '经营地址得分',
                                            `industry_score` decimal(17,4) NOT NULL COMMENT '所属行业得分',
                                            `business_scope_score` decimal(17,4) NOT NULL COMMENT '经营范围得分',
                                            `basic_change_score` decimal(17,4) NOT NULL COMMENT '基本变动信息得分',
                                            `main_business_income` decimal(17,4) NOT NULL COMMENT '主营业务收入',
                                            `main_business_income_score` decimal(17,4) NOT NULL COMMENT '主营业务收入得分',
                                            `main_business_cost` decimal(17,4) NOT NULL COMMENT '主营业务成本',
                                            `main_business_profit` decimal(17,4) NOT NULL COMMENT '毛利率',
                                            `main_business_profit_score` decimal(17,4) NOT NULL COMMENT '毛利率得分',
                                            `revenue_rating` varchar(50) NOT NULL COMMENT '收入评级',
                                            `evaluation_opinions` text NOT NULL COMMENT '评估意见',
                                            `admitted` varchar(50) NOT NULL COMMENT '是否准入',
                                            `score` decimal(17,4) NOT NULL COMMENT '得分',
                                            `credit_limit` decimal(17,4) NOT NULL COMMENT '授信额度',

                                            `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                            `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                            `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                            `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                            PRIMARY KEY (`id`)
) COMMENT='供应商审核第二步';

DROP TABLE IF EXISTS  `upstream_procurement_documents`;
CREATE TABLE `upstream_procurement_documents` (
                                                    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                    `c_upstream_procurement_documents_history_id` bigint(20) NOT NULL COMMENT 'c端 上游采购单据id',
                                                    `name` varchar(32) DEFAULT '' COMMENT '合作企业名称',
                                                    `compliance` tinyint(3) DEFAULT null COMMENT '是否达标 0不达标 1达标',
                                                    `supplier_approval_second_id` bigint(20) DEFAULT NULL COMMENT '供应商审核第二步id',
                                                    `result` tinyint(3) DEFAULT null COMMENT '视频尽调-准入结论 0否 1是',
                                                    `score` decimal(17,4) DEFAULT null COMMENT '得分',
                                                    PRIMARY KEY (`id`)
) COMMENT='上游采购单据';

DROP TABLE IF EXISTS  `sales_documents_info`;
CREATE TABLE `sales_documents_info` (
                                          `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                          `c_sales_documents_info_history_id` bigint(20) NOT NULL COMMENT 'c端 下游销售单据id',
                                          `name` varchar(32) DEFAULT '' COMMENT '合作企业名称',
                                          `compliance` tinyint(3) DEFAULT null COMMENT '是否达标 0不达标 1达标',
                                          `supplier_approval_second_id` bigint(20) DEFAULT NULL COMMENT '供应商审核第二步id',
                                          `result` tinyint(3) DEFAULT null COMMENT '视频尽调-准入结论 0否 1是',
                                          `score` decimal(17,4) DEFAULT null COMMENT '得分',
                                          PRIMARY KEY (`id`)
) COMMENT='下游销售单据';

DROP TABLE IF EXISTS  `video_due_diligence`;
CREATE TABLE `video_due_diligence` (
                                          `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                          `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                          `enterprise_name` varchar(50) DEFAULT '' COMMENT '企业名称',
                                          `social_credit_code` varchar(50) DEFAULT '' COMMENT '统一性用代码',
                                          `legal_representative` varchar(50) DEFAULT '' COMMENT '法定代表人',
                                          `age` tinyint(3) DEFAULT null COMMENT '年龄',
                                          `shareholder_standard_score` decimal(17,4) NOT NULL COMMENT '股东标准分值',
                                          `shareholder_measurement_score` decimal(17,4) NOT NULL COMMENT '股东测算分值',
                                          `shareholder_question` longtext DEFAULT NULL COMMENT '股东问题',
                                          `shareholder_feedback` longtext DEFAULT NULL COMMENT '股东尽调反馈',
                                          `shareholder_conclusion` tinyint(3) NOT NULL COMMENT '股东准入结论 0否  1是',
                                          `start_date` datetime DEFAULT NULL COMMENT '成立日期',
                                          `establishment_period` bigint(20) DEFAULT NULL COMMENT '成立年限',
                                          `life_standard_score` decimal(17,4) NOT NULL COMMENT '成立年限标准分值',
                                          `life_measurement_score` decimal(17,4) NOT NULL COMMENT '成立年限测算分值',
                                          `life_question` longtext DEFAULT NULL COMMENT '成立年限问题',
                                          `life_feedback` longtext DEFAULT NULL COMMENT '成立年限尽调反馈',
                                          `life_conclusion` tinyint(3) NOT NULL COMMENT '成立年限准入结论 0否  1是',
                                          `capital_standard_score` decimal(17,4) NOT NULL COMMENT '注册资本标准分值',
                                          `capital_measurement_score` decimal(17,4) NOT NULL COMMENT '注册资本测算分值',
                                          `registered_capital` varchar(50) DEFAULT '' COMMENT '注册资本',
                                          `capital_question` longtext DEFAULT NULL COMMENT '注册资本问题',
                                          `capital_feedback` longtext DEFAULT NULL COMMENT '注册资本尽调反馈',
                                          `capital_conclusion` tinyint(3) NOT NULL COMMENT '注册资本准入结论 0否  1是',
                                          `address` varchar(50) DEFAULT '' COMMENT '注册地址',
                                          `address_standard_score` decimal(17,4) NOT NULL COMMENT ' 注册地址标准分值',
                                          `address_measurement_score` decimal(17,4) NOT NULL COMMENT ' 注册地址测算分值',
                                          `address_question` longtext DEFAULT NULL COMMENT ' 注册地址问题',
                                          `address_feedback` longtext DEFAULT NULL COMMENT ' 注册地址尽调反馈',
                                          `address_conclusion` tinyint(3) NOT NULL COMMENT ' 注册地址准入结论 0否  1是',
                                          `business_address` varchar(50) DEFAULT '' COMMENT '经营地址',
                                          `business_address_standard_score` decimal(17,4) NOT NULL COMMENT ' 经营地址标准分值',
                                          `business_address_measurement_score` decimal(17,4) NOT NULL COMMENT ' 经营地址测算分值',
                                          `business_address_question` longtext DEFAULT NULL COMMENT ' 经营地址问题',
                                          `business_address_feedback` longtext DEFAULT NULL COMMENT ' 经营地址尽调反馈',
                                          `business_address_conclusion` tinyint(3) NOT NULL COMMENT ' 经营地址准入结论 0否  1是',
                                          `industry` varchar(50) DEFAULT '' COMMENT '所属行业',
                                          `industry_standard_score` decimal(17,4) DEFAULT NULL COMMENT ' 所属行业标准分值',
                                          `industry_measurement_score` decimal(17,4) DEFAULT NULL COMMENT ' 所属行业测算分值',
                                          `industry_question` longtext DEFAULT NULL COMMENT ' 所属行业问题',
                                          `industry_feedback` longtext DEFAULT NULL COMMENT ' 所属行业尽调反馈',
                                          `industry_conclusion` tinyint(3) DEFAULT NULL COMMENT ' 所属行业准入结论 0否  1是',
                                          `business_scope` longtext DEFAULT NULL COMMENT '经营范围',
                                          `business_scope_standard_score` decimal(17,4) NOT NULL COMMENT ' 经营范围标准分值',
                                          `business_scope_measurement_score` decimal(17,4) NOT NULL COMMENT '经营范围测算分值',
                                          `business_scope_question` longtext DEFAULT NULL COMMENT '经营范围地址问题',
                                          `business_scope_feedback` longtext DEFAULT NULL COMMENT '经营范围地址尽调反馈',
                                          `business_scope_conclusion` tinyint(3) NOT NULL COMMENT '经营范围准入结论 0否  1是',
                                          `basic_change_size` int(10) DEFAULT null COMMENT '基本变动信息',
                                          `change_standard_score` decimal(17,4) NOT NULL COMMENT '  基本变动信息标准分值',
                                          `change_measurement_score` decimal(17,4) NOT NULL COMMENT ' 基本变动信息测算分值',
                                          `change_question` longtext DEFAULT NULL COMMENT ' 基本变动信息地址问题',
                                          `change_feedback` longtext DEFAULT NULL COMMENT ' 基本变动信息地址尽调反馈',
                                          `change_conclusion` tinyint(3) NOT NULL COMMENT ' 基本变动信息准入结论 0否  1是',
                                          `associated_enterprise_standard_score` decimal(17,4) DEFAULT NULL COMMENT '关联企业标准分值',
                                          `associated_enterprise_measurement_score` decimal(17,4) DEFAULT NULL COMMENT '关联企业测算分值',
                                          `associated_enterprise_question` longtext DEFAULT NULL COMMENT '关联企业地址问题',
                                          `associated_enterprise_feedback` longtext DEFAULT NULL COMMENT '关联企业地址尽调反馈',
                                          `associated_enterprise_conclusion` tinyint(3) DEFAULT NULL COMMENT '关联企业准入结论 0否  1是',
                                          `negative_information_question` longtext DEFAULT NULL COMMENT '负面清单问题',
                                          `negative_information_feedback` longtext DEFAULT NULL COMMENT '负面清单反馈',
                                          `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                          `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                          `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                          `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                          PRIMARY KEY (`id`)
) COMMENT='视频尽调';

DROP TABLE IF EXISTS  `video_due_diligence_shareholders_situation`;
CREATE TABLE `video_due_diligence_shareholders_situation` (
                                       `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                       `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                       `video_due_diligence_id` bigint(20) NOT NULL COMMENT '视频尽调id',
                                       `c_credit_investigation_info_history_id` bigint(20) NOT NULL COMMENT 'c端 征信相关情况 企业负责人id',
                                       `overdue_accounts` bigint(20) NOT NULL COMMENT '近两年发生过逾期的账户数',
                                       `total_overdue_amount` decimal(17,4) NOT NULL COMMENT '近两年发生过逾期的合计金额',
                                       `over_90_days_overdue` tinyint(3) NOT NULL COMMENT '账户是否发生过90天以上逾期 0否 1是',
                                       `overdue_months` bigint(20) NOT NULL COMMENT '近两年贷款、信用卡连续逾期的月数',
                                       `number_of_overdue_repayments` bigint(20) NOT NULL COMMENT '近两年逾期还款记录累计次数',
                                       `number_of_loan_inquiries` bigint(20) NOT NULL COMMENT '近半年来贷款审批查询次数',
                                       `repayment_guarantee_amount` decimal(17,4) NOT NULL COMMENT '相关还款担保责任金额（为非授信主体的担保',
                                       `bad_records` tinyint(3) DEFAULT NULL COMMENT '关注类和不良类贷款记录 0无 1有',
                                       `record_of_dishonesty_execution` tinyint(3) NOT NULL COMMENT '失信被执行记录 0无 1有',
                                       `executed_record` tinyint(3) NOT NULL COMMENT '被执行记录 0无 1有',
                                       `ST_count` tinyint(3) DEFAULT NULL COMMENT '限高消费情况（个人） 0无 1有',
                                       `number_of_overdue_accounts_score` decimal(17,4) DEFAULT NULL COMMENT '近两年发生过逾期的账户数得分',
                                       `overdue_score` decimal(17,4) DEFAULT NULL COMMENT '账户是否发生过90天以上逾期得分',
                                       `consecutive_overdue_month_score` decimal(17,4) DEFAULT NULL COMMENT '近两年贷款、信用卡连续逾期的月数得分',
                                       `number_of_approval_queries_score` decimal(17,4) DEFAULT NULL COMMENT '近半年来贷款审批查询次数得分',
                                       `amount_of_guarantee_liability_score` decimal(17,4) NOT NULL COMMENT '相关还款担保责任金额（为非授信主体的担保）得分',
                                       `bad_records_score` decimal(17,4) DEFAULT NULL COMMENT '关注类和不良类贷款记录得分',
                                       `shi_xin_score` decimal(17,4) DEFAULT NULL COMMENT '失信被执行记录得分',
                                       `zhi_xing_score` decimal(17,4) DEFAULT NULL COMMENT '被执行记录得分',
                                       `ST_count_score` decimal(17,4) DEFAULT NULL COMMENT '限高消费情况（个人）得分',
                                       `question` longtext DEFAULT NULL COMMENT '问题',
                                       `feedback` longtext DEFAULT NULL COMMENT '反馈',

                                       PRIMARY KEY (`id`)
) COMMENT='视频尽调-企业负责人情况';

DROP TABLE IF EXISTS  `video_due_diligence_corporate_goodwill`;
CREATE TABLE `video_due_diligence_corporate_goodwill` (
                                                              `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                              `c_supplier_info_id` bigint(20) NOT NULL COMMENT 'c端 供应商企业信息id',
                                                              `video_due_diligence_id` bigint(20) NOT NULL COMMENT '视频尽调id',
                                                              `recovered_balance` tinyint(3) NOT NULL COMMENT '是否存在被追偿余额、关注类余额、不良类余额',
                                                              `unclear_follow_up_accounts` tinyint(3) NOT NULL COMMENT '是否存在未结清信贷的关注类账户',
                                                              `outstanding_non_performing_accounts` tinyint(3) NOT NULL COMMENT '是否存在未结清信贷的不良类账户',
                                                              `outstanding_short_term_loan_balance` decimal(17,4)  NOT NULL COMMENT '未结清短期借款余额',
                                                              `recovered_balance_score` decimal(17,4) DEFAULT NULL COMMENT '是否存在被追偿余额、关注类余额、不良类余额得分',
                                                              `concerned_accounts_with_outstanding_credit_score` decimal(17,4) DEFAULT NULL COMMENT '是否存在未结清信贷的关注类账户得分',
                                                              `outstanding_non_performing_accounts_score` decimal(17,4) DEFAULT NULL COMMENT '是否存在未结清信贷的不良类账户得分',
                                                              `outstanding_balance_score` decimal(17,4) DEFAULT NULL COMMENT '未结清短期借款余额得分',
                                                              `question` longtext DEFAULT NULL COMMENT '问题',
                                                              `feedback` longtext DEFAULT NULL COMMENT '反馈',

                                                              PRIMARY KEY (`id`)
) COMMENT='视频尽调-企业商誉';

DROP TABLE IF EXISTS  `video_due_diligence_finance`;
CREATE TABLE `video_due_diligence_finance` (
                                                `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                `video_due_diligence_id` bigint(20) NOT NULL COMMENT '视频尽调id',
                                                `main_business_income` decimal(17,4) NOT NULL COMMENT '主营业务收入',
                                                `main_business_cost` decimal(17,4) NOT NULL COMMENT '主营业务成本',
                                                `main_business_profit` decimal(17,4) NOT NULL COMMENT '毛利率',
                                                `main_business_income_score` decimal(17,4) NOT NULL COMMENT '主营业务收入得分',
                                                `main_business_profit_score` decimal(17,4) NOT NULL COMMENT '毛利率得分',

                                                `question` longtext default NULL COMMENT '问题',
                                                `feedback` longtext default NULL COMMENT '反馈',

                                                PRIMARY KEY (`id`)
) COMMENT='视频尽调-企业财务';

DROP TABLE IF EXISTS  `video_due_diligence_operations`;
CREATE TABLE `video_due_diligence_operations` (
                                                `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                `video_due_diligence_id` bigint(20) NOT NULL COMMENT '视频尽调id',
                                                `question` longtext default NULL COMMENT '问题',
                                                `feedback` longtext default NULL COMMENT '反馈',

                                                PRIMARY KEY (`id`)
) COMMENT='视频尽调-企业经营';

DROP TABLE IF EXISTS  `video_due_diligence_comprehensive_evaluation`;
CREATE TABLE `video_due_diligence_comprehensive_evaluation` (
                                                            `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                            `video_due_diligence_id` bigint(20) NOT NULL COMMENT '视频尽调id',
                                                            `revenue_rating` varchar(50) NOT NULL COMMENT '收入评级',
                                                            `evaluation_opinions` text NOT NULL COMMENT '评估意见',
                                                            `admitted` varchar(50) NOT NULL COMMENT '是否准入',
                                                            `score` decimal(17,4) NOT NULL COMMENT '得分',
                                                            `credit_limit` decimal(17,4) NOT NULL COMMENT '授信额度',
                                                            PRIMARY KEY (`id`)
) COMMENT='视频尽调-综合评估';

DROP TABLE IF EXISTS  `project_audit`;
CREATE TABLE `project_audit` (
                                                            `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                            `c_project_information_id` bigint(20) NOT NULL COMMENT 'c端 项目信息id',
                                                            `enterprise_nature` varchar(50) NOT NULL COMMENT '企业性质 0-大陆企业，1-社会组织 ，3-中国香港公司，4-事业单位，5-中国台湾公司，7-医院，8-海外公司，9-律师事务所，10-学校 ，11-机关单位，-1-其他',
                                                            `enterprise_nature_detail` varchar(50) default NULL COMMENT '上市公司类型',
                                                            `holding_ratio` varchar(50) NOT NULL COMMENT '控股比例',
                                                            `equity_hierarchy` varchar(50) NOT NULL COMMENT '股权层级',
                                                            `equity_hierarchy_detail` varchar(50) NOT NULL COMMENT '股权层级小类',
                                                            `credit_rating` varchar(50) NOT NULL COMMENT '信用评级',
                                                            `involving_litigation_access` tinyint(3) NOT NULL COMMENT '历史涉诉数量准入 0否 1 是',
                                                            `administrative_penalty_access` tinyint(3) NOT NULL COMMENT '行政处罚数量准入 0否 1 是',
                                                            `administrative_penalty_amount_access` tinyint(3) NOT NULL COMMENT '行政处罚金额准入 0否 1 是',
                                                            `environmental_penalty_amount_access` tinyint(3) NOT NULL COMMENT '环保处罚金额准入 0否 1 是',
                                                            `evaluation_opinions` text NOT NULL COMMENT '评估意见',

                                                            `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                                            `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                                            `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                                            `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                                            PRIMARY KEY (`id`)
) COMMENT='项目企业审核';

DROP TABLE IF EXISTS  `project_owner_score`;
CREATE TABLE `project_owner_score` (
                                                 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                 `project_audit_id` bigint(20) NOT NULL COMMENT '项目企业审核id',
                                                 `project_address_score` decimal(17,4) NOT NULL COMMENT '项目地点得分',
                                                 `project_cycle_score` decimal(17,4) NOT NULL COMMENT '项目周期得分',
                                                 `project_nature_score` decimal(17,4) NOT NULL COMMENT '项目性质得分',
                                                 `fund_score` decimal(17,4) NOT NULL COMMENT '资金来源及占比得分',
                                                 `establishment_period_score` decimal(17,4) NOT NULL COMMENT '成立年限得分',
                                                 `registered_address_score` decimal(17,4) NOT NULL COMMENT '注册地址得分',
                                                 `business_address_score` decimal(17,4) NOT NULL COMMENT '经营地址得分',
                                                 `registered_capital_score` decimal(17,4) NOT NULL COMMENT '注册资本得分',
                                                 `enterprise_nature_score` decimal(17,4) NOT NULL COMMENT '企业性质得分',
                                                 `holding_ratio_score` decimal(17,4) NOT NULL COMMENT '控股比例得分',
                                                 `equity_hierarchy_score` decimal(17,4) NOT NULL COMMENT '股权层级得分',
                                                 `credit_rating_score` decimal(17,4) NOT NULL COMMENT '信用评级得分',
                                                 `enterprise_change` tinyint(3) NOT NULL COMMENT '企业基本变动信息',
                                                 `enterprise_change_score` decimal(17,4) NOT NULL COMMENT '企业基本变动信息得分',
                                                 `shi_xin` tinyint(3) NOT NULL COMMENT '失信被执行信息',
                                                 `shi_xin_score` decimal(17,4) NOT NULL COMMENT '失信被执行信息得分',
                                                 `st_count` tinyint(3) NOT NULL COMMENT ' 限高消费情况（企业）',
                                                 `st_count_score` decimal(17,4) NOT NULL COMMENT ' 限高消费情况（企业）得分',
                                                 `st_count_person` tinyint(3) NOT NULL COMMENT '限高消费情况（法人）',
                                                 `st_count_person_score` decimal(17,4) NOT NULL COMMENT '限高消费情况（法人）得分',
                                                 `zhi_xing_amount` decimal(17,4) NOT NULL COMMENT '当前被执行金额',
                                                 `zhi_xing_amount_score` decimal(17,4) NOT NULL COMMENT '当前被执行金额得分',
                                                 `zhi_xing_frequent` bigint(20) NOT NULL COMMENT '当前被执行频率',
                                                 `zhi_xing_frequent_score` decimal(17,4) NOT NULL COMMENT '当前被执行频率得分',
                                                 `historical_litigation_amount` decimal(17,4) NOT NULL COMMENT '历史涉诉金额',
                                                 `historical_litigation_amount_score` decimal(17,4) NOT NULL COMMENT '历史涉诉金额得分',
                                                 `historical_litigation_count` bigint(20) NOT NULL COMMENT '历史涉诉数量（近一年）',
                                                 `historical_litigation_count_score` decimal(17,4) NOT NULL COMMENT '历史涉诉数量（近一年）得分',
                                                 `private_lending` tinyint(3) NOT NULL COMMENT '民间借贷被告记录',
                                                 `private_lending_score` decimal(17,4) NOT NULL COMMENT '民间借贷被告记录得分',
                                                 `financial_institution` tinyint(3) NOT NULL COMMENT '金融机构被告案件',
                                                 `financial_institution_score` decimal(17,4) NOT NULL COMMENT '金融机构被告案件得分',
                                                 `equity_freeze` tinyint(3) NOT NULL COMMENT '股权冻结',
                                                 `equity_freeze_score` decimal(17,4) NOT NULL COMMENT '股权冻结得分',
                                                 `major_abnormal_litigation` tinyint(3) NOT NULL COMMENT '重大异常诉讼',
                                                 `major_abnormal_litigation_score` decimal(17,4) NOT NULL COMMENT '重大异常诉讼得分',
                                                 `serious_illegality` tinyint(3) NOT NULL COMMENT '严重违法行为',
                                                 `serious_illegality_score` decimal(17,4) NOT NULL COMMENT '严重违法行为得分',
                                                 `tax_owe_notice` tinyint(3) NOT NULL COMMENT '欠税公告',
                                                 `tax_owe_notice_score` decimal(17,4) NOT NULL COMMENT '欠税公告得分',
                                                 `tax_illegal` tinyint(3) NOT NULL COMMENT '税收违法',
                                                 `tax_illegal_score` decimal(17,4) NOT NULL COMMENT '税收违法得分',
                                                 `blacklist` tinyint(3) NOT NULL COMMENT ' 黑名单信息',
                                                 `blacklist_score` decimal(17,4) NOT NULL COMMENT ' 黑名单信息得分',
                                                 `exception` tinyint(3) NOT NULL COMMENT '其他经营异常',
                                                 `exception_score` decimal(17,4) NOT NULL COMMENT '其他经营异常得分',
                                                 `administrative_penalty_count` bigint(20) NOT NULL COMMENT '行政处罚数量',
                                                 `administrative_penalty_count_score` decimal(17,4) NOT NULL COMMENT '行政处罚数量得分',
                                                 `administrative_penalty_amount` decimal(17,4) NOT NULL COMMENT '行政处罚金额',
                                                 `administrative_penalty_amount_score` decimal(17,4) NOT NULL COMMENT '行政处罚金额得分',
                                                 `environmental_penalties_amount` decimal(17,4) NOT NULL COMMENT '环保处罚金额',
                                                 `environmental_penalties_amount_score` decimal(17,4) NOT NULL COMMENT '环保处罚金额得分',
                                                 `news` tinyint(3) NOT NULL COMMENT '重大负面新闻舆情',
                                                 `news_score` decimal(17,4) NOT NULL COMMENT '重大负面新闻舆情得分',
                                                 `estimated_accounting_period_score` decimal(17,4) NOT NULL COMMENT '预估账期得分',


                                                 `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                                 `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                                 `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                                 `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                                 PRIMARY KEY (`id`)
) COMMENT='项目业主企业打分表';


DROP TABLE IF EXISTS  `project_owner_private_lending`;
CREATE TABLE `project_owner_private_lending` (
                                   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                   `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                                   `c_judgment_documents_id` bigint(20) NOT NULL COMMENT 'sop端 裁判文书信息id',
                                   `case_name` varchar(3000) DEFAULT NULL COMMENT '文书标题',
                                   `case_reason` varchar(1000) DEFAULT NULL COMMENT '案由',
                                   `case_No` varchar(100) DEFAULT NULL COMMENT '案号',
                                   `amount` varchar(100) DEFAULT NULL COMMENT '案件金额（元）',
                                   `judge_result` text DEFAULT NULL COMMENT '裁判结果',
                                   `judge_date` varchar(100) DEFAULT NULL COMMENT '裁判日期',
                                   `publish_date` varchar(100) DEFAULT NULL COMMENT '发布日期',
                                   `party_name` varchar(100) DEFAULT NULL COMMENT '当事人',
                                   `private_lending` tinyint(3) NOT NULL COMMENT '是否民间借贷 0 否 1 是',
                                   PRIMARY KEY (`id`)
) COMMENT='项目业主方-民间借贷';

DROP TABLE IF EXISTS  `project_owner_equity_freeze`;
CREATE TABLE `project_owner_equity_freeze` (
                                                 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                 `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                                                 `c_equity_freeze_data_id` bigint(20) NOT NULL COMMENT 'sop端 股权冻结列表信息id',
                                                 `doc_No` varchar(100) DEFAULT NULL COMMENT '执行通知书文号',
                                                 `be_executed` varchar(500) DEFAULT NULL COMMENT '被执行人',
                                                 `freeze_company` varchar(500) DEFAULT NULL COMMENT '冻结股权标的企业',
                                                 `equity_amount` varchar(100) DEFAULT NULL COMMENT '股权数额',
                                                 `execute_court` varchar(500) DEFAULT NULL COMMENT '执行法院',
                                                 `status` varchar(100) DEFAULT NULL COMMENT '状态',
                                                 `freeze_start_date` varchar(100) DEFAULT NULL COMMENT '冻结开始日期，精确到天，如“2022-01-01”',
                                                 `freeze_end_date` varchar(100) DEFAULT NULL COMMENT '冻结结束日期，精确到天，如“2022-01-01”',
                                                 `equity_freeze` tinyint(3) NOT NULL COMMENT '股权冻结 0 否 1 是',
                                                 PRIMARY KEY (`id`)
) COMMENT='项目业主方-股权冻结';

DROP TABLE IF EXISTS  `project_owner_major_abnormal_litigation`;
CREATE TABLE `project_owner_major_abnormal_litigation` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                               `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                                               `c_judgment_documents_id` bigint(20) NOT NULL COMMENT 'sop端 裁判文书信息id',
                                               `case_name` varchar(3000) DEFAULT NULL COMMENT '文书标题',
                                               `case_reason` varchar(1000) DEFAULT NULL COMMENT '案由',
                                               `case_No` varchar(100) DEFAULT NULL COMMENT '案号',
                                               `amount` varchar(100) DEFAULT NULL COMMENT '案件金额（元）',
                                               `judge_result` text DEFAULT NULL COMMENT '裁判结果',
                                               `judge_date` varchar(100) DEFAULT NULL COMMENT '裁判日期',
                                               `publish_date` varchar(100) DEFAULT NULL COMMENT '发布日期',
                                               `party_name` varchar(100) DEFAULT NULL COMMENT '当事人',
                                               `major_abnormal_litigation` tinyint(3) NOT NULL COMMENT '重大异常诉讼 0 否 1 是',
                                               PRIMARY KEY (`id`)
) COMMENT='项目业主方-重大异常诉讼';

DROP TABLE IF EXISTS  `project_owner_serious_illegality`;
CREATE TABLE `project_owner_serious_illegality` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                                      `c_serious_illegal_data_id` bigint(20) NOT NULL COMMENT 'sop端 严重违法明细id',
                                      `add_date` varchar(100) DEFAULT NULL COMMENT '列入日期，精确到天，如“2022-01-01',
                                      `add_office` varchar(500) DEFAULT NULL COMMENT '作出决定机关(列入)',
                                      `add_reason` varchar(1000) DEFAULT NULL COMMENT '列入严重违法失信企业名单原因',
                                      `serious_illegality` tinyint(3) NOT NULL COMMENT '严重违法 0 否 1 是',
                                      PRIMARY KEY (`id`)
) COMMENT='项目业主方-严重违法';

DROP TABLE IF EXISTS  `project_owner_tax_owe_notice`;
CREATE TABLE `project_owner_tax_owe_notice` (
                                  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                  `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                                  `c_tax_owe_notice_data_id` bigint(20) NOT NULL COMMENT 'sop端 欠税公告明细id',
                                  `title` varchar(1000) DEFAULT NULL COMMENT '欠税税种',
                                  `amount` varchar(100) DEFAULT NULL COMMENT '欠税余额（元）',
                                  `new_amount` varchar(100) DEFAULT NULL COMMENT '当前新发生的欠税金额（元）',
                                  `punish_office` varchar(1000) DEFAULT NULL COMMENT '发布单位',
                                  `punish_date` varchar(100) DEFAULT NULL COMMENT '发布日期，精确到天，如“2022-01-01”',
                                  `tax_owe_notice` tinyint(3) NOT NULL COMMENT '欠税公告 0 否 1 是',
                                  PRIMARY KEY (`id`)
) COMMENT='项目业主方-欠税公告';

DROP TABLE IF EXISTS  `project_owner_tax_illegal_data`;
CREATE TABLE `project_owner_tax_illegal_data` (
                                    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                    `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                                    `c_tax_illegal_data_id` bigint(20) NOT NULL COMMENT 'sop端 税收违法明细id',
                                    `punish_date` varchar(100) DEFAULT NULL COMMENT '发布日期，精确到天，如“2022-01-01”',
                                    `case_nature` varchar(100) DEFAULT NULL COMMENT '案件性质',
                                    `tax_gov` varchar(500) DEFAULT NULL COMMENT '所属税务机关',
                                    `illegal_content` varchar(1000) DEFAULT NULL COMMENT '主要违法事实',
                                    `punish_content` varchar(1000) DEFAULT NULL COMMENT '法律依据及处理处罚情况',
                                    `tax_illegal` tinyint(3) NOT NULL COMMENT '税收违法 0 否 1 是',
                                    PRIMARY KEY (`id`)
) COMMENT='项目业主方-税收违法';

DROP TABLE IF EXISTS  `project_owner_blacklist`;
CREATE TABLE `project_owner_blacklist` (
                             `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                             `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                             `c_blacklist_id` bigint(20) NOT NULL COMMENT 'sop端 黑名单id',
                             `punish_type` varchar(100) DEFAULT NULL COMMENT '类型',
                             `case_reason` varchar(1000) DEFAULT NULL COMMENT '列入原因',
                             `decision_office` varchar(500) DEFAULT NULL COMMENT '列入机关',
                             `decision_date` varchar(100) DEFAULT NULL COMMENT '列入日期，精确到天，如“2022-01-01”',
                             `removed_date` varchar(100) DEFAULT NULL COMMENT '移出日期，精确到天，如“2022-01-01”',
                             `blacklist` tinyint(3) NOT NULL COMMENT '黑名单 0 否 1 是',
                             PRIMARY KEY (`id`)
) COMMENT='项目业主方-黑名单';

DROP TABLE IF EXISTS  `project_owner_exception_data`;
CREATE TABLE `project_owner_exception_data` (
                                  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                  `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                                  `c_exception_data_id` bigint(20) NOT NULL COMMENT 'sop端 经营异常id',
                                  `add_date` varchar(100) DEFAULT NULL COMMENT '列入日期，精确到天，如“2022-01-01”',
                                  `add_office` varchar(500) DEFAULT NULL COMMENT '作出决定机关(列入)',
                                  `add_reason` varchar(1000) DEFAULT NULL COMMENT '列入经营异常名录原因',
                                  `exception` tinyint(3) NOT NULL COMMENT '经营异常 0 否 1 是',
                                  PRIMARY KEY (`id`)
) COMMENT='项目业主方-其他经营异常';

DROP TABLE IF EXISTS  `project_owner_News`;
CREATE TABLE `project_owner_News` (
                         `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                         `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                         `c_News_id` bigint(20) NOT NULL COMMENT 'sop端 新闻舆情id',
                         `title` varchar(1000) DEFAULT NULL COMMENT '新闻标题',
                         `publish_time` varchar(100) DEFAULT NULL COMMENT '发布时间',
                         `News` tinyint(3) NOT NULL COMMENT '重大负面新闻舆情 0 否 1 是',
                         PRIMARY KEY (`id`)
) COMMENT='项目业主方-重大负面新闻舆情';

DROP TABLE IF EXISTS  `project_owner_comprehensive_evaluation`;
CREATE TABLE `project_owner_comprehensive_evaluation` (
                         `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                         `project_audit_id` bigint(20) NOT NULL COMMENT '项目业主方审核id',
                         `admitted` varchar(32) DEFAULT NULL COMMENT '是否准入',
                         `project_score` decimal(17,4) DEFAULT NULL COMMENT '项目得分',
                         `credit_limit` decimal(17,4) DEFAULT NULL COMMENT '授信额度（万元）',
                         PRIMARY KEY (`id`)
) COMMENT='项目业主方审核- 综合评估';

DROP TABLE IF EXISTS  `project_core_enterprise_audit`;
CREATE TABLE `project_core_enterprise_audit` (
                                 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                 `c_project_core_enterprise_id` bigint(20) NOT NULL COMMENT 'c端 项目核心企业id',
                                 `enterprise_nature` varchar(50) NOT NULL COMMENT '企业性质 0-大陆企业，1-社会组织 ，3-中国香港公司，4-事业单位，5-中国台湾公司，7-医院，8-海外公司，9-律师事务所，10-学校 ，11-机关单位，-1-其他',
                                 `enterprise_nature_detail` varchar(50) NOT NULL COMMENT '上市公司类型',
                                 `holding_ratio` varchar(50) NOT NULL COMMENT '控股比例',
                                 `equity_hierarchy` varchar(50) NOT NULL COMMENT '股权层级',
                                 `equity_hierarchy_detail` varchar(50) NOT NULL COMMENT '股权层级小类',
                                 `credit_rating` varchar(50) NOT NULL COMMENT '信用评级',
                                 `involving_litigation_access` tinyint(3) NOT NULL COMMENT '历史涉诉数量准入 0否 1 是',
                                 `administrative_penalty_access` tinyint(3) NOT NULL COMMENT '行政处罚数量准入 0否 1 是',
                                 `administrative_penalty_amount_access` tinyint(3) NOT NULL COMMENT '行政处罚金额准入 0否 1 是',
                                 `environmental_penalty_amount_access` tinyint(3) NOT NULL COMMENT '环保处罚金额准入 0否 1 是',
                                 `evaluation_opinions` text NOT NULL COMMENT '评估意见',

                                 `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                 `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                 `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                 `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                 PRIMARY KEY (`id`)
) COMMENT='项目核心企业审核';

DROP TABLE IF EXISTS  `project_core_enterprise_score`;
CREATE TABLE `project_core_enterprise_score` (
                                 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                 `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                 `establishment_period_score` decimal(17,4) NOT NULL COMMENT '成立年限得分',
                                 `registered_capital_score` decimal(17,4) NOT NULL COMMENT '注册资本得分',
                                 `business_address_score` decimal(17,4) NOT NULL COMMENT '经营地址得分',
                                 `enterprise_nature_score` decimal(17,4) NOT NULL COMMENT '企业性质得分',
                                 `holding_ratio_score` decimal(17,4) NOT NULL COMMENT '控股比例得分',
                                 `equity_hierarchy_score` decimal(17,4) NOT NULL COMMENT '股权层级得分',
                                 `credit_rating_score` decimal(17,4) NOT NULL COMMENT '信用评级得分',
                                 `enterprise_change` tinyint(3) NOT NULL COMMENT '企业基本变动信息',
                                 `enterprise_change_score` decimal(17,4) NOT NULL COMMENT '企业基本变动信息得分',
                                 `shi_xin` tinyint(3) NOT NULL COMMENT '失信被执行信息',
                                 `shi_xin_score` decimal(17,4) NOT NULL COMMENT '失信被执行信息得分',
                                 `st_count` tinyint(3) NOT NULL COMMENT ' 限高消费情况（企业）',
                                 `st_count_score` decimal(17,4) NOT NULL COMMENT ' 限高消费情况（企业）得分',
                                 `st_count_person` tinyint(3) NOT NULL COMMENT '限高消费情况（法人）',
                                 `st_count_person_score` decimal(17,4) NOT NULL COMMENT '限高消费情况（法人）得分',
                                 `zhi_xing_amount` decimal(17,4) NOT NULL COMMENT '当前被执行金额',
                                 `zhi_xing_amount_score` decimal(17,4) NOT NULL COMMENT '当前被执行金额得分',
                                 `zhi_xing_frequent` bigint(20) NOT NULL COMMENT '当前被执行频率',
                                 `zhi_xing_frequent_score` decimal(17,4) NOT NULL COMMENT '当前被执行频率得分',
                                 `historical_litigation_amount` decimal(17,4) NOT NULL COMMENT '历史涉诉金额',
                                 `historical_litigation_amount_score` decimal(17,4) NOT NULL COMMENT '历史涉诉金额得分',
                                 `historical_litigation_count` bigint(20) NOT NULL COMMENT '历史涉诉数量（近一年）',
                                 `historical_litigation_count_score` decimal(17,4) NOT NULL COMMENT '历史涉诉数量（近一年）得分',
                                 `private_lending` tinyint(3) NOT NULL COMMENT '民间借贷被告记录',
                                 `private_lending_score` decimal(17,4) NOT NULL COMMENT '民间借贷被告记录得分',
                                 `financial_institution` tinyint(3) NOT NULL COMMENT '金融机构被告案件',
                                 `financial_institution_score` decimal(17,4) NOT NULL COMMENT '金融机构被告案件得分',
                                 `equity_freeze` tinyint(3) NOT NULL COMMENT '股权冻结',
                                 `equity_freeze_score` decimal(17,4) NOT NULL COMMENT '股权冻结得分',
                                 `major_abnormal_litigation` tinyint(3) NOT NULL COMMENT '重大异常诉讼',
                                 `major_abnormal_litigation_score` decimal(17,4) NOT NULL COMMENT '重大异常诉讼得分',
                                 `serious_illegality` tinyint(3) NOT NULL COMMENT '严重违法行为',
                                 `serious_illegality_score` decimal(17,4) NOT NULL COMMENT '严重违法行为得分',
                                 `tax_owe_notice` tinyint(3) NOT NULL COMMENT '欠税公告',
                                 `tax_owe_notice_score` decimal(17,4) NOT NULL COMMENT '欠税公告得分',
                                 `tax_illegal` tinyint(3) NOT NULL COMMENT '税收违法',
                                 `tax_illegal_score` decimal(17,4) NOT NULL COMMENT '税收违法得分',
                                 `blacklist` tinyint(3) NOT NULL COMMENT ' 黑名单信息',
                                 `blacklist_score` decimal(17,4) NOT NULL COMMENT ' 黑名单信息得分',
                                 `exception` tinyint(3) NOT NULL COMMENT '其他经营异常',
                                 `exception_score` decimal(17,4) NOT NULL COMMENT '其他经营异常得分',
                                 `administrative_penalty_count` bigint(20) NOT NULL COMMENT '行政处罚数量',
                                 `administrative_penalty_count_score` decimal(17,4) NOT NULL COMMENT '行政处罚数量得分',
                                 `administrative_penalty_amount` decimal(17,4) NOT NULL COMMENT '行政处罚金额',
                                 `administrative_penalty_amount_score` decimal(17,4) NOT NULL COMMENT '行政处罚金额得分',
                                 `environmental_penalties_amount` decimal(17,4) NOT NULL COMMENT '环保处罚金额',
                                 `environmental_penalties_amount_score` decimal(17,4) NOT NULL COMMENT '环保处罚金额得分',
                                 `news` tinyint(3) NOT NULL COMMENT '重大负面新闻舆情',
                                 `news_score` decimal(17,4) NOT NULL COMMENT '重大负面新闻舆情得分',
                                 `historical_cooperation_duration_score` decimal(17,4) NOT NULL COMMENT '历史合作时间得分',
                                 `historical_cooperation_scale_score` decimal(17,4) NOT NULL COMMENT '历史合作规模得分',
                                 `historical_cooperation_invoicing_amount_score` decimal(17,4) NOT NULL COMMENT '累计历史开票金额得分',
                                 `historical_cooperation_maximum_accounting_period_score` decimal(17,4) NOT NULL COMMENT '历史回款最长账期得分',
                                 `historical_cooperation_times_score` decimal(17,4) NOT NULL COMMENT '历史合作项目数量得分',


                                 `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                 `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                 `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                 `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                 PRIMARY KEY (`id`)
) COMMENT='项目核心企业打分表';


DROP TABLE IF EXISTS  `project_core_enterprise_private_lending`;
CREATE TABLE `project_core_enterprise_private_lending` (
                                                 `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                 `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                                 `c_judgment_documents_id` bigint(20) NOT NULL COMMENT 'sop端 裁判文书信息id',
                                                 `case_name` varchar(3000) DEFAULT NULL COMMENT '文书标题',
                                                 `case_reason` varchar(1000) DEFAULT NULL COMMENT '案由',
                                                 `case_No` varchar(100) DEFAULT NULL COMMENT '案号',
                                                 `amount` varchar(100) DEFAULT NULL COMMENT '案件金额（元）',
                                                 `judge_result` text DEFAULT NULL COMMENT '裁判结果',
                                                 `judge_date` varchar(100) DEFAULT NULL COMMENT '裁判日期',
                                                 `publish_date` varchar(100) DEFAULT NULL COMMENT '发布日期',
                                                 `party_name` varchar(100) DEFAULT NULL COMMENT '当事人',
                                                 `private_lending` tinyint(3) NOT NULL COMMENT '是否民间借贷 0 否 1 是',
                                                 PRIMARY KEY (`id`)
) COMMENT='项目核心企业-民间借贷';

DROP TABLE IF EXISTS  `project_core_enterprise_equity_freeze`;
CREATE TABLE `project_core_enterprise_equity_freeze` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                               `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                               `c_equity_freeze_data_id` bigint(20) NOT NULL COMMENT 'sop端 股权冻结列表信息id',
                                               `doc_No` varchar(100) DEFAULT NULL COMMENT '执行通知书文号',
                                               `be_executed` varchar(500) DEFAULT NULL COMMENT '被执行人',
                                               `freeze_company` varchar(500) DEFAULT NULL COMMENT '冻结股权标的企业',
                                               `equity_amount` varchar(100) DEFAULT NULL COMMENT '股权数额',
                                               `execute_court` varchar(500) DEFAULT NULL COMMENT '执行法院',
                                               `status` varchar(100) DEFAULT NULL COMMENT '状态',
                                               `freeze_start_date` varchar(100) DEFAULT NULL COMMENT '冻结开始日期，精确到天，如“2022-01-01”',
                                               `freeze_end_date` varchar(100) DEFAULT NULL COMMENT '冻结结束日期，精确到天，如“2022-01-01”',
                                               `equity_freeze` tinyint(3) NOT NULL COMMENT '股权冻结 0 否 1 是',
                                               PRIMARY KEY (`id`)
) COMMENT='项目核心企业-股权冻结';

DROP TABLE IF EXISTS  `project_core_enterprise_major_abnormal_litigation`;
CREATE TABLE `project_core_enterprise_major_abnormal_litigation` (
                                                           `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                           `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                                           `c_judgment_documents_id` bigint(20) NOT NULL COMMENT 'sop端 裁判文书信息id',
                                                           `case_name` varchar(3000) DEFAULT NULL COMMENT '文书标题',
                                                           `case_reason` varchar(1000) DEFAULT NULL COMMENT '案由',
                                                           `case_No` varchar(100) DEFAULT NULL COMMENT '案号',
                                                           `amount` varchar(100) DEFAULT NULL COMMENT '案件金额（元）',
                                                           `judge_result` text DEFAULT NULL COMMENT '裁判结果',
                                                           `judge_date` varchar(100) DEFAULT NULL COMMENT '裁判日期',
                                                           `publish_date` varchar(100) DEFAULT NULL COMMENT '发布日期',
                                                           `party_name` varchar(100) DEFAULT NULL COMMENT '当事人',
                                                           `major_abnormal_litigation` tinyint(3) NOT NULL COMMENT '重大异常诉讼 0 否 1 是',
                                                           PRIMARY KEY (`id`)
) COMMENT='项目核心企业-重大异常诉讼';

DROP TABLE IF EXISTS  `project_core_enterprise_serious_illegality`;
CREATE TABLE `project_core_enterprise_serious_illegality` (
                                                    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                    `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                                    `c_serious_illegal_data_id` bigint(20) NOT NULL COMMENT 'sop端 严重违法明细id',
                                                    `add_date` varchar(100) DEFAULT NULL COMMENT '列入日期，精确到天，如“2022-01-01',
                                                    `add_office` varchar(500) DEFAULT NULL COMMENT '作出决定机关(列入)',
                                                    `add_reason` varchar(1000) DEFAULT NULL COMMENT '列入严重违法失信企业名单原因',
                                                    `serious_illegality` tinyint(3) NOT NULL COMMENT '严重违法 0 否 1 是',
                                                    PRIMARY KEY (`id`)
) COMMENT='项目核心企业-严重违法';

DROP TABLE IF EXISTS  `project_core_enterprise_tax_owe_notice`;
CREATE TABLE `project_core_enterprise_tax_owe_notice` (
                                                `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                                `c_tax_owe_notice_data_id` bigint(20) NOT NULL COMMENT 'sop端 欠税公告明细id',
                                                `title` varchar(1000) DEFAULT NULL COMMENT '欠税税种',
                                                `amount` varchar(100) DEFAULT NULL COMMENT '欠税余额（元）',
                                                `new_amount` varchar(100) DEFAULT NULL COMMENT '当前新发生的欠税金额（元）',
                                                `punish_office` varchar(1000) DEFAULT NULL COMMENT '发布单位',
                                                `punish_date` varchar(100) DEFAULT NULL COMMENT '发布日期，精确到天，如“2022-01-01”',
                                                `tax_owe_notice` tinyint(3) NOT NULL COMMENT '欠税公告 0 否 1 是',
                                                PRIMARY KEY (`id`)
) COMMENT='项目核心企业-欠税公告';

DROP TABLE IF EXISTS  `project_core_enterprise_tax_illegal_data`;
CREATE TABLE `project_core_enterprise_tax_illegal_data` (
                                                  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                  `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                                  `c_tax_illegal_data_id` bigint(20) NOT NULL COMMENT 'sop端 税收违法明细id',
                                                  `punish_date` varchar(100) DEFAULT NULL COMMENT '发布日期，精确到天，如“2022-01-01”',
                                                  `case_nature` varchar(100) DEFAULT NULL COMMENT '案件性质',
                                                  `tax_gov` varchar(500) DEFAULT NULL COMMENT '所属税务机关',
                                                  `illegal_content` varchar(1000) DEFAULT NULL COMMENT '主要违法事实',
                                                  `punish_content` varchar(1000) DEFAULT NULL COMMENT '法律依据及处理处罚情况',
                                                  `tax_illegal` tinyint(3) NOT NULL COMMENT '税收违法 0 否 1 是',
                                                  PRIMARY KEY (`id`)
) COMMENT='项目核心企业-税收违法';

DROP TABLE IF EXISTS  `project_core_enterprise_blacklist`;
CREATE TABLE `project_core_enterprise_blacklist` (
                                           `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                           `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                           `c_blacklist_id` bigint(20) NOT NULL COMMENT 'sop端 黑名单id',
                                           `punish_type` varchar(100) DEFAULT NULL COMMENT '类型',
                                           `case_reason` varchar(1000) DEFAULT NULL COMMENT '列入原因',
                                           `decision_office` varchar(500) DEFAULT NULL COMMENT '列入机关',
                                           `decision_date` varchar(100) DEFAULT NULL COMMENT '列入日期，精确到天，如“2022-01-01”',
                                           `removed_date` varchar(100) DEFAULT NULL COMMENT '移出日期，精确到天，如“2022-01-01”',
                                           `blacklist` tinyint(3) NOT NULL COMMENT '黑名单 0 否 1 是',
                                           PRIMARY KEY (`id`)
) COMMENT='项目核心企业-黑名单';

DROP TABLE IF EXISTS  `project_core_enterprise_exception_data`;
CREATE TABLE `project_core_enterprise_exception_data` (
                                                `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                                `c_exception_data_id` bigint(20) NOT NULL COMMENT 'sop端 经营异常id',
                                                `add_date` varchar(100) DEFAULT NULL COMMENT '列入日期，精确到天，如“2022-01-01”',
                                                `add_office` varchar(500) DEFAULT NULL COMMENT '作出决定机关(列入)',
                                                `add_reason` varchar(1000) DEFAULT NULL COMMENT '列入经营异常名录原因',
                                                `exception` tinyint(3) NOT NULL COMMENT '经营异常 0 否 1 是',
                                                PRIMARY KEY (`id`)
) COMMENT='项目核心企业-其他经营异常';

DROP TABLE IF EXISTS  `project_core_enterprise_News`;
CREATE TABLE `project_core_enterprise_News` (
                                       `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                       `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                       `c_News_id` bigint(20) NOT NULL COMMENT 'sop端 新闻舆情id',
                                       `title` varchar(1000) DEFAULT NULL COMMENT '新闻标题',
                                       `publish_time` varchar(100) DEFAULT NULL COMMENT '发布时间',
                                       `News` tinyint(3) NOT NULL COMMENT '重大负面新闻舆情 0 否 1 是',
                                       PRIMARY KEY (`id`)
) COMMENT='项目核心企业-重大负面新闻舆情';


DROP TABLE IF EXISTS  `project_core_enterprise_comprehensive_evaluation`;
CREATE TABLE `project_core_enterprise_comprehensive_evaluation` (
                                                           `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                           `project_core_enterprise_audit_id` bigint(20) NOT NULL COMMENT '项目核心企业审核id',
                                                           `admitted` varchar(32) DEFAULT NULL COMMENT '是否准入',
                                                           `fixed_credit_score` decimal(17,4) DEFAULT NULL COMMENT '固定额度得分',
                                                           `fixed_credit` decimal(17,4) DEFAULT NULL COMMENT '固定额度',
                                                           `special_quota_score` decimal(17,4) DEFAULT NULL COMMENT '专项额度得分',
                                                           `special_quota` decimal(17,4) DEFAULT NULL COMMENT '专项额度',
                                                           `credit_limit` decimal(17,4) DEFAULT NULL COMMENT '授信额度（万元）',
                                                           PRIMARY KEY (`id`)
) COMMENT='项目核心企业授信- 综合评估';

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('B端_企业性质', NULL, 'enterpriseNature', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('事业单位', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_1', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('八大建筑类央企系', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_2', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('建筑类省属国企系', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_3', NULL, 2, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('建筑类市属国企系', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_4', NULL, 3, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('非建筑类央企系', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_5', NULL, 4, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('非建筑类省属国企系', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_6', NULL, 5, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('非建筑类市属国企系', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_7', NULL, 6, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('其他类', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_8', NULL, 7, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('民营上市公司', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_9', NULL, 8, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('民营非上市公司', (select t.id from t_dictionary t where t.code = 'enterpriseNature'), 'enterpriseNature_10', NULL, 9, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('主板', (select t.id from t_dictionary t where t.code = 'enterpriseNature_9'), 'enterpriseNature_9_A', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('科创板', (select t.id from t_dictionary t where t.code = 'enterpriseNature_9'), 'enterpriseNature_9_B', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('创业板', (select t.id from t_dictionary t where t.code = 'enterpriseNature_9'), 'enterpriseNature_9_C', NULL, 2, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('新三板', (select t.id from t_dictionary t where t.code = 'enterpriseNature_9'), 'enterpriseNature_9_D', NULL, 3, now(), now());


INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('B端_控股比例', NULL, 'holdingRatio', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('控股比例＜51%', (select t.id from t_dictionary t where t.code = 'holdingRatio'), 'holdingRatio_1', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('51%≤控股比例≤67%', (select t.id from t_dictionary t where t.code = 'holdingRatio'), 'holdingRatio_2', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('控股比例>67%', (select t.id from t_dictionary t where t.code = 'holdingRatio'), 'holdingRatio_3', NULL, 2, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('B端_股权层级', NULL, 'equityHierarchy', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('建筑类公司', (select t.id from t_dictionary t where t.code = 'equityHierarchy'), 'equityHierarchy_1', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('非建筑类公司', (select t.id from t_dictionary t where t.code = 'equityHierarchy'), 'equityHierarchy_2', NULL, 1, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('本级', (select t.id from t_dictionary t where t.code = 'equityHierarchy_1'), 'equityHierarchyDetail_A', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('一级', (select t.id from t_dictionary t where t.code = 'equityHierarchy_1'), 'equityHierarchyDetail_B', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('二级', (select t.id from t_dictionary t where t.code = 'equityHierarchy_1'), 'equityHierarchyDetail_C', NULL, 2, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('二级以下', (select t.id from t_dictionary t where t.code = 'equityHierarchy_1'), 'equityHierarchyDetail_D', NULL, 3, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('B端_股权层级小类_非建筑类公司', NULL, 'equityHierarchyDetail_2', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('本级', (select t.id from t_dictionary t where t.code = 'equityHierarchy_2'), 'equityHierarchyDetail_2_A', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('一级', (select t.id from t_dictionary t where t.code = 'equityHierarchy_2'), 'equityHierarchyDetail_2_B', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('二级', (select t.id from t_dictionary t where t.code = 'equityHierarchy_2'), 'equityHierarchyDetail_2_C', NULL, 2, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('三级', (select t.id from t_dictionary t where t.code = 'equityHierarchy_2'), 'equityHierarchyDetail_2_D', NULL, 3, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('三级以下', (select t.id from t_dictionary t where t.code = 'equityHierarchy_2'), 'equityHierarchyDetail_2_E', NULL, 4, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('事业单位', (select t.id from t_dictionary t where t.code = 'equityHierarchy_2'), 'equityHierarchyDetail_2_F', NULL, 5, now(), now());

DROP TABLE IF EXISTS  `enterprise_credit_rating`;
CREATE TABLE `enterprise_credit_rating` (
                                                                    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                                    `name` varchar(100) DEFAULT NULL COMMENT '企业名称',
                                                                    `level` varchar(100) DEFAULT NULL COMMENT '最新长期评级',
                                                                    `rating_outlook` varchar(100) DEFAULT NULL COMMENT '评级展望',
                                                                    `rating_adjustment` varchar(100) DEFAULT NULL COMMENT '评级调整',
                                                                    `rating_agency` varchar(100) DEFAULT NULL COMMENT '评级机构',
                                                                    PRIMARY KEY (`id`)
) COMMENT='企业信用评级';


DROP TABLE IF EXISTS  `credit_resolution`;
CREATE TABLE `credit_resolution` (
                                     `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                     `c_project_information_id` bigint(20) unsigned DEFAULT null COMMENT '项目信息id',
                                     `credit_type` varchar(50) DEFAULT null COMMENT '授信类型',
                                     `domestic_factoring` varchar(50) DEFAULT '' COMMENT '合作业务版块:国内保理',
                                     `implementing_factoring_products` varchar(50) DEFAULT '' COMMENT ' 国内-实施保理产品:',
                                     `implementing_factoring_type` varchar(50) DEFAULT '' COMMENT ' 国内-实施保理产品:',
                                     `proposed_credit_line` decimal(17,2) DEFAULT '0.00' COMMENT '授信金额',
                                     `currency` varchar(50) DEFAULT null COMMENT '授信金额币种',
                                     `credit_start_date` datetime DEFAULT NULL COMMENT '授信生效日',
                                     `proposed_credit_term` int(4) DEFAULT '0' COMMENT '授信期限',
                                     `credit_end_date` datetime DEFAULT NULL COMMENT '授信到期日',
                                     `financing_ratio_low` float(5,4) DEFAULT '0.0000' COMMENT '融资比例（占用）低点',
                                     `financing_ratio_high` float(5,4) DEFAULT '0.0000' COMMENT '融资比例（占用）高点',
                                     `plan_irr` float(6,4) DEFAULT '0.0000' COMMENT '预期IRR（占用）',
                                     `proposed_financing_ratio_two_low` float(5,4) DEFAULT '0.0000' COMMENT '融资比例（占用）低点',
                                     `proposed_financing_ratio_two_high` float(5,4) DEFAULT '0.0000' COMMENT '融资比例（占用）高点',
                                     `plan_irr_two` float(6,4) DEFAULT '0.0000' COMMENT '预期IRR（占用）',
                                     `financing_rate_low` float(5,4) DEFAULT '0.0000' COMMENT '融资利率低点',
                                     `financing_rate_high` float(5,4) DEFAULT '0.0000' COMMENT '融资利率高点',
                                     `management_rate_low` float(5,4) DEFAULT '0.0000' COMMENT '管理费率低点',
                                     `management_rate_high` float(5,4) DEFAULT '0.0000' COMMENT '管理费率高点',
                                     `margin_ratio_low` float(5,4) DEFAULT '0.0000' COMMENT '保证金比例低点',
                                     `margin_ratio_high` float(5,4) DEFAULT '0.0000' COMMENT '保证金比例高点',
                                     `comprehensive_quotation` float(5,4) DEFAULT '0.0000' COMMENT '对外综合报价',
                                     `principal_payment_method` varchar(50) DEFAULT '' COMMENT '本金支付方式',
                                     `payment_method_for_interest_management_fee` varchar(50) DEFAULT null COMMENT '利息管理费支付方式',
                                     `payment_method_for_interest_management_fee_detail` varchar(50) DEFAULT null COMMENT '利息管理费支付方式为其他时 填写',
                                     `margin_payment_method` varchar(50) DEFAULT '' COMMENT '保证金支付方式',
                                     `other_fee_payment_method` varchar(50) DEFAULT '' COMMENT '其他费用支付方式',
                                     `upstream_accounting_period` bigint(20) DEFAULT NULL COMMENT '上游账期',
                                     `upstream_accounting_period_chang_reason` varchar(50) DEFAULT NULL COMMENT '上游账期变更原因',
                                     `factoring_financing_period` bigint(20) DEFAULT NULL COMMENT '保理融资期限',
                                     `factoring_financing_period_chang_reason` varchar(50) DEFAULT NULL COMMENT '保理融资期限变更原因',
                                     `credit_report` tinyint(1) DEFAULT NULL COMMENT '是否上报 1:是，0:否',
                                     `report_method` tinyint(1) DEFAULT NULL COMMENT '上报方式 1:A类，0:B类',
                                     `credit_enhancement_measures_one` tinyint(1) DEFAULT NULL COMMENT '增信措施 保证 1是 0 否',
                                     `credit_enhancement_measures_two` tinyint(1) DEFAULT NULL COMMENT '增信措施 抵押 1是 0 否',
                                     `credit_enhancement_measures_three` tinyint(1) DEFAULT NULL COMMENT '增信措施 质押 1是 0 否',
                                     `credit_enhancement_measures_fore` tinyint(1) DEFAULT NULL COMMENT '增信措施 其他 1是 0 否',
                                     `credit_enhancement_measures_illustrate` varchar(500) DEFAULT NULL COMMENT '增信说明',
                                     `has_condition` tinyint(1) DEFAULT NULL COMMENT ' 指导性单笔业务满足条件 1是 0 否',
                                     `status` varchar(50) DEFAULT NULL COMMENT ' 状态',

                                     `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                 `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                 `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                 `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',

                                     PRIMARY KEY (`id`)
) COMMENT='授信决议';

DROP TABLE IF EXISTS  `business_meets_conditions`;
CREATE TABLE `business_meets_conditions` (
                                            `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                            `credit_resolution_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议id',
                                            `content` varchar(100) DEFAULT NULL COMMENT '条件内容',
                                            PRIMARY KEY (`id`)
) COMMENT='指导性单笔业务满足条件';

DROP TABLE IF EXISTS  `loan_conditions`;
CREATE TABLE `loan_conditions` (
                                             `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                             `credit_resolution_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议id',
                                             `content` varchar(100) DEFAULT NULL COMMENT '条件内容',
                                             PRIMARY KEY (`id`)
) COMMENT='放款条件';

DROP TABLE IF EXISTS  `credit_conclusion`;
CREATE TABLE `credit_conclusion` (
                                             `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                             `credit_resolution_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议id',
                                             `content` varchar(100) DEFAULT NULL COMMENT '条件内容',
                                             PRIMARY KEY (`id`)
) COMMENT='授信结论';

DROP TABLE IF EXISTS  `credit_resolution_history`;
CREATE TABLE `credit_resolution_history` (
                                     `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                     `c_project_information_id` bigint(20) unsigned DEFAULT null COMMENT '项目信息id',
                                     `credit_type` varchar(50) DEFAULT '0' COMMENT '授信类型',
                                     `domestic_factoring` varchar(50) DEFAULT '' COMMENT '合作业务版块:国内保理',
                                     `implementing_factoring_products` varchar(50) DEFAULT '' COMMENT ' 国内-实施保理产品:',
                                     `implementing_factoring_type` varchar(50) DEFAULT '' COMMENT ' 国内-实施保理产品:',
                                     `proposed_credit_line` decimal(17,2) DEFAULT '0.00' COMMENT '授信金额',
                                     `currency` varchar(50) DEFAULT '0' COMMENT '授信金额币种',
                                     `credit_start_date` datetime DEFAULT NULL COMMENT '授信生效日',
                                     `proposed_credit_term` int(4) DEFAULT '0' COMMENT '授信期限',
                                     `credit_end_date` datetime DEFAULT NULL COMMENT '授信到期日',
                                     `financing_ratio_low` float(5,4) DEFAULT '0.0000' COMMENT '融资比例（占用）低点',
                                     `financing_ratio_high` float(5,4) DEFAULT '0.0000' COMMENT '融资比例（占用）高点',
                                     `plan_irr` float(6,4) DEFAULT '0.0000' COMMENT '预期IRR（占用）',
                                     `proposed_financing_ratio_two_low` float(5,4) DEFAULT '0.0000' COMMENT '融资比例（占用）低点',
                                     `proposed_financing_ratio_two_high` float(5,4) DEFAULT '0.0000' COMMENT '融资比例（占用）高点',
                                     `plan_irr_two` float(6,4) DEFAULT '0.0000' COMMENT '预期IRR（占用）',
                                     `financing_rate_low` float(5,4) DEFAULT '0.0000' COMMENT '融资利率低点',
                                     `financing_rate_high` float(5,4) DEFAULT '0.0000' COMMENT '融资利率高点',
                                     `management_rate_low` float(5,4) DEFAULT '0.0000' COMMENT '管理费率低点',
                                     `management_rate_high` float(5,4) DEFAULT '0.0000' COMMENT '管理费率高点',
                                     `margin_ratio_low` float(5,4) DEFAULT '0.0000' COMMENT '保证金比例低点',
                                     `margin_ratio_high` float(5,4) DEFAULT '0.0000' COMMENT '保证金比例高点',
                                     `comprehensive_quotation` float(5,4) DEFAULT '0.0000' COMMENT '对外综合报价',
                                     `principal_payment_method` varchar(50) DEFAULT '' COMMENT '本金支付方式',
                                     `payment_method_for_interest_management_fee` varchar(50) DEFAULT null COMMENT '利息管理费支付方式',
                                     `payment_method_for_interest_management_fee_detail` varchar(50) DEFAULT null COMMENT '利息管理费支付方式为其他时 填写',
                                     `margin_payment_method` varchar(50) DEFAULT '' COMMENT '保证金支付方式',
                                     `other_fee_payment_method` varchar(50) DEFAULT '' COMMENT '其他费用支付方式',
                                     `upstream_accounting_period` bigint(20) DEFAULT NULL COMMENT '上游账期',
                                     `upstream_accounting_period_chang_reason` varchar(50) DEFAULT NULL COMMENT '上游账期变更原因',
                                     `factoring_financing_period` bigint(20) DEFAULT NULL COMMENT '保理融资期限',
                                     `factoring_financing_period_chang_reason` varchar(50) DEFAULT NULL COMMENT '保理融资期限变更原因',
                                     `credit_report` tinyint(1) DEFAULT NULL COMMENT '是否上报 1:是，0:否',
                                     `report_method` tinyint(1) DEFAULT NULL COMMENT '上报方式 1:A类，0:B类',
                                     `credit_enhancement_measures_one` tinyint(1) DEFAULT NULL COMMENT '增信措施 保证 1是 0 否',
                                     `credit_enhancement_measures_two` tinyint(1) DEFAULT NULL COMMENT '增信措施 抵押 1是 0 否',
                                     `credit_enhancement_measures_three` tinyint(1) DEFAULT NULL COMMENT '增信措施 质押 1是 0 否',
                                     `credit_enhancement_measures_fore` tinyint(1) DEFAULT NULL COMMENT '增信措施 其他 1是 0 否',
                                     `credit_enhancement_measures_illustrate` varchar(500) DEFAULT NULL COMMENT '增信说明',
                                     `has_condition` tinyint(1) DEFAULT NULL COMMENT ' 指导性单笔业务满足条件 1是 0 否',
                                     `status` varchar(50) DEFAULT NULL COMMENT ' 状态',

                                     `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                 `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                 `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                 `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                     PRIMARY KEY (`id`)
) COMMENT='授信决议历史';

DROP TABLE IF EXISTS  `business_meets_conditions_history`;
CREATE TABLE `business_meets_conditions_history` (
                                             `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                             `credit_resolution_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议id',
                                             `content` varchar(100) DEFAULT NULL COMMENT '条件内容',
                                             PRIMARY KEY (`id`)
) COMMENT='指导性单笔业务满足条件历史';

DROP TABLE IF EXISTS  `loan_conditions_history`;
CREATE TABLE `loan_conditions_history` (
                                   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                   `credit_resolution_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议id',
                                   `content` varchar(100) DEFAULT NULL COMMENT '条件内容',
                                   PRIMARY KEY (`id`)
) COMMENT='放款条件历史';

DROP TABLE IF EXISTS  `credit_conclusion_history`;
CREATE TABLE `credit_conclusion_history` (
                                    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                    `credit_resolution_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议id',
                                    `content` varchar(100) DEFAULT NULL COMMENT '条件内容',
                                    PRIMARY KEY (`id`)
) COMMENT='授信结论历史';



DROP TABLE IF EXISTS  `credit_resolution_approval`;
CREATE TABLE `credit_resolution_approval` (
                                            `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                            `credit_resolution_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议id',
                                            `credit_resolution_history_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议历史id',
                                            `conclusion` varchar(50) COLLATE utf8_bin DEFAULT '' COMMENT '审批结论',
                                            `suggestion` varchar(3000) COLLATE utf8_bin DEFAULT '' COMMENT '审批意见',
                                            PRIMARY KEY (`id`)
) COMMENT='授信决议审核结论';

DROP TABLE IF EXISTS  `reconsider_adjust`;
CREATE TABLE `reconsider_adjust` (
                                              `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                              `credit_resolution_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议id',
                                              `reason` varchar(100) DEFAULT NULL COMMENT '申请理由',
                                              `adjust_type` varchar(50) DEFAULT NULL COMMENT '调整类型',
                                              `adjust_type_detail` varchar(50) DEFAULT NULL COMMENT '调整类型 当为其他时，展示，必填文本框',
                                              `remark` varchar(100) DEFAULT NULL COMMENT '申请理由',
                                              PRIMARY KEY (`id`)
) COMMENT='复议调整';

DROP TABLE IF EXISTS  `reconsider_adjust_approval`;
CREATE TABLE `reconsider_adjust_approval` (
                                              `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                              `credit_resolution_id` bigint(20) unsigned DEFAULT null COMMENT '授信决议id',
                                              `conclusion` varchar(50) COLLATE utf8_bin DEFAULT '' COMMENT '审批结论',
                                              `suggestion` varchar(3000) COLLATE utf8_bin DEFAULT '' COMMENT '审批意见',
                                              PRIMARY KEY (`id`)
) COMMENT='复议调整审批';

INSERT INTO `t_permission`(`parentId`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( NULL, '授信决议管理', 'creditResolutionManagement', 5, NULL, '', NULL, NULL, NULL, now(), now());
INSERT INTO `t_permission`(`parentId`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( (select t.id from t_permission t where t.ename = 'creditResolutionManagement'), '数据全员可见', 'viewAllCreditResolution', 0, '授信决议管理', '/credit/resolution/viewAll', NULL, NULL, NULL, now(), now());


INSERT INTO `t_permission`(`parentId`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( NULL, '项目授信管理', 'projectCreditManagement', 5, NULL, '', NULL, NULL, NULL, now(), now());
INSERT INTO `t_permission`(`parentId`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( (select t.id from t_permission t where t.ename = 'projectCreditManagement'), '数据全员可见', 'viewAllProjectInformation', 0, '项目授信管理', '/project/viewAll', NULL, NULL, NULL, now(), now());

INSERT INTO `t_permission`(`parentId`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( NULL, '核心企业授信管理', 'projectCoreEnterpriseCreditManagement', 5, NULL, '', NULL, NULL, NULL, now(), now());
INSERT INTO `t_permission`(`parentId`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( (select t.id from t_permission t where t.ename = 'projectCoreEnterpriseCreditManagement'), '数据全员可见', 'viewAllProjectCoreEnterprise', 0, '核心企业授信管理', '/project/core/viewAll', NULL, NULL, NULL, now(), now());

INSERT INTO `t_permission`(`parentId`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( NULL, '供应商授信管理', 'supplierInfoCreditManagement', 5, NULL, '', NULL, NULL, NULL, now(), now());
INSERT INTO `t_permission`(`parentId`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( (select t.id from t_permission t where t.ename = 'supplierInfoCreditManagement'), '数据全员可见', 'viewAllSupplierInfo', 0, '供应商授信管理', '/supplier/viewAll', NULL, NULL, NULL, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('B端_利息管理费支付方式', NULL, 'paymentMethodForInterestManagementFee', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('前收', (select t.id from t_dictionary t where t.code = 'paymentMethodForInterestManagementFee'), 'paymentMethodForInterestManagementFee_A', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('后收', (select t.id from t_dictionary t where t.code = 'paymentMethodForInterestManagementFee'), 'paymentMethodForInterestManagementFee_B', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('管理费前收利息后收', (select t.id from t_dictionary t where t.code = 'paymentMethodForInterestManagementFee'), 'paymentMethodForInterestManagementFee_C', NULL, 2, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('B端_复议调整类型', NULL, 'reviewAndAdjustmentTypes', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('续授信', (select t.id from t_dictionary t where t.code = 'reviewAndAdjustmentTypes'), 'reviewAndAdjustmentTypes_A', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('账期调整', (select t.id from t_dictionary t where t.code = 'reviewAndAdjustmentTypes'), 'reviewAndAdjustmentTypes_B', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('更改IRR', (select t.id from t_dictionary t where t.code = 'reviewAndAdjustmentTypes'), 'reviewAndAdjustmentTypes_C', NULL, 2, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('修改利息收取方式', (select t.id from t_dictionary t where t.code = 'reviewAndAdjustmentTypes'), 'reviewAndAdjustmentTypes_D', NULL, 3, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('申请提额', (select t.id from t_dictionary t where t.code = 'reviewAndAdjustmentTypes'), 'reviewAndAdjustmentTypes_E', NULL, 4, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('申请续授信', (select t.id from t_dictionary t where t.code = 'reviewAndAdjustmentTypes'), 'reviewAndAdjustmentTypes_F', NULL, 5, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('增加或修改增信措施', (select t.id from t_dictionary t where t.code = 'reviewAndAdjustmentTypes'), 'reviewAndAdjustmentTypes_G', NULL, 6, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('其他', (select t.id from t_dictionary t where t.code = 'reviewAndAdjustmentTypes'), 'reviewAndAdjustmentTypes_H', NULL, 7, now(), now());

delete from sys_user_org_rel
where org_id in
      (select id from sys_org where id = 26 or parent_id = 26);


delete from sys_user_role_rel
where role_id in
      (select id from sys_role where id = 4 or parent_id = 4);


delete from sys_role_permission_rel

where role_id in

      (select id from sys_role where id = 4 or parent_id = 4);


delete from sys_user where id in
                           (
                               select user_id from sys_user_org_rel
                               where org_id in
                                     (select id from sys_org where id = 26 or parent_id = 26)
                           );


delete from sys_org where id = 26 or parent_id = 26;


delete from sys_role where id = 4 or parent_id = 4;

INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( 145, 'button', '下载报告', 'downloadProjectReport', 1, '项目授信管理', '/project/downloadProjectReport', NULL, NULL, NULL, now(), now());

INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( 149, 'button', '下载报告', 'downloadSupplierInfoReport', 1, '供应商授信管理', '/supplier/downloadSupplierInfoReport', NULL, NULL, NULL,  now(), now());

INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( 145, 'button', '查看', 'viewProject', 2, '项目授信管理', '/project/viewProject', NULL, NULL, NULL, now(), now());

INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( 149, 'button', '查看', 'viewSupplierInfo', 2, '供应商授信管理', '/supplier/viewSupplierInfo', NULL, NULL, NULL,  now(), now());

INSERT INTO `t_permission`(`parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES (143, 'button', '查看', 'viewCreditResolution', 1, '授信决议管理', '/credit/resolution/viewCreditResolution', NULL, NULL, NULL,  now(), now());

DROP TABLE IF EXISTS  `contract_template`;
CREATE TABLE `contract_template` (
                                              `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                              `version` varchar(50) DEFAULT '' COMMENT '合同版本',
                                              `name` varchar(200) DEFAULT '' COMMENT '合同名称',
                                              `contract_type` varchar(200) DEFAULT '' COMMENT '合同类型',
                                              `template_type` varchar(200) DEFAULT '' COMMENT '模板类型',
                                              `template_code` varchar(200) DEFAULT '' COMMENT '模板code',
                                              `visible` tinyint(2) DEFAULT null COMMENT '是否启用',

                                              `user_create` varchar(32) DEFAULT '' COMMENT '创建人',
                                              `user_modified` varchar(32) DEFAULT '' COMMENT '修改人',
                                              `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                              `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
                                              PRIMARY KEY (`id`)
) COMMENT='合同模板';

-- 修改内容

alter table supplier_approval_second add map_files_compliance tinyint(3) DEFAULT null COMMENT '地点定位图是否达标 0不达标 1达标';
alter table supplier_approval_second add rental_files_compliance tinyint(3) DEFAULT null COMMENT '租房合同是否达标 0不达标 1达标';
alter table supplier_approval_second add water_files_compliance tinyint(3) DEFAULT null COMMENT '房屋房费缴纳流水是否达标 0不达标 1达标';
alter table supplier_approval_second add office_files_compliance tinyint(3) DEFAULT null COMMENT '办公环境是否达标 0不达标 1达标';

alter table credit_resolution add visible tinyint(3) DEFAULT null COMMENT '暂存 0暂存 1提交';

alter table project_audit add visible tinyint(3) DEFAULT null COMMENT '暂存 0暂存 1提交';

alter table project_core_enterprise_audit add visible tinyint(3) DEFAULT null COMMENT '暂存 0暂存 1提交';

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('B端_本金还款方式', NULL, 'principalPaymentMethod', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('到期一次性支付', (select t.id from t_dictionary t where t.code = 'principalPaymentMethod'), 'principalPaymentMethod_A', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('按月支付', (select t.id from t_dictionary t where t.code = 'principalPaymentMethod'), 'principalPaymentMethod_B', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('按季支付', (select t.id from t_dictionary t where t.code = 'principalPaymentMethod'), 'principalPaymentMethod_C', NULL, 2, now(), now());

alter table project_audit add involving_Litigation_access_count bigint(20) default NULL comment '历史涉诉数量';
alter table project_audit add administrative_penalty_access_count bigint(20) default NULL comment '行政处罚数量';
alter table project_audit add administrative_penalty_amount bigint(20) default NULL comment '行政处罚金额';
alter table project_audit add environmental_penalty_amount bigint(20) default NULL comment '环保处罚金额';

alter table project_core_enterprise_audit add involving_Litigation_access_count bigint(20) default NULL comment '历史涉诉数量';
alter table project_core_enterprise_audit add administrative_penalty_access_count bigint(20) default NULL comment '行政处罚数量';
alter table project_core_enterprise_audit add administrative_penalty_amount bigint(20) default NULL comment '行政处罚金额';
alter table project_core_enterprise_audit add environmental_penalty_amount bigint(20) default NULL comment '环保处罚金额';

alter table supplier_approval_second drop evaluation_opinions;

alter table project_audit modify evaluation_opinions text default NULL COMMENT '评估意见';

alter table project_audit modify `holding_ratio` varchar(50) default NULL COMMENT '控股比例';
alter table project_audit modify `equity_hierarchy` varchar(50) default NULL COMMENT '股权层级';
alter table project_audit modify `equity_hierarchy_detail` varchar(50) default NULL COMMENT '股权层级小类';
alter table project_audit modify `credit_rating` varchar(50) default NULL COMMENT '信用评级';
alter table project_audit modify `involving_litigation_access` tinyint(3) default NULL COMMENT '历史涉诉数量准入 0否 1 是';
alter table project_audit modify `administrative_penalty_access` tinyint(3) default NULL COMMENT '行政处罚数量准入 0否 1 是';
alter table project_audit modify `administrative_penalty_amount_access` tinyint(3) default NULL COMMENT '行政处罚金额准入 0否 1 是';
alter table project_audit modify `environmental_penalty_amount_access` tinyint(3) default NULL COMMENT '环保处罚金额准入 0否 1 是';

alter table project_owner_private_lending modify `private_lending` tinyint(3) default NULL COMMENT '是否民间借贷 0 否 1 是';
alter table project_owner_equity_freeze modify `equity_freeze`  tinyint(3) default NULL COMMENT '股权冻结 0 否 1 是';
alter table project_owner_major_abnormal_litigation modify `major_abnormal_litigation` tinyint(3) default NULL COMMENT '重大异常诉讼 0 否 1 是';
alter table project_owner_serious_illegality modify `serious_illegality` tinyint(3) default NULL COMMENT '严重违法 0 否 1 是';
alter table project_owner_tax_owe_notice modify `tax_owe_notice` tinyint(3) default NULL COMMENT '欠税公告 0 否 1 是';
alter table project_owner_tax_illegal_data modify `tax_illegal` tinyint(3) default NULL COMMENT '税收违法 0 否 1 是';
alter table project_owner_blacklist modify `blacklist` tinyint(3) default NULL COMMENT '黑名单 0 否 1 是';
alter table project_owner_exception_data modify `exception` tinyint(3) default NULL COMMENT '经营异常 0 否 1 是';
alter table project_owner_news modify `News` tinyint(3) default NULL COMMENT '重大负面新闻舆情 0 否 1 是';

alter table project_owner_major_abnormal_litigation modify `major_abnormal_litigation` tinyint(3) default NULL COMMENT '重大异常诉讼 0 否 1 是';

alter table project_core_enterprise_audit modify `enterprise_nature` varchar(50) default NULL COMMENT '企业性质 0-大陆企业，1-社会组织 ，3-中国香港公司，4-事业单位，5-中国台湾公司，7-医院，8-海外公司，9-律师事务所，10-学校 ，11-机关单位，-1-其他';
alter table project_core_enterprise_audit modify `enterprise_nature_detail` varchar(50) default NULL COMMENT '上市公司类型';
alter table project_core_enterprise_audit modify `holding_ratio` varchar(50) default NULL COMMENT '控股比例';
alter table project_core_enterprise_audit modify `equity_hierarchy` varchar(50) default NULL COMMENT '股权层级';
alter table project_core_enterprise_audit modify `equity_hierarchy_detail` varchar(50) default NULL COMMENT '股权层级小类';
alter table project_core_enterprise_audit modify `credit_rating` varchar(50) default NULL COMMENT '信用评级';
alter table project_core_enterprise_audit modify `involving_litigation_access` tinyint(3) default NULL COMMENT '历史涉诉数量准入 0否 1 是';
alter table project_core_enterprise_audit modify `administrative_penalty_access` tinyint(3) default NULL COMMENT '行政处罚数量准入 0否 1 是';
alter table project_core_enterprise_audit modify `administrative_penalty_amount_access` tinyint(3) default NULL COMMENT '行政处罚金额准入 0否 1 是';
alter table project_core_enterprise_audit modify `environmental_penalty_amount_access` tinyint(3) default NULL COMMENT '环保处罚金额准入 0否 1 是';
alter table project_core_enterprise_audit modify `evaluation_opinions` text default NULL COMMENT '评估意见';


alter table project_core_enterprise_private_lending modify `private_lending` tinyint(3) default NULL COMMENT '是否民间借贷 0 否 1 是';
alter table project_core_enterprise_equity_freeze modify `equity_freeze`  tinyint(3) default NULL COMMENT '股权冻结 0 否 1 是';
alter table project_core_enterprise_major_abnormal_litigation modify `major_abnormal_litigation` tinyint(3) default NULL COMMENT '重大异常诉讼 0 否 1 是';
alter table project_core_enterprise_serious_illegality modify `serious_illegality` tinyint(3) default NULL COMMENT '严重违法 0 否 1 是';
alter table project_core_enterprise_tax_owe_notice modify `tax_owe_notice` tinyint(3) default NULL COMMENT '欠税公告 0 否 1 是';
alter table project_core_enterprise_tax_illegal_data modify `tax_illegal` tinyint(3) default NULL COMMENT '税收违法 0 否 1 是';
alter table project_core_enterprise_blacklist modify `blacklist` tinyint(3) default NULL COMMENT '黑名单 0 否 1 是';
alter table project_core_enterprise_exception_data modify `exception` tinyint(3) default NULL COMMENT '经营异常 0 否 1 是';
alter table project_core_enterprise_news modify `News` tinyint(3) default NULL COMMENT '重大负面新闻舆情 0 否 1 是';

alter table electronic_signature_personal add short_auth_url_creat datetime DEFAULT NULL COMMENT '短链接生成日期';

alter table loan_conditions modify `content` varchar(1000) DEFAULT NULL COMMENT '条件内容';
alter table loan_conditions_history modify `content` varchar(1000) DEFAULT NULL COMMENT '条件内容';

-- 修改二
alter table supplier_approval_second add age bigint(20) default NULL comment '年龄';

alter table supplier_approval_second add age_compliance tinyint(3) DEFAULT null COMMENT '年龄是否达标 0不达标 1达标';

alter table supplier_approval_second add notice varchar(500) DEFAULT null COMMENT '法人必要补充资料提示';

alter table video_due_diligence_comprehensive_evaluation add fix_score decimal(17,4) DEFAULT null COMMENT '修正分数';

INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( null, 'menu', '联系我们', 'ContactUSHome', 3, NULL, '', '1', NULL, NULL, now(), now());
INSERT INTO `t_permission`( `parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES ( (select t.id from t_permission t where t.ename = 'ContactUSHome'), 'button', '查看', 'viewContactUSHome', 0, '联系我们', '/ContactUSHome/viewContactUSHome', NULL, NULL, NULL, now(), now());
