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

-- ----------------------------
-- Table structure for inv_stock_compare
-- ----------------------------
CREATE TABLE IF NOT EXISTS `inv_stock_compare`
(
    `id`               bigint                                                        NOT NULL,
    `status`           int                                                           NOT NULL COMMENT '状态',
    `thrSysId`         int                                                           NOT NULL COMMENT '第三方系统id',
    `thrSysName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '第三方系统名称',
    `thirdTableField`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '第三方系统字段名',
    `invCode`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '仓库编码',
    `invName`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '仓库名称',
    `mainAction`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '出入库类型',
    `action`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '单据类型编码',
    `actionName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '单据类型名称',
    `compareStartDate` date                                                          NOT NULL COMMENT '筛选开始时间',
    `compareEndDate`   date                                                          NOT NULL COMMENT '筛选结束时间',
    `compareTime`      datetime                                                      NULL     DEFAULT NULL COMMENT '对比时间',
    `siftBatchNo`      bit(1)                                                        NOT NULL DEFAULT b'0' COMMENT '是否区分批次号',
    `remark`           text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '备注',
    `createTime`       datetime                                                      NOT NULL COMMENT '创建时间',
    `createUser`       bigint                                                        NOT NULL COMMENT '创建人id',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '库存对比表'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for inv_stock_compare_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `inv_stock_compare_detail`
(
    `compareId`     bigint                                                        NOT NULL COMMENT '对比id',
    `productId`     bigint                                                        NOT NULL COMMENT '产品id',
    `thrProductId`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '第三方产品编码',
    `nameCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'DI',
    `productName`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '产品名称',
    `cpms`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '产品描述',
    `ggxh`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '规格型号',
    `manufactory`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '生产厂家',
    `ylqxzcrbarmc`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL COMMENT '医疗器械注册/备案人名称',
    `zczbhhzbapzbh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL COMMENT '注册证编号/备案批准编号',
    `mainAction`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '出入库类型',
    `count`         int                                                           NOT NULL COMMENT '对应数量',
    `thrCount`      int                                                           NULL DEFAULT NULL COMMENT '第三方数量',
    `compareCount`  int                                                           NULL DEFAULT NULL COMMENT '对比数量',
    PRIMARY KEY (`compareId`, `productId`, `mainAction`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '库存对比明细'
  ROW_FORMAT = Dynamic;


CALL Pro_Temp_ColumnWork('io_order', 'confirmUser', 'varchar(255)', 1);


CREATE TABLE IF NOT EXISTS `sys_app_version`
(
    `id`          int                                                           NOT NULL,
    `type`        varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NOT NULL COMMENT '类型：android,pc,',
    `versionName` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL COMMENT '版本号',
    `versionCode` int                                                           NULL DEFAULT NULL,
    `appName`     varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL COMMENT '应用名称',
    `createTime`  datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建日期',
    `downloadUrl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '下载地址',
    `updateLog`   varchar(600) 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;


CREATE TABLE IF NOT EXISTS `device_change_log`
(
    `id`              bigint                                                        NOT NULL COMMENT '日志id',
    `deviceCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码',
    `type`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库，change:变更归属',
    `changeOrderId`   bigint                                                        NOT NULL COMMENT '变更单号',
    `deptCode`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作部门',
    `deptName`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作部门',
    `toDeptCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门',
    `toDeptName`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门',
    `confirmUser`     bigint                                                        NOT NULL COMMENT '确认人id',
    `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '确认人姓名',
    `confirmTime`     datetime(0)                                                   NOT NULL COMMENT '确认时间',
    `confirmRemark`   text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '确认备注',
    `remark`          text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '备注',
    `createUserName`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '操作人姓名',
    `createUser`      bigint                                                        NOT NULL COMMENT '操作人id',
    `createTime`      datetime(0)                                                   NOT NULL COMMENT '操作时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '设备变更日志表'
  ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for device_change_order
-- ----------------------------
CREATE TABLE IF NOT EXISTS `device_change_order`
(
    `orderId`         bigint                                                        NOT NULL COMMENT '编码',
    `type`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'add:新增入库，change:变更归属',
    `status`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.待目标部门接收 ，2.完成(目标确认接收) ，3.目标部门拒收，4.取消',
    `deptCode`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门',
    `toDeptCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '目标部门',
    `confirmUser`     bigint                                                        NULL DEFAULT NULL COMMENT '确认人id',
    `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '确认人姓名',
    `confirmTime`     datetime(0)                                                   NULL DEFAULT NULL COMMENT '确认时间',
    `confirmRemark`   text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '确认备注',
    `remark`          text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '备注',
    `createUserName`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人',
    `createUser`      bigint                                                        NULL DEFAULT NULL COMMENT '创建人id',
    `createTime`      datetime(0)                                                   NOT NULL COMMENT '创建时间',
    PRIMARY KEY (`orderId`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '设备变更单'
  ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for device_change_order_item
-- ----------------------------
CREATE TABLE IF NOT EXISTS `device_change_order_item`
(
    `orderId`        bigint                                                        NOT NULL COMMENT '变更单号',
    `deviceCode`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '设备编码',
    `productId`      bigint                                                        NOT NULL COMMENT '产品id',
    `udi`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT 'UDI码',
    `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 '批次号',
    `serialNo`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '序列号',
    `productionDate` date                                                          NULL     DEFAULT NULL COMMENT '生产日期',
    `expireDate`     date                                                          NULL     DEFAULT NULL COMMENT '失效日期',
    `manufactory`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生产厂家',
    `measname`       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 '注册/备案凭证号',
    `supId`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商ID',
    `supName`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商名称',
    PRIMARY KEY (`orderId`, `deviceCode`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '设备变更单明细'
  ROW_FORMAT = DYNAMIC;

CREATE TABLE IF NOT EXISTS `device_check`
(
    `taskId`         bigint                                                        NOT NULL COMMENT '巡检任务id',
    `planId`         bigint                                                        NULL     DEFAULT NULL COMMENT '计划id',
    `planName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '计划名称',
    `chargeDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '负责部门编码',
    `checkUserId`    bigint                                                        NULL     DEFAULT NULL COMMENT '巡检人id',
    `checkUserName`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '巡检人姓名',
    `checkUserPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '巡检人电话',
    `deviceCount`    int                                                           NOT NULL COMMENT '设备数量',
    `finishCount`    int                                                           NOT NULL DEFAULT 0 COMMENT '完成设备数量',
    `exceptionCount` int                                                           NOT NULL DEFAULT 0 COMMENT '异常数量',
    `finishTime`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '完成时间',
    `name`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '任务名称',
    `remark`         text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '任务备注',
    `sysFlag`        bit(1)                                                        NOT NULL COMMENT '是否系统创建 1/true 是 0/false 否',
    `finishFlag`     bit(1)                                                        NOT NULL DEFAULT b'0' COMMENT '是否已完成',
    `createTime`     datetime(0)                                                   NOT NULL COMMENT '创建时间',
    `createUserId`   bigint                                                        NULL     DEFAULT NULL COMMENT '创建人id',
    `createUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '创建人姓名',
    PRIMARY KEY (`taskId`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '巡检任务表'
  ROW_FORMAT = DYNAMIC;

CREATE TABLE IF NOT EXISTS `device_check_detail`
(
    `taskId`         bigint                                                        NOT NULL COMMENT '任务id',
    `deviceCode`     varbinary(255)                                                NOT NULL COMMENT '设备编码',
    `deptCode`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码',
    `deptName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '部门名称',
    `finishFlag`     bit(1)                                                        NOT NULL DEFAULT b'0' COMMENT '是否已完成 1/true 0/false',
    `productId`      bigint                                                        NOT NULL COMMENT '产品id',
    `udi`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT 'UDI码',
    `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 '批次号',
    `serialNo`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '序列号',
    `productionDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生产日期',
    `expireDate`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '失效日期',
    `manufactory`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生产厂家',
    `measname`       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 '注册/备案凭证号',
    `supId`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商ID',
    `supName`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商名称',
    `itemCount`      int                                                           NOT NULL DEFAULT 0 COMMENT '项目数量',
    `exceptionCount` int                                                           NOT NULL DEFAULT 0 COMMENT '异常数量',
    `finishCount`    int                                                           NOT NULL DEFAULT 0 COMMENT '完成项目数量',
    `finishTime`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '完成时间',
    `repairId`       bigint                                                        NULL     DEFAULT NULL COMMENT '维修单id',
    PRIMARY KEY (`taskId`, `deviceCode`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '巡检任务明细'
  ROW_FORMAT = DYNAMIC;

CREATE TABLE IF NOT EXISTS `device_check_detail_item`
(
    `taskId`        bigint                                                        NOT NULL COMMENT '任务id',
    `deviceCode`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码',
    `itemCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码',
    `itemName`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称',
    `itemContent`   longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NOT NULL COMMENT '项目内容',
    `normalFlag`    bit(1)                                                        NULL     DEFAULT NULL COMMENT '正常标识',
    `finishFlag`    bit(1)                                                        NOT NULL DEFAULT b'0' COMMENT '完成标识',
    `finishTime`    datetime(0)                                                   NULL     DEFAULT NULL COMMENT '完成时间',
    `suggestion`    longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NULL COMMENT '巡检建议',
    `checkUserId`   bigint                                                        NULL     DEFAULT NULL COMMENT '巡检人id',
    `checkUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '巡检人姓名',
    `checkDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '巡检部门',
    `checkDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '巡检部门名称',
    PRIMARY KEY (`taskId`, `deviceCode`, `itemCode`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '设备巡检项目'
  ROW_FORMAT = DYNAMIC;

CREATE TABLE IF NOT EXISTS `device_check_item_dict`
(
    `code`           varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码',
    `name`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称',
    `content`        longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NOT NULL COMMENT '项目内容',
    `createUserId`   bigint                                                        NOT NULL COMMENT '创建人id',
    `createUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称',
    `createTime`     datetime(0)                                                   NOT NULL COMMENT '创建时间',
    PRIMARY KEY (`code`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '巡检项目字典'
  ROW_FORMAT = DYNAMIC;

CREATE TABLE IF NOT EXISTS `device_info`
(
    `deviceCode`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码',
    `deptCode`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码',
    `status`              varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '1.正常，2变更归属中，3.维修申请中  4.维修中  6.销毁/报废',
    `checkLock`           bit(1)                                                        NOT NULL DEFAULT b'0' COMMENT '巡检锁定',
    `udi`                 varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT 'UDI码',
    `nameCode`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT 'DI码',
    `productId`           bigint                                                        NOT NULL COMMENT '产品id',
    `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 '批次号',
    `serialNo`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '序列号',
    `productionDate`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生产日期',
    `expireDate`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '失效日期',
    `manufactory`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生产厂家',
    `measname`            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 '注册/备案凭证号',
    `supId`               varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商ID',
    `supName`             varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商名称',
    `changeCount`         int                                                           NOT NULL DEFAULT 0 COMMENT '变更次数',
    `repairApplyCount`    int                                                           NOT NULL DEFAULT 0 COMMENT '报修次数',
    `repairCount`         int                                                           NOT NULL DEFAULT 0 COMMENT '维修次数',
    `checkCount`          int                                                           NOT NULL DEFAULT 0 COMMENT '巡检次数',
    `lastChangeOrderId`   bigint                                                        NOT NULL COMMENT '最后变更单号',
    `lastRepairApplyId`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '最后报修申请单号',
    `lastRepairApplyTime` datetime(0)                                                   NULL     DEFAULT NULL COMMENT '最后报修时间',
    `lastRepairId`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '最后维修单号',
    `lastRepairUserName`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '最后维修负责人名称',
    `lastRepairUserPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '最后维修人联系电话',
    `lastRepairTime`      datetime(0)                                                   NULL     DEFAULT NULL COMMENT '最后维修时间',
    `lastCheckUserId`     bigint                                                        NULL     DEFAULT NULL COMMENT '最后检查/巡检负责人',
    `lastCheckUserName`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '最后检查/巡检负责人名称',
    `lastCheckPhone`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '最后检查/巡检人联系电话',
    `lastCheckTime`       datetime(0)                                                   NULL     DEFAULT NULL COMMENT '最后检查/巡检时间',
    `lastCheckTaskId`     bigint                                                        NULL     DEFAULT NULL COMMENT '最后检查/巡检任务id',
    `createTime`          datetime(0)                                                   NOT NULL COMMENT '创建时间',
    `createUserId`        bigint                                                        NOT NULL COMMENT '创建人id',
    `createUserName`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人名称',
    PRIMARY KEY (`deviceCode`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '设备表'
  ROW_FORMAT = DYNAMIC;

CREATE TABLE IF NOT EXISTS `device_repair`
(
    `id`              bigint                                                        NOT NULL COMMENT '维修id',
    `applyId`         bigint                                                        NULL     DEFAULT NULL COMMENT '维修申请id',
    `checkTaskId`     bigint                                                        NULL     DEFAULT NULL COMMENT '巡检任务单id',
    `finishFlag`      bit(1)                                                        NOT NULL DEFAULT b'0' COMMENT '是否已完成 true/false',
    `description`     longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NOT NULL COMMENT '问题描述',
    `diagnosisInfo`   longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NOT NULL COMMENT '诊断信息',
    `innerFlag`       bit(1)                                                        NULL     DEFAULT NULL COMMENT '是否内部维修',
    `repairUserName`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '维修人姓名',
    `repairUserPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '维修人联系方式',
    `deviceCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备码',
    `deptCode`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码',
    `deptName`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门名称',
    `productId`       bigint                                                        NOT NULL COMMENT '产品id',
    `udi`             varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT 'UDI码',
    `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 '批次号',
    `serialNo`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '序列号',
    `productionDate`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生产日期',
    `expireDate`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '失效日期',
    `manufactory`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生产厂家',
    `measname`        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 '注册/备案凭证号',
    `supId`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商ID',
    `supName`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商名称',
    `createUserId`    bigint                                                        NOT NULL COMMENT '创建人id',
    `createUserName`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建人姓名',
    `createTime`      datetime(0)                                                   NOT NULL COMMENT '创建时间',
    `createDeptCode`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门',
    `createDeptName`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '创建部门名称',
    `confirmUserId`   bigint                                                        NULL     DEFAULT NULL COMMENT '确认人id',
    `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认人姓名',
    `confirmTime`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '确认时间',
    `confirmRemark`   longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NULL COMMENT '确认备注',
    `confirmDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认部门',
    `confirmDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认部门名称',
    `confirmPhone`    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;

CREATE TABLE IF NOT EXISTS `device_repair_apply`
(
    `id`              bigint                                                        NOT NULL COMMENT '报修单id',
    `status`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '状态 待受理，受理中，维修中，完成',
    `applyDeptCode`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修部门编码',
    `applyDeptName`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修部门',
    `applyUserId`     bigint                                                        NOT NULL COMMENT '报修人id',
    `applyUserName`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修人姓名',
    `applyUserPhone`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '报修人联系方式',
    `applyTime`       datetime(0)                                                   NOT NULL COMMENT '报修时间',
    `deviceCount`     int                                                           NOT NULL COMMENT '设备数量',
    `finishCount`     int                                                           NOT NULL DEFAULT 0 COMMENT '完成数量',
    `confirmDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认部门',
    `confirmDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认部门名称',
    `confirmUserId`   bigint                                                        NULL     DEFAULT NULL COMMENT '确认人id',
    `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认人姓名',
    `confirmPhone`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认人联系方式',
    `confirmTime`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '确认时间',
    `finishTime`      datetime(0)                                                   NULL     DEFAULT NULL COMMENT '完成时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '设备报修单'
  ROW_FORMAT = DYNAMIC;

CREATE TABLE IF NOT EXISTS `device_repair_apply_detail`
(
    `applyId`         bigint                                                        NOT NULL COMMENT '报修单id',
    `deviceCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码',
    `deptCode`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门编码',
    `deptName`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '部门名称',
    `description`     longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NOT NULL COMMENT '问题描述',
    `diagnosisInfo`   longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NULL COMMENT '诊断信息',
    `status`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '\0' COMMENT '状态  待诊断、待维修、维修中、完成',
    `repairFlag`      bit(1)                                                        NULL     DEFAULT NULL COMMENT '是否需要维修 true/false',
    `repairId`        bigint                                                        NULL     DEFAULT NULL COMMENT '维修单id',
    `productId`       bigint                                                        NOT NULL COMMENT '产品id',
    `udi`             varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT 'UDI码',
    `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 '批次号',
    `serialNo`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '序列号',
    `productionDate`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生产日期',
    `expireDate`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '失效日期',
    `manufactory`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生产厂家',
    `measname`        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 '注册/备案凭证号',
    `supId`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商ID',
    `supName`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商名称',
    `confirmUserId`   bigint                                                        NULL     DEFAULT NULL COMMENT '确认人id',
    `confirmUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认人姓名',
    `confirmTime`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '确认时间',
    `confirmRemark`   longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NULL COMMENT '确认备注',
    `confirmDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认部门',
    `confirmDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '确认部门名称',
    `finishTime`      datetime(0)                                                   NULL     DEFAULT NULL COMMENT '完成时间',
    PRIMARY KEY (`applyId`, `deviceCode`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '设备报修单明细'
  ROW_FORMAT = DYNAMIC;

CREATE TABLE IF NOT EXISTS `device_repair_order`
(
    `id`              int                                                           NOT NULL AUTO_INCREMENT,
    `orderId`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '报修单号',
    `deptCode`        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 COMMENT '仓库编码',
    `code`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资产编码',
    `status`          tinyint                                                       NULL DEFAULT NULL COMMENT '状态（0：新增；1：未审核；2：已审核）',
    `createUser`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
    `auditUser`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '审核人',
    `msg`             varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '报修说明',
    `createTime`      datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建时间',
    `auditTime`       datetime(0)                                                   NULL DEFAULT NULL COMMENT '审核时间',
    `updateTime`      datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `remark`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `repairType`      tinyint                                                       NULL DEFAULT NULL,
    `urgencyType`     tinyint                                                       NULL DEFAULT NULL,
    `planTime`        datetime(0)                                                   NULL DEFAULT NULL,
    `uploadImage`     text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL,
    `repariName`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `reparistartTime` datetime(0)                                                   NULL DEFAULT NULL,
    `repariEndTime`   datetime(0)                                                   NULL DEFAULT NULL,
    `repariRemark`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `repariImage`     text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL,
    `inspectUser`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 20
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '设备报修单表'
  ROW_FORMAT = DYNAMIC;

CREATE TABLE IF NOT EXISTS `device_repair_order_detail`
(
    `id`         bigint                                                        NOT NULL,
    `orderIdFk`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `code`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目编号',
    `content`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目内容',
    `type`       int                                                           NULL DEFAULT NULL COMMENT '项目类型：1：巡检；2：养护',
    `remark`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
    `updateTime` datetime(0)                                                   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;



INSERT ignore INTO `sys_app_version`(`id`, `type`, `versionName`, `versionCode`, `appName`, `createTime`, `downloadUrl`,
                                     `updateLog`)
VALUES (1, 'udi_wms_new', '3.0.6', 306, 'UDI扫码终端', '2023-10-30 18:42:24', 'http://192.168.1.11:9150/udiwms_new.apk',
        '1.单据审核移除UDI码异常提示；2优化多项功能');



CALL Pro_Temp_ColumnWork('basic_product_category', 'deptCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_product_category', 'invCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'inPreInBack', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'deptNoInvType', 'tinyint', 1);


INSERT ignore INTO sys_param_config(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`,
                                    `paramType`, `paramExplain`, `updateTime`)
VALUES (20088, 0, '单据详情展示方式', 'order_detail_visible', '1', 0, 0, '1:按DI统一排序2：按扫码或录入时间排序', NULL);

CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'sterBatchNo', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'sterDate', 'varchar(255)', 1);

CALL Pro_Temp_ColumnWork('io_order_detail_code', 'sterBatchNo', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_code', 'sterDate', 'varchar(255)', 1);

CALL Pro_Temp_ColumnWork('io_order_detail_result', 'sterBatchNo', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_result', 'sterDate', 'varchar(255)', 1);


UPDATE `auth_menu`
SET `menu_name`   = '耗材字典维护',
    `parent_id`   = 1644,
    `order_num`   = 1,
    `path`        = 'maintain',
    `component`   = 'basic/product/product',
    `query_param` = '{\"vueRouteSource\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = 'basic:product:maintain',
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-01-11 17:02:20',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1646;
UPDATE `auth_menu`
SET `menu_name`   = '产品信息导出',
    `parent_id`   = 1616,
    `order_num`   = 2,
    `path`        = 'basic/product/product',
    `component`   = 'basic/product/product',
    `query_param` = '{\"vueRouteSource\":2}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = 'thirdSys:product:export',
    `icon`        = '',
    `create_by`   = '超级用户',
    `create_time` = '2022-12-28 11:30:58',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1618;


CREATE TABLE IF NOT EXISTS `thr_product_type`
(
    `id`       int                                                           NOT NULL,
    `code`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类别编码',
    `name`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类别名称',
    `thirdSys` 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 '备注',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci
  ROW_FORMAT = Dynamic;

CALL Pro_Temp_ColumnWork('basic_udirel', 'uploadFlag', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'uploadMsg', 'varchar(1024)', 1);



CALL Pro_Temp_ColumnWork('thr_products', 'prcitmcode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('thr_products', 'invCode', 'varchar(255)', 1);


/*
 Navicat Premium Data Transfer

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

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

 Date: 18/01/2024 11:05:42
*/


-- ----------------------------
-- Table structure for basic_sk_prescirbe_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `basic_sk_prescirbe_detail`
(
    `id`           bigint                                                        NOT NULL,
    `relId`        bigint                                                        NULL DEFAULT NULL COMMENT '耗材产品id',
    `thrName`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材名称',
    `thrCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材编码',
    `pId`          bigint                                                        NULL DEFAULT NULL COMMENT '项目组套外键',
    `count`        int                                                           NULL DEFAULT NULL COMMENT '数量',
    `measureCount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量数量',
    `measureUnit`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量单位',
    `category`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类别',
    `frequency`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '频率',
    `price`        decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '价格',
    `ggxh`         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 '备注',
    `createTime`   datetime(0)                                                   NULL DEFAULT NULL,
    `createUser`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `updateTime`   datetime(0)                                                   NULL DEFAULT NULL,
    `updateUser`   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;

-- ----------------------------
-- Table structure for basic_sk_prescribe
-- ----------------------------
CREATE TABLE IF NOT EXISTS `basic_sk_prescribe`
(
    `code`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '处方编码',
    `sickerCode`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '病人编码',
    `prescribeDate` datetime(0)                                                   NULL DEFAULT NULL COMMENT '开方时间',
    `createDr`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '开方医生',
    `amount`        decimal(16, 4)                                                NULL DEFAULT NULL COMMENT '处方费用',
    `deptCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '就诊科室编码',
    `deptName`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '就诊科室名称',
    `diagnosis`     text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '诊断内容',
    `remark`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci 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 '创建时间',
    `updateUser`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
    `updateTime`    datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `adNum`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    PRIMARY KEY (`code`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '患者处方'
  ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for basic_sk_prescribe_item
-- ----------------------------
CREATE TABLE IF NOT EXISTS `basic_sk_prescribe_item`
(
    `id`            bigint                                                        NOT NULL,
    `thrId`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '第三方id',
    `sickerCode`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '患者编码',
    `prescribeCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '处方编码',
    `relId`         bigint                                                        NULL DEFAULT NULL COMMENT '耗材产品id',
    `itemName`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
    `itemCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编码',
    `measureCount`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量数量',
    `measureUnit`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量单位',
    `category`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类别',
    `frequency`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '频率',
    `count`         int                                                           NULL DEFAULT NULL COMMENT '数量',
    `price`         decimal(16, 4)                                                NULL DEFAULT NULL COMMENT '单价',
    `amount`        decimal(16, 4)                                                NULL DEFAULT NULL COMMENT '总价',
    `ggxh`          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 '备注',
    `adNum`         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;

-- ----------------------------
-- Table structure for basic_sk_prescribe_item_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `basic_sk_prescribe_item_detail`
(
    `id`            bigint                                                        NOT NULL,
    `pId`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `sickerCode`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '患者编码',
    `prescribeCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '处方编码',
    `relId`         bigint                                                        NULL DEFAULT NULL COMMENT '耗材产品id',
    `thrName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材名称',
    `thrCode`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材编码',
    `measureCount`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量数量',
    `measureUnit`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量单位',
    `category`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类别',
    `frequency`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '频率',
    `count`         int                                                           NULL DEFAULT NULL COMMENT '数量',
    `price`         decimal(16, 4)                                                NULL DEFAULT NULL COMMENT '价格',
    `ggxh`          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 '备注',
    `nameCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `amount`        decimal(10, 3)                                                NULL DEFAULT NULL,
    `adNum`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `updateTime`    datetime(0)                                                   NULL DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '处方用药信息表'
  ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for basic_sk_project
-- ----------------------------
CREATE TABLE IF NOT EXISTS `basic_sk_project`
(
    `id`         bigint                                                        NOT NULL AUTO_INCREMENT,
    `idCode`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '自定义编码',
    `code`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目编码',
    `name`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '项目名称',
    `category`   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 '规格',
    `remark`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `createTime` datetime(0)                                                   NULL DEFAULT NULL,
    `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `updateTime` datetime(0)                                                   NULL DEFAULT NULL,
    `updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `type`       tinyint                                                       NULL DEFAULT NULL COMMENT '类型：1：定数包，内部使用；2：项目、组套外部关联',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1726788278562713601
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci
  ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for basic_sk_project_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `basic_sk_project_detail`
(
    `id`           bigint                                                        NOT NULL,
    `relId`        bigint                                                        NULL DEFAULT NULL COMMENT '耗材产品id',
    `thrName`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材名称',
    `thrCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材编码',
    `pId`          bigint                                                        NULL DEFAULT NULL COMMENT '定数包模板id',
    `count`        int                                                           NULL DEFAULT NULL COMMENT '数量',
    `measureCount` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量数量',
    `measureUnit`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量单位',
    `category`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类别',
    `frequency`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '频率',
    `price`        decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '价格',
    `ggxh`         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 '备注',
    `createTime`   datetime(0)                                                   NULL DEFAULT NULL,
    `createUser`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `updateTime`   datetime(0)                                                   NULL DEFAULT NULL,
    `updateUser`   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;

-- ----------------------------
-- Table structure for basic_sk_sicker
-- ----------------------------
CREATE TABLE IF NOT EXISTS `basic_sk_sicker`
(
    `code`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '患者编码',
    `name`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名',
    `adNum`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '住院号',
    `idNum`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '身份证号',
    `phone`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号',
    `gender`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '性别',
    `job`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '职业',
    `bornDate`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '出生年月',
    `nationality`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '国籍',
    `education`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文化程度',
    `guardianName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '监护人',
    `guardianRel`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '监护人与患者关系',
    `curAddr`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '现居住地',
    `kosekiAddr`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '户籍地',
    `medicalIns`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci 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 '创建时间',
    `updateUser`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
    `updateTime`   datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `remark`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `deptName`     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,
    PRIMARY KEY (`code`) USING BTREE,
    INDEX `code` (`code`) USING BTREE,
    INDEX `adNum` (`adNum`) USING BTREE,
    INDEX `name` (`name`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '患者信息'
  ROW_FORMAT = DYNAMIC;



CALL Pro_Temp_ColumnWork('basic_sk_prescribe', 'adNum', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_sk_prescribe_item', 'adNum', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_sk_prescribe_item_detail', 'nameCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_sk_prescribe_item_detail', 'amount', 'decimal(10, 3)', 1);
CALL Pro_Temp_ColumnWork('basic_sk_prescribe_item_detail', 'adNum', 'varchar(255)', 1);

CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailPrescribe', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'inputSick', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'groupBuySplit', 'tinyint', 1);


CALL Pro_Temp_ColumnWork('io_order', 'sickerAdNum', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_sk_prescribe_item_detail', 'pId', 'varchar(255)', 2);
CALL Pro_Temp_ColumnWork('basic_sk_prescribe_item_detail', 'updateTime', 'datetime', 1);


CREATE TABLE IF NOT EXISTS `io_stat_detail`
(
    `id`            int                                                           NOT NULL AUTO_INCREMENT,
    `recordKeyFk`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci 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 '批次号',
    `inCount`       int                                                           NULL DEFAULT NULL COMMENT '入库数量',
    `inPrice`       decimal(10, 3)                                                NULL DEFAULT NULL COMMENT '入库价格',
    `inAmount`      decimal(10, 3)                                                NULL DEFAULT NULL COMMENT '入库金额',
    `outCount`      int                                                           NULL DEFAULT NULL COMMENT '出库数量',
    `outPrice`      decimal(10, 3)                                                NULL DEFAULT NULL COMMENT '出库价格',
    `outAmount`     decimal(10, 3)                                                NULL DEFAULT NULL COMMENT '出库金额',
    `balanceCount`  int                                                           NULL DEFAULT NULL COMMENT '结余数量',
    `balancePrice`  decimal(10, 3)                                                NULL DEFAULT NULL COMMENT '结余价格',
    `balanceAmount` decimal(10, 3)                                                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 COMMENT '部门',
    `invCode`       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;


CALL Pro_Temp_ColumnWork('io_stat_order', 'startDate', 'datetime', 1);
CALL Pro_Temp_ColumnWork('io_stat_order', 'endDate', 'datetime', 1);
CALL Pro_Temp_ColumnWork('io_stat_order', 'status', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('io_stat_order', 'statType', 'tinyint', 1);

CALL Pro_Temp_ColumnWork('basic_sk_prescribe', 'deptName', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_sk_prescribe', 'deptCode', 'varchar(255)', 1);


CREATE TABLE IF NOT EXISTS `io_order_sk_prescribe`
(
    `id`            bigint                                                        NOT NULL AUTO_INCREMENT,
    `pId`           bigint                                                        NOT NULL COMMENT '项目组套外键',
    `sickerCode`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '患者编码',
    `prescribeCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '处方编码',
    `relId`         bigint                                                        NULL DEFAULT NULL COMMENT '耗材产品id',
    `thrName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材名称',
    `thrCode`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '耗材编码',
    `measureCount`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量数量',
    `measureUnit`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量单位',
    `category`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '类别',
    `frequency`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '频率',
    `count`         int                                                           NULL DEFAULT NULL COMMENT '数量',
    `price`         decimal(16, 4)                                                NULL DEFAULT NULL COMMENT '价格',
    `ggxh`          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 '备注',
    `nameCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `amount`        decimal(10, 3)                                                NULL DEFAULT NULL COMMENT '总金额',
    `adNum`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '住院号',
    `realCount`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '实际数量',
    `realPrice`     decimal(10, 3)                                                NULL DEFAULT NULL COMMENT '实际价格',
    `orderIdFk`     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;


CALL Pro_Temp_ColumnWork('inv_stock_compare_detail', 'price', 'decimal(10, 3)', 1);
CALL Pro_Temp_ColumnWork('inv_stock_compare_detail', 'thrPrice', 'decimal(10, 3)', 1);
CALL Pro_Temp_ColumnWork('inv_stock_compare_detail', 'batchNo', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('inv_stock_compare_detail', 'createTime', 'datetime', 1);
CALL Pro_Temp_ColumnWork('inv_stock_compare_detail', 'updateTime', 'datetime', 1);


update basic_bussiness_type
set inputSick = true
WHERE inputSick is null;


CREATE TABLE IF NOT EXISTS `thr_manufacturer`
(
    `id`         bigint                                                        NOT NULL,
    `unitId`     varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL,
    `spell`      varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL,
    `addr`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `creditNo`   varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL,
    `contact`    varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL,
    `mobile`     varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL,
    `thirdSysFk` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL,
    `name`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
    `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '创建人',
    `createTime` datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建时间',
    `updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '更新人',
    `updateTime` datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `remark`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '备注',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `unique` (`unitId`, `thirdSysFk`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '第三方仓库'
  ROW_FORMAT = DYNAMIC;

SET FOREIGN_KEY_CHECKS = 1;



CALL Pro_Temp_ColumnWork('thr_corp', 'kfdm', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'purType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'attributeType', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'hcType', 'tinyint', 1);

INSERT ignore INTO basic_product_set(`id`, `parmName`, `parmKey`, `enable`, `supSelect`, `supAdd`, `localAdd`, `remark`,
                                     `sort`, `localEdit`)
VALUES (33, '采购类型', 'purType', 1, 1, 1, 0, '采购类型是否必填字段', 65, 1);

INSERT ignore INTO sys_param_config(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, `paramType`,
                                    `paramExplain`, `updateTime`)
VALUES (20099, 0, '三方出入库明细是否组套', 'inv_set_enable', '0', 1, 0, '0：否；1：是', '2023-12-26 09:26:38');

-- ----------------------------
-- Table structure for thr_inv_order
-- ----------------------------
CREATE TABLE IF NOT EXISTS `thr_inv_order`
(
    `id`         int(0)                                                        NOT NULL AUTO_INCREMENT,
    `billNo`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '单据号',
    `billDate`   datetime(0)                                                   NULL DEFAULT NULL COMMENT '单据时间',
    `startDate`  datetime(0)                                                   NULL DEFAULT NULL COMMENT '库存开始时间',
    `endDate`    datetime(0)                                                   NULL DEFAULT NULL COMMENT '库存结束时间',
    `mainAction` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '出入库类型',
    `billType`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '第三方单据类型',
    `thirdSysFk` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL COMMENT '外部系统',
    `deptCode`   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 COMMENT '仓库编码',
    `spaceCode`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货位编码',
    `status`     tinyint(0)                                                    NULL DEFAULT NULL COMMENT '单据状态',
    `createTime` datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建时间',
    `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
    `updateTime` datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `updateUser` 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 '备注',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 16
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '库存出入库明细'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for thr_inv_order_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `thr_inv_order_detail`
(
    `id`             int(0)                                                        NOT NULL AUTO_INCREMENT,
    `orderIdFk`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '单据号',
    `cpmctymc`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '产品通用名称',
    `relId`          int(0)                                                        NULL DEFAULT NULL COMMENT '物资字典主键',
    `thrCode`        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',
    `ggxh`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '规格型号',
    `batchNo`        varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL COMMENT '批次号',
    `measname`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '计量单位',
    `price`          decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '价格',
    `productionDate` datetime(0)                                                   NULL DEFAULT NULL COMMENT '生产日期',
    `expireDate`     datetime(0)                                                   NULL DEFAULT NULL COMMENT '失效日期',
    `ylqxzcrbarmc`   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 '注册/备案号',
    `inCount`        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 '出库数量',
    `supName`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '供应商',
    `deptName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '部门',
    `deptCode`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '部门编码',
    `invName`        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 COMMENT '仓库编码',
    `spaceCode`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货位',
    `spaceName`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货位编码',
    `reCount`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '实际数量',
    `mainAction`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '出入库类型',
    `manufacturer`   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 '备注',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 121
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci
  ROW_FORMAT = Dynamic;

INSERT ignore INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`,
                             `create_time`, `update_by`, `update_time`, `remark`)
VALUES (2086, '出入库明细', 1608, 8, 'thrInvOrder', NULL, NULL, 1, 0, 'M', '0', '0', NULL, '', '超级用户', '2024-02-28 11:47:10',
        NULL, NULL, NULL);
INSERT ignore INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`,
                             `create_time`, `update_by`, `update_time`, `remark`)
VALUES (2087, '出入库查询', 2086, 1, 'thirdSys/invOrder/thrInvOrder', 'thirdSys/invOrder/thrInvOrder', NULL, 1, 0, 'C', '0',
        '0', 'thirdSys:invOrder:thrInvOrder', NULL, '超级用户', '2024-02-28 11:51:21', NULL, NULL, NULL);

UPDATE auth_menu
SET `menu_name`   = '收费出入库明细',
    `parent_id`   = 2086,
    `order_num`   = 1,
    `path`        = 'thirdSys/invOrder/thrInvOrder',
    `component`   = 'thirdSys/invOrder/thrInvOrder',
    `query_param` = NULL,
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = 'thirdSys:invOrder:thrInvOrder',
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2024-02-28 11:51:21',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 2087;

INSERT ignore INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`,
                             `create_time`, `update_by`, `update_time`, `remark`)
VALUES (2088, '普耗出入库明细', 2086, 1, 'thirdSys/invOrder/thrInvPhOrder', 'thirdSys/invOrder/thrInvPhOrder', NULL, 1, 0, 'C',
        '0', '0', 'thirdSys:invOrder:thrInvPhOrder', NULL, '超级用户', '2024-02-28 11:51:21', NULL, NULL, NULL);

INSERT ignore INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`,
                             `create_time`, `update_by`, `update_time`, `remark`)
VALUES (2089, '高耗出入库明细', 2086, 1, 'thirdSys/invOrder/thrInvGhOrder', 'thirdSys/invOrder/thrInvGhOrder', NULL, 1, 0, 'C',
        '0', '0', 'thirdSys:invOrder:thrInvGhOrder', NULL, '超级用户', '2024-02-28 11:51:21', NULL, NULL, NULL);

CALL Pro_Temp_ColumnWork('thr_inv_order', 'sourceType',
                         ' int(0) NULL DEFAULT NULL COMMENT ''来源类型，1收费，2普耗，3高耗'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'exMsg', ' text NULL DEFAULT NULL COMMENT ''单据异常信息'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'skProject', ' int(0) NULL DEFAULT NULL COMMENT ''是否组套'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order_detail', 'udiCode',
                         ' varchar(255)  NULL DEFAULT NULL COMMENT ''udiCode'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order_detail', 'serialNo',
                         ' varchar(255)  NULL DEFAULT NULL COMMENT ''序列号'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order_detail', 'sickerCode',
                         ' varchar(80)  NULL DEFAULT NULL COMMENT ''患者编码'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order_detail', 'sickerName',
                         ' varchar(30)  NULL DEFAULT NULL COMMENT ''患者名称'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'thirdSysFk',
                         ' varchar(30) NULL DEFAULT NULL COMMENT ''第三方系统标识'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order_detail', 'supId',
                         ' varchar(30)  NULL DEFAULT NULL COMMENT ''供应商ID'' AFTER `remark`', 1);


CALL Pro_Temp_ColumnWork('basic_sk_project_detail', 'supId',
                         ' varchar(30)  NULL DEFAULT NULL COMMENT ''供应商ID'' AFTER `remark`', 1);
CALL Pro_Temp_ColumnWork('basic_sk_project_detail', 'thrName',
                         ' varchar(30)  NULL DEFAULT NULL COMMENT ''供应商ID'' AFTER `remark`', 1);


INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (75, '收费出入库明细下载', 'invSfOrderUrl', '/udiwms/erp/inv/getInvSfResult', 1, '1', '', 'thirdId', 1, 3, 1440, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (76, '收费出入库明细下载', 'invSfOrderUrl', '', 1, '1', '', 'thirdId1', 1, 3, NULL, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (77, '收费出入库明细下载', 'invSfOrderUrl', '', 1, '1', '', 'thirdId2', 1, 3, NULL, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (78, '收费出入库明细下载', 'invSfOrderUrl', '', 1, '1', '', 'thirdId3', 1, 3, NULL, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (79, '收费出入库明细下载', 'invSfOrderUrl', '', 1, '1', '', 'thirdId4', 1, 3, NULL, NULL);

INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (90, '普耗出入库明细下载', 'invPhOrderUrl', '/udiwms/erp/inv/getInvPhResult', 1, '1', '', 'thirdId', 1, 3, 1440, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (91, '普耗出入库明细下载', 'invPhOrderUrl', '', 1, '1', '', 'thirdId1', 1, 3, NULL, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (92, '普耗出入库明细下载', 'invPhOrderUrl', '', 1, '1', '', 'thirdId2', 1, 3, NULL, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (93, '普耗出入库明细下载', 'invPhOrderUrl', '', 1, '1', '', 'thirdId3', 1, 3, NULL, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (94, '普耗出入库明细下载', 'invPhOrderUrl', '', 1, '1', '', 'thirdId4', 1, 3, NULL, NULL);


INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (95, '高耗出入库明细下载', 'invGhOrderUrl', '/udiwms/erp/inv/getInvGhResult', 1, '1', '', 'thirdId', 1, 3, 1440, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (96, '高耗出入库明细下载', 'invGhOrderUrl', '', 1, '1', '', 'thirdId1', 1, 3, NULL, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (97, '高耗出入库明细下载', 'invGhOrderUrl', '', 1, '1', '', 'thirdId2', 1, 3, NULL, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (98, '高耗出入库明细下载', 'invGhOrderUrl', '', 1, '1', '', 'thirdId3', 1, 3, NULL, NULL);
INSERT ignore INTO thr_system_detail(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                     `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (99, '高耗出入库明细下载', 'invGhOrderUrl', '', 1, '1', '', 'thirdId4', 1, 3, NULL, NULL);



CALL Pro_Temp_ColumnWork('inv_product', 'inBatchNo', ' varchar(30)  NULL DEFAULT NULL COMMENT ''入院批号'' ',
                         1);


INSERT ignore INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`,
                                      `paramType`, `paramExplain`, `updateTime`)
VALUES (200320, 0, '普耗/收费出库先进先出', 'phfee_batchno_fifo', '1', 1, 0, '第三方普耗/收费出库是否按照批号先进先出先进先出', '2024-03-07 15:20:35');

CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailInvBatchNo',
                         'tinyint  NULL DEFAULT NULL COMMENT ''是否允许库存批次号先进先出''', 1);

CALL Pro_Temp_ColumnWork('io_code_temp', 'errUdiCode', 'varchar(255) NULL DEFAULT NULL COMMENT ''去掉错误符号异常UDI码''', 1);
CALL Pro_Temp_ColumnWork('io_code', 'errUdiCode', 'varchar(255) NULL DEFAULT NULL COMMENT ''去掉错误符号异常UDI码''', 1);
CALL Pro_Temp_ColumnWork('thr_system_bus_api', 'fromCorp', 'varchar(255) NULL DEFAULT NULL COMMENT ''配置默认往来单位''', 1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'fromCorp', 'varchar(255) NULL DEFAULT NULL COMMENT ''配置默认往来单位''', 1);


INSERT IGNORE INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`,
                                      `paramType`, `paramExplain`, `updateTime`)
VALUES (200321, 0, '收费出库是否过滤高值耗材', 'fee_out_filter_hight', '0', 1, 0, '收费出库是否过滤高值耗材', '2024-03-13 09:50:48');

INSERT IGNORE INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`,
                                      `paramType`, `paramExplain`, `updateTime`)
VALUES (200322, 0, '收费出库是否过滤一对多', 'fee_out_filter_cp', '0', 1, 0, '收费出库是否过滤1对多的耗材', '2024-03-13 11:04:02');
INSERT IGNORE INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`,
                                      `paramType`, `paramExplain`, `updateTime`)
VALUES (200323, 0, '收费出库是否自动生成单据', 'fee_out_auto_gen', '0', 1, 0, '收费出库是否自动生成单据', '2024-03-13 11:04:02');
INSERT IGNORE INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`,
                                      `paramType`, `paramExplain`, `updateTime`)
VALUES (200325, 0, '高耗出库是否自动生成单据', 'gh_out_auto_gen', '0', 1, 0, '高耗出库是否自动生成单据', '2024-03-20 10:23:42');


CALL Pro_Temp_ColumnWork('io_order', 'fromPatientCode',
                         ' varchar(30)  NULL DEFAULT NULL COMMENT ''往来患者code'' AFTER `sickerAdNum`', 1);



CREATE TABLE if not exists `sys_approval_flow`
(
    `id`         varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NOT NULL COMMENT '主键，可作为审批编号',
    `title`      varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NULL DEFAULT NULL COMMENT '标题（王五的请假申请）',
    `type`       varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NULL DEFAULT NULL COMMENT '审批类型（字典表设置code用作区分类型）',
    `status`     int(0)                                                        NULL DEFAULT NULL COMMENT '审核状态（1：待审核；2：通过；3：驳回；4：撤销）',
    `userId`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '申请人主键',
    `userName`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '申请人名称',
    `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '创建人',
    `createTime` datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建时间',
    `updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '更新人',
    `updateTime` datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 20
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_as_cs COMMENT = '审批主表'
  ROW_FORMAT = Dynamic;

CREATE TABLE if not exists `sys_approval_flow_mx`
(
    `id`               varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NOT NULL COMMENT '明细表主键',
    `approvalFlowId`   varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NOT NULL COMMENT '审批表主键',
    `approvalUserId`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '审批人主键',
    `approvalUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '审批人名称',
    `approvalTime`     datetime(0)                                                   NULL DEFAULT NULL COMMENT '审批时间',
    `approvalOpinion`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '审批意见',
    `approvalStatus`   int(0)                                                        NULL DEFAULT NULL COMMENT '审核状态（1：审核中；2：等待我审核；3：通过；4：驳回）',
    `approvalSort`     int(0)                                                        NULL DEFAULT NULL COMMENT '排序',
    `createUser`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '创建人',
    `createTime`       datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建时间',
    `updateUser`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '更新人',
    `updateTime`       datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 20
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_as_cs COMMENT = '审批明细表'
  ROW_FORMAT = Dynamic;

CREATE TABLE if not exists `sys_approval_flow_config`
(
    `id`           varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NOT NULL COMMENT '审核配置表主键',
    `type`         varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NULL DEFAULT NULL COMMENT '审批单据名称',
    `typeName`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '审批人主键',
    `approvalSort` int(0)                                                        NULL DEFAULT NULL COMMENT '排序',
    `createUser`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '创建人',
    `createTime`   datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建时间',
    `updateUser`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '更新人',
    `updateTime`   datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 20
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_as_cs COMMENT = '审批配置表'
  ROW_FORMAT = Dynamic;



CREATE TABLE if not exists `sys_approval_flow_config_mx`
(
    `id`               varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NOT NULL COMMENT '审核配置表主键',
    `type`             varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NULL DEFAULT NULL COMMENT '审批类型（字典表设置code用作区分类型）',
    `approvalUserId`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '审批人主键',
    `approvalUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '审批人名称',
    `approvalSort`     int(0)                                                        NULL DEFAULT NULL COMMENT '排序',
    `createUser`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '创建人',
    `createTime`       datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建时间',
    `updateUser`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '更新人',
    `updateTime`       datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 20
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_as_cs COMMENT = '审批配置明细表'
  ROW_FORMAT = Dynamic;


INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`,
                             `create_time`, `update_by`, `update_time`, `remark`)
VALUES (2090, '审批配置', 1643, 7, 'basic/approval/SysApprovalFlowConfig', 'basic/approval/SysApprovalFlowConfig', NULL, 1,
        0, 'C', '0', '0', NULL, NULL, '超级用户', '2024-03-14 09:57:58', NULL, NULL, NULL);

INSERT IGNORE INTO sys_approval_flow_config(`id`, `type`, `typeName`, `approvalSort`, `createUser`, `createTime`,
                                            `updateUser`, `updateTime`)
VALUES ('1', 'ly', '领用单据', 1, NULL, NULL, NULL, NULL);
INSERT IGNORE INTO sys_approval_flow_config(`id`, `type`, `typeName`, `approvalSort`, `createUser`, `createTime`,
                                            `updateUser`, `updateTime`)
VALUES ('2', 'sg', '申购单据', 2, NULL, NULL, NULL, NULL);
INSERT IGNORE INTO sys_approval_flow_config(`id`, `type`, `typeName`, `approvalSort`, `createUser`, `createTime`,
                                            `updateUser`, `updateTime`)
VALUES ('3', 'cgjh', '采购计划单据', 3, NULL, NULL, NULL, NULL);
INSERT IGNORE INTO sys_approval_flow_config(`id`, `type`, `typeName`, `approvalSort`, `createUser`, `createTime`,
                                            `updateUser`, `updateTime`)
VALUES ('4', 'cgdd', '采购订单单据', 4, NULL, NULL, NULL, NULL);

CALL Pro_Temp_ColumnWork('pur_receive', 'approvalFlowId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''审批表主键(关联审批流程主表)'' ',
                         1);

INSERT IGNORE INTO sys_param_config(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, `paramType`,
                                    `paramExplain`, `updateTime`)
VALUES (200324, 0, '是否开启审批流程配置', 'sys_approval_flow', '0', 1, 0, '0：否；1：是', '2024-03-13 11:04:02');


UPDATE sys_custom_config_detail
SET `configId`    = 21,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'status',
    `columnDesc`  = '单据状态',
    `columnType`  = 'eltag',
    `colorRule`   = '',
    `sort`        = NULL,
    `lableRule`   = '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}',
    `width`       = 120,
    `tooltip`     = NULL,
    `buttonRule`  = '',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 234;
UPDATE sys_custom_config_detail
SET `configId`    = 23,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'status',
    `columnDesc`  = '单据状态',
    `columnType`  = 'eltag',
    `colorRule`   = '',
    `sort`        = NULL,
    `lableRule`   = '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}',
    `width`       = NULL,
    `tooltip`     = NULL,
    `buttonRule`  = '',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 256;

UPDATE sys_custom_config_detail
SET `configId`    = 23,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'auditRemark',
    `columnDesc`  = '审核详情',
    `columnType`  = 'button',
    `colorRule`   = NULL,
    `sort`        = NULL,
    `lableRule`   = NULL,
    `width`       = NULL,
    `tooltip`     = NULL,
    `buttonRule`  = '[{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"审核过程\",\"clickFuc\":\"showApprovalFlowDetail\"}]',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 258;



CALL Pro_Temp_ColumnWork('basic_sk_project', 'unit',
                         ' varchar(30)  NULL DEFAULT NULL COMMENT ''单位'' AFTER `type`', 1);

CALL Pro_Temp_ColumnWork('basic_sk_project', 'price',
                         ' varchar(30)  NULL DEFAULT NULL COMMENT ''价格'' AFTER `type`', 1);

UPDATE sys_custom_config_detail
SET `configId`    = 19,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'oper',
    `columnDesc`  = '操作',
    `columnType`  = 'button',
    `colorRule`   = '',
    `sort`        = NULL,
    `lableRule`   = '',
    `width`       = 500,
    `tooltip`     = NULL,
    `buttonRule`  = '[{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"编辑\",\"clickFuc\":\"newDistributionForm\",\"disabledFuc\":\"!(row.status!=3 || row.flowStatus!=3)\",\"hasPermi\":\"\"},{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"打印\",\"clickFuc\":\"printOrder\"},{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"删除\",\"clickFuc\":\"deleteDialog\"}]',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 215;
UPDATE sys_custom_config_detail
SET `configId`    = 25,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'auditRemark',
    `columnDesc`  = '审核详情',
    `columnType`  = 'button',
    `colorRule`   = NULL,
    `sort`        = NULL,
    `lableRule`   = NULL,
    `width`       = NULL,
    `tooltip`     = NULL,
    `buttonRule`  = '[{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"审核过程\",\"clickFuc\":\"showApprovalFlowDetail\"}]',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 2713;

UPDATE sys_custom_config_detail
SET `configId`    = 25,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'status',
    `columnDesc`  = '单据状态',
    `columnType`  = 'eltag',
    `colorRule`   = '',
    `sort`        = NULL,
    `lableRule`   = '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}',
    `width`       = NULL,
    `tooltip`     = NULL,
    `buttonRule`  = '',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 2711;

UPDATE sys_custom_config_detail
SET `configId`    = 19,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'status',
    `columnDesc`  = '单据状态',
    `columnType`  = 'eltag',
    `colorRule`   = '',
    `sort`        = NULL,
    `lableRule`   = '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}',
    `width`       = NULL,
    `tooltip`     = NULL,
    `buttonRule`  = '',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 212;

CALL Pro_Temp_ColumnWork('pur_apply', 'approvalFlowId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''审批表主键(关联审批流程主表)'' ',
                         1);

CALL Pro_Temp_ColumnWork('pur_plan', 'approvalFlowId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''审批表主键(关联审批流程主表)'' ',
                         1);

CALL Pro_Temp_ColumnWork('pur_order', 'approvalFlowId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''审批表主键(关联审批流程主表)'' ',
                         1);

UPDATE sys_custom_config_detail
SET `configId`    = 29,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'status',
    `columnDesc`  = '单据状态',
    `columnType`  = 'eltag',
    `colorRule`   = '',
    `sort`        = NULL,
    `lableRule`   = '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}',
    `width`       = NULL,
    `tooltip`     = NULL,
    `buttonRule`  = '',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 2769;

UPDATE sys_custom_config_detail
SET `configId`    = 31,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'status',
    `columnDesc`  = '单据状态',
    `columnType`  = 'eltag',
    `colorRule`   = '',
    `sort`        = NULL,
    `lableRule`   = '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}',
    `width`       = NULL,
    `tooltip`     = NULL,
    `buttonRule`  = '',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 2799;

UPDATE sys_custom_config_detail
SET `configId`    = 33,
    `type`        = '1',
    `isShow`      = 1,
    `columnName`  = 'status',
    `columnDesc`  = '单据状态',
    `columnType`  = 'eltag',
    `colorRule`   = '',
    `sort`        = NULL,
    `lableRule`   = '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}',
    `width`       = NULL,
    `tooltip`     = NULL,
    `buttonRule`  = '',
    `number`      = NULL,
    `lineNumber`  = NULL,
    `clickFuc`    = NULL,
    `size`        = NULL,
    `style`       = NULL,
    `disabled`    = NULL,
    `checkRules`  = NULL,
    `inputType`   = NULL,
    `disabledFuc` = NULL,
    `expression`  = NULL,
    `dataFuc`     = NULL,
    `isShowXx`    = NULL
WHERE `id` = 2827;


INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38001, 19, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);


INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38002, 25, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);


INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38003, 25, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38004, 21, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);


INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38005, 23, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38006, 23, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38007, 27, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38008, 27, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38009, 29, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38010, 29, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38011, 31, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38012, 31, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38013, 33, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38014, 33, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38015, 33, '1', 1, 'flowAuditByName', '流程审核人', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38016, 31, '1', 1, 'auditRemark', '审核详情', 'button', NULL, NULL, NULL, NULL, NULL,
        '[{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"审核过程\",\"clickFuc\":\"showApprovalFlowDetail\"}]',
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38017, 33, '1', 1, 'auditRemark', '审核详情', 'button', NULL, NULL, NULL, NULL, NULL,
        '[{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"审核过程\",\"clickFuc\":\"showApprovalFlowDetail\"}]',
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);


CALL Pro_Temp_ColumnWork('sys_approval_flow', 'updateUserName',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''更新人名字'' ',
                         1);


INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38018, 35, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38019, 35, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38021, 37, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38020, 37, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38022, 39, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38023, 39, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38024, 42, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38025, 42, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38026, 39, '1', 1, 'auditRemark', '审核详情', 'button', NULL, NULL, NULL, NULL, NULL,
        '[{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"审核过程\",\"clickFuc\":\"showApprovalFlowDetail\"}]',
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38027, 44, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38028, 44, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38029, 46, '1', 1, 'flowStatus', '流程单据状态', 'eltag', '', NULL,
        '{\"1\":\"草稿\",\"2\":\"未审核\",\"3\":\"已审核\",\"4\":\"已拒绝\"}', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38030, 46, '1', 1, 'flowAuditTime', '流程审核时间', 'text', NULL, 1, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38031, 46, '1', 1, 'auditRemark', '审核详情', 'button', NULL, NULL, NULL, NULL, NULL,
        '[{\"type\":\"text\",\"size\":\"small\",\"style\":\"\",\"name\":\"审核过程\",\"clickFuc\":\"showApprovalFlowDetail\"}]',
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'sourceType',
                         ' varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''来源类型'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'remark',
                         ' varchar(526) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''备注'' ',
                         1);

INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`,
                             `create_time`, `update_by`, `update_time`, `remark`)
VALUES (2091, '字典管理', 1, 8, 'dict', 'system/dict/index', NULL, 1, 0, 'C', '0', '0', 'system:dict:list', NULL, '超级用户',
        '2024-03-19 14:58:35', NULL, NULL, NULL);


insert IGNORE into sys_dict_type
values (3, '系统开关', 'sys_normal_disable', '0', 'admin', sysdate(), '', null, '系统开关列表');
insert IGNORE into sys_dict_data
values (6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '正常状态');
insert IGNORE into sys_dict_data
values (7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', sysdate(), '', null, '停用状态');

insert IGNORE into sys_dict_type
values (4, '设备来源', 'device_source_type', '0', 'admin', sysdate(), '', null, '设备来源列表');
insert IGNORE into sys_dict_data
values (8, 1, '采购', '1', 'device_source_type', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null,
        'chooseProductFlag');
insert IGNORE into sys_dict_data
values (9, 2, '赠与', '2', 'device_source_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null,
        'selectInvProductVisible');
insert IGNORE into sys_dict_data
values (10, 3, '寄售', '3', 'device_source_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null,
        'chooseProductFlag');


ALTER TABLE sys_dict_data
    MODIFY COLUMN `dict_code` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '字典编码' FIRST;
ALTER TABLE sys_dict_type
    MODIFY COLUMN `dict_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '字典主键' FIRST;

INSERT IGNORE INTO sys_dict_type(`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`,
                                 `update_time`, `remark`)
VALUES (9, '相关人员类别', 'device_user_type', '0', 'admin', '2024-03-20 11:47:55', 'admin', '2024-03-20 11:47:55',
        '相关人员类别列表');
insert IGNORE into sys_dict_data
values (11, 1, '维护员', '1', 'device_user_type', '', 'primary', 'Y', '0', 'admin', sysdate(), '', null, '维护人员');
insert IGNORE into sys_dict_data
values (12, 2, '厂家技术支持', '2', 'device_user_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '厂家技术支持人员');
insert IGNORE into sys_dict_data
values (13, 3, '操作员', '3', 'device_user_type', '', 'primary', 'N', '0', 'admin', sysdate(), '', null, '操作人员');

CALL Pro_Temp_ColumnWork('device_asset_user', 'userType',
                         ' varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''用户类型'' ',
                         1);

ALTER TABLE device_asset_cert
    MODIFY COLUMN `updateUser` varchar(255) NULL DEFAULT NULL COMMENT '更新人' AFTER `createTime`;
ALTER TABLE device_asset_user
    MODIFY COLUMN `updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人' AFTER `createTime`;


CALL Pro_Temp_ColumnWork('thr_inv_order_detail', 'batchNo', 'varchar(60)', 2);

INSERT IGNORE INTO sys_custom_config_detail(`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                            `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                            `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                            `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                            `dataFuc`, `isShowXx`)
VALUES (38032, 16, '1', 1, 'auditTime', '审核时间', 'text', '', NULL, '', NULL, NULL, '', NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL);

CALL Pro_Temp_ColumnWork('basic_products', 'catalogname1',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''一级分类名称(学科，品名）''',
                         1);

CALL Pro_Temp_ColumnWork('basic_products', 'catalogname2',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''二级分类名称(用途、品目）''',
                         1);

CALL Pro_Temp_ColumnWork('basic_products', 'catalogname3',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''三级分类名称(部位、功能、品种）''',
                         1);

CALL Pro_Temp_ColumnWork('basic_products', 'catalogCode1',
                         ' bigint DEFAULT NULL COMMENT ''一级分类名称(学科，品名）''',
                         1);

CALL Pro_Temp_ColumnWork('basic_products', 'catalogCode2',
                         ' bigint DEFAULT NULL COMMENT ''二级分类名称(用途、品目）''',
                         1);

CALL Pro_Temp_ColumnWork('basic_products', 'catalogCode3',
                         ' bigint DEFAULT NULL COMMENT''三级分类名称(部位、功能、品种）''',
                         1);


CALL Pro_Temp_ColumnWork('basic_products', 'matrial',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''耗材材质''',
                         1);

CALL Pro_Temp_ColumnWork('thr_products', 'catalogname1',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''一级分类名称(学科，品名）''',
                         1);

CALL Pro_Temp_ColumnWork('thr_products', 'catalogname2',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''二级分类名称(用途、品目）''',
                         1);

CALL Pro_Temp_ColumnWork('thr_products', 'catalogname3',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''三级分类名称(部位、功能、品种）''',
                         1);


CALL Pro_Temp_ColumnWork('thr_products', 'catalogCode1',
                         ' bigint DEFAULT NULL COMMENT ''一级分类名称(学科，品名）''',
                         1);

CALL Pro_Temp_ColumnWork('thr_products', 'catalogCode2',
                         ' bigint DEFAULT NULL COMMENT ''二级分类名称(用途、品目）''',
                         1);

CALL Pro_Temp_ColumnWork('thr_products', 'catalogCode3',
                         ' bigint DEFAULT NULL COMMENT''三级分类名称(部位、功能、品种）''',
                         1);

CALL Pro_Temp_ColumnWork('thr_products', 'matrial',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''耗材材质''',
                         1);

CALL Pro_Temp_ColumnWork('thr_inv_order_detail', 'handleStatus',
                         ' int(0) NULL DEFAULT NULL COMMENT ''是否处理''',
                         1);

CALL Pro_Temp_ColumnWork('io_order', 'thrOrderIdFk',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''来源单据号''',
                         1);
ALTER TABLE thr_inv_order_detail
    MODIFY COLUMN `relId` bigint(0) NULL DEFAULT NULL COMMENT '物资字典主键' AFTER `cpmctymc`;

INSERT IGNORE INTO sys_scheduled(`id`, `cronName`, `cron`, `customerId`, `remark`)
VALUES (151, 'scanThrOrderGenerateOrderTask', '0 0 0/1 * * ?', NULL, '定时扫描三方的明细表生成单据');

CALL Pro_Temp_ColumnWork('thr_inv_order_detail', 'toBillNo',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''生成的单据号''',
                         1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'toBillNo',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''生成的单据号''',
                         1);


CALL Pro_Temp_ColumnWork('thr_inv_order', 'genStatus',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''生成单据状态''',
                         1);


CALL Pro_Temp_ColumnWork('basic_udirel', 'newNeedUpload', 'tinyint NULL DEFAULT NULL COMMENT ''是否系统新增产品需要上传''', 1);

CALL Pro_Temp_ColumnWork('inv_count_order_detail', 'supId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''供应商ID''',
                         1);



CREATE TABLE IF NOT EXISTS thr_consume_material_category
(
    `categoryId`       bigint                                                        NOT NULL COMMENT '分类ID',
    `parentCategoryId` bigint                                                        NOT NULL COMMENT '父级分类ID，关联自身表',
    `categoryName`     varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL DEFAULT NULL COMMENT '分类名称',
    `description`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '分类描述',
    `level`            int(0)                                                        NOT NULL COMMENT '分类级别', --
    `createUser`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '创建人',
    `createTime`       datetime(0)                                                   NULL DEFAULT NULL COMMENT '创建时间',
    `updateUser`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '更新人',
    `updateTime`       datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `remark`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT '' COMMENT '备注',
    PRIMARY KEY (`categoryId`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '医保耗材分类表'
  ROW_FORMAT = DYNAMIC;


CREATE TABLE IF NOT EXISTS dept_material_category
(
    `deptCode`   bigint NOT NULL COMMENT '部门code',
    `categoryId` bigint NOT NULL COMMENT '分类ID'
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '部门医保耗材分类关系表'
  ROW_FORMAT = DYNAMIC;


INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`,
                             `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
VALUES (1866, '科室出库', 1655, 888, 'inout/IoDepartmentOrder', 'inout/IoDepartmentOrder', NULL, 1, 0, 'C', '0', '0', NULL,
        NULL, '超级用户', '2023-06-14 15:00:11', NULL, NULL, NULL);


CALL Pro_Temp_ColumnWork('basic_sk_sicker', 'sourceType',
                         ' int(0)  NULL DEFAULT NULL COMMENT ''来源类型 2：手动''',
                         1);

INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`, `visible`,
                             `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`,
                             `remark`)
VALUES (2092, '科室医保分类', 1643, 8, 'basic/consume/materialCategory', 'basic/consume/materialCategory', NULL, 1, 0, 'C',
        '0', '0',
        NULL, NULL, '超级用户', '2024-04-08 16:08:55', NULL, NULL, NULL);


CALL Pro_Temp_ColumnWork('thr_inv_order', 'sickerCode',
                         'varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''患者编码''',
                         1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'sickerName',
                         ' varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''患者名称''',
                         1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'chargeTime',
                         ' datetime(0)                                                   NULL DEFAULT NULL COMMENT''收费时间''',
                         1);
CALL Pro_Temp_ColumnWork('thr_inv_order', 'chargeUser',
                         ' varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''收费人员''',
                         1);

CALL Pro_Temp_ColumnWork('basic_sk_project', 'status',
                         ' int(0)  NULL DEFAULT NULL COMMENT '' 状态（1.草稿，2.未审核，3.已审核,4.已拒绝）''', 1);

CALL Pro_Temp_ColumnWork('basic_products', 'destinyType',
                         ' int(0)  NULL DEFAULT NULL COMMENT''类型：1：定数包，内部使用；2：项目、组套外部关联''',
                         1);


CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailProductAttributes',
                         'tinyint    NULL DEFAULT NULL COMMENT ''校验产品采购类型 ：1：校验；2.无需校验''', 1);
CALL Pro_Temp_ColumnWork('basic_sk_sicker', 'deptName',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL',
                         1);
CALL Pro_Temp_ColumnWork('basic_sk_sicker', 'deptCode',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL',
                         1);

INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (2093, '术式套包管理', 1643, 6, 'destiny/warlockBag', 'basic/destiny/warlockBag', NULL, 1, 0, 'C', '0', '0', NULL,
        NULL, '超级用户', '2024-04-15 14:13:39', NULL, NULL, NULL);

CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'destinyId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''术式模板id''',
                         1);

CALL Pro_Temp_ColumnWork('pur_apply_detail', 'destinyId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''术式模板id''',
                         1);

CALL Pro_Temp_ColumnWork('pur_order_detail', 'destinyId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''术式模板id''',
                         1);

CALL Pro_Temp_ColumnWork('pur_plan_detail', 'destinyId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''术式模板id''',
                         1);

CALL Pro_Temp_ColumnWork('pur_receive_detail', 'destinyId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''术式模板id''',
                         1);



INSERT IGNORE INTO `thr_system_detail`(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                       `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (100, '项目字典下载', 'sfProjectDictUrl', NULL, 1, '1', NULL, 'thirdId', 1, 3, 1440, NULL);

INSERT IGNORE INTO `thr_system_detail`(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                       `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (101, '项目字典下载', 'sfProjectDictUrl', NULL, 1, '1', NULL, 'thirdId1', 1, 3, 1440, NULL);

INSERT IGNORE INTO `thr_system_detail`(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                       `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (102, '项目字典下载', 'sfProjectDictUrl', NULL, 1, '1', NULL, 'thirdId2', 1, 3, 1440, NULL);

INSERT IGNORE INTO `thr_system_detail`(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                       `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (103, '项目字典下载', 'sfProjectDictUrl', NULL, 1, '1', NULL, 'thirdId3', 1, 3, 1440, NULL);

INSERT IGNORE INTO `thr_system_detail`(`id`, `name`, `key`, `value`, `enabled`, `guideUrl`, `remark`, `thirdSysFk`,
                                       `itrCache`, `fromType`, `time`, `dlLastTime`)
VALUES (104, '项目字典下载', 'sfProjectDictUrl', NULL, 1, '1', NULL, 'thirdId4', 1, 3, 1440, NULL);


CALL Pro_Temp_ColumnWork('device_info', 'assetType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''资产分类''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'sasacType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''国资分类''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'assetMnemonicCode',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''资产助记码''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'number',
                         ' int(0)  NULL DEFAULT 1 COMMENT''数量''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'acquisitionMethod',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''取得方式''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'purpose',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''用途''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'depreciationYear',
                         ' int(0)  ZEROFILL NULL COMMENT''折旧年''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'depreciationMonth',
                         ' int(0)  ZEROFILL NULL COMMENT''折旧月''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'invCode',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''存储仓库''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'estimatedTotalHour',
                         ' int(0)  ZEROFILL NULL COMMENT''预计总工时''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'dayHour',
                         ' int(0) ZEROFILL NULL COMMENT''单日工时''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'assetValue',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''单个资产价值'' ',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'ownFund',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''自有资金'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'financialAppropriation',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''财政拨款'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'educationFund',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''科教基金'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'otherFund',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''其他资金'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'nonPeerFinancialAppropriation',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''非同级财政拨款'' ',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'ybbm',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''医疗器械分类编码''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'catalogname1',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''一级分类名称(学科，品名）''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'catalogname2',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''二级分类名称(用途、品目）''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'catalogname3',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''三级分类名称(部位、功能、品种）''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'catalogCode',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''编码''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'catalogCode1',
                         ' bigint DEFAULT NULL COMMENT ''一级分类名称(学科，品名）''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'catalogCode2',
                         ' bigint DEFAULT NULL COMMENT ''二级分类名称(用途、品目）''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'catalogCode3',
                         ' bigint DEFAULT NULL COMMENT''三级分类名称(部位、功能、品种）''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'managementCategory',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''管理类别''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'endUser',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''使用人''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'estimatedResidualValue',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''预计残值'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'currencyType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''币种''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'purType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''采购类型''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'purchaseDate',
                         ' date NULL DEFAULT NULL COMMENT ''购置日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'addDate',
                         ' date NULL DEFAULT NULL COMMENT ''添加日期''',
                         1);



CALL Pro_Temp_ColumnWork('device_change_order_item', 'assetType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''资产分类''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'sasacType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''国资分类''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'assetMnemonicCode',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''资产助记码''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'number',
                         ' int(0)  NULL DEFAULT 1 COMMENT''数量''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'acquisitionMethod',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''取得方式''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'purpose',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''用途''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'depreciationYear',
                         ' int(0)  ZEROFILL NULL COMMENT''折旧年''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'depreciationMonth',
                         ' int(0)  ZEROFILL NULL COMMENT''折旧月''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'invCode',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''存储仓库''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'estimatedTotalHour',
                         ' int(0)  ZEROFILL NULL COMMENT''预计总工时''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'dayHour',
                         ' int(0) ZEROFILL NULL COMMENT''单日工时''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'assetValue',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''单个资产价值'' ',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'ownFund',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''自有资金'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'financialAppropriation',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''财政拨款'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'educationFund',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''科教基金'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'otherFund',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''其他资金'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'nonPeerFinancialAppropriation',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''非同级财政拨款'' ',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'ybbm',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''医疗器械分类编码''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'catalogname1',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''一级分类名称(学科，品名）''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'catalogname2',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''二级分类名称(用途、品目）''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'catalogname3',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''三级分类名称(部位、功能、品种）''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'catalogCode',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''编码''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'catalogCode1',
                         ' bigint DEFAULT NULL COMMENT ''一级分类名称(学科，品名）''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'catalogCode2',
                         ' bigint DEFAULT NULL COMMENT ''二级分类名称(用途、品目）''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order_item', 'catalogCode3',
                         ' bigint DEFAULT NULL COMMENT''三级分类名称(部位、功能、品种）''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'managementCategory',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''管理类别''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'endUser',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''使用人''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'estimatedResidualValue',
                         'decimal(10, 2) ZEROFILL NULL COMMENT ''预计残值'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'currencyType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''币种''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'purType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''采购类型''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'purchaseDate',
                         ' date NULL DEFAULT NULL COMMENT ''购置日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'addDate',
                         ' date NULL DEFAULT NULL COMMENT ''添加日期''',
                         1);



CALL Pro_Temp_ColumnWork('device_change_order_item', 'assetName',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''资产品名''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'isImperative',
                         ' bigint DEFAULT NULL COMMENT ''是否强检''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'isMaintain',
                         ' bigint DEFAULT NULL COMMENT ''是否保养''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'imperativeCycle',
                         ' bigint DEFAULT NULL COMMENT ''检定周期(月）''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'maintainCycle',
                         ' bigint DEFAULT NULL COMMENT ''保养周期(月）''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'startImperativeDate',
                         ' date NULL DEFAULT NULL COMMENT ''开始检定日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'startMaintainDate',
                         ' date NULL DEFAULT NULL COMMENT ''开始保养日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'serviceType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修组''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'maintainType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''保养组''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'managerUser',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''管理人''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'approveUser',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''审核人''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'ledgerAccount',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''对应会计科目''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'impairmentProvision',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''减值准备''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'estimatedWorkload',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''预计工作量''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'completedWorkload',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''已完成工作量''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'maintenanceType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维保类型''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'maintenanceCycle',
                         ' bigint DEFAULT NULL COMMENT ''维保周期''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'startMaintenancDate',
                         ' date NULL DEFAULT NULL COMMENT ''维保开始日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'endMaintenancDate',
                         ' date NULL DEFAULT NULL COMMENT ''维保结束日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'networkType',
                         ' bigint DEFAULT NULL COMMENT ''内外网''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'userRole',
                         ' bigint DEFAULT NULL COMMENT ''使用角色''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'isAddDomain',
                         ' bigint DEFAULT NULL COMMENT ''是否加域''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'isUDisc',
                         ' bigint DEFAULT NULL COMMENT ''u盘是否禁用''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'ascriptionType',
                         ' bigint DEFAULT NULL COMMENT ''设备归类''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order_item', 'assetReserveType',
                         ' bigint DEFAULT NULL COMMENT ''资产备用类型''',
                         1);



CALL Pro_Temp_ColumnWork('device_info', 'assetName',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''资产品名''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'isImperative',
                         ' bigint DEFAULT NULL COMMENT ''是否强检''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'isMaintain',
                         ' bigint DEFAULT NULL COMMENT ''是否保养''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'imperativeCycle',
                         ' bigint DEFAULT NULL COMMENT ''检定周期(月）''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'maintainCycle',
                         ' bigint DEFAULT NULL COMMENT ''保养周期(月）''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'startImperativeDate',
                         ' date NULL DEFAULT NULL COMMENT ''开始检定日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'startMaintainDate',
                         ' date NULL DEFAULT NULL COMMENT ''开始保养日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'serviceType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修组''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'maintainType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''保养组''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'managerUser',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''管理人''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'approveUser',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''审核人''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'ledgerAccount',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''对应会计科目''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'impairmentProvision',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''减值准备''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'estimatedWorkload',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''预计工作量''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'completedWorkload',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''已完成工作量''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'maintenanceType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维保类型''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'maintenanceCycle',
                         ' bigint DEFAULT NULL COMMENT ''维保周期''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'startMaintenancDate',
                         ' date NULL DEFAULT NULL COMMENT ''维保开始日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'endMaintenancDate',
                         ' date NULL DEFAULT NULL COMMENT ''维保结束日期''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'networkType',
                         ' bigint DEFAULT NULL COMMENT ''内外网''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'userRole',
                         ' bigint DEFAULT NULL COMMENT ''使用角色''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'isAddDomain',
                         ' bigint DEFAULT NULL COMMENT ''是否加域''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'isUDisc',
                         ' bigint DEFAULT NULL COMMENT ''u盘是否禁用''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'ascriptionType',
                         ' bigint DEFAULT NULL COMMENT ''设备归类''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'assetReserveType',
                         ' varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''资产备用类型''',
                         1);

CALL Pro_Temp_ColumnWork('device_plan', 'status', 'tinyint    NULL DEFAULT NULL COMMENT ''设备巡检计划状态 ：1：草稿；2.已提交''', 1);

INSERT ignore INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (2094, '我的报修单', 1703, 11, '/dev/deviceRepairApplyMy', 'dev/deviceRepairApplyMy',
        NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-11-29 18:00:49', NULL, NULL, NULL);


CALL Pro_Temp_ColumnWork('auth_dept', 'maintenance',
                         ' tinyint(0) ZEROFILL NULL COMMENT''是否为维修部门''',
                         1);

CALL Pro_Temp_ColumnWork('device_repair', 'repairDeptCode',
                         'varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修部门''',
                         1);



CALL Pro_Temp_ColumnWork('device_check_detail', 'normalFlag',
                         'tinyint    NULL DEFAULT NULL COMMENT ''巡检状态 ：0：异常；1.正常''', 1);
CALL Pro_Temp_ColumnWork('device_check_detail', 'livePath',
                         ' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''现场照片''',
                         1);
CALL Pro_Temp_ColumnWork('device_check_detail', 'suggestion',
                         ' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''巡检建议''',
                         1);

UPDATE auth_menu
SET `menu_name`   = '本科室设备',
    `parent_id`   = 1703,
    `order_num`   = 4,
    `path`        = '/dev/deviceInfoSelf',
    `component`   = 'dev/deviceInfoSelf',
    `query_param` = NULL,
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-11-22 16:16:48',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 2021;


CALL Pro_Temp_ColumnWork('device_repair', 'repairDescription',
                         ' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修内容''',
                         1);
ALTER TABLE device_repair
    MODIFY COLUMN `diagnosisInfo` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '诊断信息' AFTER `description`;

CALL Pro_Temp_ColumnWork('device_check_detail', 'applyId',
                         'bigint DEFAULT NULL COMMENT''报修单id''',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order', 'destroyType',
                         'bigint DEFAULT NULL COMMENT''移除类型 1报废；2销毁''',
                         1);

CALL Pro_Temp_ColumnWork('device_change_order', 'approvalFlowId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''审批表主键(关联审批流程主表)'' ',
                         1);
CALL Pro_Temp_ColumnWork('device_change_order', 'billNo',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''单据号'' ',
                         1);

INSERT IGNORE INTO sys_approval_flow_config(`id`, `type`, `typeName`, `approvalSort`, `createUser`, `createTime`,
                                            `updateUser`, `updateTime`)
VALUES ('5', 'sbyc', '设备移除', 7, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_approval_flow_config(`id`, `type`, `typeName`, `approvalSort`, `createUser`, `createTime`,
                                            `updateUser`, `updateTime`)
VALUES ('6', 'cght', '采购合同单据', 6, NULL, NULL, NULL, NULL);

CALL Pro_Temp_ColumnWork('sys_approval_flow_config_mx', 'approvalNodeType',
                         ' bigint(0) NOT NULL COMMENT ''审批节点类型 1 人员 2 岗位'' ',
                         1);
CALL Pro_Temp_ColumnWork('sys_approval_flow_config_mx', 'approvalPostId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''审批岗位信息'' ',
                         1);
CALL Pro_Temp_ColumnWork('sys_approval_flow_config_mx', 'approvalPostName',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''审批岗位名称'' ',
                         1);


CALL Pro_Temp_ColumnWork('sys_approval_flow_mx', 'approvalNodeType',
                         ' bigint(0) NOT NULL COMMENT ''审批节点类型 1 人员 2 岗位'' ',
                         1);
CALL Pro_Temp_ColumnWork('sys_approval_flow_mx', 'approvalPostId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''审批岗位信息'' ',
                         1);
CALL Pro_Temp_ColumnWork('sys_approval_flow_mx', 'approvalPostName',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''审批岗位名称'' ',
                         1);

CALL Pro_Temp_ColumnWork('sys_approval_flow', 'nextNodeName',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''下一个节点审核名字'' ',
                         1);

CALL Pro_Temp_ColumnWork('sys_approval_flow', 'nextApprovalNodeType',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT ''下一个节点审核类型'' ',
                         1);

-- ----------------------------
-- Table structure for pur_contract
-- ----------------------------
CREATE TABLE IF NOT EXISTS `pur_contract`
(
    `id`              int(0)                                                        NOT NULL AUTO_INCREMENT,
    `code`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '合同编号',
    `name`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '合同名称',
    `fromCorp`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '往来单位/供应商',
    `contractDate`    datetime(0)                                                   NULL DEFAULT NULL COMMENT '合同签订日期',
    `invCode`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '当前仓库',
    `status`          int(0)                                                        NULL DEFAULT NULL COMMENT '合同状态',
    `type`            int(0)                                                        NULL DEFAULT NULL COMMENT '合同类型',
    `payType`         int(0)                                                        NULL DEFAULT NULL COMMENT '付款方式',
    `startDate`       datetime(0)                                                   NULL DEFAULT NULL COMMENT '开始时间',
    `endDate`         datetime(0)                                                   NULL DEFAULT NULL COMMENT '截止时间',
    `amount`          decimal(10, 3)                                                NULL DEFAULT NULL COMMENT '合同金额',
    `payAmount`       decimal(10, 3)                                                NULL DEFAULT NULL COMMENT '实付金额',
    `payDate`         datetime(0)                                                   NULL DEFAULT NULL COMMENT '付款日期',
    `invoiceDate`     datetime(0)                                                   NULL DEFAULT NULL COMMENT '开票日期',
    `planOrderIdFk`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '采购计划ID外键',
    `orderIdFk`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '采购订单外键',
    `createUser`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人',
    `updateUser`      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 '更新时间',
    `remark`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
    `approvalFlowId`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '审批表主键(关联审批流程主表)',
    `isGenerateOrder` int(0)                                                        NULL DEFAULT 0 COMMENT '是否生成订单 1.已生成;0.未生成 ',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '采购合同表'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for pur_contract_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `pur_contract_detail`
(
    `id`              bigint(0)                                                     NOT NULL AUTO_INCREMENT COMMENT '单据业务ID',
    `orderIdFk`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL COMMENT '关联合同编号',
    `productId`       bigint(0)                                                     NULL DEFAULT NULL COMMENT '产品编码',
    `productUniqueId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '产品唯一id uniqueId',
    `nameCode`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '最小销售标识',
    `batchNo`         varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NULL DEFAULT NULL COMMENT '批次号',
    `productName`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '产品名称',
    `productCompany`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '生产厂家',
    `produceDate`     date                                                          NULL DEFAULT NULL COMMENT '生产日期',
    `expireDate`      date                                                          NULL DEFAULT NULL COMMENT '过期时间',
    `zczbhhzbapzbh`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '注册证/备案号',
    `ggxh`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '规格型号',
    `packRatio`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '包装级别',
    `supId`           bigint(0)                                                     NULL DEFAULT NULL COMMENT '供应商id',
    `supName`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '供应商名称',
    `count`           int(0)                                                        NULL DEFAULT NULL COMMENT '订单该产品实际数量',
    `price`           decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '价格',
    `firstSalesInvNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '销售发票号（第一票）',
    `secSalesInvNo`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '销售发票号（第二票）',
    `secSalesListNo`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '销售清单号（第二票）',
    `invoiceDate`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '开票日期',
    `remark`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL,
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_as_cs COMMENT = '单据业务详情表'
  ROW_FORMAT = Dynamic;

CALL Pro_Temp_ColumnWork('pur_plan', 'importStatus',
                         ' bit(1)                                                        NOT NULL DEFAULT b''0'' COMMENT ''是否 导入''',
                         1);

INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (3679, '合同管理', 1673, 4, 'purContract', NULL, NULL, 1, 0, 'M', '0', '0', NULL, NULL, '超级用户',
        '2023-02-10 14:52:34', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (3680, '待提交合同', 3679, 1, 'purchase/purContract/purContract', 'purchase/purContract/purContract', NULL, 1, 0, 'C',
        '0', '0', NULL, NULL, '超级用户', '2023-02-10 16:25:48', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (3689, '待审核合同', 3679, 2, 'purchase/purContract/purContractReviewed', 'purchase/purContract/purContractReviewed',
        NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-02-14 11:07:07', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (3690, '已完成合同', 3679, 3, 'purchase/purContract/purContractFinish', 'purchase/purContract/purContractFinish',
        NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-02-14 11:27:49', NULL, NULL, NULL);

CALL Pro_Temp_ColumnWork('pur_plan', 'importStatus',
                         ' bit(1)                                                        NOT NULL DEFAULT b''0'' COMMENT ''是否 导入''',
                         1);


INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (3691, '申购管理', 1703, 13, 'purApply', NULL, NULL, 1, 0, 'M', '0', '0', NULL, NULL, '超级用户', '2023-02-08 17:01:50',
        NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (3692, '计划管理', 1703, 14, 'purPlan', NULL, NULL, 1, 0, 'M', '0', '0', NULL, NULL, '超级用户', '2023-02-10 14:52:34',
        NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (3693, '订单管理', 1703, 15, 'purOrder', NULL, NULL, 1, 0, 'M', '0', '0', NULL, NULL, '超级用户', '2023-03-08 10:21:58',
        NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`, `is_cache`, `menu_type`,
                             `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                             `update_time`, `remark`)
VALUES (3694, '合同管理', 1703, 16, 'purContract', NULL, NULL, 1, 0, 'M', '0', '0', NULL, NULL, '超级用户',
        '2023-02-10 14:52:34', NULL, NULL, NULL);

INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3695, '新增申购单', 3691, 1, 'purchase/purApply/purApply', 'purchase/purApply/purApply', '{\"pageType\":2}', 1, 0,
        'C',
        '0', '0', 'purchase:purApply:purApply', NULL, '超级用户', '2023-02-08 17:02:19', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3696, '审核申购单', 3691, 2, 'purchase/purApply/pureApplyAudit', 'purchase/purApply/pureApplyAudit',
        '{\"pageType\":2}',
        1, 0, 'C', '0', '0', 'purchase:purApply:pureApplyAudit', NULL, '超级用户', '2023-02-10 13:54:03', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3697, '查询申购单', 3691, 3, 'purchase/purApply/pureApplySearch', 'purchase/purApply/pureApplySearch',
        '{\"pageType\":2}', 1, 0, 'C', '0', '0', 'purchase:purApply:pureApplySearch', NULL, '超级用户',
        '2023-02-10 14:47:19',
        NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3698, '新增采购计划', 3692, 1, 'purchase/purPlan/purPlan', 'purchase/purPlan/purPlan', '{\"pageType\":2}', 1, 0, 'C',
        '0',
        '0', 'purchase:purPlan:purPlan', NULL, '超级用户', '2023-02-10 16:25:48', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3699, '审核采购计划', 3692, 2, 'purchase/purPlan/purPlanAudit', 'purchase/purPlan/purPlanAudit', '{\"pageType\":2}',
        1, 0,
        'C', '0', '0', NULL, NULL, '超级用户', '2023-02-14 11:07:07', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3700, '查询采购计划', 3692, 3, 'purchase/purPlan/purPlanSearch', 'purchase/purPlan/purPlanSearch', '{\"pageType\":2}',
        1,
        0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-02-14 11:27:49', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3701, '新增采购订单', 3693, 1, 'purchase/purOrder/purOrder', 'purchase/purOrder/purOrder', '{\"pageType\":2}', 1, 0,
        'C',
        '0', '0', NULL, '', '超级用户', '2023-03-08 10:32:25', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3702, '审核采购订单', 3693, 2, 'purchase/purOrder/purOrderAudit', 'purchase/purOrder/purOrderAudit',
        '{\"pageType\":2}',
        1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-03-08 10:33:41', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3703, '查询采购订单', 3693, 3, 'purchase/purOrder/purOrderSearch', 'purchase/purOrder/purOrderSearch',
        '{\"pageType\":2}',
        1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-03-08 10:34:32', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3704, '申购单明细', 3691, 4, 'details', 'purchase/purApply/pureApplySearchDetails', '{\"pageType\":2}', 1, 0, 'C',
        '0',
        '0', NULL, NULL, '超级用户', '2023-04-04 09:30:27', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3705, '采购计划明细', 3692, 4, 'details', 'purchase/purPlan/purPlanSearchDetails', '{\"pageType\":2}', 1, 0, 'C', '0',
        '0', NULL, NULL, '超级用户', '2023-04-04 09:32:00', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3706, '采购订单明细', 3693, 4, 'details', 'purchase/purOrder/purOrderSearchDetails', '{\"pageType\":2}', 1, 0, 'C',
        '0',
        '0', NULL, NULL, '超级用户', '2023-04-04 09:32:44', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3707, '我的申购单 ', 3691, 2, 'purchase/purApply/pureApplyMySearch', 'purchase/purApply/pureApplyMySearch',
        '{\"pageType\":2}', 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-07-20 17:08:38', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3708, '待提交合同', 3694, 1, 'purchase/purContract/purContract', 'purchase/purContract/purContract',
        '{\"pageType\":2}',
        1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-02-10 16:25:48', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3709, '待审核合同', 3694, 2, 'purchase/purContract/purContractReviewed', 'purchase/purContract/purContractReviewed',
        '{\"pageType\":2}', 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-02-14 11:07:07', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3710, '已完成合同', 3694, 3, 'purchase/purContract/purContractFinish', 'purchase/purContract/purContractFinish',
        '{\"pageType\":2}', 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-02-14 11:27:49', NULL, NULL, NULL);


UPDATE auth_menu
SET `menu_name`   = '新增申购单',
    `parent_id`   = 1674,
    `order_num`   = 1,
    `path`        = 'purchase/purApply/purApply',
    `component`   = 'purchase/purApply/purApply',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = 'purchase:purApply:purApply',
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-02-08 17:02:19',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1675;
UPDATE auth_menu
SET `menu_name`   = '审核申购单',
    `parent_id`   = 1674,
    `order_num`   = 2,
    `path`        = 'purchase/purApply/pureApplyAudit',
    `component`   = 'purchase/purApply/pureApplyAudit',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = 'purchase:purApply:pureApplyAudit',
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-02-10 13:54:03',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1677;
UPDATE auth_menu
SET `menu_name`   = '查询申购单',
    `parent_id`   = 1674,
    `order_num`   = 3,
    `path`        = 'purchase/purApply/pureApplySearch',
    `component`   = 'purchase/purApply/pureApplySearch',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = 'purchase:purApply:pureApplySearch',
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-02-10 14:47:19',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1678;
UPDATE auth_menu
SET `menu_name`   = '新增采购计划',
    `parent_id`   = 1679,
    `order_num`   = 1,
    `path`        = 'purchase/purPlan/purPlan',
    `component`   = 'purchase/purPlan/purPlan',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = 'purchase:purPlan:purPlan',
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-02-10 16:25:48',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1680;
UPDATE auth_menu
SET `menu_name`   = '审核采购计划',
    `parent_id`   = 1679,
    `order_num`   = 2,
    `path`        = 'purchase/purPlan/purPlanAudit',
    `component`   = 'purchase/purPlan/purPlanAudit',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-02-14 11:07:07',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1689;
UPDATE auth_menu
SET `menu_name`   = '查询采购计划',
    `parent_id`   = 1679,
    `order_num`   = 3,
    `path`        = 'purchase/purPlan/purPlanSearch',
    `component`   = 'purchase/purPlan/purPlanSearch',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-02-14 11:27:49',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1690;
UPDATE auth_menu
SET `menu_name`   = '新增采购订单',
    `parent_id`   = 1730,
    `order_num`   = 1,
    `path`        = 'purchase/purOrder/purOrder',
    `component`   = 'purchase/purOrder/purOrder',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = '',
    `create_by`   = '超级用户',
    `create_time` = '2023-03-08 10:32:25',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1731;
UPDATE auth_menu
SET `menu_name`   = '审核采购订单',
    `parent_id`   = 1730,
    `order_num`   = 2,
    `path`        = 'purchase/purOrder/purOrderAudit',
    `component`   = 'purchase/purOrder/purOrderAudit',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-03-08 10:33:41',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1732;
UPDATE auth_menu
SET `menu_name`   = '查询采购订单',
    `parent_id`   = 1730,
    `order_num`   = 3,
    `path`        = 'purchase/purOrder/purOrderSearch',
    `component`   = 'purchase/purOrder/purOrderSearch',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-03-08 10:34:32',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1733;
UPDATE auth_menu
SET `menu_name`   = '申购单明细',
    `parent_id`   = 1674,
    `order_num`   = 4,
    `path`        = 'details',
    `component`   = 'purchase/purApply/pureApplySearchDetails',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-04-04 09:30:27',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1763;
UPDATE auth_menu
SET `menu_name`   = '采购计划明细',
    `parent_id`   = 1679,
    `order_num`   = 4,
    `path`        = 'details',
    `component`   = 'purchase/purPlan/purPlanSearchDetails',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-04-04 09:32:00',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1764;
UPDATE auth_menu
SET `menu_name`   = '采购订单明细',
    `parent_id`   = 1730,
    `order_num`   = 4,
    `path`        = 'details',
    `component`   = 'purchase/purOrder/purOrderSearchDetails',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-04-04 09:32:44',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1765;
UPDATE auth_menu
SET `menu_name`   = '我的申购单 ',
    `parent_id`   = 1674,
    `order_num`   = 2,
    `path`        = 'purchase/purApply/pureApplyMySearch',
    `component`   = 'purchase/purApply/pureApplyMySearch',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-07-20 17:08:38',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 1843;
UPDATE auth_menu
SET `menu_name`   = '待提交合同',
    `parent_id`   = 3679,
    `order_num`   = 1,
    `path`        = 'purchase/purContract/purContract',
    `component`   = 'purchase/purContract/purContract',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-02-10 16:25:48',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 3680;
UPDATE auth_menu
SET `menu_name`   = '待审核合同',
    `parent_id`   = 3679,
    `order_num`   = 2,
    `path`        = 'purchase/purContract/purContractReviewed',
    `component`   = 'purchase/purContract/purContractReviewed',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-02-14 11:07:07',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 3689;
UPDATE auth_menu
SET `menu_name`   = '已完成合同',
    `parent_id`   = 3679,
    `order_num`   = 3,
    `path`        = 'purchase/purContract/purContractFinish',
    `component`   = 'purchase/purContract/purContractFinish',
    `query_param` = '{\"pageType\":1}',
    `is_frame`    = 1,
    `is_cache`    = 0,
    `menu_type`   = 'C',
    `visible`     = '0',
    `status`      = '0',
    `perms`       = NULL,
    `icon`        = NULL,
    `create_by`   = '超级用户',
    `create_time` = '2023-02-14 11:27:49',
    `update_by`   = NULL,
    `update_time` = NULL,
    `remark`      = NULL
WHERE `menu_id` = 3690;


CALL Pro_Temp_ColumnWork('pur_apply', 'pageType',
                         ' int                                                       NOT NULL DEFAULT b''1'' COMMENT ''1:业务管理；2：设备管理''',
                         1);
CALL Pro_Temp_ColumnWork('pur_plan', 'pageType',
                         ' int                                                       NOT NULL DEFAULT b''1'' COMMENT ''1:业务管理；2：设备管理''',
                         1);
CALL Pro_Temp_ColumnWork('pur_order', 'pageType',
                         ' int                                                       NOT NULL DEFAULT b''1'' COMMENT ''1:业务管理；2：设备管理''',
                         1);
CALL Pro_Temp_ColumnWork('pur_contract', 'pageType',
                         ' int                                                       NOT NULL DEFAULT b''1'' COMMENT ''1:业务管理；2：设备管理''',
                         1);


CALL Pro_Temp_ColumnWork('device_info', 'purApplyBillNo',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL   COMMENT''申购订单单据号''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'purOrderBillNo',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL  COMMENT''采购订单单据号''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'purContractBillNo',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL  COMMENT''采购合同单据号''',
                         1);
CALL Pro_Temp_ColumnWork('device_info', 'purPlanBillNo',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL  COMMENT''采购计划单据号''',
                         1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'devInType',
                         ' int   NOT NULL DEFAULT b''0'' COMMENT ''是否设备入库 ：0：未启用；2.启用''', 1);

CALL Pro_Temp_ColumnWork('io_order', 'purOrderId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''采购订单单号''',
                         1);

CALL Pro_Temp_ColumnWork('io_order', 'purPlanId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''采购计划单号''',
                         1);

CALL Pro_Temp_ColumnWork('pur_order', 'purPlanId',
                         ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''采购计划单号''',
                         1);

CALL Pro_Temp_ColumnWork('device_info', 'updateTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''更新时间''',
                         1);

CALL Pro_Temp_ColumnWork('device_check', 'updateTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''更新时间''',
                         1);


CALL Pro_Temp_ColumnWork('device_check_detail', 'updateTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''更新时间''',
                         1);


CALL Pro_Temp_ColumnWork('device_check_detail_item', 'updateTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''更新时间''',
                         1);

CALL Pro_Temp_ColumnWork('device_repair', 'updateTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''更新时间''',
                         1);

CALL Pro_Temp_ColumnWork('device_repair_apply', 'updateTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''更新时间''',
                         1);

CALL Pro_Temp_ColumnWork('device_repair_apply_detail', 'updateTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''更新时间''',
                         1);


CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceInfo',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''设备管理数据-设备信息管理''',
                         1);

CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceCheck',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''设备管理数据-巡检管理''',
                         1);


CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceCheckDetail',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''巡检设备具体数据''',
                         1);

CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceCheckDetailItem',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''巡检设备项目''',
                         1);

CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceRepairApply',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''报修单数据''',
                         1);

CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceRepairDetail',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''报修单明细''',
                         1);

CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceRepair',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''维修单''',
                         1);



CALL Pro_Temp_ColumnWork('device_repair', 'repairDescription',
                         ' varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修内容''',
                         1);

CALL Pro_Temp_ColumnWork('sync_data_set', 'produceBusiness',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''生产企业信息''',
                         1);


-- ----------------------------
-- Table structure for device_upkeep
-- ----------------------------
CREATE TABLE IF NOT EXISTS `device_upkeep`
(
    `taskId`          bigint(0)                                                     NOT NULL COMMENT '保养任务id',
    `planId`          bigint(0)                                                     NULL     DEFAULT NULL COMMENT '计划id',
    `planName`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '计划名称',
    `chargeDeptCode`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '负责部门编码',
    `upkeepUserId`    bigint(0)                                                     NULL     DEFAULT NULL COMMENT '保养人id',
    `upkeepUserName`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '保养人姓名',
    `upkeepUserPhone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '保养人电话',
    `deviceCount`     int(0)                                                        NOT NULL COMMENT '设备数量',
    `finishCount`     int(0)                                                        NOT NULL DEFAULT 0 COMMENT '完成设备数量',
    `exceptionCount`  int(0)                                                        NOT NULL DEFAULT 0 COMMENT '异常数量',
    `finishTime`      datetime(0)                                                   NULL     DEFAULT NULL COMMENT '完成时间',
    `name`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '任务名称',
    `remark`          text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '任务备注',
    `sysFlag`         bit(1)                                                        NOT NULL COMMENT '是否系统创建 1/true 是 0/false 否',
    `finishFlag`      bit(1)                                                        NOT NULL DEFAULT b'0' COMMENT '是否已完成',
    `createTime`      datetime(0)                                                   NOT NULL COMMENT '创建时间',
    `createUserId`    bigint(0)                                                     NULL     DEFAULT NULL COMMENT '创建人id',
    `createUserName`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '创建人姓名',
    `updateTime`      datetime(0)                                                   NULL     DEFAULT NULL,
    PRIMARY KEY (`taskId`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '保养任务表'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for device_upkeep_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `device_upkeep_detail`
(
    `taskId`         bigint(0)                                                      NOT NULL COMMENT '任务id',
    `deviceCode`     varbinary(255)                                                 NOT NULL COMMENT '设备编码',
    `deptCode`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NOT NULL COMMENT '部门编码',
    `deptName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '部门名称',
    `finishFlag`     bit(1)                                                         NOT NULL DEFAULT b'0' COMMENT '是否已完成 1/true 0/false',
    `productId`      bigint(0)                                                      NOT NULL COMMENT '产品id',
    `udi`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT 'UDI码',
    `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 '批次号',
    `serialNo`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '序列号',
    `productionDate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '生产日期',
    `expireDate`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '失效日期',
    `manufactory`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '生产厂家',
    `measname`       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 '注册/备案凭证号',
    `supId`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '供应商ID',
    `supName`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '供应商名称',
    `itemCount`      int(0)                                                         NOT NULL DEFAULT 0 COMMENT '项目数量',
    `exceptionCount` int(0)                                                         NOT NULL DEFAULT 0 COMMENT '异常数量',
    `finishCount`    int(0)                                                         NOT NULL DEFAULT 0 COMMENT '完成项目数量',
    `finishTime`     datetime(0)                                                    NULL     DEFAULT NULL COMMENT '完成时间',
    `normalFlag`     tinyint(0)                                                     NULL     DEFAULT NULL COMMENT '保养状态 ：0：异常；1.正常',
    `livePath`       varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '现场照片',
    `suggestion`     varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '保养建议',
    `updateTime`     datetime(0)                                                    NULL     DEFAULT NULL COMMENT '更改时间',
    PRIMARY KEY (`taskId`, `deviceCode`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '保养任务明细'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for device_upkeep_detail_item
-- ----------------------------
CREATE TABLE IF NOT EXISTS `device_upkeep_detail_item`
(
    `taskId`         bigint(0)                                                     NOT NULL COMMENT '任务id',
    `deviceCode`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '设备编码',
    `itemCode`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目编码',
    `itemName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '项目名称',
    `itemContent`    longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NOT NULL COMMENT '项目内容',
    `normalFlag`     bit(1)                                                        NULL     DEFAULT NULL COMMENT '正常标识',
    `finishFlag`     bit(1)                                                        NOT NULL DEFAULT b'0' COMMENT '完成标识',
    `finishTime`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '完成时间',
    `suggestion`     longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci     NULL COMMENT '保养建议',
    `upkeepUserId`   bigint(0)                                                     NULL     DEFAULT NULL COMMENT '保养人id',
    `upkeepUserName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '保养人姓名',
    `upkeepDeptCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '保养部门',
    `upkeepDeptName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '保养部门名称',
    `updateTime`     datetime(0)                                                   NULL     DEFAULT NULL,
    PRIMARY KEY (`taskId`, `deviceCode`, `itemCode`) USING BTREE
) ENGINE = InnoDB
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '设备保养项目'
  ROW_FORMAT = Dynamic;


CALL Pro_Temp_ColumnWork('device_check_item_dict', 'type',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''项目字典类型''',
                         1);
CALL Pro_Temp_ColumnWork('device_plan', 'type',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''计划类型''',
                         1);

CALL Pro_Temp_ColumnWork('device_plan_detail_item', 'type',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''项目类型''',
                         1);

INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`,
                             `update_time`, `remark`)
VALUES (2095, '保养任务单', 1703, 15, '/dev/deviceUpkeep', 'dev/deviceUpkeep',
        NULL, 1, 0, 'M', '0', '0', NULL, NULL, '超级用户', '2024-05-12 15:52:51', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`,
                             `update_time`, `remark`)
VALUES (2096, '设备保养计划', 1703, 15, '/dev/deviceUpkeepPlan', 'dev/deviceUpkeepPlan',
        NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2024-05-12 17:35:06', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`,
                             `update_time`, `remark`)
VALUES (2097, '保养项目字典', 1703, 15, '/dev/deviceUpkeepItemDict', 'dev/deviceUpkeepItemDict', NULL, 1, 0, 'C', '0', '0',
        NULL, NULL, '超级用户', '2024-05-14 15:02:50', NULL, NULL, NULL);
CALL Pro_Temp_ColumnWork('io_order', 'confirmTime', 'datetime(0) NULL DEFAULT NULL COMMENT ''发票确认时间''', 1);

CALL Pro_Temp_ColumnWork('device_repair_apply_detail', 'livePath',
                         'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修现场照片''',
                         1);
CALL Pro_Temp_ColumnWork('device_repair', 'livePath',
                         'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''报修现场照片''',
                         1);
CALL Pro_Temp_ColumnWork('device_repair', 'serviceLivePath',
                         'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修后现场照片''',
                         1);
CALL Pro_Temp_ColumnWork('device_repair', 'diagnosisLivePath',
                         'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''诊断照片''',
                         1);
CALL Pro_Temp_ColumnWork('device_repair_apply_detail', 'diagnosisLivePath',
                         'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''诊断照片''',
                         1);

INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`,
                                        `createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`,
                                        `busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`)
VALUES (1724370174626394116, 'DECPSG', '设备产品申购', NULL, 2, 1, NULL, '1', NULL, '2023-11-14 18:14:44', NULL, 2, 3,
        'DECGJH', NULL, NULL);
INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`,
                                        `createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`,
                                        `busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`)
VALUES (1724370174626394117, 'DECGJH', '设备采购计划', NULL, 3, 1, NULL, '1', NULL, '2023-11-14 18:14:34', NULL, 2, 1,
        'DECGDD', NULL, NULL);
INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`,
                                        `createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`,
                                        `busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`)
VALUES (1724370174626394118, 'DECGDD', '设备采购订单', NULL, 5, 1, NULL, '1', NULL, '2023-11-14 18:14:22', NULL, 2, 2, NULL,
        NULL, NULL);

CALL Pro_Temp_ColumnWork('device_repair', 'repairUserId', 'bigint DEFAULT NULL COMMENT''报修人id''', 1);


ALTER TABLE device_plan_detail_item
    DROP PRIMARY KEY,
    ADD PRIMARY KEY (`planId`, `productId`, `itemCode`, `deviceCode`) USING BTREE;

CALL Pro_Temp_ColumnWork('sync_data_set', 'deviceUpkeep',
                         ' tinyint  NULL DEFAULT NULL COMMENT ''保养单''',
                         1);

INSERT IGNORE INTO sys_pdf_template(`id`, `name`, `type`, `module`, `param`, `path`, `rowCount`, `qrcodeCount`,
                                    `remark`, `create_time`, `update_time`, `jrxmlPath`,
                                    `bussinessType`, `bussinessStatus`)
VALUES (4, '设备标签模板', 2, 0, '', '7bdc497e-b0e4-444d-be63-cc27978568ea.jasper', 10,
        1, '', '2024-05-21 16:24:56', '2024-05-21 16:24:56', '2427d70b-2b69-483f-9a9d-7c9c4a3c688e.jrxml', NULL, NULL);


CALL Pro_Temp_ColumnWork('device_plan', 'planBillNo',
                         'varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''计划单号''',
                         1);
CALL Pro_Temp_ColumnWork('device_check', 'taskBillNo',
                         'varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''巡检任务单号''',
                         1);
CALL Pro_Temp_ColumnWork('device_repair_apply', 'repairApplyBillNo',
                         'varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''报修单号''',
                         1);
CALL Pro_Temp_ColumnWork('device_repair', 'repairBillNo',
                         'varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修单号''',
                         1);
CALL Pro_Temp_ColumnWork('device_upkeep', 'taskBillNo',
                         'varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''保养任务单号''',
                         1);


INSERT IGNORE INTO auth_menu (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                              `is_frame`, `is_cache`,
                              `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                              `update_by`, `update_time`, `remark`)
VALUES (3711, '询价管理', 1673, 2, 'purInquiry', NULL, NULL, 1, 0, 'M', '0', '0', NULL, NULL, '超级用户', '2023-02-08 17:01:50',
        NULL, NULL, NULL);

INSERT IGNORE INTO auth_menu (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                              `is_frame`, `is_cache`, `menu_type`,
                              `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                              `update_time`, `remark`)
VALUES (3712, '新增询价计划单', 3711, 1, 'purchase/purInquiry/purInquiry', 'purchase/purInquiry/purInquiry',
        '{\"pageType\":1}', 1, 0, 'C',
        '0', '0', 'purchase:purInquiry:purInquiry', NULL, '超级用户', '2023-02-08 17:02:19', NULL, NULL, NULL);

INSERT IGNORE INTO auth_menu (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                              `is_frame`, `is_cache`, `menu_type`,
                              `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                              `update_time`, `remark`)
VALUES (3713, '待审核询价计划单', 3711, 2, 'purchase/purInquiry/purInquiryReviewed', 'purchase/purInquiry/purInquiryReviewed',
        '{\"pageType\":1}', 1, 0, 'C',
        '0', '0', 'purchase:purInquiry:purInquiryReviewed', NULL, '超级用户', '2023-02-08 17:02:19', NULL, NULL, NULL);

INSERT IGNORE INTO auth_menu (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                              `is_frame`, `is_cache`, `menu_type`,
                              `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                              `update_time`, `remark`)
VALUES (3714, '已审核询价计划单', 3711, 3, 'purchase/purInquiry/purInquiryFinish', 'purchase/purInquiry/purInquiryFinish',
        '{\"pageType\":1}', 1, 0, 'C',
        '0', '0', 'purchase:purInquiry:purInquiryFinish', NULL, '超级用户', '2023-02-08 17:02:19', NULL, NULL, NULL);

INSERT IGNORE INTO auth_menu (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                              `is_frame`, `is_cache`, `menu_type`,
                              `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                              `update_time`, `remark`)
VALUES (3715, '待审核询价报价单', 3711, 5, 'purchase/purInquiryOffer/purInquiryOfferReviewed',
        'purchase/purInquiryOffer/purInquiryOfferReviewed', '{\"pageType\":1}', 1, 0, 'C',
        '0', '0', 'purchase:purInquiryOffer:purInquiryOfferReviewed', NULL, '超级用户', '2023-02-08 17:02:19', NULL, NULL,
        NULL);
INSERT IGNORE INTO auth_menu (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                              `is_frame`, `is_cache`, `menu_type`,
                              `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                              `update_time`, `remark`)
VALUES (3716, '已审核询价报价单', 3711, 6, 'purchase/purInquiryOffer/purInquiryOfferFinish',
        'purchase/purInquiryOffer/purInquiryOfferFinish', '{\"pageType\":1}', 1, 0, 'C',
        '0', '0', 'purchase:purInquiryOffer:purInquiryOfferFinish', NULL, '超级用户', '2023-02-08 17:02:19', NULL, NULL,
        NULL);

INSERT IGNORE INTO auth_menu (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                              `is_frame`, `is_cache`, `menu_type`,
                              `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`,
                              `update_time`, `remark`)
VALUES (3717, '待报价询价报价单', 3711, 4, 'purchase/purInquiryOffer/purInquiryOffer',
        'purchase/purInquiryOffer/purInquiryOffer', '{\"pageType\":1}', 1, 0, 'C',
        '0', '0', 'purchase:purInquiryOffer:purInquiryOffer', NULL, '超级用户', '2023-02-08 17:02:19', NULL, NULL, NULL);

INSERT IGNORE INTO sys_approval_flow_config(`id`, `type`, `typeName`, `approvalSort`, `createUser`, `createTime`,
                                            `updateUser`, `updateTime`)
VALUES ('7', 'xjjh', '询价计划单据', 7, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO sys_approval_flow_config(`id`, `type`, `typeName`, `approvalSort`, `createUser`, `createTime`,
                                            `updateUser`, `updateTime`)
VALUES ('8', 'xjbj', '询价报价单据', 8, NULL, NULL, NULL, NULL);

-- ----------------------------
-- Table structure for pur_inquiry
-- ----------------------------
CREATE TABLE IF NOT EXISTS `pur_inquiry`
(
    `id`             bigint(0)                                                     NOT NULL AUTO_INCREMENT,
    `billNo`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '询价单据号',
    `billDate`       datetime(0)                                                   NULL     DEFAULT NULL COMMENT '询价发起日期',
    `status`         tinyint(0)                                                    NULL     DEFAULT NULL COMMENT '状态（1.草稿，2.未审核，3.已审核,4.已拒绝）',
    `billType`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL,
    `remark`         varchar(512) 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 COMMENT '当前仓库',
    `deptCode`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci 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 '创建时间',
    `auditUser`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '审核人',
    `auditTime`      datetime(0)                                                   NULL     DEFAULT NULL COMMENT '审核时间',
    `updateUser`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '更新人',
    `updateTime`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '更新时间',
    `auditRemark`    varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '审核说明',
    `targetInvCode`  varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '目标仓库',
    `targetDeptCode` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '目标部门',
    `planBillNo`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生成采购计划单据号',
    `generatePlan`   tinyint(0)                                                    NULL     DEFAULT NULL COMMENT '是否已生成采购计划',
    `emergency`      tinyint(0)                                                    NULL     DEFAULT NULL COMMENT '紧急情况',
    `arrivalTime`    datetime(0)                                                   NULL     DEFAULT NULL COMMENT '期望到货时间',
    `approvalFlowId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL     DEFAULT NULL COMMENT '审批表主键(关联审批流程主表)',
    `pageType`       int(0)                                                        NOT NULL DEFAULT 1 COMMENT '1:业务管理；2：设备管理',
    `validUntil`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '询价截止时间',
    `supIds`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商ids',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 97
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '询价业务'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for pur_inquiry_item
-- ----------------------------
CREATE TABLE IF NOT EXISTS `pur_inquiry_item`
(
    `id`              bigint(0)                                                     NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `orderIdFk`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL COMMENT '关联询价编号',
    `count`           int(0)                                                        NULL DEFAULT NULL COMMENT '询价数量',
    `price`           decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '期望单价',
    `totalPrice`      decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '期望总价',
    `attachmentPath`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '询价附件的路径或URL（如产品规格书、图纸等）',
    `remark`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '说明',
    `productId`       bigint(0)                                                     NULL DEFAULT NULL COMMENT '产品编码',
    `productUniqueId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '产品唯一id uniqueId',
    `nameCode`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '最小销售标识',
    `batchNo`         varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NULL DEFAULT NULL COMMENT '批次号',
    `productName`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '产品名称',
    `productCompany`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '生产厂家',
    `produceDate`     date                                                          NULL DEFAULT NULL COMMENT '生产日期',
    `expireDate`      date                                                          NULL DEFAULT NULL COMMENT '过期时间',
    `zczbhhzbapzbh`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '注册证/备案号',
    `ggxh`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '规格型号',
    `packRatio`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '包装级别',
    `measname`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '单位',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1791362555050999838
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_as_cs COMMENT = '询价业务明细表'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for pur_inquiry_item_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `pur_inquiry_item_detail`
(
    `id`            bigint(0)                                                     NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `orderIdFk`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL COMMENT '关联询价编号',
    `orderItemIdFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL COMMENT '关联询明细价id',
    `supNumber`     int(0)                                                        NOT NULL COMMENT '供应商报价第几次',
    `supId`         bigint(0)                                                     NOT NULL COMMENT '供应商id',
    `supName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '供应商名称',
    `supPerson`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '供应商联系人姓名',
    `supPhone`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '供应商联系人电话',
    `supEmail`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '供应商联系人电子邮件',
    `supFilePath`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '供应商附件的路径或URL',
    `supCount`      int(0)                                                        NULL DEFAULT NULL COMMENT '供应商报价数量',
    `supPrice`      decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '供应商报价单价',
    `supTotalPrice` decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '供应商报价总价',
    `supRemark`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '说明',
    `accord`        int(0)                                                        NULL DEFAULT NULL COMMENT '是否符合 1 符合 ；0 不符合',
    `adopt`         int(0)                                                        NULL DEFAULT NULL COMMENT '是否采纳 1 采纳 ；0 不采纳',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 235
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_as_cs COMMENT = '询价业务明细详情表'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for pur_inquiry_offer
-- ----------------------------
CREATE TABLE IF NOT EXISTS `pur_inquiry_offer`
(
    `id`             bigint(0)                                                     NOT NULL AUTO_INCREMENT,
    `billNo`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '询价单据号',
    `billDate`       datetime(0)                                                   NULL     DEFAULT NULL COMMENT '询价发起日期',
    `status`         tinyint(0)                                                    NULL     DEFAULT NULL COMMENT '状态（1.草稿，2.未审核，3.已审核,4.已拒绝）',
    `billType`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL,
    `remark`         varchar(512) 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 COMMENT '当前仓库',
    `deptCode`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci 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 '创建时间',
    `auditUser`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '审核人',
    `auditTime`      datetime(0)                                                   NULL     DEFAULT NULL COMMENT '审核时间',
    `updateUser`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '更新人',
    `updateTime`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '更新时间',
    `auditRemark`    varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '审核说明',
    `targetInvCode`  varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '目标仓库',
    `targetDeptCode` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci  NULL     DEFAULT NULL COMMENT '目标部门',
    `planBillNo`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '生成采购计划单据号',
    `generatePlan`   tinyint(0)                                                    NULL     DEFAULT NULL COMMENT '是否已生成采购计划',
    `emergency`      tinyint(0)                                                    NULL     DEFAULT NULL COMMENT '紧急情况',
    `arrivalTime`    datetime(0)                                                   NULL     DEFAULT NULL COMMENT '期望到货时间',
    `approvalFlowId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL     DEFAULT NULL COMMENT '审批表主键(关联审批流程主表)',
    `pageType`       int(0)                                                        NOT NULL DEFAULT 1 COMMENT '1:业务管理；2：设备管理',
    `validUntil`     datetime(0)                                                   NULL     DEFAULT NULL COMMENT '询价截止时间',
    `supIds`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL     DEFAULT NULL COMMENT '供应商ids',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 97
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT = '询价报价业务'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for pur_inquiry_offer_item
-- ----------------------------
CREATE TABLE IF NOT EXISTS `pur_inquiry_offer_item`
(
    `id`              bigint(0)                                                     NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `orderIdFk`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL COMMENT '关联询价编号',
    `count`           int(0)                                                        NULL DEFAULT NULL COMMENT '询价数量',
    `price`           decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '期望单价',
    `totalPrice`      decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '期望总价',
    `attachmentPath`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '询价附件的路径或URL（如产品规格书、图纸等）',
    `remark`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '说明',
    `productId`       bigint(0)                                                     NULL DEFAULT NULL COMMENT '产品编码',
    `productUniqueId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '产品唯一id uniqueId',
    `nameCode`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '最小销售标识',
    `batchNo`         varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NULL DEFAULT NULL COMMENT '批次号',
    `productName`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '产品名称',
    `productCompany`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '生产厂家',
    `produceDate`     date                                                          NULL DEFAULT NULL COMMENT '生产日期',
    `expireDate`      date                                                          NULL DEFAULT NULL COMMENT '过期时间',
    `zczbhhzbapzbh`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '注册证/备案号',
    `ggxh`            varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '规格型号',
    `packRatio`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '包装级别',
    `measname`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '单位',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 1791362555050999838
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_as_cs COMMENT = '询价报价业务明细表'
  ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for pur_inquiry_offer_item_detail
-- ----------------------------
CREATE TABLE IF NOT EXISTS `pur_inquiry_offer_item_detail`
(
    `id`            bigint(0)                                                     NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `orderIdFk`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL COMMENT '关联询价编号',
    `orderItemIdFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NOT NULL COMMENT '关联询明细价id',
    `supNumber`     int(0)                                                        NOT NULL COMMENT '供应商报价第几次',
    `supId`         bigint(0)                                                     NOT NULL COMMENT '供应商id',
    `supName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '供应商名称',
    `supPerson`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '供应商联系人姓名',
    `supPhone`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '供应商联系人电话',
    `supEmail`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '供应商联系人电子邮件',
    `supFilePath`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '供应商附件的路径或URL',
    `supCount`      int(0)                                                        NULL DEFAULT NULL COMMENT '供应商报价数量',
    `supPrice`      decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '供应商报价单价',
    `supTotalPrice` decimal(10, 2)                                                NULL DEFAULT NULL COMMENT '供应商报价总价',
    `supRemark`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs NULL DEFAULT NULL COMMENT '说明',
    `accord`        int(0)                                                        NULL DEFAULT NULL COMMENT '是否符合 1 符合 ；0 不符合',
    `adopt`         int(0)                                                        NULL DEFAULT NULL COMMENT '是否采纳 1 采纳 ；0 不采纳',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 250
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_as_cs COMMENT = '询价报价业务明细详情表'
  ROW_FORMAT = Dynamic;


CALL Pro_Temp_ColumnWork('pur_apply_detail', 'measname',
                         ' varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''单位''',
                         1);

-- ----------------------------
-- Table structure for pur_apply_argument
-- ----------------------------
CREATE TABLE IF NOT EXISTS `pur_apply_argument`
(
    `id`                bigint(0)                                                     NOT NULL AUTO_INCREMENT,
    `orderIdFk`         varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '订单外键',
    `orderDetailIdFk`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '订单详情外键',
    `applyBillNo`       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 COMMENT '当前仓库',
    `deptCode`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属部门',
    `deptName`          varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci 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 '创建时间',
    `updateUser`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
    `updateTime`        datetime(0)                                                   NULL DEFAULT NULL COMMENT '更新时间',
    `productId`         bigint(0)                                                     NULL DEFAULT NULL COMMENT '产品ID',
    `productName`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '产品名称',
    `count`             int(0)                                                        NULL DEFAULT NULL COMMENT '数量',
    `measname`          varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs  NULL DEFAULT NULL COMMENT '单位',
    `mainParam`         text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs         NULL COMMENT '配置要求及主要技术参数',
    `applicationReason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs         NULL COMMENT '申请理由',
    `benefitPrediction` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs         NULL COMMENT '效益预测',
    `supportCondition`  text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs         NULL COMMENT '配套条件',
    `supportPerson`     text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '使用科室人员配备情况',
    `maintenanceForce`  text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '维修技术力量的保证或维修途径',
    `fundSource`        text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '资金来源',
    `feasibility`       text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci         NULL COMMENT '可行性论证',
    `argStatus`         int(0)                                                        NULL DEFAULT 0 COMMENT '论证状态',
    `createName`        varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '创建人昵称',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 91
  CHARACTER SET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci
  ROW_FORMAT = Dynamic;

INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`,
                             `update_time`, `remark`)
VALUES (3718, '论证管理', 1703, 0, 'purApplyArgument', NULL, NULL, 1, 0, 'M', '0', '0', NULL, NULL,
        '超级用户', '2023-02-08 17:01:50', NULL, NULL, NULL);
INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`,
                             `is_frame`,
                             `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`,
                             `update_by`, `update_time`, `remark`)
VALUES (3719, '论证明细', 3718, 1, 'purchase/purApplyArgument/purApplyArgument',
        'purchase/purApplyArgument/purApplyArgument', '{\"pageType\":2}', 1, 0, 'C',
        '0', '0', 'purchase:purApplyArgument:purApplyArgument', NULL, '超级用户', '2023-02-08 17:02:19', NULL, NULL, NULL);

INSERT IGNORE INTO sys_pdf_template(`id`, `name`, `type`, `module`, `param`, `path`, `rowCount`, `qrcodeCount`,
                                    `remark`, `create_time`, `update_time`, `jrxmlPath`,
                                    `bussinessType`, `bussinessStatus`)
VALUES (6, '设备申购论证单据模板', 2, 0, '', '', 10, 1, '', '2024-05-21 17:04:11', '2024-05-21 17:04:11', '', NULL, NULL);



INSERT IGNORE INTO sys_pdf_template_relevance_statemen(`id`, `templateId`, `customerId`, `adminId`, `moduleId`,
                                                       `localAction`, `remark1`, `remark2`, `remark3`, `printType`,
                                                       `modelKey`, `updateTime`)
VALUES (7, 33, 110, 0, NULL, '设备论证单据打印', NULL, NULL, NULL, NULL, 'reportForms', NULL);


CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailHcType',
                         'tinyint    NULL DEFAULT NULL COMMENT '' 校验耗材类型 ：0:不耗材；1:高值耗材；2:无普通耗材''', 1);

CREATE TABLE IF NOT EXISTS `thr_medical_product_category`
(
    `id`                      int NOT NULL AUTO_INCREMENT,
    `materialId`              int          DEFAULT NULL COMMENT '物资分类编码',
    `materialName`            varchar(255) DEFAULT NULL COMMENT '物资分类的名称',
    `firstLevelCategoryCode`  int          DEFAULT NULL COMMENT '一级分类的编码',
    `firstLevelCategoryName`  varchar(255) DEFAULT NULL COMMENT '一级分类的名称',
    `secondLevelCategoryCode` int          DEFAULT NULL COMMENT '二级分类的编码',
    `secondLevelCategoryName` varchar(255) DEFAULT NULL COMMENT '二级分类的名称',
    `managementType`          int          DEFAULT NULL COMMENT '管理类别 ',
    `materialCode`            varchar(255) DEFAULT NULL COMMENT '标识',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 160
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='医疗产品分类标识';

CALL Pro_Temp_ColumnWork('basic_products', 'requireScanCode',
                         'bit(1) NOT NULL DEFAULT b''0'' COMMENT ''是否需要扫码 1是；0否''',
                         1);

INSERT IGNORE INTO `sys_custom_config_detail` (`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                               `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                               `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                               `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                               `dataFuc`, `isShowXx`)
VALUES (41779, 94, '2', 1, 'confirmDateRange', '发票确认时间', 'datePickera', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'requireScanCode',
                         'bit(1) NOT NULL DEFAULT b''0'' COMMENT ''是否需要扫码 1是；0否''',
                         1);


INSERT IGNORE INTO `sys_custom_config_detail` (`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                               `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                               `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                               `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                               `dataFuc`, `isShowXx`)
VALUES (41782, 68, '2', 1, 'invoiceEncode', '发票号', 'input', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

INSERT IGNORE INTO `sys_custom_config_detail` (`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                               `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                               `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                               `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                               `dataFuc`, `isShowXx`)
VALUES (41780, 94, '2', 1, 'corpName', '供应商', 'input', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT IGNORE INTO `sys_custom_config_detail` (`id`, `configId`, `type`, `isShow`, `columnName`, `columnDesc`,
                                               `columnType`, `colorRule`, `sort`, `lableRule`, `width`, `tooltip`,
                                               `buttonRule`, `number`, `lineNumber`, `clickFuc`, `size`, `style`,
                                               `disabled`, `checkRules`, `inputType`, `disabledFuc`, `expression`,
                                               `dataFuc`, `isShowXx`)
VALUES (41781, 94, '1', 1, 'corpName', '供应商', 'text', NULL, NULL, NULL, 160, 1, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL);

CALL Pro_Temp_ColumnWork('device_repair_apply', 'livePath',
                         'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修现场照片''',
                         1);


CALL Pro_Temp_ColumnWork('device_check_item_dict', 'updateTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''更新时间''',
                         1);



ALTER TABLE sup_evaluate
    MODIFY COLUMN `id` BIGINT NOT NULL;
ALTER TABLE sup_evaluate_detail
    MODIFY COLUMN `id` BIGINT NOT NULL;
ALTER TABLE sup_evaluate_plan
    MODIFY COLUMN `id` BIGINT NOT NULL;
ALTER TABLE sup_evaluate_plan_detail
    MODIFY COLUMN `id` BIGINT NOT NULL;
ALTER TABLE sup_evaluate_detail
    MODIFY COLUMN `planDetailId` BIGINT;


CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'codeCheck',
                         'tinyint    NULL DEFAULT NULL COMMENT '' 是否开启校验扫码 ：0:不校验；1:只允许录入扫码产品；2:只允许录入不扫码产品''', 1);

CALL Pro_Temp_ColumnWork('basic_products', 'bzgg',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''包装规格''',
                         1);

CALL Pro_Temp_ColumnWork('basic_sk_sicker', 'inHospTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''入院时间''',
                         1);
CALL Pro_Temp_ColumnWork('basic_sk_sicker', 'outHospTime',
                         ' datetime NULL DEFAULT NULL COMMENT ''出院时间''',
                         1);
CALL Pro_Temp_ColumnWork('basic_udirel', 'isStack', 'tinyint', 1);


CALL Pro_Temp_ColumnWork('inv_remind_set', 'lowStockNum',
                         ' int(0) NULL DEFAULT NULL COMMENT ''低库存预警数量''',
                         1);
CALL Pro_Temp_ColumnWork('inv_remind_set', 'overStockNum',
                         ' int(0) NULL DEFAULT NULL COMMENT ''库存积压预警数量''',
                         1);
CALL Pro_Temp_ColumnWork('inv_remind_set', 'recentDateTime',
                         ' int(0) NULL DEFAULT NULL COMMENT ''近效期预警时间（小时）''',
                         1);
CALL Pro_Temp_ColumnWork('inv_remind_set', 'isDateBy',
                         ' tinyint(0) NULL DEFAULT 1 COMMENT ''时间预警填写类型1天2小时''',
                         1);


CREATE TABLE IF NOT EXISTS `sys_msg_todo`
(
    `id`         int NOT NULL AUTO_INCREMENT,
    `code`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '消息编码',
    `msgType`    tinyint                                                       DEFAULT NULL COMMENT '消息类型（1:入院物资申请；2:单据审核；3：单据发票确认；5.资质审核;6：领用单审核；7:申购单审核；8：采购订单审核；）',
    `msgContent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '消息内容',
    `dealStatus` tinyint                                                       DEFAULT NULL COMMENT '处理状态',
    `pushStatus` tinyint                                                       DEFAULT NULL COMMENT '推送小程序状态（1：未推送；2:推送成功；3：推送失败',
    `toUrl`      varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '跳转地址',
    `createTime` datetime                                                      DEFAULT NULL COMMENT '创建时间',
    `updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '更新人',
    `updateTime` datetime                                                      DEFAULT NULL COMMENT '更新时间',
    `deptCode`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所属仓库',
    `invCode`    varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '所属仓库',
    `remark`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci;


CREATE TABLE IF NOT EXISTS `device_asset_contract`
(
    `id`         bigint NOT NULL,
    `devCodeFk`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '设备资产编码外键',
    `name`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '证书名称',
    `code`       varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '证书编码',
    `filePath`   text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '文件路径',
    `vailDate`   datetime                                                      DEFAULT NULL COMMENT '生效期',
    `expireDate` datetime                                                      DEFAULT NULL COMMENT '失效期',
    `status`     tinyint                                                       DEFAULT NULL COMMENT '证书状态',
    `type`       tinyint                                                       DEFAULT NULL COMMENT '证书类型（1：资质证书；2：技术材料）',
    `remark`     varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注说明',
    `createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
    `createTime` datetime                                                      DEFAULT NULL COMMENT '创建时间',
    `updateUser` varchar(255)                                                  DEFAULT NULL COMMENT '更新人',
    `updateTime` datetime                                                      DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci
  ROW_FORMAT = DYNAMIC;


INSERT ignore INTO `basic_bussiness_type`(`id`, `mainAction`, `action`, `name`, `enable`, `remark`, `thirdSysFk`,
                                          `genUnit`, `innerOrder`, `secCheckEnable`, `checkEnable`, `checkUdims`,
                                          `checkPdaEd`, `checkPdaUn`, `checkPc`, `checkWebNew`, `checkSp`,
                                          `checkChange`, `secCheckUdims`, `secCheckPdaEd`, `secCheckPdaUn`,
                                          `secCheckPc`, `secCheckWebNew`, `secCheckChange`, `secCheckSp`, `corpType`,
                                          `supplementOrderType`, `checkBalance`, `secCheckBalance`, `useDyCount`,
                                          `expireTip`, `updateTime`, `defaultUnit`, `prefix`, `outToSpms`, `ullageFill`,
                                          `scanPreIn`, `vailInv`, `entrutSpms`, `codeFillCheck`, `defaultSubInv`,
                                          `defaultInv`, `orderVisibleType`, `checkCopy`, `secCheckCopy`, `originAction`,
                                          `advanceType`, `changeEnable`, `spUse`, `preIn`, `preInBack`, `supplementAll`,
                                          `createUser`, `createTime`, `updateUser`, `vailDispatch`, `vailGroupBuy`,
                                          `busType`, `inStock`, `actionType`, `thrCheckEnable`, `thrCheckWebNew`,
                                          `thrCheckPdaUn`, `thrCheckPdaEd`, `thrCheckUdims`, `thrCheckPc`, `thrCheckSp`,
                                          `thrCheckChange`, `thrCheckBalance`, `thrCheckCopy`, `fillCodeRel`,
                                          `checkVailDate`, `checkExpire`, `checkCertExpire`, `preInBackAction`,
                                          `backPreinType`, `advancePreIn`, `sortNum`, `spaceOut`, `checkReview`,
                                          `secCheckReview`, `thrCheckReview`, `checkWebNewType`, `editType`,
                                          `inPreInBack`, `deptNoInvType`, `vailPrescribe`, `inputSick`, `groupBuySplit`,
                                          `vailInvBatchNo`, `vailProductAttributes`, `devInType`, `vailHcType`,
                                          `requireScanCode`, `codeCheck`)
VALUES (1844274444567728128, 'WareHouseIn', 'SC72854426720051', '科室退费入库', 1, '', '', 0, 0, 0, 1, 0, 0, 0, 0, 4, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 1, '', 0, 0, 0, 1, '2024-10-10 15:49:37', NULL, NULL, 0, 0, 0, 0, 0, 0, NULL, NULL, 0, 0, 0,
        NULL, NULL, 0, 0, NULL, 0, 0, NULL, NULL, '1', 0, 0, NULL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, NULL,
        1, 0, 999, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, NULL, 0, NULL, 0, NULL, b'0', NULL);

CALL Pro_Temp_ColumnWork('basic_products', 'requireCost',
                         'bit(1) NOT NULL DEFAULT b''0'' COMMENT ''是否需要收费 1是；0否''',
                         1);

CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'requireCost',
                         'bit(1) NOT NULL DEFAULT b''0'' COMMENT ''校验是否需要收费 1是；0否''',
                         1);


CALL Pro_Temp_ColumnWork('io_order_detail_code', 'filePath',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''检验报告''',
                         1);

CALL Pro_Temp_ColumnWork('io_order_detail_code', 'coldFilePath',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''检验报告名称''',
                         1);


CALL Pro_Temp_ColumnWork('io_order_detail_code', 'checkFileName',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''冷链报告''',
                         1);


CALL Pro_Temp_ColumnWork('io_order_detail_code', 'checkColdFileName',
                         'varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT ''冷链报告名称''',
                         1);