DROP TABLE IF EXISTS  `c_supplier_info`;
CREATE TABLE `c_supplier_info` (
                                   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

                                   `c_enterprise_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                   `construction_industry` tinyint(3) DEFAULT NULL COMMENT '本次合作品类是否为建工行业',
                                   `sys_user_id` bigint(20) NOT NULL COMMENT 'c端用户表id',
                                   `status` varchar(100) DEFAULT NULL COMMENT '企业准入状态',
                                   `guarantee_enterprise_id` bigint(20) DEFAULT NULL COMMENT '担保企业 企业信息id',
                                   `revenue_rating` varchar(50) DEFAULT NULL COMMENT '收入评级',
                                   `credit_limit` decimal(17,4) DEFAULT NULL COMMENT '授信额度',
                                   `admitted` varchar(50) DEFAULT NULL COMMENT '是否准入',
                                   `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  `c_enterprise`;
CREATE TABLE `c_enterprise` (
                                          `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

                                          `corporate_name` varchar(1000) NOT NULL COMMENT '公司名称',
                                          `social_credit_code` varchar(20) DEFAULT NULL COMMENT '统一社会信用代码',
                                          `legal_representative` varchar(50) DEFAULT NULL COMMENT '法人代表',
                                          `major_shareholders` varchar(50) DEFAULT NULL COMMENT '大股东',
                                          `controller` varchar(50) DEFAULT NULL COMMENT '实控人',
                                          `start_sate` datetime DEFAULT NULL COMMENT '成立日期',
                                          `registered_capital` varchar(50) DEFAULT NULL COMMENT '注册资本（万）',
                                          `address` varchar(500) DEFAULT NULL COMMENT '注册（登记）地址',
                                          `business_address` varchar(500) DEFAULT NULL COMMENT '实际经营地址',
                                          `c_comprehensive_risk_investigation_id` bigint(20) DEFAULT NULL COMMENT 'sop综合风险排查信息表id  企业',
                                          `c_dongjiangao_risk_id` bigint(20) DEFAULT NULL COMMENT 'sop法人董监高风险扫描表id',
                                          `c_dongjiangao_risk_big_id` bigint(20) DEFAULT NULL COMMENT 'sop大股东董监高风险扫描表id',
                                          `c_dongjiangao_risk_controller_id` bigint(20) DEFAULT NULL COMMENT 'sop实控人董监高风险扫描表id',
                                          `status` varchar(100) DEFAULT NULL COMMENT '企业准入状态',
                                          `auth_status` tinyint(1) DEFAULT '0' COMMENT '企业认证状态 0：未认证 1：已认证',
                                          `auth_url` varchar(1024) DEFAULT NULL COMMENT '认证链接',
                                          `short_auth_url` varchar(1024) DEFAULT NULL COMMENT '认证短链接',
                                          `fdd_customer_id` varchar(50) DEFAULT NULL COMMENT '企业在法大大上的客户编号',
                                          `certificate_sign_url` varchar(1024) DEFAULT NULL COMMENT '授权书签署链接',
                                          `certificate_short_sign_url` varchar(1024) DEFAULT NULL COMMENT '授权书签署短链接',
                                          `certificate_contract_id` varchar(1024) DEFAULT NULL COMMENT '授权书合同编号',
                                          `certificate_transaction_id` varchar(255) DEFAULT NULL COMMENT '企业在法大大上签署授权书的交易号',
                                          `certificate_sign_status` tinyint(1) DEFAULT '0' COMMENT '企业授权授权书签署状态 0：未签署 1：已签署',
                                          `auto_sign_status` tinyint(1) DEFAULT '0' COMMENT '企业授权自动签署状态 0：未认证 1：已认证',
                                          `auto_sign_url` varchar(1024) DEFAULT NULL COMMENT '自动签署链接',
                                          `short_auto_sign_url` varchar(1024) 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  `c_supplier_info_history`;
CREATE TABLE `c_supplier_info_history` (
                                   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

                                   `c_enterprise_history_id` bigint(20) NOT NULL COMMENT '企业信息历史id',
                                   `construction_industry` tinyint(3) DEFAULT NULL COMMENT '本次合作品类是否为建工行业',
                                   `sys_user_id` bigint(20) NOT NULL COMMENT 'c端用户表id',
                                   `status` varchar(100) DEFAULT NULL COMMENT '企业准入状态',
                                   `guarantee_enterprise_history_id` bigint(20) DEFAULT NULL COMMENT '担保企业 企业信息历史id',
                                   `revenue_rating` varchar(50) DEFAULT NULL COMMENT '收入评级',
                                   `credit_limit` decimal(17,4) DEFAULT NULL COMMENT '授信额度',
                                   `admitted` varchar(50) DEFAULT NULL COMMENT '是否准入',
                                   `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  `c_enterprise_history`;
CREATE TABLE `c_enterprise_history` (
                                `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

                                `corporate_name` varchar(1000) NOT NULL COMMENT '公司名称',
                                `social_credit_code` varchar(20) DEFAULT NULL COMMENT '统一社会信用代码',
                                `legal_representative` varchar(50) DEFAULT NULL COMMENT '法人代表',
                                `major_shareholders` varchar(50) DEFAULT NULL COMMENT '大股东',
                                `controller` varchar(50) DEFAULT NULL COMMENT '实控人',
                                `start_sate` datetime DEFAULT NULL COMMENT '成立日期',
                                `registered_capital` varchar(50) DEFAULT NULL COMMENT '注册资本（万）',
                                `address` varchar(500) DEFAULT NULL COMMENT '注册（登记）地址',
                                `business_address` varchar(500) DEFAULT NULL COMMENT '实际经营地址',
                                `c_comprehensive_risk_investigation_id` bigint(20) DEFAULT NULL COMMENT 'sop综合风险排查信息表id  企业',
                                `c_dongjiangao_risk_id` bigint(20) DEFAULT NULL COMMENT 'sop法人董监高风险扫描表id',
                                `c_dongjiangao_risk_big_id` bigint(20) DEFAULT NULL COMMENT 'sop大股东董监高风险扫描表id',
                                `c_dongjiangao_risk_controller_id` bigint(20) DEFAULT NULL COMMENT 'sop实控人董监高风险扫描表id',
                                `status` varchar(100) DEFAULT NULL COMMENT '企业准入状态',
                                `auth_status` tinyint(1) DEFAULT '0' COMMENT '企业认证状态 0：未认证 1：已认证',
                                `auth_url` varchar(1024) DEFAULT NULL COMMENT '认证链接',
                                `short_auth_url` varchar(1024) DEFAULT NULL COMMENT '认证短链接',
                                `fdd_customer_id` varchar(50) DEFAULT NULL COMMENT '企业在法大大上的客户编号',
                                `certificate_sign_url` varchar(1024) DEFAULT NULL COMMENT '授权书签署链接',
                                `certificate_short_sign_url` varchar(1024) DEFAULT NULL COMMENT '授权书签署短链接',
                                `certificate_contract_id` varchar(1024) DEFAULT NULL COMMENT '授权书合同编号',
                                `certificate_sign_status` tinyint(1) DEFAULT '0' COMMENT '企业授权授权书签署状态 0：未签署 1：已签署',
                                `auto_sign_status` tinyint(1) DEFAULT '0' COMMENT '企业授权自动签署状态 0：未认证 1：已认证',
                                `auto_sign_url` varchar(1024) DEFAULT NULL COMMENT '自动签署链接',
                                `short_auto_sign_url` varchar(1024) 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  `c_supplier_contact`;
CREATE TABLE `c_supplier_contact` (
                                   `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

                                   `contact_name` varchar(50) DEFAULT NULL COMMENT '企业联系人姓名',
                                   `mobile` varchar(50) DEFAULT NULL COMMENT '企业联系电话',
                                   `email` varchar(128) DEFAULT NULL COMMENT '电子邮箱',
                                   `supplier_info_id` bigint(20) NOT NULL COMMENT '供应商企业信息表id',

                                   `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  `c_supplier_contact_history`;
CREATE TABLE `c_supplier_contact_history` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

                                      `contact_name` varchar(50) DEFAULT NULL COMMENT '企业联系人姓名',
                                      `mobile` varchar(50) DEFAULT NULL COMMENT '企业联系电话',
                                      `email` varchar(128) DEFAULT NULL COMMENT '电子邮箱',
                                      `c_supplier_info_history` bigint(20) NOT NULL COMMENT '供应商企业信息表id',

                                      `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  `c_due_diligence_appointment`;
CREATE TABLE `c_due_diligence_appointment` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

                                      `corporate_name` varchar(1000) NOT NULL COMMENT '公司名称',
                                      `social_credit_code` varchar(20) DEFAULT NULL COMMENT '统一社会信用代码',
                                      `due_diligence` tinyint(3) DEFAULT NULL COMMENT ' 线下尽调 1确认',
                                      `contact_name` varchar(50) DEFAULT NULL COMMENT '联系人姓名',
                                      `mobile` varchar(50) DEFAULT NULL COMMENT '联系电话',
                                      `supplier_info_id` bigint(20) NOT NULL COMMENT '供应商企业信息表id',

                                      `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  `c_credit_investigation_info`;
CREATE TABLE `c_credit_investigation_info` (
                                              `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                              `c_enterprise_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                              `type` varchar(50) NOT NULL COMMENT '身份类型',
                                              `name` varchar(32) DEFAULT '' COMMENT '姓名',
                                              `social_credit_code` varchar(32) DEFAULT '' COMMENT '身份证号码',
                                              PRIMARY KEY (`id`)
) COMMENT='征信相关情况 企业负责人';

DROP TABLE IF EXISTS  `c_credit_investigation_info_history`;
CREATE TABLE `c_credit_investigation_info_history` (
                                              `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                              `c_enterprise_history_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                              `type` varchar(50) NOT NULL COMMENT '身份类型',
                                              `name` varchar(32) DEFAULT '' COMMENT '姓名',
                                              `social_credit_code` varchar(32) DEFAULT '' COMMENT '身份证号码',
                                              PRIMARY KEY (`id`)
) COMMENT='征信相关情况 企业负责人历史表';

DROP TABLE IF EXISTS  `c_corporate_finance`;
CREATE TABLE `c_corporate_finance` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

                                               `c_enterprise_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                               `type` varchar(50) NOT NULL COMMENT '报表类型',
                                               `date` timestamp NULL default NULL COMMENT '报表年月',
                                               `amount_unit` varchar(32) DEFAULT '' 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  `c_corporate_finance_history`;
CREATE TABLE `c_corporate_finance_history` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

                                               `c_enterprise_history_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                               `type` varchar(50) NOT NULL COMMENT '报表类型',
                                               `date` timestamp NULL default NULL COMMENT '报表年月',
                                               `amount_unit` varchar(32) DEFAULT '' 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  `c_upstream_procurement_documents`;
CREATE TABLE `c_upstream_procurement_documents` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                               `c_enterprise_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                               `name` varchar(32) DEFAULT '' COMMENT '合作企业名称',
                                               PRIMARY KEY (`id`)
) COMMENT='上游采购单据';

DROP TABLE IF EXISTS  `c_upstream_procurement_documents_history`;
CREATE TABLE `c_upstream_procurement_documents_history` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                               `c_enterprise_history_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                               `name` varchar(32) DEFAULT '' COMMENT '合作企业名称',
                                               PRIMARY KEY (`id`)
) COMMENT='上游采购单据 历史';

DROP TABLE IF EXISTS  `c_sales_documents_info`;
CREATE TABLE `c_sales_documents_info` (
                                                         `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                         `c_enterprise_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                                         `name` varchar(32) DEFAULT '' COMMENT '国央企名称',
                                                         PRIMARY KEY (`id`)
) COMMENT='下游销售单据';

DROP TABLE IF EXISTS  `c_sales_documents_info_history`;
CREATE TABLE `c_sales_documents_info_history` (
                                                         `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                         `c_enterprise_history_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                                         `name` varchar(32) DEFAULT '' COMMENT '国央企名称',
                                                         PRIMARY KEY (`id`)
) COMMENT='下游销售单据 历史';

DROP TABLE IF EXISTS  `c_associated_enterprise_info`;
CREATE TABLE `c_associated_enterprise_info` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                               `c_enterprise_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                               `name` varchar(50) NOT NULL COMMENT '关联企业名称',
                                               `status` varchar(100) DEFAULT '' COMMENT '状态',
                                               `legal_representative` varchar(32) DEFAULT '' COMMENT '法定代表人',
                                               `stock_percent` varchar(10) DEFAULT NULL COMMENT '持股比例',
                                               `main_business` text DEFAULT NULL COMMENT '主营业务',
                                               PRIMARY KEY (`id`)
) COMMENT='关联企业相关情况';

DROP TABLE IF EXISTS  `c_associated_enterprise_info_history`;
CREATE TABLE `c_associated_enterprise_info_history` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                               `c_enterprise_history_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                               `name` varchar(50) NOT NULL COMMENT '关联企业名称',
                                               `status` varchar(100) DEFAULT '' COMMENT '状态',
                                               `legal_representative` varchar(32) DEFAULT '' COMMENT '法定代表人',
                                               `stock_percent` varchar(10) DEFAULT NULL COMMENT '持股比例',
                                               `main_business` text DEFAULT NULL COMMENT '主营业务',
                                               PRIMARY KEY (`id`)
) COMMENT='关联企业相关情况历史';

DROP TABLE IF EXISTS  `c_project_information`;
CREATE TABLE `c_project_information` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                               `c_supplier_info_id` bigint(20) NOT NULL COMMENT '供应商企业信息',
                                               `business_number` varchar(32) DEFAULT NULL COMMENT '业务编号',
                                               `project_type` varchar(32) DEFAULT NULL COMMENT '项目类型',
                                               `project_name` varchar(32) DEFAULT NULL COMMENT '项目名称',
                                               `c_enterprise_id` bigint(20) DEFAULT NULL COMMENT '项目业主方信息id',
                                               `c_enterprise_history_id` bigint(20) DEFAULT NULL COMMENT '项目业主方历史信息id',
                                               `company_for_project` tinyint(3) DEFAULT NULL COMMENT '是否为项目成立的公司 0否 1是',
                                               `project_address` varchar(32) DEFAULT NULL COMMENT '项目地点',
                                               `project_cycle` varchar(32) DEFAULT NULL COMMENT '项目周期',
                                               `project_nature` varchar(32) DEFAULT NULL COMMENT '项目性质',
                                               `project_nature_detail` varchar(32) DEFAULT NULL COMMENT '项目性质细节分类',
                                               `project_nature_detail_des` varchar(32) DEFAULT NULL COMMENT '项目性质细节分类具体内容',
                                               `goods_category` varchar(32) DEFAULT NULL COMMENT '货物品类',
                                               `goods_category_detail` varchar(32) DEFAULT NULL COMMENT '货物品类二级分类',
                                               `goods_category_detail_des` varchar(32) DEFAULT NULL COMMENT '货物品类三级分类',
                                               `purpose` varchar(32) DEFAULT NULL COMMENT ' 使用方法',
                                               `purpose_detail` varchar(32) DEFAULT NULL COMMENT ' 用途',
                                               `financial_funds` decimal(17,4) DEFAULT NULL COMMENT '财政资金',
                                               `bank_loans` decimal(17,4) DEFAULT NULL COMMENT '银行贷款',
                                               `foreign_capital` decimal(17,4) DEFAULT NULL COMMENT '利用外资',
                                               `raise_independently` decimal(17,4) DEFAULT NULL COMMENT '企事业单位自筹自己',
                                               `special_fund` decimal(17,4) DEFAULT NULL COMMENT '专项资金',
                                               `other_funds` decimal(17,4) DEFAULT NULL COMMENT '其他资金',
                                               `unknown` decimal(17,4) DEFAULT NULL COMMENT '未知',
                                               `bidding` tinyint(3) DEFAULT NULL COMMENT '是否招投标 0否 1是',
                                               `cooperation_amount` decimal(17,4) DEFAULT NULL COMMENT '本次拟合作金额',
                                               `peak_value` decimal(17,4) DEFAULT NULL COMMENT '月供货峰值',
                                               `estimated_accounting_period` bigint(20) DEFAULT NULL COMMENT '预估账期',
                                               `high_peak_usage` decimal(17,4) DEFAULT NULL COMMENT '用款高峰值',
                                               `status` varchar(100) DEFAULT NULL COMMENT ' 项目状态',
                                               `sales` tinyint(1) DEFAULT 0 COMMENT '是否已做销售合同，0:否 1:是',
                                               `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  `c_project_core_enterprise`;
CREATE TABLE `c_project_core_enterprise` (
                                               `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                               `c_project_information_id` bigint(20) DEFAULT NULL COMMENT '项目信息',
                                               `c_enterprise_id` bigint(20) DEFAULT NULL COMMENT '企业信息id',
                                               `c_enterprise_history_id` bigint(20) DEFAULT NULL COMMENT '企业历史信息id',
                                               `centralized_procurement_platform` tinyint(3) DEFAULT NULL COMMENT '集采平台 0否 1是',
                                               `historical_cooperation` tinyint(3) DEFAULT NULL COMMENT '历史合作 0否 1是',
                                               `historical_cooperation_duration` varchar(100) DEFAULT NULL COMMENT '历史合作时间',
                                               `historical_cooperation_scale` varchar(100) DEFAULT NULL COMMENT '历史合作规模',
                                               `historical_cooperation_invoicing_amount` varchar(100) DEFAULT NULL COMMENT '累计历史开票金额',
                                               `historical_cooperation_maximum_accounting_period` varchar(100) DEFAULT NULL COMMENT '历史回款最长账期',
                                               `historical_cooperation_times` varchar(100) DEFAULT NULL COMMENT '历史合作项目数量',
                                               `status` varchar(100) 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  `c_project_core_enterprise_file`;
CREATE TABLE `c_project_core_enterprise_file` (
                                             `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                             `c_project_core_enterprise_id` bigint(20) NOT NULL COMMENT '项目核心企业id',
                                             `project_number` bigint(20) NOT NULL COMMENT '项目编号',

                                             PRIMARY KEY (`id`)
) COMMENT='核心企业 历史合作资料';

DROP TABLE IF EXISTS  `c_project_information_history`;
CREATE TABLE `c_project_information_history` (
                                         `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                         `c_supplier_info_id` bigint(20) NOT NULL COMMENT '供应商企业信息',
                                         `business_number` varchar(32) DEFAULT NULL COMMENT '业务编号',
                                         `project_type` varchar(32) DEFAULT NULL COMMENT '项目类型',
                                         `project_name` varchar(32) DEFAULT NULL COMMENT '项目名称',
                                         `c_enterprise_id` bigint(20) DEFAULT NULL COMMENT '项目业主方信息id',
                                         `company_for_project` tinyint(3) DEFAULT NULL COMMENT '是否为项目成立的公司 0否 1是',
                                         `project_address` varchar(32) DEFAULT NULL COMMENT '项目地点',
                                         `project_cycle` varchar(32) DEFAULT NULL COMMENT '项目周期',
                                         `project_nature` varchar(32) DEFAULT NULL COMMENT '项目性质',
                                         `project_nature_detail` varchar(32) DEFAULT NULL COMMENT '项目性质细节分类',
                                         `project_nature_detail_des` varchar(32) DEFAULT NULL COMMENT '项目性质细节分类具体内容',
                                         `goods_category` varchar(32) DEFAULT NULL COMMENT '货物品类',
                                         `goods_category_detail` varchar(32) DEFAULT NULL COMMENT '货物品类二级分类',
                                         `goods_category_detail_des` varchar(32) DEFAULT NULL COMMENT '货物品类三级分类',
                                         `purpose` varchar(32) DEFAULT NULL COMMENT ' 使用方法',
                                         `purpose_detail` varchar(32) DEFAULT NULL COMMENT ' 用途',
                                         `financial_funds` decimal(17,4) DEFAULT NULL COMMENT '财政资金',
                                         `bank_loans` decimal(17,4) DEFAULT NULL COMMENT '银行贷款',
                                         `foreign_capital` decimal(17,4) DEFAULT NULL COMMENT '利用外资',
                                         `raise_independently` decimal(17,4) DEFAULT NULL COMMENT '企事业单位自筹自己',
                                         `special_fund` decimal(17,4) DEFAULT NULL COMMENT '专项资金',
                                         `other_funds` decimal(17,4) DEFAULT NULL COMMENT '其他资金',
                                         `unknown` decimal(17,4) DEFAULT NULL COMMENT '未知',
                                         `bidding` tinyint(3) DEFAULT NULL COMMENT '是否招投标 0否 1是',
                                         `cooperation_amount` decimal(17,4) DEFAULT NULL COMMENT '本次拟合作金额',
                                         `peak_value` decimal(17,4) DEFAULT NULL COMMENT '月供货峰值',
                                         `estimated_accounting_period` bigint(20) DEFAULT NULL COMMENT '预估账期',
                                         `high_peak_usage` decimal(17,4) DEFAULT NULL COMMENT '用款高峰值',
                                         `status` varchar(100) 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  `c_project_core_enterprise_history`;
CREATE TABLE `c_project_core_enterprise_history` (
                                             `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                             `c_project_information_id` bigint(20) NOT NULL COMMENT '项目信息',
                                             `c_enterprise_id` bigint(20) NOT NULL COMMENT '企业信息id',
                                             `centralized_procurement_platform` tinyint(3) NOT NULL COMMENT '集采平台 0否 1是',
                                             `historical_cooperation` tinyint(3) DEFAULT NULL COMMENT '历史合作 0否 1是',
                                             `historical_cooperation_duration` varchar(100) DEFAULT NULL COMMENT '历史合作时间',
                                             `historical_cooperation_scale` varchar(100) DEFAULT NULL COMMENT '历史合作规模',
                                             `historical_cooperation_invoicing_amount` varchar(100) DEFAULT NULL COMMENT '累计历史开票金额',
                                             `historical_cooperation_maximum_accounting_period` varchar(100) DEFAULT NULL COMMENT '历史回款最长账期',
                                             `historical_cooperation_times` varchar(100) DEFAULT NULL COMMENT '历史合作项目数量',
                                             `status` varchar(100) DEFAULT NULL COMMENT ' 核心企业状态',
                                             PRIMARY KEY (`id`)
) COMMENT='项目核心企业历史记录';


DROP TABLE IF EXISTS  `c_project_core_enterprise_file_history`;
CREATE TABLE `c_project_core_enterprise_file_history` (
                                                  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                                  `c_project_core_enterprise_id` bigint(20) NOT NULL COMMENT '项目核心企业id',
                                                  `project_number` bigint(20) NOT NULL COMMENT '项目编号',
                                                  PRIMARY KEY (`id`)
) COMMENT='核心企业 历史合作资料历史记录';

DROP TABLE IF EXISTS  `sys_email`;
CREATE TABLE `sys_email` (
                             `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                             `title` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '收件人',
                             `receive_user` text COLLATE utf8_unicode_ci COMMENT '发送人',
                             `chao_song_user` text COLLATE utf8_unicode_ci COMMENT '抄送人',
                             `secret_user` text COLLATE utf8_unicode_ci COMMENT '密送人',
                             `content` longtext COLLATE utf8_unicode_ci COMMENT '邮件内容',
                             `status` tinyint(1) DEFAULT NULL COMMENT '0失败 1 成功',
                             `source` varchar(32) DEFAULT NULL COMMENT '数据来源',
                             `user_create` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '创建人',
                             `user_modified` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin 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 '邮件管理';

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_供应商授信状态', NULL, 'c_supplier_status', 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 = 'c_supplier_status'), 'c_supplier_status_0', 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 = 'c_supplier_status'), 'c_supplier_status_1', 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 = 'c_supplier_status'), 'c_supplier_status_2', 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 = 'c_supplier_status'), 'c_supplier_status_3', 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 = 'c_supplier_status'), 'c_supplier_status_4', 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 = 'c_supplier_status'), 'c_supplier_status_5', 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 = 'c_supplier_status'), 'c_supplier_status_6', 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 = 'c_supplier_status'), 'c_supplier_status_7', 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 = 'c_supplier_status'), 'c_supplier_status_8', 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 = 'c_supplier_status'), 'c_supplier_status_9', NULL, 9, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_供应商企业负责人身份类型', NULL, 'c_credit_investigation_info_type', 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 = 'c_credit_investigation_info_type'), 'c_credit_investigation_info_type_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 = 'c_credit_investigation_info_type'), 'c_credit_investigation_info_type_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 = 'c_credit_investigation_info_type'), 'c_credit_investigation_info_type_3', NULL, 2, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_项目类型', NULL, 'c_project_type', 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 = 'c_project_type'), 'c_project_type_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 = 'c_project_type'), 'c_project_type_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 = 'c_project_type'), 'c_project_type_3', NULL, 2, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_项目和核心企业状态', NULL, 'c_project_and_enterprise_status', 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 = 'c_project_and_enterprise_status'), 'c_project_and_enterprise_status_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 = 'c_project_and_enterprise_status'), 'c_project_and_enterprise_status_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 = 'c_project_and_enterprise_status'), 'c_project_and_enterprise_status_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 = 'c_project_and_enterprise_status'), 'c_project_and_enterprise_status_4', NULL, 3, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_核心企业历史合作时间', NULL, 'c_core_enterprise_cooperation_time', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('时间<1年', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_cooperation_time'), 'c_core_enterprise_cooperation_time_1', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('1年≤时间<3年', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_cooperation_time'), 'c_core_enterprise_cooperation_time_2', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('时间≥3年', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_cooperation_time'), 'c_core_enterprise_cooperation_time_3', NULL, 2, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_核心企业历史合作规模', NULL, 'c_core_enterprise_cooperation_scale', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('规模<1000万元', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_cooperation_scale'), 'c_core_enterprise_cooperation_scale_1', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('1000万元≤规模<3000万元', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_cooperation_scale'), 'c_core_enterprise_cooperation_scale_2', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('规模≥3000万元', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_cooperation_scale'), 'c_core_enterprise_cooperation_scale_3', NULL, 2, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_核心企业累计历史开票金额', NULL, 'c_core_enterprise_invoice_amount', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('金额<1000万元', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_invoice_amount'), 'c_core_enterprise_invoice_amount_1', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('1000万元≤金额<3000万元', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_invoice_amount'), 'c_core_enterprise_invoice_amount_2', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('金额≥3000万元', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_invoice_amount'), 'c_core_enterprise_invoice_amount_3', NULL, 2, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_核心企业 历史回款最长账期', NULL, 'c_core_enterprise_longest_accounting_period', 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 = 'c_core_enterprise_longest_accounting_period'), 'c_core_enterprise_longest_accounting_period_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 = 'c_core_enterprise_longest_accounting_period'), 'c_core_enterprise_longest_accounting_period_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 = 'c_core_enterprise_longest_accounting_period'), 'c_core_enterprise_longest_accounting_period_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 = 'c_core_enterprise_longest_accounting_period'), 'c_core_enterprise_longest_accounting_period_4', NULL, 3, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_核心企业历史合作项目数量', NULL, 'c_core_enterprise_cooperation_count', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('数量<2个', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_cooperation_count'), 'c_core_enterprise_cooperation_count_1', NULL, 0, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('2个≤数量<5个', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_cooperation_count'), 'c_core_enterprise_cooperation_count_2', NULL, 1, now(), now());
INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('数量≥5个', (select t.id from t_dictionary t where t.code = 'c_core_enterprise_cooperation_count'), 'c_core_enterprise_cooperation_count_3', NULL, 2, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_项目周期', NULL, 'c_project_cycle', 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 = 'c_project_cycle'), 'c_project_cycle_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 = 'c_project_cycle'), 'c_project_cycle_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 = 'c_project_cycle'), 'c_project_cycle_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 = 'c_project_cycle'), 'c_project_cycle_4', NULL, 3, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_项目性质', NULL, 'c_project_nature', 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 = 'c_project_nature'), 'c_project_nature_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 = 'c_project_nature'), 'c_project_nature_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 = 'c_project_nature'), 'c_project_nature_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 = 'c_project_nature'), 'c_project_nature_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 = 'c_project_nature'), 'c_project_nature_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 = 'c_project_nature_1'), 'c_project_nature_1_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 = 'c_project_nature_1'), 'c_project_nature_1_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 = 'c_project_nature_1'), 'c_project_nature_1_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 = 'c_project_nature_1'), 'c_project_nature_1_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 = 'c_project_nature_1'), 'c_project_nature_1_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 = 'c_project_nature_2'), 'c_project_nature_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 = 'c_project_nature_2'), 'c_project_nature_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 = 'c_project_nature_2'), 'c_project_nature_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 = 'c_project_nature_2'), 'c_project_nature_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 = 'c_project_nature_2'), 'c_project_nature_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 = 'c_project_nature_3'), 'c_project_nature_3_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 = 'c_project_nature_3'), 'c_project_nature_3_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 = 'c_project_nature_3'), 'c_project_nature_3_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 = 'c_project_nature_3'), 'c_project_nature_3_D', NULL, 3, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_项目货物品类', NULL, 'c_project_goods_category', 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 = 'c_project_goods_category'), 'c_project_goods_category_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 = 'c_project_goods_category'), 'c_project_goods_category_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 = 'c_project_goods_category'), 'c_project_goods_category_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 = 'c_project_goods_category'), 'c_project_goods_category_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 = 'c_project_goods_category'), 'c_project_goods_category_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 = 'c_project_goods_category'), 'c_project_goods_category_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 = 'c_project_goods_category'), 'c_project_goods_category_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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_H', 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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_I', 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 = 'c_project_goods_category_1'), 'c_project_goods_category_1_J', 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 = 'c_project_goods_category_2'), 'c_project_goods_category_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 = 'c_project_goods_category_2'), 'c_project_goods_category_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 = 'c_project_goods_category_2'), 'c_project_goods_category_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 = 'c_project_goods_category_2'), 'c_project_goods_category_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 = 'c_project_goods_category_3'), 'c_project_goods_category_3_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 = 'c_project_goods_category_3'), 'c_project_goods_category_3_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 = 'c_project_goods_category_3'), 'c_project_goods_category_3_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 = 'c_project_goods_category_3'), 'c_project_goods_category_3_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 = 'c_project_goods_category_3'), 'c_project_goods_category_3_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 = 'c_project_goods_category_3'), 'c_project_goods_category_3_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 = 'c_project_goods_category_3'), 'c_project_goods_category_3_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 = 'c_project_goods_category_4'), 'c_project_goods_category_4_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 = 'c_project_goods_category_4'), 'c_project_goods_category_4_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 = 'c_project_goods_category_4'), 'c_project_goods_category_4_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 = 'c_project_goods_category_4'), 'c_project_goods_category_4_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 = 'c_project_goods_category_4'), 'c_project_goods_category_4_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 = 'c_project_goods_category_4'), 'c_project_goods_category_4_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 = 'c_project_goods_category_5'), 'c_project_goods_category_5_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 = 'c_project_goods_category_5'), 'c_project_goods_category_5_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 = 'c_project_goods_category_5'), 'c_project_goods_category_5_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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_H', 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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_I', 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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_J', 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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_K', NULL, 10, 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 = 'c_project_goods_category_6'), 'c_project_goods_category_6_L', NULL, 11, now(), now());

INSERT INTO `t_dictionary`(`name`, `parentId`, `code`, `value`, `gradation`, `gmt_create`, `gmt_modified`)
VALUES ('C端_项目货物的用途', NULL, 'c_project_goods_purpose', 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 = 'c_project_goods_purpose'), 'c_project_goods_purpose_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 = 'c_project_goods_purpose'), 'c_project_goods_purpose_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 = 'c_project_goods_purpose_1'), 'c_project_goods_purpose_1_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 = 'c_project_goods_purpose_2'), 'c_project_goods_purpose_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 = 'c_project_goods_purpose_2'), 'c_project_goods_purpose_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 = 'c_project_goods_purpose_2'), 'c_project_goods_purpose_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 = 'c_project_goods_purpose_2'), 'c_project_goods_purpose_2_D', NULL, 3, now(), now());

alter table c_supplier_info add supplier_errors varchar(500) DEFAULT NULL COMMENT '供应商红否原因';

alter table c_supplier_info add guarantee_enterprise_errors varchar(500) DEFAULT NULL COMMENT '核心企业红否原因';

alter table c_supplier_info_history add supplier_errors varchar(500) DEFAULT NULL COMMENT '供应商红否原因';

alter table c_supplier_info_history add guarantee_enterprise_errors varchar(500) DEFAULT NULL COMMENT '核心企业红否原因';

alter table c_project_information add errors_string varchar(500) DEFAULT NULL COMMENT '红否原因';

alter table c_project_information_history add errors_string varchar(500) DEFAULT NULL COMMENT '红否原因';

alter table c_project_core_enterprise add errors_string varchar(500) DEFAULT NULL COMMENT '红否原因';

alter table c_project_core_enterprise_history add errors_string varchar(500) DEFAULT NULL COMMENT '红否原因';

-- 二次更改

CREATE TABLE `tax_bureau_website` (
                                      `id` bigint(255) DEFAULT NULL,
                                      `area` varchar(255) DEFAULT NULL COMMENT '地区',
                                      `address` varchar(255) DEFAULT NULL COMMENT '网址'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('1', '北京市电子税务局网址（北京市）', 'https://etax.beijing.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('2', '上海市电子税务局网址（上海市）', 'https://etax.shanghai.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('3', '天津市电子税务局网址（天津市）', 'https://etax.tianjin.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('4', '重庆市电子税务局网址（重庆市）', 'https://etax.chongqing.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('5', '河北省电子税务局网址', 'https://etax.hebei.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('6', '山西省电子税务局网址', 'https://etax.shanxi.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('7', '内蒙古电子税务局网址', 'https://etax.neimenggu.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('8', '辽宁省电子税务局网址', 'https://etax.liaoning.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('9', '大连市电子税务局网址', 'https://etax.dalian.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('10', '吉林省电子税务局网址', 'https://etax.jilin.chinatax.gov.cn:10812/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('11', '黑龙江省电子税务局网址', 'https://etax.heilongjiang.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('12', '江苏省电子税务局网址', 'https://etax.jiangsu.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('13', '浙江省电子税务局网址', 'https://etax.zhejiang.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('14', '宁波市电子税务局网址（宁波市）', 'https://etax.ningbo.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('15', '安徽省电子税务局网址', 'https://etax.anhui.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('16', '福建省电子税务局网址', 'https://etax.fujian.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('17', '厦门市电子税务局网址（厦门市）', 'https://etax.xiamen.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('18', '江西省电子税务局网址', 'https://etax.jiangxi.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('19', '山东省电子税务局网址', 'http://etax.shandong.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('20', '青岛市电子税务局网址（青岛市）', 'https://etax.qingdao.chinatax.gov.cn');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('21', '河南省电子税务局网址', 'https://etax.henan.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('22', '湖北省电子税务局网址', 'https://etax.hubei.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('23', '湖南省电子税务局网址', 'https://etax.hunan.chinatax.gov.cn');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('24', '广东省电子税务局网址', 'https://etax.guangdong.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('25', '深圳市电子税务局网址（深圳市）', 'https://etax.shenzhen.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('26', '广西省电子税务局网址', 'https://etax.guangxi.chinatax.gov.cn:9723/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('27', '海南省电子税务局网址', 'https://etax.hainan.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('28', '四川省电子税务局网址', 'https://etax.sichuan.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('29', '贵州省电子税务局网址', 'https://etax.guizhou.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('30', '云南省电子税务局网址', 'https://etax.yunnan.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('31', '西藏自治区电子税务局网址', 'https://etax.xizang.chinatax.gov.cn:8443/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('32', '陕西省电子税务局网址', 'https://etax.shaanxi.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('33', '甘肃省电子税务局网址', 'https://etax.gansu.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('34', '青海省电子税务局网址', 'https://etax.qinghai.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('35', '宁夏回族自治区电子税务局网址', 'https://etax.ningxia.chinatax.gov.cn/');
INSERT INTO `tax_bureau_website`(`id`, `area`, `address`) VALUES ('36', '新疆维吾尔自治区电子税务局网址', 'https://etax.xinjiang.chinatax.gov.cn/');

update `t_dictionary`set `name` = '固定项目：货物与项目一一对应，非集采公司采购。' where code = 'c_project_type_1';
update `t_dictionary`set `name` = '集采项目：货物与项目非一一对应，集采公司采购。' where code = 'c_project_type_2';
update `t_dictionary`set `name` = '无项目：暂无具体项目。' where code = 'c_project_type_3';


update `t_dictionary`set `name` = '自身使用：核心企业用于生产加工自用' where code = 'c_project_goods_purpose_1';
update `t_dictionary`set `name` = '下游使用：核心企业的下游项目方使用' where code = 'c_project_goods_purpose_2';

-- 用户咨询表
DROP TABLE IF EXISTS `c_business_consulting`;
CREATE table `c_business_consulting`(
                                      `id` BIGINT UNSIGNED AUTO_INCREMENT   NOT NULL   COMMENT '主键',
                                      `enterprice_cn`       VARCHAR(300)    DEFAULT '' COMMENT '企业名称',
                                      `contact_name`       VARCHAR(300)    DEFAULT '' COMMENT '联系人',
                                      `contact_post`       VARCHAR(300)    DEFAULT '' COMMENT '联系人职务',
                                      `email`               VARCHAR(100)    DEFAULT '' COMMENT '工作邮箱',
                                      `phone_number`        CHAR(11)        DEFAULT '' COMMENT '手机号（大陆)',
                                      `enterprise_type`      varchar(300)    DEFAULT '' COMMENT '企业类型',
                                      `main_categories`      varchar(300)    DEFAULT '' COMMENT '主营品类',
                                      `annual_sales_revenue`      varchar(300)    DEFAULT '' COMMENT '年销售额（万元）',
                                      `main_customers`      varchar(300)    DEFAULT '' COMMENT '主要客户',
                                      `estimated_accounting_period`      varchar(300)    DEFAULT '' COMMENT '预估账期',
                                      `accounts_receivable_balance`      varchar(300)    DEFAULT '' COMMENT '应收余额（万元）',
                                      `info_content`        varchar(300)    DEFAULT '' COMMENT '信息内容',
                                      `gmt_create`          TIMESTAMP       DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                      PRIMARY KEY (`id`)
) COMMENT='用户咨询表';


-- 修改
alter table c_project_core_enterprise add process bigint(20) DEFAULT 1 comment '是否流程授信 0 否 1 是';
alter table c_project_core_enterprise add old_core_enterprise_id bigint(20) DEFAULT null comment '关联的核心企业授信ID';

INSERT INTO `t_permission`(`parentId`, `type`, `cname`, `ename`, `gradation`, `moduleName`, `url`, `icon`, `user_create`, `user_modified`, `gmt_create`, `gmt_modified`)
VALUES (158, 'button', '下载', 'enterpriseDownload', 3, '企业', '/customer/enterpriseDownload', 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 (160, 'button', '下载', 'personDownload', 3, '个人', '/customer/personDownload', NULL, NULL, NULL, now(), now());

alter table c_supplier_info add visible tinyint(2) DEFAULT null COMMENT '0暂存 1提交';
alter table supplier_approval_second add visible tinyint(2) DEFAULT null COMMENT '0暂存 1提交';
alter table video_due_diligence add visible tinyint(2) DEFAULT null COMMENT '0暂存 1提交';

alter table credit_situation modify `amount_of_guarantee_liability` decimal(17,4) default NULL COMMENT '相关还款担保责任金额（为非授信主体的担保）';
alter table sys_operation_log modify `result` longtext COLLATE utf8_unicode_ci DEFAULT null COMMENT '请求的结果';

alter table video_due_diligence modify `shareholder_standard_score` decimal(17,4) default NULL COMMENT '股东标准分值';
alter table video_due_diligence modify `shareholder_measurement_score` decimal(17,4) default NULL COMMENT '股东测算分值';
alter table video_due_diligence modify `shareholder_conclusion` tinyint(3) default NULL COMMENT '股东准入结论 0否  1是';
alter table video_due_diligence modify `life_standard_score` decimal(17,4) default NULL COMMENT '成立年限标准分值';
alter table video_due_diligence modify `life_measurement_score` decimal(17,4) default NULL COMMENT '成立年限测算分值';
alter table video_due_diligence modify `life_conclusion` tinyint(3) default NULL COMMENT '成立年限准入结论 0否  1是';
alter table video_due_diligence modify `capital_standard_score` decimal(17,4) default NULL COMMENT '注册资本标准分值';
alter table video_due_diligence modify `capital_measurement_score` decimal(17,4) default NULL COMMENT '注册资本测算分值';
alter table video_due_diligence modify `capital_conclusion` tinyint(3) default NULL COMMENT '注册资本准入结论 0否  1是';
alter table video_due_diligence modify `address_standard_score` decimal(17,4) default NULL COMMENT ' 注册地址标准分值';
alter table video_due_diligence modify `address_measurement_score` decimal(17,4) default NULL COMMENT ' 注册地址测算分值';
alter table video_due_diligence modify `address_conclusion` tinyint(3) default NULL COMMENT ' 注册地址准入结论 0否  1是';
alter table video_due_diligence modify `business_address_standard_score` decimal(17,4) default NULL COMMENT ' 经营地址标准分值';
alter table video_due_diligence modify `business_address_measurement_score` decimal(17,4) default NULL COMMENT ' 经营地址测算分值';
alter table video_due_diligence modify `business_address_conclusion` tinyint(3) default NULL COMMENT ' 经营地址准入结论 0否  1是';
alter table video_due_diligence modify `business_scope_standard_score` decimal(17,4) default NULL COMMENT ' 经营范围标准分值';
alter table video_due_diligence modify `business_scope_measurement_score` decimal(17,4) default NULL COMMENT '经营范围测算分值';
alter table video_due_diligence modify `business_scope_conclusion` tinyint(3) default NULL COMMENT '经营范围准入结论 0否  1是';
alter table video_due_diligence modify `change_standard_score` decimal(17,4) default NULL COMMENT '  基本变动信息标准分值';
alter table video_due_diligence modify `change_measurement_score` decimal(17,4) default NULL COMMENT ' 基本变动信息测算分值';
alter table video_due_diligence modify `change_conclusion` tinyint(3) default NULL COMMENT ' 基本变动信息准入结论 0否  1是';

alter table video_due_diligence_shareholders_situation modify `overdue_accounts` bigint(20) default NULL COMMENT '近两年发生过逾期的账户数';
alter table video_due_diligence_shareholders_situation modify `total_overdue_amount` decimal(17,4) default NULL COMMENT '近两年发生过逾期的合计金额';
alter table video_due_diligence_shareholders_situation modify `over_90_days_overdue` tinyint(3) default NULL COMMENT '账户是否发生过90天以上逾期 0否 1是';
alter table video_due_diligence_shareholders_situation modify `overdue_months` bigint(20) default NULL COMMENT '近两年贷款、信用卡连续逾期的月数';
alter table video_due_diligence_shareholders_situation modify `number_of_overdue_repayments` bigint(20) default NULL COMMENT '近两年逾期还款记录累计次数';
alter table video_due_diligence_shareholders_situation modify `number_of_loan_inquiries` bigint(20) default NULL COMMENT '近半年来贷款审批查询次数';
alter table video_due_diligence_shareholders_situation modify `repayment_guarantee_amount` decimal(17,4) default NULL COMMENT '相关还款担保责任金额（为非授信主体的担保';
alter table video_due_diligence_shareholders_situation modify `record_of_dishonesty_execution` tinyint(3) default NULL COMMENT '失信被执行记录 0无 1有';
alter table video_due_diligence_shareholders_situation modify `executed_record` tinyint(3) default NULL COMMENT '被执行记录 0无 1有';
alter table video_due_diligence_shareholders_situation modify `amount_of_guarantee_liability_score` decimal(17,4) default NULL COMMENT '相关还款担保责任金额（为非授信主体的担保）得分';

alter table video_due_diligence_corporate_goodwill modify `recovered_balance` tinyint(3) default NULL COMMENT '是否存在被追偿余额、关注类余额、不良类余额';
alter table video_due_diligence_corporate_goodwill modify `unclear_follow_up_accounts` tinyint(3) default NULL COMMENT '是否存在未结清信贷的关注类账户';
alter table video_due_diligence_corporate_goodwill modify `outstanding_non_performing_accounts` tinyint(3) default NULL COMMENT '是否存在未结清信贷的不良类账户';
alter table video_due_diligence_corporate_goodwill modify `outstanding_short_term_loan_balance` decimal(17,4) default NULL COMMENT '未结清短期借款余额';

alter table video_due_diligence_finance modify `video_due_diligence_id` bigint(20) default NULL COMMENT '视频尽调id';
alter table video_due_diligence_finance modify `main_business_income` decimal(17,4) default NULL COMMENT '主营业务收入';
alter table video_due_diligence_finance modify `main_business_cost` decimal(17,4) default NULL COMMENT '主营业务成本';
alter table video_due_diligence_finance modify `main_business_profit` decimal(17,4) default NULL COMMENT '毛利率';
alter table video_due_diligence_finance modify `main_business_income_score` decimal(17,4) default NULL COMMENT '主营业务收入得分';
alter table video_due_diligence_finance modify `main_business_profit_score` decimal(17,4) default NULL COMMENT '毛利率得分';

-- 修改 2024-4-12

alter table supplier_approval_first add `approval_comment` varchar(3000) DEFAULT '' COMMENT '审批意见';
alter table supplier_approval_first add `approval_conclusion` varchar(50) DEFAULT NULL COMMENT '审批结论';

alter table supplier_approval_first add visible tinyint(2) DEFAULT null COMMENT '0暂存 1提交';
update supplier_approval_first set visible = 1;

update credit_situation t1 INNER JOIN supplier_approval_first t2 on t1.c_supplier_info_id = t2.c_supplier_info_id set t1.c_supplier_info_id = t2.id;

alter table credit_situation change c_supplier_info_id supplier_approval_first_id bigint(20) NOT NULL COMMENT '审核第一步id';


alter table supplier_approval_first modify `main_enterprise_count` bigint(20) default NULL COMMENT '主企业红线否决项';
alter table supplier_approval_first modify `main_enterprise_result` varchar(32) default NULL COMMENT '主企业测算结论';