-- CreateTable
CREATE TABLE `db_accessoryclass_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_askleave_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_asset_category` (
    `category_id` INTEGER NOT NULL AUTO_INCREMENT,
    `category_name` VARCHAR(100) NOT NULL,
    `parent_id` INTEGER NULL DEFAULT 0,
    `level` INTEGER NOT NULL,
    `sort_order` INTEGER NULL DEFAULT 0,
    `description` VARCHAR(500) NULL,
    `create_time` DATETIME(0) NULL DEFAULT CURRENT_TIMESTAMP(0),

    INDEX `idx_parent_id`(`parent_id`),
    PRIMARY KEY (`category_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_assetclass68_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_assetclass_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_assetfinancialclass_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_assetsource_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_assetsubclass_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_classattr_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_county` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `id_f` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_credible` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_deviceinspectionitem_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_devicemaintain_period_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_devicemaintain_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_devicemaintainresponsibleunit_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_district` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `id_f` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_emergencyclass_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_extern_service_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_grid_placeclass_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_holiday_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_inspection_conclusion_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_inspection_period_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_inspectionmode` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_job_state` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_marriage_state` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_medicalinstrumentsclass_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_nation` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_notice_receivertype` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_notice_sendtype` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_notice_status` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_notice_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_province` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_restaurantcertificate_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_sex` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_skillcertificate_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_specialclass_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_staff_adminis_position` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_staff_degree` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_staff_education_positon` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_staff_technical_position` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_staff_tutor_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheet_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheetcarryingtools_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheetdecchannel_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheetdecsource_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheeteval_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheetfinishtime_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheetreponsetime_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheetspecimen_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheetstate_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheettrackstate_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_tasksheeturgencydegree_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_technicalwork_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_use_status_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_workpost_type` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `db_workstate` (
    `id` VARCHAR(32) NOT NULL,
    `name` VARCHAR(50) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_ask_leave` (
    `id` VARCHAR(32) NOT NULL,
    `exteam_id` VARCHAR(32) NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `ask_date` DATE NULL,
    `begin_date` DATE NOT NULL,
    `begin_time` TIME(0) NOT NULL,
    `leave_days` INTEGER NULL DEFAULT 1,
    `end_date` DATE NOT NULL,
    `end_time` TIME(0) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_askleaveplan` (
    `id` VARCHAR(32) NOT NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `user_name` VARCHAR(20) NOT NULL DEFAULT '',
    `user_mobile` VARCHAR(15) NULL,
    `ask_date` DATE NULL,
    `askleavetype_id` VARCHAR(32) NULL,
    `holidaytype_id` VARCHAR(32) NULL,
    `exteam_id` VARCHAR(32) NULL,
    `service_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_asset_borrow` (
    `borrow_id` INTEGER NOT NULL AUTO_INCREMENT,
    `asset_id` INTEGER NOT NULL,
    `asset_name` VARCHAR(50) NULL,
    `borrow_date` DATE NULL,
    `return_date` DATE NULL,
    `actual_return_date` DATE NULL,
    `borrower_id` VARCHAR(32) NULL,
    `borrow_department_id` VARCHAR(50) NULL,
    `location` VARCHAR(21) NULL,
    `lender_id` VARCHAR(32) NULL,
    `approver_id` VARCHAR(32) NULL,
    `registrant_id` VARCHAR(32) NULL,
    `registrant_date` DATE NULL,
    `note` VARCHAR(200) NULL,
    `is_return` INTEGER NOT NULL DEFAULT 0,
    `delete_flag` INTEGER NOT NULL DEFAULT 0,
    `hosp_id` VARCHAR(32) NULL,

    PRIMARY KEY (`borrow_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_asset_change` (
    `asset_change_id` INTEGER NOT NULL AUTO_INCREMENT,
    `asset_id` INTEGER NOT NULL,
    `asset_name` VARCHAR(50) NULL,
    `old_header_id` VARCHAR(32) NULL,
    `now_header_id` VARCHAR(32) NULL,
    `old_location` VARCHAR(50) NULL,
    `new_location` VARCHAR(50) NULL,
    `old_use_man_id` VARCHAR(50) NULL,
    `now_use_man_id` VARCHAR(50) NULL,
    `chang_date` DATE NULL,
    `registrant_id` VARCHAR(32) NULL,
    `registrant_date` DATE NULL,
    `note` VARCHAR(50) NULL,
    `hosp_id` VARCHAR(32) NULL,

    PRIMARY KEY (`asset_change_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_asset_disposal` (
    `assert_disposal_id` INTEGER NOT NULL AUTO_INCREMENT,
    `asset_id` INTEGER NOT NULL,
    `asset_name` VARCHAR(50) NULL,
    `disposal_method` VARCHAR(500) NULL,
    `disposal_amount` DOUBLE NULL,
    `disposal_date` DATE NULL,
    `place_to_go` VARCHAR(50) NULL,
    `registrant_id` VARCHAR(32) NULL,
    `registrant_date` DATE NULL,
    `note` VARCHAR(200) NULL,
    `disposal_man_id` VARCHAR(32) NULL,
    `hosp_id` VARCHAR(32) NULL,

    PRIMARY KEY (`assert_disposal_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_asset_information` (
    `asset_id` INTEGER NOT NULL AUTO_INCREMENT,
    `asset_name` VARCHAR(50) NOT NULL,
    `asset_category_id` INTEGER NOT NULL,
    `asset_sn` VARCHAR(50) NULL,
    `specifications` VARCHAR(50) NULL,
    `model` VARCHAR(50) NULL,
    `asset_brand` VARCHAR(50) NULL,
    `manufacturer` VARCHAR(50) NULL,
    `purchase_date` DATE NULL,
    `purchase_price` DOUBLE NULL,
    `purchase_quantity` INTEGER NULL DEFAULT 1,
    `unit` VARCHAR(30) NULL,
    `purchase_man_id` VARCHAR(32) NULL,
    `location` VARCHAR(21) NULL,
    `status` TINYINT NULL,
    `value` DOUBLE NULL,
    `depreciation_rate` FLOAT NULL,
    `use_man_id` VARCHAR(32) NULL,
    `department_id` VARCHAR(51) NULL,
    `usefullife` FLOAT NULL,
    `header_id` VARCHAR(32) NULL,
    `disposaldate` DATE NULL,
    `is_disposal` TINYINT NOT NULL DEFAULT 0,
    `warranty_date` DATE NULL,
    `asset_pic` VARCHAR(200) NULL,
    `note` VARCHAR(20) NULL,
    `registrant_id` VARCHAR(32) NULL,
    `registrant_date` DATE NULL,
    `delete_flag` INTEGER NOT NULL DEFAULT 0,
    `is_maintenance` INTEGER NOT NULL DEFAULT 0,
    `hosp_id` VARCHAR(32) NULL,
    `image` MEDIUMTEXT NULL,

    PRIMARY KEY (`asset_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_asset_inventory` (
    `inventory_id` INTEGER NOT NULL AUTO_INCREMENT,
    `inventory_plan_id` INTEGER NOT NULL,
    `asset_id` INTEGER NOT NULL,
    `asset_name` VARCHAR(50) NULL,
    `inventory_date` DATE NULL,
    `inventory_result` TINYINT NULL,
    `inventory_pic` VARCHAR(200) NULL,
    `inventory_man_id` VARCHAR(32) NULL,
    `note` VARCHAR(200) NULL,
    `hosp_id` VARCHAR(32) NULL,
    `image` MEDIUMTEXT NULL,

    PRIMARY KEY (`inventory_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_asset_inventory_plan` (
    `inventory_plan_id` INTEGER NOT NULL AUTO_INCREMENT,
    `inventory_start_date` DATE NULL,
    `inventory_end_date` DATE NULL,
    `inventory_man_id` VARCHAR(32) NULL,
    `note` VARCHAR(200) NULL,
    `hosp_id` VARCHAR(32) NULL,
    `image` MEDIUMTEXT NULL,
    `inventory_man_name` VARCHAR(20) NULL DEFAULT '',

    PRIMARY KEY (`inventory_plan_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_asset_maintenance` (
    `maintenance_id` INTEGER NOT NULL AUTO_INCREMENT,
    `asset_id` BIGINT NOT NULL,
    `asset_name` VARCHAR(50) NULL,
    `maintenance_date` DATE NULL,
    `maintenance_cost` DOUBLE NULL,
    `maintenance_dapartment` VARCHAR(50) NULL,
    `maintenance_man` VARCHAR(51) NULL,
    `maintenance_phone` VARCHAR(52) NULL,
    `registrant_id` VARCHAR(32) NULL,
    `registrant_date` DATE NULL,
    `note` VARCHAR(200) NULL,
    `is_finish` INTEGER NULL DEFAULT 0,
    `hosp_id` VARCHAR(32) NULL,

    PRIMARY KEY (`maintenance_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_call_info` (
    `id` VARCHAR(32) NOT NULL,
    `cdr_id` VARCHAR(50) NULL,
    `starttime` DATETIME(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `callnumber` VARCHAR(30) NULL,
    `isconnected` BOOLEAN NULL DEFAULT false,
    `istransfered` BOOLEAN NULL DEFAULT false,
    `transfertel` VARCHAR(30) NULL,
    `iscallback` BOOLEAN NULL DEFAULT false,
    `duration` INTEGER NULL DEFAULT 0,
    `recordingurl` VARCHAR(255) NULL,
    `tasksheet_type` VARCHAR(32) NULL,
    `tasksheet_id` VARCHAR(32) NULL,
    `sheet_code` VARCHAR(20) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaning_tasksheet` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NULL DEFAULT '02',
    `sheet_code` VARCHAR(20) NOT NULL,
    `dec_tel` VARCHAR(15) NULL,
    `dec_dept` VARCHAR(32) NULL,
    `declarer` VARCHAR(32) NULL,
    `declarer_post` VARCHAR(32) NULL,
    `dec_time` DATETIME(0) NULL,
    `dec_source` VARCHAR(32) NULL,
    `dec_channel` VARCHAR(32) NULL,
    `urgent_degree` VARCHAR(32) NULL,
    `service_place` VARCHAR(32) NULL,
    `service_dept` VARCHAR(32) NULL,
    `ask_pic` VARCHAR(400) NULL,
    `ask_wav` VARCHAR(400) NULL,
    `ask_word` VARCHAR(400) NULL,
    `is_ordered` BOOLEAN NULL DEFAULT false,
    `ordered_datetime` DATETIME(0) NULL,
    `needcontact_dept` VARCHAR(32) NULL,
    `needcontact` VARCHAR(20) NULL,
    `needcontact_tel` VARCHAR(15) NULL,
    `isreworksheet` BOOLEAN NULL DEFAULT false,
    `reponse_rank` VARCHAR(400) NULL,
    `exteam_id` VARCHAR(32) NULL,
    `excompany_id` VARCHAR(32) NULL,
    `finish_time` DATETIME(0) NULL,
    `finish_pic` VARCHAR(400) NULL,
    `finish_wav` VARCHAR(400) NULL,
    `finish_word` VARCHAR(400) NULL,
    `satisfaction_evaluation` VARCHAR(32) NULL,
    `satisfaction_content` VARCHAR(200) NULL,
    `issuperviset` BOOLEAN NULL DEFAULT false,
    `supervisor_id` VARCHAR(32) NULL,
    `superviset_time` DATETIME(0) NULL,
    `isconfirm` BOOLEAN NULL DEFAULT false,
    `confirmingperson_id` VARCHAR(32) NULL,
    `confirm_time` DATETIME(0) NULL,
    `confirm_content` VARCHAR(400) NULL,
    `confirm_wav` VARCHAR(400) NULL,
    `iscomplaint` BOOLEAN NULL DEFAULT false,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasksheet_state` VARCHAR(32) NULL,
    `isautodispatching` BOOLEAN NULL DEFAULT false,
    `user_type` INTEGER NULL DEFAULT 2,
    `finish_rank` VARCHAR(32) NULL,
    `undertake_person` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaning_tasksheet_serviceitem` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `service_item` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaning_tasksheet_statetrack` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `acceptance_person` VARCHAR(32) NULL,
    `tasksheet_state` VARCHAR(32) NULL DEFAULT '01',
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaning_tasksheet_undertake` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_statetrack_id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `undertake_person` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_item` (
    `id` VARCHAR(32) NOT NULL,
    `template_id` VARCHAR(32) NOT NULL,
    `item_name` VARCHAR(50) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_itemcontent` (
    `id` VARCHAR(32) NOT NULL,
    `item_id` VARCHAR(32) NOT NULL,
    `content` VARCHAR(400) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_person` (
    `id` VARCHAR(32) NOT NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `isleader` BOOLEAN NULL DEFAULT false,
    `isactive` BOOLEAN NULL DEFAULT true,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_plan` (
    `id` VARCHAR(32) NOT NULL,
    `plan_name` VARCHAR(50) NOT NULL,
    `grid_placeclass_id` VARCHAR(32) NULL,
    `template_id` VARCHAR(32) NOT NULL,
    `inspection_period` VARCHAR(32) NOT NULL,
    `start_month` INTEGER NULL,
    `start_day` INTEGER NULL,
    `workdaycount` INTEGER NULL,
    `start_date` DATE NULL,
    `start_time` TIME(0) NULL,
    `end_time` TIME(0) NULL,
    `frequency` INTEGER NULL,
    `minimuminterval` INTEGER NULL,
    `isactive` BOOLEAN NULL DEFAULT true,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `ispatrol` BOOLEAN NULL DEFAULT true,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_plan_grid` (
    `id` VARCHAR(32) NOT NULL,
    `plan_id` VARCHAR(32) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_tasksheet` (
    `id` VARCHAR(32) NOT NULL,
    `sheet_code` VARCHAR(20) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `grid_name` VARCHAR(200) NOT NULL,
    `grid_placeclass_id` VARCHAR(32) NULL,
    `template_id` VARCHAR(32) NOT NULL,
    `plan_id` VARCHAR(32) NOT NULL,
    `start_time` DATETIME(0) NULL,
    `end_time` DATETIME(0) NULL,
    `finish_time` DATETIME(0) NULL,
    `finish_pic` VARCHAR(400) NULL,
    `finish_wav` VARCHAR(400) NULL,
    `finish_word` VARCHAR(400) NULL,
    `ispatrol` BOOLEAN NULL DEFAULT true,
    `finish_conclusion` VARCHAR(32) NULL,
    `credible` VARCHAR(32) NULL,
    `iscreatesheet` BOOLEAN NULL DEFAULT false,
    `tasksheet_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasksheet_state` VARCHAR(32) NULL,
    `undertake_person` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_tasksheet_itemconclusion` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `item_id` VARCHAR(32) NULL,
    `itemfinish_pic` VARCHAR(400) NULL,
    `itemfinish_wav` VARCHAR(400) NULL,
    `itemfinish_word` VARCHAR(400) NULL,
    `itemfinish_conclusion` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_tasksheet_serviceitem` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `service_item` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_tasksheet_statetrack` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `acceptance_person` VARCHAR(32) NULL,
    `tasksheet_state` VARCHAR(32) NULL DEFAULT '01',
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_tasksheet_undertake` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_statetrack_id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `undertake_person` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_cleaninginspection_template` (
    `id` VARCHAR(32) NOT NULL,
    `templatename` VARCHAR(50) NOT NULL,
    `grid_placeclass_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `ispatrol` BOOLEAN NULL DEFAULT true,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_complaint_tasksheet` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NULL DEFAULT '07',
    `sheet_code` VARCHAR(20) NOT NULL,
    `dec_tel` VARCHAR(15) NULL,
    `dec_dept` VARCHAR(32) NULL,
    `declarer` VARCHAR(32) NULL,
    `declarer_post` VARCHAR(32) NULL,
    `dec_time` DATETIME(0) NULL,
    `dec_channel` VARCHAR(32) NULL,
    `complaint_subject` VARCHAR(100) NULL,
    `service_place` VARCHAR(32) NULL,
    `ask_word` VARCHAR(400) NULL,
    `ask_pic` VARCHAR(400) NULL,
    `ask_wav` VARCHAR(400) NULL,
    `is_anonymous` BOOLEAN NULL DEFAULT false,
    `isrework` BOOLEAN NULL DEFAULT false,
    `becomplained_tasksheet_id` VARCHAR(32) NULL,
    `becomplained_tasksheet_type` VARCHAR(32) NULL,
    `becomplained_sheet_code` VARCHAR(20) NULL,
    `new_tasksheet_id` VARCHAR(32) NULL,
    `exteam_id` VARCHAR(32) NULL,
    `excompany_id` VARCHAR(32) NULL,
    `exstaff_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasksheet_state` VARCHAR(32) NULL,
    `user_type` INTEGER NULL DEFAULT 2,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_comprerepair_tasksheet` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NULL DEFAULT '01',
    `sheet_code` VARCHAR(20) NOT NULL,
    `dec_tel` VARCHAR(15) NULL,
    `dec_dept` VARCHAR(32) NULL,
    `declarer` VARCHAR(32) NULL,
    `declarer_post` VARCHAR(32) NULL,
    `dec_time` DATETIME(0) NULL,
    `dec_source` VARCHAR(32) NULL,
    `dec_channel` VARCHAR(32) NULL,
    `urgent_degree` VARCHAR(32) NULL,
    `service_place` VARCHAR(32) NULL,
    `service_dept` VARCHAR(32) NULL,
    `ask_pic` VARCHAR(400) NULL,
    `ask_wav` VARCHAR(400) NULL,
    `ask_word` VARCHAR(400) NULL,
    `is_ordered` BOOLEAN NULL DEFAULT false,
    `ordered_datetime` DATETIME(0) NULL,
    `needcontact_dept` VARCHAR(32) NULL,
    `needcontact` VARCHAR(20) NULL,
    `needcontact_tel` VARCHAR(15) NULL,
    `isreworksheet` BOOLEAN NULL DEFAULT false,
    `reponse_rank` VARCHAR(400) NULL,
    `exteam_id` VARCHAR(32) NULL,
    `excompany_id` VARCHAR(32) NULL,
    `finish_time` DATETIME(0) NULL,
    `finish_pic` VARCHAR(400) NULL,
    `finish_wav` VARCHAR(400) NULL,
    `finish_word` VARCHAR(400) NULL,
    `satisfaction_evaluation` VARCHAR(32) NULL,
    `satisfaction_content` VARCHAR(200) NULL,
    `issuperviset` BOOLEAN NULL DEFAULT false,
    `supervisor_id` VARCHAR(32) NULL,
    `superviset_time` DATETIME(0) NULL,
    `isconfirm` BOOLEAN NULL DEFAULT false,
    `confirmingperson_id` VARCHAR(32) NULL,
    `confirm_time` DATETIME(0) NULL,
    `confirm_content` VARCHAR(400) NULL,
    `confirm_wav` VARCHAR(400) NULL,
    `iscomplaint` BOOLEAN NULL DEFAULT false,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasksheet_state` VARCHAR(32) NULL,
    `isautodispatching` BOOLEAN NULL DEFAULT false,
    `user_type` INTEGER NULL DEFAULT 2,
    `finish_rank` VARCHAR(32) NULL,
    `undertake_person` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_comprerepair_tasksheet_serviceitem` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `service_item` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_comprerepair_tasksheet_statetrack` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `acceptance_person` VARCHAR(32) NULL,
    `tasksheet_state` VARCHAR(32) NULL DEFAULT '01',
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_comprerepair_tasksheet_undertake` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_statetrack_id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `undertake_person` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_category` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `category_name` VARCHAR(50) NOT NULL,
    `parent_id` BIGINT NULL DEFAULT 0,
    `sort` INTEGER NULL DEFAULT 0,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `hosp_id` VARCHAR(32) NULL,

    UNIQUE INDEX `uk_category_name`(`category_name`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_check_item` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `check_plan_id` BIGINT NOT NULL,
    `inventory_id` BIGINT NOT NULL,
    `quantity` INTEGER NOT NULL,
    `check_result` TINYINT NULL,
    `check_pic` VARCHAR(200) NULL,
    `check_date` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` TEXT NULL,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `check_man_id` VARCHAR(32) NOT NULL,
    `hosp_id` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_check_plan` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `check_start_date` DATE NULL,
    `check_end_date` DATE NULL,
    `create_by` VARCHAR(32) NULL,
    `remark` TEXT NULL,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `hosp_id` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_distribution_application` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `user_id` VARCHAR(32) NOT NULL,
    `is_distribution` TINYINT NULL,
    `distribution_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `is_agree` BOOLEAN NULL DEFAULT false,
    `user_mobile` VARCHAR(15) NULL,
    `sku_id` BIGINT NOT NULL,
    `agree_id` VARCHAR(20) NOT NULL DEFAULT '',

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_distribution_item` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `plan_id` BIGINT NOT NULL,
    `group_id` BIGINT NOT NULL,
    `sku_id` BIGINT NOT NULL,
    `location_id` BIGINT NOT NULL,
    `recipient_id` VARCHAR(32) NULL,
    `actual_quantity` INTEGER NOT NULL DEFAULT 0,
    `notes` VARCHAR(200) NULL,
    `created_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `is_distributed` TINYINT NOT NULL DEFAULT 0,
    `hosp_id` VARCHAR(32) NULL,
    `get_time` TIMESTAMP(0) NULL,

    INDEX `idx_dist_item_goods`(`sku_id`),
    INDEX `idx_dist_item_group`(`group_id`),
    INDEX `idx_dist_item_plan`(`plan_id`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_distribution_plan` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `plan_title` VARCHAR(100) NOT NULL,
    `hosp_id` VARCHAR(32) NOT NULL,
    `warehouse_id` BIGINT NOT NULL,
    `period_type` VARCHAR(20) NOT NULL,
    `quantity_per_period` DECIMAL(10, 2) NOT NULL,
    `last_distribution_date` DATE NULL,
    `next_distribution_date` DATE NULL,
    `is_active` TINYINT NULL DEFAULT 1,
    `created_by_id` VARCHAR(50) NULL,
    `created_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `updated_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `distribution_flag` BOOLEAN NULL DEFAULT false,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_goods` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `goods_name` VARCHAR(100) NOT NULL,
    `category_id` BIGINT NULL,
    `brand` VARCHAR(50) NULL,
    `status` TINYINT NULL DEFAULT 0,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `hosp_id` VARCHAR(32) NULL,

    INDEX `idx_goods_category`(`category_id`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_groups` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `hosp_id` VARCHAR(32) NOT NULL,
    `group_name` VARCHAR(50) NOT NULL,
    `group_person_count` INTEGER NOT NULL,
    `group_head_id` VARCHAR(32) NOT NULL,
    `group_comment` VARCHAR(200) NULL,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_inbound_item` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `inbound_id` BIGINT NOT NULL,
    `sku_id` BIGINT NOT NULL,
    `quantity` INTEGER NOT NULL,
    `actual_quantity` INTEGER NULL,
    `unit_price` DECIMAL(10, 2) NULL,
    `location_id` BIGINT NULL,
    `hosp_id` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_inbound_order` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `inbound_no` VARCHAR(50) NOT NULL,
    `warehouse_id` BIGINT NOT NULL,
    `supplier_id` BIGINT NULL,
    `inbound_type` VARCHAR(20) NULL,
    `operator_id` VARCHAR(32) NULL,
    `status` VARCHAR(20) NULL,
    `inbound_date` DATE NOT NULL,
    `remark` TEXT NULL,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `hosp_id` VARCHAR(32) NULL,

    UNIQUE INDEX `uk_inbound_no`(`inbound_no`),
    INDEX `idx_inbound_supplier`(`supplier_id`),
    INDEX `idx_inbound_warehouse`(`warehouse_id`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_inventory` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `sku_id` BIGINT NOT NULL,
    `warehouse_id` BIGINT NOT NULL,
    `location_id` BIGINT NULL,
    `quantity` INTEGER NOT NULL DEFAULT 0,
    `locked_quantity` INTEGER NULL DEFAULT 0,
    `last_update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `hosp_id` VARCHAR(32) NULL,

    INDEX `idx_inventory_sku`(`sku_id`),
    INDEX `idx_inventory_warehouse`(`warehouse_id`),
    UNIQUE INDEX `uk_sku_warehouse_location`(`sku_id`, `warehouse_id`, `location_id`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_outbound_item` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `outbound_id` BIGINT NOT NULL,
    `sku_id` BIGINT NOT NULL,
    `quantity` INTEGER NOT NULL,
    `actual_quantity` INTEGER NULL,
    `location_id` BIGINT NULL,
    `hosp_id` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_outbound_order` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `outbound_no` VARCHAR(50) NOT NULL,
    `warehouse_id` BIGINT NOT NULL,
    `customer_id` VARCHAR(32) NULL,
    `outbound_type` VARCHAR(20) NOT NULL,
    `operator_id` VARBINARY(32) NULL,
    `status` VARCHAR(20) NOT NULL,
    `outbound_date` DATE NOT NULL,
    `remark` TEXT NULL,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `hosp_id` VARCHAR(32) NULL,

    UNIQUE INDEX `uk_outbound_no`(`outbound_no`),
    INDEX `idx_outbound_warehouse`(`warehouse_id`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_sku` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `goods_id` BIGINT NOT NULL,
    `sku_code` VARCHAR(50) NULL,
    `specification` VARCHAR(200) NULL,
    `barcode` VARCHAR(50) NOT NULL,
    `supplier_id` BIGINT NULL,
    `purchase_price` DECIMAL(10, 2) NULL,
    `selling_price` DECIMAL(10, 2) NULL,
    `unit` VARCHAR(20) NULL,
    `min_stock` INTEGER NULL DEFAULT 0,
    `max_stock` INTEGER NULL,
    `status` TINYINT NULL DEFAULT 0,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `hosp_id` VARCHAR(32) NULL,

    UNIQUE INDEX `uk_sku_code`(`sku_code`),
    UNIQUE INDEX `uk_sku_barcode`(`barcode`),
    INDEX `idx_sku_goods`(`goods_id`),
    INDEX `idx_sku_supplier`(`supplier_id`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_supplier` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `supplier_name` VARCHAR(100) NOT NULL,
    `contact_person` VARCHAR(50) NULL,
    `phone` VARCHAR(20) NULL,
    `address` VARCHAR(200) NULL,
    `status` TINYINT NULL DEFAULT 1,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `hosp_id` VARCHAR(32) NULL,

    UNIQUE INDEX `uk_supplier_name`(`supplier_name`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_warehouse` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `warehouse_code` VARCHAR(32) NOT NULL,
    `warehouse_name` VARCHAR(100) NOT NULL,
    `address` VARCHAR(200) NULL,
    `manager_id` VARCHAR(32) NULL,
    `area` DECIMAL(10, 2) NULL,
    `status` TINYINT NULL DEFAULT 0,
    `parent_id` BIGINT NULL DEFAULT 0,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `hosp_id` VARCHAR(32) NULL,

    UNIQUE INDEX `uk_warehouse_code`(`warehouse_code`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_consumable_warehouse_location` (
    `id` BIGINT NOT NULL AUTO_INCREMENT,
    `warehouse_id` BIGINT NOT NULL,
    `location_code` VARCHAR(50) NOT NULL,
    `location_type` VARCHAR(20) NULL,
    `status` TINYINT NULL DEFAULT 0,
    `create_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `hosp_id` VARCHAR(32) NULL,

    UNIQUE INDEX `uk_warehouse_location_code`(`warehouse_id`, `location_code`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_department` (
    `id` VARCHAR(32) NOT NULL,
    `dept_code` VARCHAR(50) NULL,
    `dept_name` VARCHAR(50) NOT NULL,
    `superior_id` VARCHAR(32) NULL,
    `dept_selfcode` VARCHAR(20) NOT NULL,
    `dept_level` INTEGER NULL,
    `dept_tel` VARCHAR(100) NULL,
    `dept_leader_name` VARCHAR(20) NULL,
    `dept_leader_tel` VARCHAR(15) NULL,
    `dept_leader_ID` VARCHAR(32) NULL,
    `dept_fullname` VARCHAR(255) NULL,
    `abbre` VARCHAR(200) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_device_use_dept` (
    `id` VARCHAR(32) NOT NULL,
    `device_id` VARCHAR(32) NOT NULL,
    `dept_id` VARCHAR(32) NOT NULL,
    `rmv_value_rate` DOUBLE NULL DEFAULT 0.0000,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_devicebill` (
    `id` VARCHAR(32) NOT NULL,
    `device_code` VARCHAR(20) NULL,
    `assetcode` VARCHAR(50) NULL,
    `assetname` VARCHAR(100) NULL,
    `code68` VARCHAR(50) NULL,
    `financialcode` VARCHAR(50) NULL,
    `modelspec` VARCHAR(50) NULL,
    `factorycode` VARCHAR(50) NULL,
    `grid_id` VARCHAR(32) NULL,
    `dposition` VARCHAR(100) NULL,
    `administrators` VARCHAR(32) NULL,
    `Contractcode` VARCHAR(30) NULL,
    `repair_expire` DATETIME(0) NULL,
    `measurementunit` VARCHAR(10) NULL,
    `registrationcode` VARCHAR(50) NULL,
    `installdate` DATETIME(0) NULL,
    `acceptdate` DATETIME(0) NULL,
    `indate` DATETIME(0) NULL,
    `outdate` DATETIME(0) NULL,
    `enabledate` DATETIME(0) NULL,
    `assetsource` VARCHAR(32) NULL,
    `iscostaccounting` BOOLEAN NULL DEFAULT false,
    `isimported` BOOLEAN NULL DEFAULT false,
    `ismedicaluse` BOOLEAN NULL DEFAULT false,
    `isusing` BOOLEAN NULL DEFAULT true,
    `use_status` VARCHAR(32) NULL,
    `assetclass` VARCHAR(32) NULL,
    `assetsubclass` VARCHAR(32) NULL,
    `devicecategory` VARCHAR(32) NULL,
    `financialclass` VARCHAR(32) NULL,
    `class68` VARCHAR(32) NULL,
    `medicalinstrumentsclass` VARCHAR(32) NULL,
    `classattr` VARCHAR(32) NULL,
    `isaccessory` BOOLEAN NULL DEFAULT false,
    `accessoryclass` VARCHAR(32) NULL,
    `isspecial` BOOLEAN NULL DEFAULT false,
    `specialclass` VARCHAR(32) NULL,
    `isemergency` BOOLEAN NULL DEFAULT false,
    `emergencyclass` VARCHAR(32) NULL,
    `supplier` VARCHAR(100) NULL,
    `suppliercontract` VARCHAR(50) NULL,
    `suppliertel` VARCHAR(15) NULL,
    `manufacturer` VARCHAR(100) NULL,
    `brand` VARCHAR(50) NULL,
    `productionplace` VARCHAR(100) NULL,
    `aftersaletel` VARCHAR(15) NULL,
    `aftersaleengineer` VARCHAR(50) NULL,
    `dateproduction` DATE NULL,
    `service_life` INTEGER NULL,
    `equipment_value` DOUBLE NULL,
    `financial_value` DOUBLE NULL,
    `teaching_value` DOUBLE NULL,
    `research_value` DOUBLE NULL,
    `selfraised_value` DOUBLE NULL,
    `othe_value` DOUBLE NULL,
    `depreciationmethod` VARCHAR(32) NULL,
    `rmv_value_rate` DOUBLE NULL,
    `configuration` VARCHAR(200) NULL,
    `devicepic` VARCHAR(400) NULL,
    `task_owner` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_devicecategory` (
    `id` VARCHAR(32) NOT NULL,
    `category_code` VARCHAR(20) NULL,
    `category_name` VARCHAR(50) NOT NULL,
    `superior_id` VARCHAR(32) NULL,
    `devicecategory_level` INTEGER NULL,
    `sortorder` INTEGER NULL DEFAULT 0,
    `isusing` BOOLEAN NULL DEFAULT true,
    `manage_affiliation` VARCHAR(32) NULL,
    `respon_affiliation` VARCHAR(32) NULL,
    `category_fullname` VARCHAR(200) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_item` (
    `id` VARCHAR(32) NOT NULL,
    `template_id` VARCHAR(32) NOT NULL,
    `item_name` VARCHAR(50) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_itemcontent` (
    `id` VARCHAR(32) NOT NULL,
    `item_id` VARCHAR(32) NOT NULL,
    `content` VARCHAR(400) NULL,
    `deviceinspection_type` VARCHAR(32) NULL,
    `maxvalue1` DOUBLE NULL,
    `minvalue` DOUBLE NULL,
    `uint` VARCHAR(20) NULL,
    `itemradioitem_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_itemradioitem` (
    `id` VARCHAR(32) NOT NULL,
    `itemcontent_id` VARCHAR(32) NOT NULL,
    `prompt` VARCHAR(100) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_plan` (
    `id` VARCHAR(32) NOT NULL,
    `plan_name` VARCHAR(50) NOT NULL,
    `devicecategory_id` VARCHAR(32) NOT NULL,
    `template_id` VARCHAR(32) NOT NULL,
    `inspection_period` VARCHAR(32) NOT NULL,
    `start_month` INTEGER NULL,
    `start_day` INTEGER NULL,
    `workdaycount` INTEGER NULL,
    `start_date` DATE NULL,
    `start_time` TIME(0) NULL,
    `end_time` TIME(0) NULL,
    `frequency` INTEGER NULL,
    `minimuminterval` INTEGER NULL,
    `isactive` BOOLEAN NULL DEFAULT true,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `ispatrol` BOOLEAN NULL DEFAULT true,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_plan_device` (
    `id` VARCHAR(32) NOT NULL,
    `plan_id` VARCHAR(32) NOT NULL,
    `device_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_tasksheet` (
    `id` VARCHAR(32) NOT NULL,
    `sheet_code` VARCHAR(20) NOT NULL,
    `device_id` VARCHAR(32) NOT NULL,
    `device_name` VARCHAR(200) NOT NULL,
    `inspectiontype` VARCHAR(32) NULL,
    `template_id` VARCHAR(32) NULL,
    `plan_id` VARCHAR(32) NOT NULL,
    `start_time` DATETIME(0) NULL,
    `end_time` DATETIME(0) NULL,
    `finish_time` DATETIME(0) NULL,
    `finish_pic` VARCHAR(400) NULL,
    `finish_wav` VARCHAR(400) NULL,
    `finish_word` VARCHAR(400) NULL,
    `finish_conclusion` VARCHAR(32) NULL,
    `credible` VARCHAR(32) NULL,
    `iscreatesheet` BOOLEAN NULL DEFAULT false,
    `tasksheet_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `ispatrol` BOOLEAN NULL DEFAULT true,
    `tasksheet_state` VARCHAR(32) NULL,
    `undertake_person` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_tasksheet_itemcontentconclusion` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `item_id` VARCHAR(32) NULL,
    `itemcontent_id` VARCHAR(32) NULL,
    `inspection_type` VARCHAR(32) NULL,
    `maxvalue` DOUBLE NULL,
    `minvalue` DOUBLE NULL,
    `uint` VARCHAR(20) NULL,
    `currentvalue` DOUBLE NULL,
    `itemradioitem_id` VARCHAR(32) NULL,
    `current_result` VARCHAR(100) NULL,
    `itemfinish_conclusion` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_tasksheet_serviceitem` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `service_item` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_tasksheet_statetrack` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `acceptance_person` VARCHAR(32) NULL,
    `tasksheet_state` VARCHAR(32) NULL DEFAULT '01',
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_tasksheet_undertake` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_statetrack_id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `undertake_person` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_deviceinspection_template` (
    `id` VARCHAR(32) NOT NULL,
    `templatename` VARCHAR(50) NOT NULL,
    `devicecategory_id` VARCHAR(32) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `ispatrol` BOOLEAN NULL DEFAULT true,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentmaintenance_item` (
    `id` VARCHAR(32) NOT NULL,
    `template_id` VARCHAR(32) NOT NULL,
    `item_name` VARCHAR(50) NULL,
    `content` VARCHAR(400) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentmaintenance_plan` (
    `id` VARCHAR(32) NOT NULL,
    `plan_name` VARCHAR(50) NOT NULL,
    `maintenancetype` VARCHAR(32) NULL,
    `template_id` VARCHAR(32) NULL,
    `planstarttime` DATE NULL,
    `planendtime` DATE NULL,
    `responsibleunittype` VARCHAR(32) NULL,
    `responsibleunitname` VARCHAR(100) NULL,
    `responsibleunitperson` VARCHAR(20) NULL,
    `responsibleunittel` VARCHAR(15) NULL,
    `maintain_period_id` VARCHAR(32) NULL,
    `start_month` INTEGER NULL,
    `start_day` INTEGER NULL,
    `start_day2` INTEGER NULL,
    `workdaycount` INTEGER NULL,
    `start_date` DATE NULL,
    `isactive` BOOLEAN NULL DEFAULT true,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentmaintenance_plan_device` (
    `id` VARCHAR(32) NOT NULL,
    `plan_id` VARCHAR(32) NOT NULL,
    `device_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentmaintenance_tasksheet` (
    `id` VARCHAR(32) NOT NULL,
    `sheet_code` VARCHAR(20) NOT NULL,
    `device_id` VARCHAR(32) NOT NULL,
    `assetcode` VARCHAR(50) NULL,
    `assetname` VARCHAR(100) NULL,
    `plan_id` VARCHAR(32) NULL,
    `maintenancetype` VARCHAR(32) NULL,
    `template_id` VARCHAR(32) NULL,
    `devicecategory_id` VARCHAR(32) NULL,
    `start_time` DATETIME(0) NULL,
    `end_time` DATETIME(0) NULL,
    `finish_time` DATETIME(0) NULL,
    `finish_pic` VARCHAR(400) NULL,
    `finish_wav` VARCHAR(400) NULL,
    `finish_word` VARCHAR(400) NULL,
    `finish_conclusion` VARCHAR(32) NULL,
    `credible` VARCHAR(32) NULL,
    `iscreatesheet` BOOLEAN NULL DEFAULT false,
    `tasksheet_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasksheet_state` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentmaintenance_tasksheet_itemcontentconclusion` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `item_id` VARCHAR(32) NULL,
    `itemfinish_word` VARCHAR(200) NULL,
    `itemfinish_conclusion` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentmaintenance_tasksheet_serviceitem` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `service_item` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentmaintenance_tasksheet_statetrack` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `acceptance_person` VARCHAR(32) NULL,
    `tasksheet_state` VARCHAR(32) NULL DEFAULT '01',
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    INDEX `index_tasksheet_id`(`tasksheet_id`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentmaintenance_tasksheet_undertake` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_statetrack_id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `undertake_person` VARCHAR(32) NULL,
    `undertakeunittype` VARCHAR(32) NULL,
    `undertakeunitname` VARCHAR(100) NULL,
    `undertakeunitperson` VARCHAR(20) NULL,
    `undertakeunittel` VARCHAR(15) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentmaintenance_template` (
    `id` VARCHAR(32) NOT NULL,
    `templatename` VARCHAR(50) NOT NULL,
    `devicecategory_id` VARCHAR(32) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentrepair_tasksheet` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NULL DEFAULT '02',
    `sheet_code` VARCHAR(20) NULL,
    `dec_tel` VARCHAR(15) NULL,
    `dec_dept` VARCHAR(32) NULL,
    `declarer` VARCHAR(32) NULL,
    `declarer_post` VARCHAR(32) NULL,
    `dec_time` DATETIME(0) NULL,
    `dec_source` VARCHAR(32) NULL,
    `dec_channel` VARCHAR(32) NULL,
    `urgent_degree` VARCHAR(32) NULL,
    `device_id` VARCHAR(32) NULL,
    `grid_id` VARCHAR(32) NULL,
    `position` VARCHAR(100) NULL,
    `devicecategory` VARCHAR(32) NULL,
    `task_owner` VARCHAR(32) NULL,
    `ask_pic` VARCHAR(400) NULL,
    `ask_wav` VARCHAR(400) NULL,
    `ask_word` VARCHAR(400) NULL,
    `is_ordered` BOOLEAN NULL DEFAULT false,
    `ordered_datetime` DATETIME(0) NULL,
    `needcontact_dept` VARCHAR(32) NULL,
    `needcontact` VARCHAR(20) NULL,
    `needcontact_tel` VARCHAR(15) NULL,
    `isreworksheet` BOOLEAN NULL DEFAULT false,
    `reponse_rank` VARCHAR(400) NULL,
    `exteam_id` VARCHAR(32) NULL,
    `excompany_id` VARCHAR(32) NULL,
    `finish_time` DATETIME(0) NULL,
    `finish_pic` VARCHAR(400) NULL,
    `finish_wav` VARCHAR(400) NULL,
    `finish_word` VARCHAR(400) NULL,
    `satisfaction_evaluation` VARCHAR(32) NULL,
    `satisfaction_content` VARCHAR(200) NULL,
    `issuperviset` BOOLEAN NULL DEFAULT false,
    `supervisor_id` VARCHAR(32) NULL,
    `superviset_time` DATETIME(0) NULL,
    `isconfirm` BOOLEAN NULL DEFAULT false,
    `confirmingperson_id` VARCHAR(32) NULL,
    `confirm_time` DATETIME(0) NULL,
    `iscomplaint` BOOLEAN NULL DEFAULT false,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasksheet_state` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentrepair_tasksheet_serviceitem` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `service_item` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentrepair_tasksheet_statetrack` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `acceptance_person` VARCHAR(32) NULL,
    `tasksheet_state` VARCHAR(32) NULL DEFAULT '01',
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_equipmentrepair_tasksheet_undertake` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_statetrack_id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `undertake_person` VARCHAR(32) NULL,
    `undertakeunittype` VARCHAR(32) NULL,
    `undertakeunitname` VARCHAR(100) NULL,
    `undertakeunitperson` VARCHAR(20) NULL,
    `undertakeunittel` VARCHAR(15) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_excompany` (
    `id` VARCHAR(32) NOT NULL,
    `excompany_name` VARCHAR(100) NOT NULL,
    `excompany_legal` VARCHAR(50) NULL,
    `excompany_leader_name` VARCHAR(50) NULL,
    `excompany_leader_tel` VARCHAR(15) NULL,
    `excompany_leader_ID` VARCHAR(32) NULL,
    `excompany_staff_amount` INTEGER NULL,
    `excompany_service_startdate` DATE NULL,
    `excompany_service_enddate` DATE NULL,
    `excompany_certificate` VARCHAR(400) NULL,
    `excompany_complaint_tel` VARCHAR(15) NULL,
    `services_remark` VARCHAR(400) NULL,
    `excompany_address` VARCHAR(200) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_excompany_services` (
    `id` VARCHAR(32) NOT NULL,
    `exservice_name` VARCHAR(32) NOT NULL,
    `excompany_id` VARCHAR(32) NULL,
    `service_id` VARCHAR(32) NULL,
    `leader_name` VARCHAR(20) NULL,
    `leader_tel` VARCHAR(15) NULL,
    `leader_ID` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_exstaff_restaurantcertificate` (
    `id` VARCHAR(32) NOT NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `restaurantcertificate_id` VARCHAR(32) NULL,
    `restaurantcertificate_pic` VARCHAR(400) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_exstaff_skillcertificate` (
    `id` VARCHAR(32) NOT NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `skillcertificate_id` VARCHAR(32) NULL,
    `skillcertificate_pic` VARCHAR(400) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_exteam` (
    `id` VARCHAR(32) NOT NULL,
    `exteam_name` VARCHAR(100) NOT NULL,
    `exteam_code` VARCHAR(20) NOT NULL,
    `exservices_id` VARCHAR(32) NOT NULL,
    `excompany_id` VARCHAR(32) NOT NULL,
    `service_id` VARCHAR(32) NULL,
    `exteam_leader_name` VARCHAR(20) NULL,
    `exteam_leader_mobile` VARCHAR(15) NULL,
    `exteam_tel` VARCHAR(15) NULL,
    `exteam_leader_id` VARCHAR(32) NULL,
    `exteam_staff_amount` INTEGER NULL,
    `super_id` VARCHAR(32) NULL,
    `exteam_level` INTEGER NULL,
    `exteam_fullname` VARCHAR(400) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_exteam_grid` (
    `id` VARCHAR(32) NOT NULL,
    `team_id` VARCHAR(32) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `grid_code` VARCHAR(30) NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_grid` (
    `id` VARCHAR(32) NOT NULL,
    `grid_code` VARCHAR(30) NOT NULL,
    `grid_name` VARCHAR(100) NOT NULL,
    `superior_grid_id` VARCHAR(32) NULL,
    `dept_id` VARCHAR(32) NULL,
    `grid_level` INTEGER NULL,
    `grid_area` DOUBLE NULL,
    `grid_placeclass_id` VARCHAR(32) NULL,
    `grid_picture` VARCHAR(400) NULL,
    `grid_fullname` VARCHAR(400) NULL,
    `grid_centerX` DOUBLE NULL,
    `grid_centerY` DOUBLE NULL,
    `grid_radius` INTEGER NULL DEFAULT 50,
    `grid_leader_ID` VARCHAR(32) NULL,
    `grid_leader_name` VARCHAR(20) NULL,
    `grid_leader_tel` VARCHAR(15) NULL,
    `grid_tel` VARCHAR(100) NULL,
    `abbre` VARCHAR(200) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_grid_tel` (
    `id` VARCHAR(32) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `grid_tel` VARCHAR(15) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_hosp_functionlist` (
    `id` VARCHAR(32) NOT NULL,
    `hosp_id` VARCHAR(32) NOT NULL,
    `function_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_hosp_params` (
    `id` VARCHAR(32) NOT NULL,
    `clearinspectionmode` VARCHAR(32) NULL,
    `isCenterdispatchedworker` BOOLEAN NULL DEFAULT false,
    `isCenterdispatchedworkerForDevice` BOOLEAN NULL DEFAULT false,
    `isCenterdispatchedworkerForClearinspection` BOOLEAN NULL DEFAULT false,
    `isCenterdispatchedworkerForSecurityinspection` BOOLEAN NULL DEFAULT false,
    `dispatchedworkerinterval` INTEGER NULL DEFAULT 30,
    `evaluateinterval` INTEGER NULL DEFAULT 48,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_hospfunctions` (
    `id` VARCHAR(32) NOT NULL,
    `functionname` VARCHAR(50) NOT NULL,
    `functionurl` VARCHAR(255) NULL,
    `functiondesc` VARCHAR(255) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_hospital_basic_information` (
    `id` VARCHAR(32) NOT NULL,
    `hosp_code` VARCHAR(20) NOT NULL,
    `hosp_name` VARCHAR(100) NOT NULL,
    `hosp_certificate_number` VARCHAR(30) NULL,
    `hosp_build_date` DATE NULL,
    `hosp_authorized_strength` INTEGER NULL,
    `hosp_build_area` DOUBLE NULL,
    `hosp_emergency_area` DOUBLE NULL,
    `hosp_bed_amount` INTEGER NULL,
    `hosp_outpatient_volume` INTEGER NULL,
    `pid` VARCHAR(32) NULL,
    `cid` VARCHAR(32) NULL,
    `county_id` VARCHAR(32) NULL,
    `hosp_detail_address` VARCHAR(255) NULL,
    `hosp_parking_amount` INTEGER NULL,
    `hosp_police_amount` INTEGER NULL,
    `hosp_security_amount` INTEGER NULL,
    `hosp_security_company_id` VARCHAR(32) NULL,
    `hosp_president` VARCHAR(255) NULL,
    `hosp_representative` VARCHAR(255) NULL,
    `hosp_legal_name` VARCHAR(20) NULL,
    `hosp_main_leadership_team` VARCHAR(255) NULL,
    `hosp_affair_chief` VARCHAR(20) NULL,
    `hosp_affair_chief_mobile` VARCHAR(15) NULL,
    `hosp_affair_chief_tel` VARCHAR(15) NULL,
    `hosp_affair_chief_email` VARCHAR(100) NULL,
    `hosp_security_chief` VARCHAR(20) NULL,
    `hosp_security_chief_mobile` VARCHAR(15) NULL,
    `hosp_badge` VARCHAR(400) NULL,
    `hosp_logo` VARCHAR(400) NULL,
    `hosp_app_logo` VARCHAR(400) NULL,
    `hosp_picture` VARCHAR(400) NULL,
    `hosp_serve_center_tel` VARCHAR(15) NULL,
    `hosp_staff_audit_tel` VARCHAR(15) NULL,
    `hosp_introduction` VARCHAR(500) NULL,
    `hosp_centerX` DOUBLE NULL,
    `hosp_centerY` DOUBLE NULL,
    `hosp_radius` INTEGER NULL DEFAULT 50,
    `hosp_url` VARCHAR(20) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `hosp_president_tel` VARCHAR(15) NULL,
    `hosp_president_ID` VARCHAR(32) NULL,
    `excompany_logo` VARCHAR(200) NULL,
    `excompany_name` VARCHAR(50) NULL,
    `hosp_QRcodefile` VARCHAR(400) NULL,
    `excompany_tel` VARCHAR(15) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_ibeacon` (
    `id` VARCHAR(32) NOT NULL,
    `ibeacon_name` VARCHAR(32) NULL,
    `ibeacon_UUID` VARCHAR(36) NULL,
    `ibeacon_Marj` VARCHAR(50) NULL,
    `ibeacon_Minj` VARCHAR(50) NULL,
    `ibeacon_RSSI` VARCHAR(10) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `grid_id` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `isusing` BOOLEAN NULL DEFAULT true,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_material_tasktype` (
    `id` VARCHAR(32) NOT NULL,
    `material_id` VARCHAR(32) NOT NULL,
    `tasktype_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_materialbill` (
    `id` VARCHAR(32) NOT NULL,
    `material_name` VARCHAR(50) NOT NULL,
    `material_spec` VARCHAR(50) NULL,
    `material_price` DOUBLE NULL,
    `material_stock` INTEGER NULL,
    `category_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasktype_id` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_materialcategory` (
    `id` VARCHAR(32) NOT NULL,
    `materialcategory_name` VARCHAR(50) NOT NULL,
    `materialcategory_code` VARCHAR(20) NOT NULL,
    `superior_id` VARCHAR(32) NULL,
    `materialcategory_level` INTEGER NULL,
    `materialcategory_fullname` VARCHAR(200) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasktype_id` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_materialconsumerecord` (
    `id` VARCHAR(32) NOT NULL,
    `material_id` VARCHAR(32) NOT NULL,
    `tasksheettype_id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `material_price` DOUBLE NULL,
    `consumecount` INTEGER NULL DEFAULT 0,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `useuserid` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `category_id` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_materialstoragerecord` (
    `id` VARCHAR(32) NOT NULL,
    `category_id` VARCHAR(32) NULL,
    `material_id` VARCHAR(32) NOT NULL,
    `storagecount` INTEGER NULL DEFAULT 0,
    `useuserid` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `hosp_ID` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_month_schedule` (
    `id` VARCHAR(32) NOT NULL,
    `exteam_id` VARCHAR(32) NOT NULL,
    `post_id` VARCHAR(32) NOT NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `exstaff_name` VARCHAR(20) NULL,
    `exstaff_phone` VARCHAR(15) NULL,
    `start_date` DATE NULL,
    `dates` VARCHAR(100) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_notice` (
    `id` VARCHAR(32) NOT NULL,
    `title` VARCHAR(200) NOT NULL,
    `keywords` VARCHAR(100) NOT NULL,
    `notice_type` VARCHAR(32) NOT NULL,
    `notice_status` VARCHAR(32) NOT NULL,
    `notice_content` VARCHAR(200) NOT NULL,
    `receivertype` VARCHAR(32) NOT NULL,
    `sendtype` VARCHAR(32) NOT NULL,
    `staff_name` VARCHAR(50) NOT NULL,
    `staff_id` VARCHAR(32) NOT NULL,
    `publish_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_notice_receiver` (
    `id` VARCHAR(32) NOT NULL,
    `noticeid` VARCHAR(32) NULL,
    `noticereceiverid` VARCHAR(32) NULL,
    `receivertype` VARCHAR(32) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_page` (
    `id` VARCHAR(32) NOT NULL,
    `page_url` VARCHAR(255) NULL,
    `page_name` VARCHAR(255) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_role` (
    `id` VARCHAR(32) NOT NULL,
    `role_name` VARCHAR(20) NOT NULL,
    `role_dec` VARCHAR(100) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_role_page` (
    `id` VARCHAR(32) NOT NULL,
    `role_id` VARCHAR(32) NOT NULL,
    `page_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_scheduleplan` (
    `id` VARCHAR(32) NOT NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `user_name` VARCHAR(20) NOT NULL DEFAULT '',
    `user_mobile` VARCHAR(15) NULL,
    `post_id` VARCHAR(32) NULL,
    `start_date` DATE NULL,
    `work_time` VARCHAR(400) NULL,
    `exteam_id` VARCHAR(32) NULL,
    `service_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_schedulework` (
    `id` VARCHAR(32) NOT NULL,
    `workscheduling_id` VARCHAR(32) NOT NULL,
    `classes` VARCHAR(20) NULL,
    `sche_date` DATE NOT NULL,
    `week` INTEGER NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_item` (
    `id` VARCHAR(32) NOT NULL,
    `template_id` VARCHAR(32) NOT NULL,
    `item_name` VARCHAR(50) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_itemcontent` (
    `id` VARCHAR(32) NOT NULL,
    `item_id` VARCHAR(32) NOT NULL,
    `content` VARCHAR(400) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_person` (
    `id` VARCHAR(32) NOT NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `isleader` BOOLEAN NULL DEFAULT false,
    `isactive` BOOLEAN NULL DEFAULT true,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_plan` (
    `id` VARCHAR(32) NOT NULL,
    `plan_name` VARCHAR(50) NOT NULL,
    `grid_placeclass_id` VARCHAR(32) NULL,
    `template_id` VARCHAR(32) NOT NULL,
    `inspection_period` VARCHAR(32) NOT NULL,
    `start_month` INTEGER NULL,
    `start_day` INTEGER NULL,
    `workdaycount` INTEGER NULL,
    `start_date` DATE NULL,
    `start_time` TIME(0) NULL,
    `end_time` TIME(0) NULL,
    `frequency` INTEGER NULL,
    `minimuminterval` INTEGER NULL,
    `isactive` BOOLEAN NULL DEFAULT true,
    `ispatrol` TINYINT NULL DEFAULT 2,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_plan_grid` (
    `id` VARCHAR(32) NOT NULL,
    `plan_id` VARCHAR(32) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_tasksheet` (
    `id` VARCHAR(32) NOT NULL,
    `sheet_code` VARCHAR(20) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `grid_name` VARCHAR(200) NOT NULL,
    `grid_placeclass_id` VARCHAR(32) NULL,
    `template_id` VARCHAR(32) NOT NULL,
    `plan_id` VARCHAR(32) NOT NULL,
    `start_time` DATETIME(0) NULL,
    `end_time` DATETIME(0) NULL,
    `ispatrol` TINYINT NULL DEFAULT 2,
    `finish_time` DATETIME(0) NULL,
    `finish_pic` VARCHAR(400) NULL,
    `finish_wav` VARCHAR(400) NULL,
    `finish_word` VARCHAR(400) NULL,
    `finish_conclusion` VARCHAR(32) NULL,
    `credible` VARCHAR(32) NULL,
    `iscreatesheet` BOOLEAN NULL DEFAULT false,
    `tasksheet_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasksheet_state` VARCHAR(32) NULL,
    `undertake_person` VARCHAR(32) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_tasksheet_itemconclusion` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `item_id` VARCHAR(32) NULL,
    `itemfinish_pic` VARCHAR(400) NULL,
    `itemfinish_wav` VARCHAR(400) NULL,
    `itemfinish_word` VARCHAR(400) NULL,
    `itemfinish_conclusion` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_tasksheet_serviceitem` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `service_item` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_tasksheet_statetrack` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `acceptance_person` VARCHAR(32) NULL,
    `tasksheet_state` VARCHAR(32) NULL DEFAULT '01',
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_tasksheet_undertake` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_statetrack_id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `undertake_person` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_securitypatrol_template` (
    `id` VARCHAR(32) NOT NULL,
    `templatename` VARCHAR(50) NOT NULL,
    `grid_placeclass_id` VARCHAR(32) NULL,
    `ispatrol` TINYINT NULL DEFAULT 2,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_serialnumber` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `Name` VARCHAR(50) NOT NULL,
    `IDValue` INTEGER NOT NULL DEFAULT 1,
    `StrLen` INTEGER NOT NULL DEFAULT 4,
    `Reset_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `Resetflagperday` BOOLEAN NULL DEFAULT false,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_servicebill` (
    `id` VARCHAR(32) NOT NULL,
    `serviceitem_name` VARCHAR(50) NOT NULL,
    `category_id` VARCHAR(32) NULL,
    `service_type_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_serviceitemcategory` (
    `id` VARCHAR(32) NOT NULL,
    `serviceitemcategory_name` VARCHAR(50) NOT NULL,
    `serviceitemcategory_code` VARCHAR(20) NOT NULL,
    `superior_id` VARCHAR(32) NULL,
    `service_type_id` VARCHAR(32) NULL,
    `serviceitemcategory_level` INTEGER NULL,
    `serviceitemcategory_fullname` VARCHAR(200) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_today_schedule` (
    `id` VARCHAR(32) NOT NULL,
    `exteam_id` VARCHAR(32) NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `exstaff_name` VARCHAR(20) NULL,
    `exstaff_phone` VARCHAR(15) NULL,
    `workscheduling_id` VARCHAR(32) NULL,
    `start_date` DATE NULL,
    `work_time` TIME(0) NULL,
    `end_date` DATE NULL,
    `nowork_time` TIME(0) NULL,
    `leave_time` DATETIME(0) NULL,
    `back_time` DATETIME(0) NULL,
    `lea` DATETIME(0) NULL,
    `leave_period` VARCHAR(200) NULL,
    `service_location` VARCHAR(400) NULL,
    `current_state` VARCHAR(32) NULL,
    `orders_received` INTEGER NULL,
    `orders_completed` INTEGER NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `grid_code` VARCHAR(30) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_transport_tasksheet` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NULL DEFAULT '03',
    `sheet_code` VARCHAR(20) NOT NULL,
    `dec_tel` VARCHAR(15) NULL,
    `dec_dept` VARCHAR(32) NULL,
    `declarer` VARCHAR(32) NULL,
    `declarer_post` VARCHAR(32) NULL,
    `dec_time` DATETIME(0) NULL,
    `dec_source` VARCHAR(32) NULL,
    `dec_channel` VARCHAR(32) NULL,
    `urgent_degree` VARCHAR(32) NULL,
    `service_place` VARCHAR(32) NULL,
    `service_dept` VARCHAR(32) NULL,
    `ask_pic` VARCHAR(400) NULL,
    `ask_wav` VARCHAR(400) NULL,
    `ask_word` VARCHAR(400) NULL,
    `is_ordered` BOOLEAN NULL DEFAULT false,
    `ordered_datetime` DATETIME(0) NULL,
    `needcontact_dept` VARCHAR(32) NULL,
    `needcontact` VARCHAR(20) NULL,
    `needcontact_tel` VARCHAR(15) NULL,
    `isreworksheet` BOOLEAN NULL DEFAULT false,
    `reponse_rank` VARCHAR(400) NULL,
    `exteam_id` VARCHAR(32) NULL,
    `excompany_id` VARCHAR(32) NULL,
    `finish_time` DATETIME(0) NULL,
    `finish_pic` VARCHAR(400) NULL,
    `finish_wav` VARCHAR(400) NULL,
    `finish_word` VARCHAR(400) NULL,
    `satisfaction_evaluation` VARCHAR(32) NULL,
    `satisfaction_content` VARCHAR(200) NULL,
    `issuperviset` BOOLEAN NULL DEFAULT false,
    `supervisor_id` VARCHAR(32) NULL,
    `superviset_time` DATETIME(0) NULL,
    `isconfirm` BOOLEAN NULL DEFAULT false,
    `confirmingperson_id` VARCHAR(32) NULL,
    `confirm_time` DATETIME(0) NULL,
    `confirm_content` VARCHAR(400) NULL,
    `confirm_wav` VARCHAR(400) NULL,
    `iscomplaint` BOOLEAN NULL DEFAULT false,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `tasksheet_state` VARCHAR(32) NULL,
    `isautodispatching` BOOLEAN NULL DEFAULT false,
    `user_type` INTEGER NULL DEFAULT 2,
    `finish_rank` VARCHAR(32) NULL,
    `undertake_person` VARCHAR(32) NULL,
    `org_id` BIGINT NULL DEFAULT 0,
    `campus_id` BIGINT NULL DEFAULT 0,
    `dec_name` VARCHAR(100) NULL,
    `service_dept_name` VARCHAR(100) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_transport_tasksheet_additionalinfo` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `outnumber` INTEGER NULL DEFAULT 1,
    `endservice_place` VARCHAR(32) NULL,
    `endservice_dept` VARCHAR(32) NULL,
    `content` VARCHAR(200) NULL,
    `confirm_img` VARCHAR(400) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_transport_tasksheet_carryingtools` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `carryingtools` VARCHAR(32) NULL,
    `carryingtools_count` INTEGER NULL DEFAULT 1,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_transport_tasksheet_drugdto` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `dto_id` MEDIUMTEXT NULL,
    `org_id` MEDIUMTEXT NULL,
    `campus_id` MEDIUMTEXT NULL,
    `area_id` MEDIUMTEXT NULL,
    `area_name` VARCHAR(200) NULL,
    `doctor_order_id` MEDIUMTEXT NULL,
    `item_id` MEDIUMTEXT NULL,
    `item_name` VARCHAR(100) NULL,
    `doctor_order_name` VARCHAR(100) NULL,
    `management_category_code` VARCHAR(100) NULL,
    `doctor_order_flag` VARCHAR(100) NULL,
    `once_dosage` DECIMAL(10, 0) NULL,
    `once_dosage_unit` VARCHAR(20) NULL,
    `once_dosage_unit_type` INTEGER NULL,
    `patient_id` MEDIUMTEXT NULL,
    `patient_name` VARCHAR(20) NULL,
    `medical_record_no` VARCHAR(50) NULL,
    `healthcare_type` VARCHAR(50) NULL,
    `healthcare_record_id` MEDIUMTEXT NULL,
    `order_id` MEDIUMTEXT NULL,
    `specifications` VARCHAR(100) NULL,
    `frequency_id` MEDIUMTEXT NULL,
    `frequency_name` VARCHAR(50) NULL,
    `executive_status` VARCHAR(20) NULL,
    `medication_status` VARCHAR(20) NULL,
    `execute_operator_id` MEDIUMTEXT NULL,
    `execute_operator_name` VARCHAR(20) NULL,
    `is_long_term` INTEGER NULL,
    `usage_id` MEDIUMTEXT NULL,
    `usage_name` VARCHAR(50) NULL,
    `usage_type` VARCHAR(50) NULL,
    `plan_time` DATETIME(0) NULL,
    `real_start_time` DATETIME(0) NULL,
    `real_end_time` DATETIME(0) NULL,
    `result_description` VARCHAR(100) NULL,
    `barcode` VARCHAR(100) NULL,
    `execute_dept_id` MEDIUMTEXT NULL,
    `execute_dept_name` VARCHAR(100) NULL,
    `cancel_time` DATETIME(0) NULL,
    `dto_create_time` DATETIME(0) NULL,
    `dtoremark` VARCHAR(100) NULL,
    `operate_dept_id` MEDIUMTEXT NULL,
    `operate_dept_name` VARCHAR(200) NULL,
    `search_status` VARCHAR(50) NULL,
    `print_status` BOOLEAN NULL DEFAULT false,
    `execute_source_type` VARCHAR(50) NULL,
    `extistflag` BOOLEAN NULL DEFAULT false,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_transport_tasksheet_serviceitem` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `service_item` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_transport_tasksheet_serviceitemcontent` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `service_content` VARCHAR(32) NULL,
    `service_number` INTEGER NULL DEFAULT 0,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_transport_tasksheet_specimendto` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `dto_id` MEDIUMTEXT NULL,
    `org_id` MEDIUMTEXT NULL,
    `campus_id` MEDIUMTEXT NULL,
    `area_id` MEDIUMTEXT NULL,
    `area_name` VARCHAR(200) NULL,
    `item_id` MEDIUMTEXT NULL,
    `item_name` VARCHAR(100) NULL,
    `barcode` VARCHAR(100) NULL,
    `dto_create_time` DATETIME(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
    `dtoremark` VARCHAR(100) NULL,
    `operate_dept_id` MEDIUMTEXT NULL,
    `operate_dept_name` VARCHAR(200) NULL,
    `dec_dept` VARCHAR(32) NULL,
    `service_place` VARCHAR(32) NULL,
    `urgent_degree` VARCHAR(32) NULL,
    `urgent_degree_name` VARCHAR(50) NULL,
    `ask_pic` VARCHAR(400) NULL,
    `finish_pic` VARCHAR(400) NULL,
    `dec_name` VARCHAR(100) NULL,
    `service_dept_name` VARCHAR(100) NULL,
    `tasksheet_state` VARCHAR(32) NULL DEFAULT '01',
    `undertake_person` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_transport_tasksheet_statetrack` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `acceptance_person` VARCHAR(32) NULL,
    `tasksheet_state` VARCHAR(32) NULL DEFAULT '01',
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_transport_tasksheet_undertake` (
    `id` VARCHAR(32) NOT NULL,
    `tasksheet_statetrack_id` VARCHAR(32) NOT NULL,
    `tasksheet_id` VARCHAR(32) NOT NULL,
    `tasksheet_type` VARCHAR(32) NOT NULL,
    `undertake_person` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_user` (
    `id` VARCHAR(32) NOT NULL,
    `openid` VARCHAR(120) NULL,
    `user_name` VARCHAR(20) NOT NULL DEFAULT '',
    `user_sex` VARCHAR(32) NULL,
    `user_mobile` VARCHAR(15) NULL,
    `user_login_name` VARCHAR(20) NOT NULL DEFAULT '',
    `user_login_nickname` VARCHAR(20) NULL,
    `user_password` VARCHAR(32) NULL,
    `user_pic_path` VARCHAR(400) NULL,
    `is_initial` BOOLEAN NULL DEFAULT true,
    `user_activestate` BOOLEAN NULL DEFAULT true,
    `user_type` INTEGER NULL DEFAULT 1,
    `staff_identification` VARCHAR(20) NULL,
    `staff_code` VARCHAR(20) NULL,
    `dept_id` VARCHAR(32) NULL,
    `isuse_medicalhelp` BOOLEAN NULL DEFAULT true,
    `staff_picture` VARCHAR(400) NULL,
    `staff_tel` VARCHAR(15) NULL,
    `staff_birthday` DATE NULL,
    `staff_email` VARCHAR(50) NULL,
    `staff_adminis_position` VARCHAR(32) NULL,
    `staff_technical_position` VARCHAR(32) NULL,
    `staff_education_position` VARCHAR(32) NULL,
    `staff_tutor_type` VARCHAR(32) NULL,
    `staff_degree` VARCHAR(32) NULL,
    `staff_weixin` VARCHAR(50) NULL,
    `staff_qq` VARCHAR(20) NULL,
    `exstaff_jobNo` VARCHAR(20) NULL,
    `exstaff_jobstate` VARCHAR(32) NULL,
    `excompany_id` VARCHAR(32) NULL,
    `exteam_id` VARCHAR(32) NULL,
    `exstaff_employstartdate` DATETIME(0) NULL,
    `exstaff_employenddate` DATETIME(0) NULL,
    `exstaff_pic` VARCHAR(400) NULL,
    `exstaff_technicalwork` VARCHAR(32) NULL,
    `exstaff_expertise` VARCHAR(400) NULL,
    `exstaff_leadname` VARCHAR(50) NULL,
    `exstaff_stature` DOUBLE NULL,
    `exstaff_weight` DOUBLE NULL,
    `exstaff_shoesize` DOUBLE NULL,
    `exstaff_emercontactname` VARCHAR(20) NULL,
    `exstaff_emercontacttel` VARCHAR(15) NULL,
    `exstaff_emercontactrelationship` VARCHAR(100) NULL,
    `exstaff_birthday` DATETIME(0) NULL,
    `exstaff_tel` VARCHAR(15) NULL,
    `exstaff_email` VARCHAR(200) NULL,
    `exstaff_nation` VARCHAR(32) NULL,
    `exstaff_native_place` VARCHAR(100) NULL,
    `exstaff_marriage_state` VARCHAR(32) NULL,
    `exstaff_identify_id` VARCHAR(20) NULL,
    `exstaff_degree` VARCHAR(32) NULL,
    `exstaff_weixin_id` VARCHAR(100) NULL,
    `exstaff_qq_id` VARCHAR(20) NULL,
    `exstaff_address` VARCHAR(255) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(500) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `assets_role` TINYINT NULL DEFAULT 1,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_user_grid` (
    `id` VARCHAR(32) NOT NULL,
    `user_id` VARCHAR(32) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_user_hosp` (
    `id` VARCHAR(32) NOT NULL,
    `user_id` VARCHAR(32) NOT NULL,
    `hosp_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_user_pos` (
    `id` VARCHAR(32) NOT NULL,
    `user_id` VARCHAR(32) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `isexistibeacon` BOOLEAN NULL DEFAULT false,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_user_role` (
    `id` VARCHAR(32) NOT NULL,
    `user_id` VARCHAR(32) NOT NULL,
    `role_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_work_history` (
    `id` VARCHAR(32) NOT NULL,
    `exteam_id` VARCHAR(32) NOT NULL,
    `exstaff_id` VARCHAR(32) NOT NULL,
    `exstaff_name` VARCHAR(20) NULL,
    `exstaff_phone` VARCHAR(15) NULL,
    `workscheduling_id` VARCHAR(32) NULL,
    `start_date` DATE NULL,
    `work_time` TIME(0) NULL,
    `end_date` DATE NULL,
    `nowork_time` TIME(0) NULL,
    `leave_time` DATETIME(0) NULL,
    `back_time` DATETIME(0) NULL,
    `lea` DATETIME(0) NULL,
    `leave_period` VARCHAR(200) NULL,
    `service_location` VARCHAR(400) NULL,
    `current_state` VARCHAR(32) NULL,
    `orders_received` INTEGER NULL,
    `orders_completed` INTEGER NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_workpost` (
    `id` VARCHAR(32) NOT NULL,
    `post_name` VARCHAR(50) NOT NULL,
    `workposttype_id` VARCHAR(32) NULL,
    `firsthalfwork_time` TIME(0) NULL,
    `firsthalfnowork_time` TIME(0) NULL,
    `lasthalfwork_time` TIME(0) NULL,
    `lasthalfnowork_time` TIME(0) NULL,
    `exteam_id` VARCHAR(32) NULL,
    `service_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_workpost_grid` (
    `id` VARCHAR(32) NOT NULL,
    `post_id` VARCHAR(32) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `exteam_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `grid_code` VARCHAR(30) NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_workscheduling` (
    `id` VARCHAR(32) NOT NULL,
    `start_date` DATE NOT NULL,
    `end_date` DATE NOT NULL,
    `classes` VARCHAR(20) NOT NULL,
    `startwork_time` TIME(0) NOT NULL,
    `endtime_time` TIME(0) NOT NULL,
    `exteam_id` VARCHAR(32) NULL,
    `hosp_ID` VARCHAR(32) NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tb_workscheduling_grid` (
    `id` VARCHAR(32) NOT NULL,
    `workscheduling_id` VARCHAR(32) NOT NULL,
    `grid_id` VARCHAR(32) NOT NULL,
    `create_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
    `create_by` VARCHAR(32) NULL,
    `remark` VARCHAR(200) NULL,
    `delete_flag` BOOLEAN NULL DEFAULT false,
    `update_time` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

