建表.sql 41 KB
/*
 Navicat Premium Data Transfer

 Source Server         : 生产-124.71.131.246-13307-root-市场化-market_charge
 Source Server Type    : MySQL
 Source Server Version : 80020
 Source Host           : 124.71.131.246:13307
 Source Schema         : market_charge2

 Target Server Type    : MySQL
 Target Server Version : 80020
 File Encoding         : 65001

 Date: 09/08/2024 10:03:57
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for mc_basic_cmty
-- ----------------------------
DROP TABLE IF EXISTS `mc_basic_cmty`;
CREATE TABLE `mc_basic_cmty`  (
                                  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                  `fiscal_year` int NOT NULL COMMENT '财年',
                                  `region_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '区域名称',
                                  `group_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '集团名称',
                                  `company_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司名称',
                                  `company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司代码',
                                  `province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '省',
                                  `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '市',
                                  `district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '区',
                                  `street` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '街道',
                                  `vlg_or_cmty` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '村(小区)',
                                  `resp_person` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '负责人',
                                  `urb_rur_cls` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '城乡分类',
                                  `project_type_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目类型名称',
                                  `comm_hh` int NULL DEFAULT NULL COMMENT '村/小区总户数',
                                  `acct_fy_start_conf` int NULL DEFAULT NULL COMMENT '应收账款目标及完成-财年初财务确认应收账款户数',
                                  `acct_prev_recov` int NULL DEFAULT NULL COMMENT '应收账款目标及完成-往年应收在今年已回款户数',
                                  `acct_prev_charged` int NULL DEFAULT NULL COMMENT '应收账款目标及完成-往年已收费户数',
                                  `curr_fy_new_recovered` int NULL DEFAULT NULL COMMENT '本财年新增已回款户',
                                  `total_charged` int NULL DEFAULT NULL COMMENT '累计已收费总户数',
                                  `qtr_target_company` int NULL DEFAULT NULL COMMENT '季度目标(到公司)',
                                  `hh_gsg_charged` int NULL DEFAULT NULL COMMENT '纳入政府补贴户数-已收费户数',
                                  `hh_gsg_uncharged` int NULL DEFAULT NULL COMMENT '纳入政府补贴户数-未收费户数',
                                  `hh_gsg_total` int NULL DEFAULT NULL COMMENT '纳入政府补贴户数-合计',
                                  `hh_new_full` int NULL DEFAULT NULL COMMENT '市场化收费户数-新增户数(财务字段)全款户数',
                                  `hh_new_install` int NULL DEFAULT NULL COMMENT '市场化收费户数-新增户数(财务字段)分期/定金户数',
                                  `hh_prev_full` int NULL DEFAULT NULL COMMENT '市场化收费户数-往年应收户数(财务字段)全款户数',
                                  `hh_prev_inst_dp` int NULL DEFAULT NULL COMMENT '市场化收费户数-往年应收户数(财务字段)分期/定金户数',
                                  `hh_unchg` int NULL DEFAULT NULL COMMENT '市场化收费户数-未收费户数',
                                  `hh_unchg_conf` int NULL DEFAULT NULL COMMENT '暂不可收费户数-其中:提前确认',
                                  `hh_unchg_scan` int NULL DEFAULT NULL COMMENT '暂不可收费户数-其中:纳入扫雷',
                                  `hh_ev_cum_paid` int NULL DEFAULT NULL COMMENT '评价指标-市场化累计回款户数',
                                  `hh_ev_inst` int NULL DEFAULT NULL COMMENT '评价指标-其中:分期/定金户数',
                                  `hh_ev_full` int NULL DEFAULT NULL COMMENT '评价指标-其中:全款户数',
                                  `hh_ev_ignite` int NULL DEFAULT NULL COMMENT '评价指标-点火户数',
                                  `hh_ev_cum_setup` int NULL DEFAULT NULL COMMENT '评价指标-累计报装率',
                                  `hh_ev_cum_gas` int NULL DEFAULT NULL COMMENT '评价指标-累计气化率',
                                  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
                                  `create_time` datetime NOT NULL COMMENT '创建时间',
                                  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人',
                                  `update_time` datetime NOT NULL COMMENT '更新时间',
                                  `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '更新人',
                                  `def_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '删除标志(0:未删除,1:已删除)',
                                  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2399 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '基础数据-户数' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for mc_basic_money
-- ----------------------------
DROP TABLE IF EXISTS `mc_basic_money`;
CREATE TABLE `mc_basic_money`  (
                                   `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                   `fiscal_year` int NOT NULL COMMENT '财年',
                                   `region_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '区域名称',
                                   `group_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '集团名称',
                                   `company_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司名称',
                                   `company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司代码',
                                   `province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '省',
                                   `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '市',
                                   `district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '区',
                                   `street` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '街道',
                                   `vlg_or_cmty` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '村(小区)',
                                   `resp_person` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '负责人',
                                   `urb_rur_cls` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '城乡分类',
                                   `budg_conf_prev` decimal(10, 2) NULL DEFAULT NULL COMMENT '财务确认预算数-财年初财务确认往年应收',
                                   `budg_conf_new` decimal(10, 2) NULL DEFAULT NULL COMMENT '财务确认预算数-本年新增',
                                   `budg_total` decimal(10, 2) NULL DEFAULT NULL COMMENT '财务确认预算数-总预算金额',
                                   `quarterly_target` decimal(10, 2) NULL DEFAULT NULL COMMENT '季度目标(到公司四个季度)已收费金额',
                                   `cny_gsg_charged` decimal(10, 2) NULL DEFAULT NULL COMMENT '纳入政府补贴金额-已收费金额',
                                   `cny_gsg_uncharged` decimal(10, 2) NULL DEFAULT NULL COMMENT '纳入政府补贴金额-未收费金额',
                                   `cny_gsg_total` decimal(10, 2) NULL DEFAULT NULL COMMENT '纳入政府补贴金额-合计',
                                   `cny_yr_full` decimal(10, 2) NULL DEFAULT NULL COMMENT '市场化收费金额 - 本年新增金额 - 全款金额',
                                   `cny_yr_instal` decimal(10, 2) NULL DEFAULT NULL COMMENT '市场化收费金额 - 本年新增金额 - 分期金额',
                                   `cny_prev_full` decimal(10, 2) NULL DEFAULT NULL COMMENT '往年应收金额-已收费户数-全款户数',
                                   `cny_prev_install` decimal(10, 2) NULL DEFAULT NULL COMMENT '往年应收金额-已收费户数-分期/定金金额',
                                   `cny_market_cumr` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-市场化累计回款',
                                   `cny_fy_cum_return` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-财年累计回款',
                                   `cny_fp_cum_return` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-全款累计回款',
                                   `cny_inst_cum_return` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-分期累计回款',
                                   `cny_new_cum_return` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-本年新增累计回款',
                                   `cny_rcvbls_cum_return` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-往年应收累计回款',
                                   `cny_bdgt_cmpl_rate` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-预算完成率',
                                   `cny_rcvbls_cmpl_rate` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-应收账款完成率',
                                   `cny_cyn_cmpl_rate` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-本年新增完成率',
                                   `cny_pt_cmpl_rate` decimal(10, 2) NULL DEFAULT NULL COMMENT '评价指标-阶段性目标完成率',
                                   `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
                                   `create_time` datetime NOT NULL COMMENT '创建时间',
                                   `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人',
                                   `update_time` datetime NOT NULL COMMENT '更新时间',
                                   `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '更新人',
                                   `def_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '删除标志(0:未删除,1:已删除)',
                                   PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 569 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '基础数据-金额' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for mc_construction
-- ----------------------------
DROP TABLE IF EXISTS `mc_construction`;
CREATE TABLE `mc_construction`  (
                                    `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                    `cmty_id` bigint NOT NULL COMMENT '基础数据-户数-id',
                                    `region_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '区域名称',
                                    `group_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '集团名称',
                                    `company_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司名称',
                                    `company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司代码',
                                    `province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '省',
                                    `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '市',
                                    `district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '区',
                                    `street` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '街道',
                                    `vlg_or_cmty` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '村(小区)',
                                    `urb_rur_cls` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '城乡分类',
                                    `project_type_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目类型名称',
                                    `project_type_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目类型代码',
                                    `assignment_time` datetime NULL DEFAULT NULL COMMENT '市场派单时间',
                                    `is_completed` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否竣工',
                                    `completion_time` datetime NULL DEFAULT NULL COMMENT '竣工时间',
                                    `non_ncmp_rsn` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '未竣工原因',
                                    `project_person_id` bigint NULL DEFAULT NULL COMMENT '工程负责人ID',
                                    `project_person_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '工程负责人名称',
                                    `project_person_account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '工程负责人账号',
                                    `gas_conn_mtr_ris` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否通气到表前/立管',
                                    `gct_mtrris_time` datetime NULL DEFAULT NULL COMMENT '通气到表前/立管时间',
                                    `gct_ncmp_rsn` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '未完成原因',
                                    `operate_person_id` bigint NULL DEFAULT NULL COMMENT '运营负责人ID',
                                    `operate_person_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '运营负责人名称',
                                    `operate_person_account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '运营负责人账号',
                                    `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
                                    `create_time` datetime NOT NULL COMMENT '创建时间',
                                    `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人',
                                    `update_time` datetime NOT NULL COMMENT '更新时间',
                                    `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '更新人',
                                    `def_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '删除标志(0:未删除,1:已删除)',
                                    `status_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '状态名称',
                                    `status_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '状态代码',
                                    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2257 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '施工维护' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for mc_file
-- ----------------------------
DROP TABLE IF EXISTS `mc_file`;
CREATE TABLE `mc_file`  (
                            `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
                            `uuid` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '唯一标识',
                            `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件名称',
                            `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件拓展名,如.txt',
                            `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件路径',
                            `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '下载链接',
                            `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                            `create_by` bigint NULL DEFAULT NULL COMMENT '创建人',
                            `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                            `update_by` bigint NULL DEFAULT NULL COMMENT '更新人',
                            `def_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0:未删除,1:已删除)',
                            `cited` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否被引用过(0:未被引用过,1:已被引用过)',
                            `count` int NULL DEFAULT 0 COMMENT '被引用次数',
                            `file_size` int NULL DEFAULT NULL COMMENT '文件大小(kb)',
                            PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 516 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '市场化收费相关文件' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for mc_ignition
-- ----------------------------
DROP TABLE IF EXISTS `mc_ignition`;
CREATE TABLE `mc_ignition`  (
                                `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                `visit_id` bigint NOT NULL COMMENT '拜访id',
                                `region_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '区域名称',
                                `group_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '集团名称',
                                `company_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司名称',
                                `company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司代码',
                                `user_province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-省',
                                `user_city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-市',
                                `user_district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-区',
                                `user_street` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-街道',
                                `vlg_or_cmty` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '村(小区)',
                                `urb_rur_cls` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '城乡分类',
                                `user_detailed_address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-详细地址',
                                `user_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-用户编号',
                                `user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '客户-户名',
                                `user_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '客户-电话',
                                `ign_cnf_status_code` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '点火确认状态代码(NULL:未确认,Y:是,N:否)',
                                `ign_time` datetime NULL DEFAULT NULL COMMENT '点火时间',
                                `n_ign_rsn` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '未点火原因',
                                `cnf_person_id` bigint NULL DEFAULT NULL COMMENT '负责人ID',
                                `cnf_person_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '负责人名称',
                                `cnf_person_account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '负责人账号',
                                `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
                                `create_time` datetime NOT NULL COMMENT '创建时间',
                                `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人',
                                `update_time` datetime NOT NULL COMMENT '更新时间',
                                `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '更新人',
                                `def_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '删除标志(0:未删除,1:已删除)',
                                `status_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '状态名称',
                                `status_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '状态代码',
                                `user_id_card` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '身份证号',
                                PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 59 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '点火维护' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for mc_operation_log
-- ----------------------------
DROP TABLE IF EXISTS `mc_operation_log`;
CREATE TABLE `mc_operation_log`  (
                                     `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                     `data_form` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '数据表(拜访 / 点火维护 /施工维护)',
                                     `data_id` bigint NOT NULL COMMENT '数据id / 被修改的数据唯一id',
                                     `proc_role` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '处理角色 / 处理节点角色',
                                     `proc_user` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '处理人',
                                     `proc_time` datetime NOT NULL COMMENT '处理时间',
                                     `proc_account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '处理人账号',
                                     `op_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作名称 (同意  /  拒绝  / 发起  /异动)',
                                     `op_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作类型 (1:填报   2:异动   3:修改)',
                                     `op_remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作备注(拒绝说明    异动说明)',
                                     `before_data_json` json NULL COMMENT '操作前数据json',
                                     `after_data_json` json NULL COMMENT '操作后数据json',
                                     `proc_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '处理人id',
                                     PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3246 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '市场化收费相关记录' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for mc_visit
-- ----------------------------
DROP TABLE IF EXISTS `mc_visit`;
CREATE TABLE `mc_visit`  (
                             `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
                             `ticket_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '工单单号',
                             `fiscal_year` int NOT NULL COMMENT '财年',
                             `region_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '区域名称',
                             `group_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '集团名称',
                             `company_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司名称',
                             `company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '公司代码',
                             `billing_person_id` bigint NOT NULL COMMENT '收费人ID',
                             `billing_person_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '收费人名称',
                             `billing_person_account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '收费人账号',
                             `job_nature` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '工作性质(兼职/全职)',
                             `entry_time` datetime NOT NULL COMMENT '入户时间',
                             `vlg_or_cmty` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '村(小区)',
                             `urb_rur_cls` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '城乡分类',
                             `user_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '客户-户名',
                             `user_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '客户-电话',
                             `user_province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-省',
                             `user_city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-市',
                             `user_district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-区',
                             `user_street` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-街道',
                             `user_detailed_address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-详细地址',
                             `has_dm` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否获取决策人信息',
                             `dm_age` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '决策人年龄',
                             `dm_income_src` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '决策人收入来源',
                             `dm_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '决策人联系方式',
                             `is_charged` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否收费',
                             `user_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-用户编号',
                             `user_id_card` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '身份证号',
                             `invoice_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '票据单号',
                             `charge_amt` decimal(10, 2) NULL DEFAULT NULL COMMENT '收费金额(元)',
                             `payment_meth` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '缴费方式',
                             `charge_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '收费类型',
                             `is_visited` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否拜访',
                             `is_intent` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '是否有意向',
                             `house_condition` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '房屋情况',
                             `current_cooking_energy` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '现用做饭能源',
                             `current_heating_energy` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '现用取暖能源',
                             `family_members` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '家庭人口情况',
                             `fridge_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '电冰箱',
                             `ac_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '空调',
                             `tv_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '电视',
                             `washer_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '洗衣机',
                             `water_heater_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '热水器',
                             `pv_system_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '光伏',
                             `visit_province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '拜访_省',
                             `visit_city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '拜访_市',
                             `visit_district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '拜访_区',
                             `visit_street` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '拜访_街道',
                             `visit_detailed_address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '拜访_详细地址',
                             `visit_longitude` decimal(11, 8) NULL DEFAULT NULL COMMENT '拜访_经度',
                             `visit_latitude` decimal(11, 8) NULL DEFAULT NULL COMMENT '拜访_纬度',
                             `field_photo_file` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '拜访现场照片(文件id,逗号分隔)',
                             `attachment_file` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '附件(文件id,逗号分隔)',
                             `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
                             `create_time` datetime NOT NULL COMMENT '创建时间',
                             `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人',
                             `update_time` datetime NOT NULL COMMENT '更新时间',
                             `update_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '更新人',
                             `def_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '删除标志(0:未删除,1:已删除)',
                             `ticket_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '工单类型',
                             `publish_status` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '发布状态',
                             `modification_status` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '修改状态',
                             `status_node_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '状态节点名称',
                             `status_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '状态名称',
                             `status_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '状态代码',
                             `invoice_year_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '应收年份类型(往年应收/本年新增)',
                             PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 197 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '拜访工单' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for mc_visit_user
-- ----------------------------
DROP TABLE IF EXISTS `mc_visit_user`;
CREATE TABLE `mc_visit_user`  (
                                  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                  `user_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户编号',
                                  `user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-户名',
                                  `user_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '客户-电话',
                                  `residence_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '居住属性',
                                  `family_members` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '家庭人口情况',
                                  `income_source` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '家庭收入来源',
                                  `house_condition` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '房屋情况',
                                  `original_appliances` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '家电配置(原)-冗余字段',
                                  `decoration_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '装修情况',
                                  `current_cooking_energy` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '现用做饭能源(英文逗号分开)',
                                  `current_heating_energy` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '现用取暖能源',
                                  `is_intent` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户报装意愿',
                                  `region_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '区域名称',
                                  `region_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '区域代码',
                                  `budget_owner` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '预算主体',
                                  `company_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目公司名称',
                                  `company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目公司代码',
                                  `province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '省',
                                  `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '市',
                                  `district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '区',
                                  `street` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '街道',
                                  `detailed_address` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '详细地址',
                                  `fridge_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '电冰箱',
                                  `ac_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '空调',
                                  `tv_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '电视',
                                  `washer_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '洗衣机',
                                  `water_heater_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '热水器',
                                  `pv_system_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '光伏',
                                  `township` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '街道办/乡镇',
                                  `village` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '居委会/行政村',
                                  `vlg_or_cmty` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '小区/自然村',
                                  `user_age` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户年龄',
                                  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
                                  `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
                                  `def_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '删除标志(0:未删除,1:已删除)',
                                  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2600 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '百万用户信息(被拜访的用户)' ROW_FORMAT = DYNAMIC;

SET FOREIGN_KEY_CHECKS = 1;