#   字段新增   （表名，字段名，字段类型，修改方式（1：新增，2：修改，3：删除）

CALL Pro_Temp_ColumnWork('basic_udi_rel', 'companyType', 'tinyint', 1);

CALL Pro_Temp_ColumnWork('user_register', 'name', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('user_register', 'tel', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('user_register', 'qq', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('user_register', 'weChat', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('user_register', 'xemail', 'varchar(255)', 1);
-- CALL Pro_Temp_ColumnWork('user_company', 'reason', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('user_register', 'fmobile', 'varchar(255)', 1);

CALL Pro_Temp_ColumnWork('trace_order', 'recordCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('trace_order', 'count', 'int', 1);
CALL Pro_Temp_ColumnWork('trace_order', 'invCount', 'int', 1);

CALL Pro_Temp_ColumnWork('trace_product_record', 'companyIdFk', 'varchar(255)', 1);

CALL Pro_Temp_ColumnWork('sup_cert', 'companyIdFk', 'bigInt', 1);



CALL Pro_Temp_ColumnWork('basic_udi_product', 'categoryLevel', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_udi_product', 'groupBuy', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_udi_product', 'chsType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_udi_product', 'importType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_udi_product', 'purchaseType', 'tinyint', 1);

/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80021
 Source Host           : localhost:3306
 Source Schema         : udi_cpt2

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

 Date: 11/01/2024 09:23:13
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for io_stat_month
-- ----------------------------
CREATE TABLE IF NOT EXISTS `io_stat_month`
(
    `id`            int                                                           NOT NULL AUTO_INCREMENT,
    `recordKeyFk`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '汇总记录号',
    `year`          int                                                           NULL DEFAULT NULL COMMENT '年度',
    `quarter`       tinyint                                                       NULL DEFAULT NULL COMMENT '季度',
    `month`         tinyint                                                       NULL DEFAULT NULL COMMENT '月份',
    `relIdFk`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '物资编码主键',
    `nameCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '产品DI',
    `productName`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '产品名称',
    `ggxh`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '规格型号',
    `batchNo`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '批次号',
    `beginCount`    int                                                           NULL DEFAULT NULL COMMENT '期初数量',
    `beginPrice`    decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '期初价格',
    `beginAmount`   decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '期初金额',
    `inCount`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '入库数量',
    `inPrice`       decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '入库价格',
    `inAmount`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '入库金额',
    `outCount`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '出库数量',
    `outPrice`      decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '出库价格',
    `outAmount`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '出库金额',
    `balanceCount`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '结余数量',
    `balancePrice`  decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '结余价格',
    `balanceAmount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '结余金额',
    `remark`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `updateTime`    datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `deptCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `invCode`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `companyIdFk`   bigint                                                        NULL DEFAULT NULL,
    `zczbhhzbapzbh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `ylqxzcrbarmc`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 15
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci
  ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for io_stat_order
-- ----------------------------
CREATE TABLE IF NOT EXISTS `io_stat_order`
(
    `id`          int                                                           NOT NULL AUTO_INCREMENT,
    `recordKey`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '记录号',
    `date`        datetime(0)                                                   NULL DEFAULT NULL COMMENT '生成时间',
    `type`        tinyint                                                       NULL DEFAULT NULL COMMENT '1:年；2.季度，3：月；4：日；5.自定义',
    `updateTime`  datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `title`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '表格表头',
    `remark`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `invCode`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `deptCode`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `startDate`   datetime(0)                                                   NULL DEFAULT NULL COMMENT '汇总开始时间',
    `endDate`     datetime(0)                                                   NULL DEFAULT NULL COMMENT '汇总结束时间',
    `status`      tinyint                                                       NULL DEFAULT NULL COMMENT '汇总状态：1：已完成；2.生成中；3：生成失败',
    `statType`    tinyint                                                       NULL DEFAULT NULL,
    `companyIdFk` bigint                                                        NULL DEFAULT NULL COMMENT '所属企业ID',
    `createUser`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci
  ROW_FORMAT = DYNAMIC;

SET FOREIGN_KEY_CHECKS = 1;


CREATE TABLE IF NOT EXISTS `io_stat_set`
(
    `id`         int                                                           NOT NULL AUTO_INCREMENT COMMENT '上报频率',
    `code`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '上报设置编号',
    `title`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '上报设置标题',
    `startDate`  datetime(0)                                                   NULL DEFAULT NULL COMMENT '开始执行时间',
    `endDate`    datetime(0)                                                   NULL DEFAULT NULL COMMENT '结束执行时间',
    `frequency`  int                                                           NULL DEFAULT NULL COMMENT '上报频率（天）',
    `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
    `createTime` datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建时间',
    `updateTime` datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `updateUser` datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新人',
    `remark`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '重点品种上报设置表'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for io_stat_set_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `io_stat_set_detail`
(
    `id`            int                                                           NOT NULL AUTO_INCREMENT,
    `cpmctymc`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '品种名称',
    `ggxh`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '规格型号',
    `zczbhhzbapzbh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '注册/备案号',
    `ylqxzcrbarmc`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '医疗器械注册人',
    `bussinessType` tinyint                                                       NULL DEFAULT NULL COMMENT '企业类型',
    `companyName`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '注册企业名称',
    `nameCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'di/产品标识',
    `provinceCode`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '省',
    `cityCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '市',
    `areaCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '区/县',
    `remark`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '重点品种上报设置明细表'
  ROW_FORMAT = Dynamic;






