/*
 Navicat Premium Dump SQL

 Source Server         : 47.119.147.104
 Source Server Type    : MariaDB
 Source Server Version : 120002 (12.0.2-MariaDB)
 Source Host           : 47.119.147.104:3307
 Source Schema         : wx_xcx_check

 Target Server Type    : MariaDB
 Target Server Version : 120002 (12.0.2-MariaDB)
 File Encoding         : 65001

 Date: 24/12/2025 10:33:17
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for xcx_conversation
-- ----------------------------
DROP TABLE IF EXISTS `xcx_conversation`;
CREATE TABLE `xcx_conversation`  (
  `Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `UserKey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户唯一标识键',
  `ConversationContent` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '会话内容',
  `MessageType` int(11) NOT NULL DEFAULT 1 COMMENT '信息类型：1-公有，2-私有',
  `SendMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '发送方式',
  `UserLocation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户定位信息',
  `RecordTime` datetime NOT NULL COMMENT '记录时间',
  `RecordTimeUTCStamp` bigint(20) NOT NULL COMMENT '记录时间的UTC时间戳',
  `IsDeleted` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除：0-正常，1-删除',
  `CreateTime` datetime NULL DEFAULT current_timestamp() COMMENT '创建时间',
  `Latitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '纬度',
  `Longitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '经度',
  `Guid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'GUID',
  `SpeakingTime` int(11) NULL DEFAULT NULL COMMENT '对话时长',
  PRIMARY KEY (`Id`) USING BTREE,
  INDEX `idx_userkey`(`UserKey` ASC) USING BTREE,
  INDEX `idx_utcstamp`(`RecordTimeUTCStamp` ASC) USING BTREE,
  INDEX `idx_deleted`(`IsDeleted` ASC) USING BTREE,
  INDEX `idx_recordtime`(`RecordTime` ASC) USING BTREE,
  INDEX `idx_messagetype`(`MessageType` ASC) USING BTREE,
  INDEX `idx_guid`(`Guid` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 499 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会话记录表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for xcx_log
-- ----------------------------
DROP TABLE IF EXISTS `xcx_log`;
CREATE TABLE `xcx_log`  (
  `Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `RecordTime` datetime NOT NULL COMMENT '记录时间',
  `UserKey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户唯一标识键',
  `OperationContent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '操作内容',
  `UserLocation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户定位信息',
  `Impact` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '产生的影响',
  `CreateTime` datetime NULL DEFAULT current_timestamp() COMMENT '创建时间',
  PRIMARY KEY (`Id`) USING BTREE,
  INDEX `idx_userkey`(`UserKey` ASC) USING BTREE,
  INDEX `idx_recordtime`(`RecordTime` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for xcx_users
-- ----------------------------
DROP TABLE IF EXISTS `xcx_users`;
CREATE TABLE `xcx_users`  (
  `Id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `UserName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '用户名',
  `UserKey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户唯一标识键',
  `WeChatName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '微信名称',
  `PhoneNumber` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '电话号码',
  `FirstLoginTime` datetime NOT NULL COMMENT '首次登录时间',
  `IsDisabled` tinyint(4) NULL DEFAULT 0 COMMENT '是否禁用：0-启用，1-禁用',
  `CreateTime` datetime NULL DEFAULT current_timestamp() COMMENT '创建时间',
  `UpdateTime` datetime NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `AvatarUrl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '头像地址',
  `Department` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '用户部门',
  PRIMARY KEY (`Id`) USING BTREE,
  UNIQUE INDEX `idx_userkey`(`UserKey` ASC) USING BTREE,
  INDEX `idx_disabled`(`IsDisabled` ASC) USING BTREE,
  INDEX `idx_logintime`(`FirstLoginTime` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 42 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '小程序用户表' ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
