/*
 Navicat Premium Data Transfer

 Source Server         : 192.168.1.31
 Source Server Type    : MariaDB
 Source Server Version : 100236
 Source Host           : 192.168.1.31:3306
 Source Schema         : USCT

 Target Server Type    : MariaDB
 Target Server Version : 100236
 File Encoding         : 65001

 Date: 13/05/2025 16:04:43
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for Account
-- ----------------------------
DROP TABLE IF EXISTS `Account`;
CREATE TABLE `Account`  (
  `UserID` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `UserCode` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `UserName` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `Password` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `RoleID` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `Comment` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`UserID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of Account
-- ----------------------------
INSERT INTO `Account` VALUES ('usct', 'usct', '管理员', 'e10adc3949ba59abbe56e057f20f883e', '0001', '');

-- ----------------------------
-- Table structure for EScan
-- ----------------------------
DROP TABLE IF EXISTS `EScan`;
CREATE TABLE `EScan`  (
  `ScanID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ScanID same as measurementID, Primary Key',
  `ScanDateTime` datetime(0) NULL DEFAULT NULL,
  `State` int(11) NULL DEFAULT 0 COMMENT '0 using, -1 expired',
  `UpdateTime` datetime(0) NULL DEFAULT NULL COMMENT 'Update Time',
  PRIMARY KEY (`ScanID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for Patient
-- ----------------------------
DROP TABLE IF EXISTS `Patient`;
CREATE TABLE `Patient`  (
  `PatientUID` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `PatientID` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `PatientName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `Birthdate` date NOT NULL,
  `Sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `AddDate` datetime(0) NULL DEFAULT NULL,
  `COMMENT` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`PatientUID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for Role
-- ----------------------------
DROP TABLE IF EXISTS `Role`;
CREATE TABLE `Role`  (
  `RoleID` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `RoleName` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `Permissions` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `Comment` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`RoleID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of Role
-- ----------------------------
INSERT INTO `Role` VALUES ('0001', 'admin', NULL, NULL);
INSERT INTO `Role` VALUES ('0002', 'doctor', NULL, NULL);

-- ----------------------------
-- Table structure for Scan
-- ----------------------------
DROP TABLE IF EXISTS `Scan`;
CREATE TABLE `Scan`  (
  `ScanID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ScanID same as measurementID, Primary Key',
  `ReferenceID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `PatientID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `AccessionNumber` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `ScanDateTime` datetime(0) NULL DEFAULT NULL,
  `PatientName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `Laterality` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `OperatorName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `State` int(11) NULL DEFAULT 0,
  `StudyUID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `Modality` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `MPPSUID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'MPPS SOP Instance UID',
  PRIMARY KEY (`ScanID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
