/*
 Navicat Premium Data Transfer

 Source Server         : conpany 102
 Source Server Type    : MySQL
 Source Server Version : 80020 (8.0.20)
 Source Host           : 192.168.12.102:3306
 Source Schema         : wx

 Target Server Type    : MySQL
 Target Server Version : 80020 (8.0.20)
 File Encoding         : 65001

 Date: 04/09/2023 16:16:30
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for pay_casebook
-- ----------------------------
DROP TABLE IF EXISTS `pay_casebook`;
CREATE TABLE `pay_casebook` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `UpdateTime` datetime NOT NULL,
  `OpenID` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `PatientID` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `ApplyId` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '病案申请Id号',
  `UseToNo` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '模版Id',
  `UseToName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '模版名称',
  `GetWay` int DEFAULT NULL COMMENT '获取方式; 0自提 1邮寄',
  `Address` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '邮寄地址',
  `Phone` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '联系电话',
  `PatientName` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `OutTradeNo` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
  `BankTransNo` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `TradeNo` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `TreatNum` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `TotalFee` decimal(10,3) DEFAULT NULL,
  `PayWay` int DEFAULT '0',
  `PayMoney` decimal(10,3) DEFAULT NULL,
  `PayStatus` int DEFAULT NULL,
  `HisStatus` int DEFAULT NULL,
  `HisTransNo` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `HisResult` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `InvoiceTransNo` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `RefundResult` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `OperateUser` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `AuthCode` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `Remark` varchar(600) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
  `PayOrdId` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '医保订单号',
  `AcctFee` decimal(10,3) DEFAULT NULL COMMENT '医保个账金额',
  `HifpFee` decimal(10,3) DEFAULT NULL COMMENT '医保统筹金额',
  `ChrgBchno` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '顶',
  `MdTrtId` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '医保就诊ID',
  `MdUserId` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '医保用户ID',
  `BankMerchantNo` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '银行商户号',
  `RefundTime` datetime DEFAULT NULL,
  PRIMARY KEY (`ID`) USING BTREE,
  UNIQUE KEY `ID` (`ID`) USING BTREE,
  UNIQUE KEY `TradeNo` (`TradeNo`) USING BTREE,
  UNIQUE KEY `AuthCode` (`AuthCode`) USING BTREE,
  KEY `UpdateTime` (`UpdateTime`) USING BTREE,
  KEY `OutTradeNo` (`OutTradeNo`) USING BTREE,
  KEY `BankTransNo` (`BankTransNo`) USING BTREE,
  KEY `TreatNum` (`TreatNum`) USING BTREE,
  KEY `PayWay` (`PayWay`) USING BTREE,
  KEY `PayStatus` (`PayStatus`) USING BTREE,
  KEY `HisStatus` (`HisStatus`) USING BTREE,
  KEY `InvoiceTransNo` (`InvoiceTransNo`) USING BTREE,
  KEY `RefundTime` (`RefundTime`) USING BTREE,
  KEY `MdUserId` (`MdUserId`) USING BTREE,
  KEY `PayMoney` (`PayMoney`) USING BTREE,
  KEY `TotalFee` (`TotalFee`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

SET FOREIGN_KEY_CHECKS = 1;
