数据结构
12114表总览
普通表
_cache
- 缓存表
CREATE TABLE `_cache` (`id` int(11) NOT NULL AUTO_INCREMENT,`userId` varchar(255) NOT NULL COMMENT '用户Id',`content` longtext COMMENT '缓存数据',`recordStatus` varchar(255) DEFAULT 'active',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '缓存表'
_constant
- 常量表; 软删除未启用;
CREATE TABLE `_constant` (`id` int(11) NOT NULL AUTO_INCREMENT,`constantKey` varchar(255) DEFAULT NULL,`constantType` varchar(255) DEFAULT NULL COMMENT '常量类型; object, array',`desc` varchar(255) DEFAULT NULL COMMENT '描述',`constantValue` text COMMENT '常量内容; object, array',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 24 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '常量表; 软删除未启用;'
_page
- 页面表; 软删除未启用;
CREATE TABLE `_page` (`id` int(11) NOT NULL AUTO_INCREMENT,`pageId` varchar(255) DEFAULT NULL COMMENT 'pageId',`pageFile` varchar(255) DEFAULT NULL COMMENT 'page文件指定; 默认使用pageId.html',`pageHook` varchar(255) DEFAULT NULL COMMENT 'pageHook',`pageName` varchar(255) DEFAULT NULL COMMENT 'page name',`pageType` varchar(255) DEFAULT NULL COMMENT '页面类型; showInMenu, dynamicInMenu',`sort` varchar(255) DEFAULT NULL,`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 100 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '页面表; 软删除未启用;'
_record_history
- 数据历史表
CREATE TABLE `_record_history` (`id` int(11) NOT NULL AUTO_INCREMENT,`table` varchar(255) DEFAULT NULL COMMENT '表',`recordId` int(11) DEFAULT NULL COMMENT '数据在table中的主键id; recordContent.id',`recordContent` text NOT NULL COMMENT '数据',`packageContent` text NOT NULL COMMENT '当时请求的 package JSON',`operation` varchar(255) DEFAULT NULL COMMENT '操作; jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId; recordContent.operationByUserId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名; recordContent.operationByUser',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; recordContent.operationAt; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE,KEY `index_record_id` (`recordId`) USING BTREE,KEY `index_table_action` (`table`, `operation`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 1541 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '数据历史表'
_resource
- 请求资源表; 软删除未启用; resourceId=
${appId}.${pageId}.${actionId}
CREATE TABLE `_resource` (`id` int(11) NOT NULL AUTO_INCREMENT,`accessControlTable` varchar(255) DEFAULT NULL COMMENT '数据规则控制表',`resourceHook` text COMMENT '[ "before": {"service": "xx", "serviceFunction": "xxx"}, "after": [] }',`pageId` varchar(255) DEFAULT NULL COMMENT 'page id; E.g: index',`actionId` varchar(255) DEFAULT NULL COMMENT 'action id; E.g: selectXXXByXXX',`desc` varchar(255) DEFAULT NULL COMMENT '描述',`resourceType` varchar(255) DEFAULT NULL COMMENT 'resource 类型; E.g: auth service sql',`appDataSchema` text COMMENT 'appData 参数校验',`resourceData` text COMMENT 'resource 数据; { "service": "auth", "serviceFunction": "passwordLogin" } or { "table": "${tableName}", "action": "select", "whereCondition": ".where(function() {this.whereNot( { recordStatus: \\"active\\" })})" }',`requestDemo` text COMMENT '请求Demo',`responseDemo` text COMMENT '响应Demo',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 802 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '请求资源表; 软删除未启用; resourceId=`${appId}.${pageId}.${actionId}`'
_test_case
- 测试用例表
CREATE TABLE `_test_case` (`id` int(11) NOT NULL AUTO_INCREMENT,`pageId` varchar(255) DEFAULT NULL COMMENT '页面Id',`testId` varchar(255) DEFAULT NULL COMMENT '测试用例Id; 10000 ++',`testName` varchar(255) DEFAULT NULL COMMENT '测试用例名',`uiActionIdList` varchar(255) DEFAULT NULL COMMENT 'uiAction列表; 一个测试用例对应多个uiActionId',`testOpeartion` text COMMENT '测试用例步骤;',`expectedResult` text COMMENT '期望结果',`operation` varchar(255) DEFAULT NULL COMMENT '操作; jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId; recordContent.operationByUserId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名; recordContent.operationByUser',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; recordContent.operationAt; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '测试用例表'
_ui
- ui 施工方案
CREATE TABLE `_ui` (`id` int(11) NOT NULL AUTO_INCREMENT,`pageId` varchar(255) DEFAULT NULL COMMENT 'page id; E.g: index',`uiActionType` varchar(255) DEFAULT NULL COMMENT 'ui 动作类型,如:fetchData, postData, changeUi',`uiActionId` varchar(255) DEFAULT NULL COMMENT 'action id; E.g: selectXXXByXXX',`desc` varchar(255) DEFAULT NULL COMMENT '描述',`uiActionConfig` text COMMENT 'ui 动作数据',`appDataSchema` text COMMENT 'ui 校验数据',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'ui 施工方案'
_user_session
- 用户session表; deviceId 维度;软删除未启用;
CREATE TABLE `_user_session` (`id` int(11) NOT NULL AUTO_INCREMENT,`userId` varchar(255) DEFAULT NULL COMMENT '用户id',`userIp` varchar(255) DEFAULT NULL COMMENT '用户ip',`userIpRegion` varchar(255) DEFAULT NULL COMMENT '用户Ip区域',`userAgent` text COMMENT '请求的 agent',`deviceId` varchar(255) DEFAULT NULL COMMENT '设备id',`deviceType` varchar(255) DEFAULT 'web' COMMENT '设备类型; flutter, web, bot_databot, bot_chatbot, bot_xiaochengxu',`socketStatus` varchar(255) DEFAULT 'offline' COMMENT 'socket状态',`authToken` varchar(255) DEFAULT NULL COMMENT 'auth token',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE,KEY `userId_index` (`userId`) USING BTREE,KEY `userId_deviceId_index` (`userId`, `deviceId`) USING BTREE,KEY `authToken_index` (`authToken`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 50 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '用户session表; deviceId 维度;软删除未启用;'
customer
CREATE TABLE `customer` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(11) DEFAULT NULL COMMENT '业务自增ID, 1001++',`customerId` varchar(255) DEFAULT NULL COMMENT '客户ID; KH1001',`customerName` varchar(255) DEFAULT NULL COMMENT '客户名',`customerAccountNum` varchar(255) DEFAULT NULL COMMENT '银行账号',`customerBankName` varchar(255) DEFAULT NULL COMMENT '开户银行',`customerBranchBankName` varchar(255) DEFAULT NULL COMMENT '开户分行\\支行',`customerAddress` varchar(255) DEFAULT NULL COMMENT '客户地址',`customerPostalCode` varchar(255) DEFAULT NULL COMMENT '邮政编码',`customerContactPerson` varchar(255) DEFAULT NULL COMMENT '联系人',`customerPhoneNum` varchar(255) DEFAULT NULL COMMENT '联系电话',`customerCollectionCycle` varchar(255) DEFAULT NULL COMMENT '收款账期;单位:天',`customerBusinessLicenseNum` varchar(255) DEFAULT NULL COMMENT '营业执照',`customerMedicalOperatingLicenseNum` varchar(255) DEFAULT NULL COMMENT '医疗器械经营许可证',`remark` varchar(255) DEFAULT NULL COMMENT '备注',`rowStatus` varchar(255) DEFAULT '正常' COMMENT '数据状态; 正常、停用',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 25 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin
finance_asset
- 财务-资产信息表
CREATE TABLE `finance_asset` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',`assetId` varchar(255) DEFAULT NULL COMMENT '资产ID; ZC10001',`assetName` varchar(255) DEFAULT NULL COMMENT '资产;',`currentPeriod` varchar(255) DEFAULT NULL COMMENT '当前会计期间; 2022-02',`depreciationMethod` varchar(255) DEFAULT NULL COMMENT '折旧方法; 平均年限法、不折旧',`financeAssetSubject` varchar(255) DEFAULT NULL COMMENT '资产科目; 固定资产',`financeDepreciationSubject` varchar(255) DEFAULT NULL COMMENT '累计折旧科目; 累计折旧',`financeClearSubject` varchar(255) DEFAULT NULL COMMENT '资产清理科目; 固定资产清理',`financeDepreciationFeeSubject` varchar(255) DEFAULT NULL COMMENT '折旧费用科目; 管理费用-折旧费',`startUseAt` varchar(255) DEFAULT NULL COMMENT '开始使用日期; 2020-02-02',`assetValue` decimal(10, 2) DEFAULT NULL COMMENT '资产原值',`residualRate` decimal(10, 2) DEFAULT NULL COMMENT '残值率',`estimatedUseMonth` int(11) DEFAULT NULL COMMENT '预计使用月份',`depreciatedMonths` int(11) DEFAULT NULL COMMENT '已折旧月份',`remainingMonth` int(11) DEFAULT NULL COMMENT '剩余使用月份',`monthlyDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '每月折旧额',`totalDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '累计折旧',`currentYearDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '本年累计折旧;',`preYearDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '以前年度累计折旧',`currentPeriodDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '本期折旧',`financeAssetSubjectId` varchar(255) DEFAULT NULL COMMENT '资产科目ID;',`financeDepreciationSubjectId` varchar(255) DEFAULT NULL COMMENT '累计折旧科目ID;',`financeClearSubjectId` varchar(255) DEFAULT NULL COMMENT '资产清理科目ID;',`financeDepreciationFeeSubjectId` varchar(255) DEFAULT NULL COMMENT '折旧费用科目ID;',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 14 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '财务-资产信息表'
finance_asset_record
- 财务-资产信息表
CREATE TABLE `finance_asset_record` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',`assetId` varchar(255) DEFAULT NULL COMMENT '资产ID; ZC10001',`assetName` varchar(255) DEFAULT NULL COMMENT '资产;',`currentPeriod` varchar(255) DEFAULT NULL COMMENT '当前会计期间; 2022-02',`depreciationMethod` varchar(255) DEFAULT NULL COMMENT '折旧方法; 平均年限法、不折旧',`financeAssetSubject` varchar(255) DEFAULT NULL COMMENT '资产科目; 固定资产',`financeDepreciationSubject` varchar(255) DEFAULT NULL COMMENT '累计折旧科目; 累计折旧',`financeClearSubject` varchar(255) DEFAULT NULL COMMENT '资产清理科目; 固定资产清理',`financeDepreciationFeeSubject` varchar(255) DEFAULT NULL COMMENT '折旧费用科目; 管理费用-折旧费',`startUseAt` varchar(255) DEFAULT NULL COMMENT '开始使用日期; 2020-02-02',`assetValue` decimal(10, 2) DEFAULT NULL COMMENT '资产原值',`residualRate` decimal(10, 2) DEFAULT NULL COMMENT '残值率',`estimatedUseMonth` int(11) DEFAULT NULL COMMENT '预计使用月份',`depreciatedMonths` int(11) DEFAULT NULL COMMENT '已折旧月份',`remainingMonth` int(11) DEFAULT NULL COMMENT '剩余使用月份',`monthlyDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '每月折旧额',`totalDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '累计折旧',`currentYearDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '本年累计折旧',`preYearDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '以前年度累计折旧',`currentPeriodDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '本期折旧',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',`financeAssetSubjectId` varchar(255) DEFAULT NULL COMMENT '资产科目ID;',`financeDepreciationSubjectId` varchar(255) DEFAULT NULL COMMENT '累计折旧科目ID;',`financeClearSubjectId` varchar(255) DEFAULT NULL COMMENT '资产清理科目ID;',`financeDepreciationFeeSubjectId` varchar(255) DEFAULT NULL COMMENT '折旧费用科目ID;',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 362 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '财务-资产信息表'
finance_period
- 折旧-会计区间表
CREATE TABLE `finance_period` (`id` int(11) NOT NULL AUTO_INCREMENT,`periodId` varchar(255) DEFAULT NULL COMMENT '会计期间; 月份维度 E.g: 2023-03',`financeYear` varchar(255) DEFAULT NULL COMMENT '财年;',`isDepreciation` varchar(255) DEFAULT NULL COMMENT '是否折旧; 已折旧、待折旧',`isPeriodStart` varchar(255) DEFAULT '否' COMMENT '是否初始会计期间; 是, 否',`depreciationVoucherId` varchar(255) DEFAULT NULL COMMENT '折旧凭证ID',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE,UNIQUE KEY `periodId_unique` (`periodId`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 223 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '折旧-会计区间表'
payment
- 收款&付款表;
CREATE TABLE `payment` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',`idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',`paymentId` varchar(255) DEFAULT NULL COMMENT '收款/付款ID; SK10001 FK10001',`paymentType` varchar(20) DEFAULT NULL COMMENT '类型; 收款、付款',`paymentAmount` decimal(10, 2) DEFAULT NULL COMMENT '金额',`paymentPayee` varchar(50) DEFAULT NULL COMMENT '收款账户; 人、公司、账号',`paymentPayeeAccount` varchar(255) DEFAULT NULL COMMENT '收款账号; ',`paymentPayeeBank` varchar(255) DEFAULT NULL COMMENT '收款账号银行',`paymentPayeeBranchBank` varchar(255) DEFAULT NULL COMMENT '收款账号开户分行\\支行',`paymentPayer` varchar(50) DEFAULT NULL COMMENT '付款账户; 人、公司、账号',`paymentPayerAccount` varchar(255) DEFAULT NULL COMMENT '付款账号;',`paymentPayerBank` varchar(255) DEFAULT NULL COMMENT '付款账号银行',`paymentPayerBranchBank` varchar(255) DEFAULT NULL COMMENT '付款账号开户分行\\支行',`paymentMethod` varchar(50) DEFAULT NULL COMMENT '方式',`paymentStatus` varchar(20) NOT NULL DEFAULT '未付款' COMMENT '付款状态; 未付款、已付款',`invoiceStatus` varchar(255) DEFAULT '未开票' COMMENT '开票状态; 未开票、已开票',`paymentAt` varchar(255) DEFAULT NULL COMMENT '时间; E.g: 2021-05-28T10:24:54+08:00',`supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID;',`customerId` varchar(255) DEFAULT NULL COMMENT '客户ID;',`ticketId` varchar(255) DEFAULT NULL COMMENT '工单id',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 76 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '收款&付款表;'
payment_order
- 收款&付款表-订单抵扣表
CREATE TABLE `payment_order` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',`paymentId` varchar(255) DEFAULT NULL COMMENT '收款/付款ID; SK10001 FK10001',`paymentType` varchar(20) DEFAULT NULL COMMENT '类型; 收款、付款',`orderType` varchar(20) DEFAULT NULL COMMENT '订单类型; 采购订单、销售订单、采退订单、销退订单',`orderId` varchar(255) NOT NULL COMMENT '订单ID',`deductionAmount` decimal(10, 2) NOT NULL COMMENT '抵扣金额',`ticketId` varchar(255) DEFAULT NULL COMMENT '工单id',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 73 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '收款&付款表-订单抵扣表'
purchase_order
- 采购订单表
CREATE TABLE `purchase_order` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(11) DEFAULT NULL COMMENT '自增ID, 10001++',`purchaseOrderId` varchar(255) DEFAULT NULL COMMENT '订单ID; CG10001',`supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',`supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',`supplierInfo` mediumtext COMMENT '供货商信息; json',`purchaseOrderType` varchar(255) DEFAULT '普通采购' COMMENT '采购订单类型; 普通采购、资产采购',`purchaseOrderDesc` varchar(255) DEFAULT NULL COMMENT '采购订单描述;',`purchaseProductList` text COMMENT '采购产品列表; [{}, {}]',`purchaseProductListCount` int(11) DEFAULT NULL COMMENT '采购产品列表个数',`purchaseProductTotalCount` int(11) DEFAULT NULL COMMENT '采购产品总个数',`purchaseTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '订单金额',`purchaseOrderStatus` varchar(255) DEFAULT NULL COMMENT '订单状态; 待采购、采购中、订单完成/订单取消',`purchaseOrderStatusDesc` varchar(255) DEFAULT NULL COMMENT '订单状态描述; 例如: 填写订单取消原因',`purchaseCreateAt` varchar(255) DEFAULT NULL COMMENT '订单创建日期',`purchaseFinishAt` varchar(255) DEFAULT NULL COMMENT '订单完成时间',`purchaseOrderRemark` varchar(255) DEFAULT NULL COMMENT '订单备注',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 8 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '采购订单表'
purchase_return_order
- 采购退货订单表
CREATE TABLE `purchase_return_order` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(11) DEFAULT NULL COMMENT '自增ID, 10001++',`returnOrderId` varchar(255) DEFAULT NULL COMMENT '退款订单ID; XSTK10001',`supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',`supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',`supplierInfo` mediumtext COMMENT '供货商信息; json',`returnOrderDesc` varchar(255) DEFAULT NULL COMMENT '退货订单描述;',`returnProductList` text COMMENT '退货产品列表; [{}, {}]',`returnProductListCount` int(11) DEFAULT NULL COMMENT '退货产品列表个数',`returnProductTotalCount` int(11) DEFAULT NULL COMMENT '退货产品总个数',`returnTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '订单金额',`returnOrderStatus` varchar(255) DEFAULT NULL COMMENT '订单状态; 待退货、退货中、订单完成/订单取消',`returnOrderStatusDesc` varchar(255) DEFAULT NULL COMMENT '订单状态描述; 例如: 填写订单取消原因',`returnCreateAt` varchar(255) DEFAULT NULL COMMENT '订单创建日期',`returnFinishAt` varchar(255) DEFAULT NULL COMMENT '订单完成时间',`returnOrderRemark` varchar(255) DEFAULT NULL COMMENT '订单备注',`returnOrderType` varchar(255) DEFAULT NULL COMMENT '订单类型;普通退货、资产退货',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 4 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '采购退货订单表'
sale_order
CREATE TABLE `sale_order` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(11) DEFAULT NULL COMMENT '主键ID, 10001++',`saleOrderId` varchar(255) DEFAULT NULL COMMENT '订单ID; CG10001',`customerId` varchar(255) DEFAULT NULL COMMENT '客户ID',`customerName` varchar(255) DEFAULT NULL COMMENT '客户',`customerInfo` text COMMENT '客户',`saleOrderDesc` varchar(255) DEFAULT NULL COMMENT '销售订单描述;',`saleProductList` text COMMENT '销售产品列表; [{}, {}]',`saleProductListCount` int(11) DEFAULT NULL COMMENT '销售产品列表个数',`saleProductTotalCount` int(11) DEFAULT NULL COMMENT '销售产品总个数',`saleTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '订单金额',`saleOrderStatus` varchar(255) DEFAULT NULL COMMENT '订单状态; 待销售、销售中、订单完成/订单取消',`saleOrderStatusDesc` varchar(255) DEFAULT NULL COMMENT '订单状态描述; 例如: 填写订单失败原因',`saleCreateAt` varchar(255) DEFAULT NULL COMMENT '订单创建日期',`saleOrderRemark` varchar(255) DEFAULT NULL COMMENT '订单备注',`saleFinishAt` varchar(255) DEFAULT NULL COMMENT '订单完成时间',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 46 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin
sale_return_order
- 销售退货订单表
CREATE TABLE `sale_return_order` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(11) DEFAULT NULL COMMENT '主键ID, 10001++',`returnOrderId` varchar(255) DEFAULT NULL COMMENT '退款订单ID; CGTK10001',`customerId` varchar(255) DEFAULT NULL COMMENT '客户ID',`customerName` varchar(255) DEFAULT NULL COMMENT '客户',`customerInfo` text COMMENT '客户',`returnOrderDesc` varchar(255) DEFAULT NULL COMMENT '退货订单描述;',`returnProductList` text COMMENT '退货产品列表; [{}, {}]',`returnProductListCount` int(11) DEFAULT NULL COMMENT '退货产品列表个数',`returnProductTotalCount` int(11) DEFAULT NULL COMMENT '退货产品总个数',`returnTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '订单金额',`returnOrderStatus` varchar(255) DEFAULT NULL COMMENT '订单状态; 待退货、退货中、订单完成/订单取消',`returnOrderStatusDesc` varchar(255) DEFAULT NULL COMMENT '订单状态描述; 例如: 填写订单失败原因',`returnCreateAt` varchar(255) DEFAULT NULL COMMENT '订单创建日期',`returnOrderRemark` varchar(255) DEFAULT NULL COMMENT '订单备注',`returnFinishAt` varchar(255) DEFAULT NULL COMMENT '订单完成时间',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 65 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '销售退货订单表'
supplier
- 供货商
CREATE TABLE `supplier` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(11) DEFAULT NULL COMMENT '自增ID, 1001++',`supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID; GH1001',`supplierName` varchar(255) DEFAULT NULL COMMENT '供应商名',`supplierAccountNum` varchar(255) DEFAULT NULL COMMENT '付款账号',`supplierBankName` varchar(255) DEFAULT NULL COMMENT '开户银行',`supplierBranchBankName` varchar(255) DEFAULT NULL COMMENT '分行名称',`supplierBusinessLicenseNum` varchar(255) DEFAULT NULL COMMENT '营业执照',`supplierMedicalOperatingLicenseNum` varchar(255) DEFAULT NULL COMMENT '医疗器械经营许可证',`supplierPaymentCycle` varchar(255) DEFAULT NULL COMMENT '账期;单位:天',`supplierAddress` varchar(255) DEFAULT NULL COMMENT '地址',`supplierPostalCode` varchar(255) DEFAULT NULL COMMENT '邮政编码',`supplierContactPerson` varchar(255) DEFAULT NULL COMMENT '联系人',`supplierPhoneNum` varchar(255) DEFAULT NULL COMMENT '联系电话',`remark` varchar(255) DEFAULT NULL COMMENT '备注',`rowStatus` varchar(255) DEFAULT '正常' COMMENT '数据状态; 正常、停用',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间',PRIMARY KEY (`id`) USING BTREE,UNIQUE KEY `supplierId_unique` (`supplierId`) USING BTREE,UNIQUE KEY `supplierName_unique` (`supplierName`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 30 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '供货商'
supplier_product
- 供货商产品表; productId=supplierId-productName-manufacturerName- 在view或者前端拼接
CREATE TABLE `supplier_product` (`id` int(11) NOT NULL AUTO_INCREMENT,`supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID; GH10001',`supplierName` varchar(255) DEFAULT NULL,`productName` varchar(255) DEFAULT NULL COMMENT '产品名称',`manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',`productSpecList` varchar(512) DEFAULT NULL COMMENT '规格/型号列表; “15ml/袋, 20ml/袋”',`productUnit` varchar(255) DEFAULT NULL COMMENT '单位',`productType` varchar(255) DEFAULT NULL COMMENT '产品类型',`manufacturerLicenseNum` varchar(255) DEFAULT NULL COMMENT '生产许可证号',`manufacturerLicenseExpireAt` varchar(255) DEFAULT NULL COMMENT '生产许可证到期日; E.g: 2024-05-28',`manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '产品注册证号;',`manufacturerProductRCExpireAt` varchar(255) DEFAULT NULL COMMENT '产品注册证到期日; E.g: 2024-03-28',`productTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',`remark` varchar(255) DEFAULT NULL COMMENT '备注',`rowStatus` varchar(255) DEFAULT '正常' COMMENT '数据状态; 正常、停用',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 811 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '供货商产品表; productId=supplierId-productName-manufacturerName- 在view或者前端拼接'
ticket
- 工单表;
CREATE TABLE `ticket` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(11) DEFAULT NULL COMMENT '自增ID, 10001++',`ticketId` varchar(255) DEFAULT NULL COMMENT '工单ID; T10001',`ticketBizId` varchar(255) DEFAULT NULL COMMENT '业务ID; 采购订单ID、销售订单ID',`ticketType` varchar(255) DEFAULT NULL COMMENT '工单类型; 采购付款、销售收款、采购入库、采购资产入库、资产入库、销售出库',`ticketDesc` varchar(255) DEFAULT NULL COMMENT '工单描述;',`ticketContentRequest` text COMMENT '申请内容; {}',`ticketContent` text COMMENT '完成内容; {}',`ticketCommentList` text COMMENT '评论列表; [{}, {}] (后期再做)',`ticketAmount` int(11) DEFAULT NULL COMMENT '工单处理金额',`ticketRequestAmount` int(11) DEFAULT NULL COMMENT '申请金额',`ticketRequestAt` varchar(255) DEFAULT NULL COMMENT '申请时间; E.g: 2021-05-28T10:24:54+08:00',`ticketRequestByUserId` varchar(255) DEFAULT NULL COMMENT '申请人Id',`ticketRequestByUser` varchar(255) DEFAULT NULL COMMENT '申请人',`ticketStatus` varchar(255) DEFAULT '申请' COMMENT '工单状态; 申请、处理中、完成、拒绝',`ticketStatusAt` varchar(255) DEFAULT NULL COMMENT '处理时间; E.g: 2021-05-28T10:24:54+08:00',`ticketStatusDesc` varchar(255) DEFAULT NULL COMMENT '处理描述; 拒绝描述',`ticketStatusByUserId` varchar(255) DEFAULT NULL COMMENT '处理人Id',`ticketStatusByUser` varchar(255) DEFAULT NULL COMMENT '处理人',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 25 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '工单表;'
voucher
- 凭证表
CREATE TABLE `voucher` (`id` int(11) NOT NULL AUTO_INCREMENT,`periodId` varchar(255) DEFAULT NULL COMMENT '会计期间; E.g: 2023-03',`ticketIdList` varchar(255) DEFAULT NULL COMMENT '工单ID; 用‘,’分隔',`voucherName` varchar(255) DEFAULT NULL COMMENT '凭证字; 记2022',`voucherNumber` int(11) DEFAULT NULL COMMENT '凭证号; 10001',`voucherId` varchar(255) DEFAULT NULL COMMENT '凭证字号; periodId + voucherName + voucherNumber',`voucherType` varchar(255) DEFAULT '普通凭证' COMMENT '凭证类型; 普通凭证、结转凭证',`voucherTemplateId` varchar(255) DEFAULT NULL COMMENT '凭证模板ID;',`voucherTemplateName` varchar(255) DEFAULT NULL COMMENT '凭证模板名称;',`voucherAccountant` varchar(255) DEFAULT '' COMMENT '制单人',`voucherAudit` varchar(255) DEFAULT '' COMMENT '审核人; 预留字段',`voucherDebitSum` decimal(10, 2) DEFAULT NULL COMMENT '借方总额',`voucherCreditSum` decimal(10, 2) DEFAULT NULL COMMENT '贷方总额',`voucherAt` varchar(255) DEFAULT NULL COMMENT '凭证时间; E.g: 2021-05-28',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE,UNIQUE KEY `voucherId_unique` (`voucherId`) USING BTREE) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '凭证表'
voucher_entry
- 凭证条目表
CREATE TABLE `voucher_entry` (`id` int(11) NOT NULL AUTO_INCREMENT,`voucherId` varchar(255) DEFAULT NULL COMMENT '凭证Id;',`subjectId` varchar(255) DEFAULT NULL COMMENT '科目id;',`subjectName` varchar(255) DEFAULT NULL COMMENT '科目名称;',`entryAbstract` varchar(255) DEFAULT NULL COMMENT '摘要',`debit` decimal(14, 2) DEFAULT '0.00' COMMENT '借方金额',`credit` decimal(14, 2) DEFAULT '0.00' COMMENT '贷方金额',`assistIdOfCustomer` varchar(255) DEFAULT NULL COMMENT '辅助核算-客户Id',`assistIdOfSupplier` varchar(255) DEFAULT NULL COMMENT '辅助核算-供应商Id',`assistIdOfStaff` varchar(255) DEFAULT NULL COMMENT '辅助核算-员工Id',`assistIdOfProject` varchar(255) DEFAULT NULL COMMENT '辅助核算-项目Id',`assistIdOfDepart` varchar(255) DEFAULT NULL COMMENT '辅助核算-部门Id',`assistIdOfExtend1` varchar(255) DEFAULT NULL COMMENT '辅助核算-拓展1; 预留字段 assist_bank',`assistIdOfExtend2` varchar(255) DEFAULT NULL COMMENT '辅助核算-拓展2; 预留字段',`assistNameOfCustomer` varchar(255) DEFAULT NULL,`assistNameOfSupplier` varchar(255) DEFAULT NULL,`assistNameOfStaff` varchar(255) DEFAULT NULL,`assistNameOfProject` varchar(255) DEFAULT NULL,`assistNameOfDepart` varchar(255) DEFAULT NULL,`assistNameOfExtend1` varchar(255) DEFAULT NULL,`assistNameOfExtend2` varchar(255) DEFAULT NULL,`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 143 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '凭证条目表'
warehouse_asset
- 仓库-资产表
CREATE TABLE `warehouse_asset` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',`assetId` varchar(255) DEFAULT NULL COMMENT '资产ID; ZC10001',`assetName` varchar(255) DEFAULT NULL COMMENT '资产;',`warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库',`stockName` varchar(255) DEFAULT NULL COMMENT '货架',`assetUnit` varchar(255) DEFAULT NULL COMMENT '单位;',`assetSpec` varchar(255) DEFAULT NULL COMMENT '规格;',`assetSpecPrice` decimal(10, 0) DEFAULT NULL COMMENT '价格;',`purchaseAssetSpecPriceWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '产品去税价格',`purchaseAssetTaxRate` decimal(10, 2) DEFAULT NULL COMMENT '产品税率',`purchaseAssetTaxPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品税额',`purchaseAssetSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品价格',`assetType` varchar(255) DEFAULT NULL COMMENT '类型;',`assetTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',`assetStatus` varchar(255) DEFAULT NULL COMMENT '资产状态;在库,已领用,已报废,维修中',`assetUser` varchar(255) DEFAULT NULL COMMENT '资产最新相关人',`supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',`supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',`manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',`manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '生产厂家-产品注册证号;',`inventoryInType` varchar(255) DEFAULT NULL COMMENT '入库类型; 采购入库',`inventoryInOrderId` varchar(255) DEFAULT NULL COMMENT '入库关联订单ID',`inventoryInAt` varchar(255) DEFAULT NULL COMMENT '入库时间; E.g: 2021-05-28T10:24:54+08:00',`productionBatchNum` varchar(255) DEFAULT NULL COMMENT '生产批号;',`productionAt` varchar(255) DEFAULT NULL COMMENT '生产日期; E.g: 2021-05-28T10:24:54+08:00',`expirationAt` varchar(255) DEFAULT NULL COMMENT '有效期至; E.g: 2021-05-28T10:24:54+08:00',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 16 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '仓库-资产表'
warehouse_asset_record
- 仓库-资产表-记录表
CREATE TABLE `warehouse_asset_record` (`id` int(11) NOT NULL AUTO_INCREMENT,`idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 1++',`assetRecordId` varchar(255) DEFAULT NULL COMMENT '资产操作ID; ZC10001-001',`ticketId` varchar(255) DEFAULT NULL COMMENT '申请单号',`assetId` varchar(255) DEFAULT NULL COMMENT '资产ID; ZC10001',`assetName` varchar(255) DEFAULT NULL COMMENT '资产;',`assetUnit` varchar(255) DEFAULT NULL COMMENT '单位;',`assetSpec` varchar(255) DEFAULT NULL COMMENT '规格;',`assetUser` varchar(255) DEFAULT NULL COMMENT '资产相关人',`warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库',`stockName` varchar(255) DEFAULT NULL COMMENT '货架',`assetSpecPrice` decimal(10, 0) DEFAULT NULL COMMENT '价格;',`supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',`supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',`assetTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',`manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',`manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '生产厂家-产品注册证号;',`operationType` varchar(255) DEFAULT NULL COMMENT '操作类型;',`operationTypeOrderId` varchar(255) DEFAULT NULL COMMENT '操作类型对应的订单ID;',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 21 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '仓库-资产表-记录表'
warehouse_inventory
- 仓库-库存表(产品库存)
CREATE TABLE `warehouse_inventory` (`id` int(11) NOT NULL AUTO_INCREMENT,`inventoryId` varchar(255) DEFAULT NULL COMMENT '库存ID; 230603-022713-01 YYMMDD-ddhhss-XX',`ticketId` varchar(255) DEFAULT NULL COMMENT '工单id',`productName` varchar(255) DEFAULT NULL COMMENT '产品;',`warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库',`stockName` varchar(255) DEFAULT NULL COMMENT '货架',`count` int(11) DEFAULT NULL COMMENT '数量',`countOfInventoryIn` int(11) DEFAULT NULL COMMENT '入库数量',`productUnit` varchar(255) DEFAULT NULL COMMENT '产品单位;',`productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格;',`productSpecPrice` decimal(10, 0) DEFAULT NULL COMMENT '产品价格;',`purchaseProductSpecPriceWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '产品去税价格',`purchaseProductTaxRate` decimal(10, 2) DEFAULT NULL COMMENT '产品税率',`purchaseProductTaxPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品税额',`purchaseProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品价格;',`purchaseProductTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '含税总金额',`purchaseProductTotalAmountWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '不含税总金额',`productType` varchar(255) DEFAULT NULL COMMENT '产品类型;',`productTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',`supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',`supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',`manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',`inventoryInType` varchar(255) DEFAULT NULL COMMENT '入库类型; 采购入库',`inventoryInOrderId` varchar(255) DEFAULT NULL COMMENT '入库关联订单ID',`inventoryInAt` varchar(255) DEFAULT NULL COMMENT '入库时间; E.g: 2021-05-28T10:24:54+08:00',`productionBatchNum` varchar(255) DEFAULT NULL COMMENT '生产批号;',`productionAt` varchar(255) DEFAULT NULL COMMENT '生产日期; E.g: 2021-05-28T10:24:54+08:00',`expirationAt` varchar(255) DEFAULT NULL COMMENT '有效期至; E.g: 2021-05-28T10:24:54+08:00',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',`manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '生产厂家-产品注册证号;',PRIMARY KEY (`id`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 4 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '仓库-库存表(产品库存)'
warehouse_inventory_record
- 仓库-库存表-记录表
CREATE TABLE `warehouse_inventory_record` (`id` int(11) NOT NULL AUTO_INCREMENT,`inventoryId` varchar(255) DEFAULT NULL COMMENT '库存ID',`inventoryRecordId` varchar(255) DEFAULT NULL COMMENT '库存ID; 库存ID-0XX',`ticketId` varchar(255) DEFAULT NULL COMMENT '工单id',`warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库',`stockName` varchar(255) DEFAULT NULL COMMENT '货架',`operationCount` int(11) DEFAULT NULL COMMENT '操作数量',`operationType` varchar(255) DEFAULT NULL COMMENT '操作类型',`operationTypeOrderId` varchar(255) DEFAULT NULL COMMENT '操作类型对应的订单ID',`operationTargetCompanyName` varchar(255) DEFAULT NULL COMMENT '操作对象; 客户/供货商',`operationTargetCompanyAddress` varchar(255) DEFAULT NULL COMMENT '操作对象地址; 客户或者供货商',`productName` varchar(255) DEFAULT NULL COMMENT '产品;',`productUnit` varchar(255) DEFAULT NULL COMMENT '产品单位;',`productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格;',`productSpecPrice` decimal(10, 0) DEFAULT NULL COMMENT '产品价格;',`purchaseProductSpecPriceWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '产品去税价格',`purchaseProductTaxRate` decimal(10, 2) DEFAULT NULL COMMENT '产品税率',`purchaseProductTaxPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品税额',`purchaseProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品价格;',`purchaseProductTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '含税总金额',`purchaseProductTotalAmountWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '不含税总金额',`productType` varchar(255) DEFAULT NULL COMMENT '产品类型;',`productTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',`supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',`supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',`manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',`manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '生产厂家-产品注册证号;',`productionBatchNum` varchar(255) DEFAULT NULL COMMENT '生产批号',`productionAt` varchar(255) DEFAULT NULL COMMENT '生产日期; E.g: 2021-05-28T10:24:54+08:00',`expirationAt` varchar(255) DEFAULT NULL COMMENT '有效期至; E.g: 2021-05-28T10:24:54+08:00',`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',PRIMARY KEY (`id`) USING BTREE,UNIQUE KEY `inventoryRecordId_unique` (`inventoryRecordId`) USING BTREE) ENGINE = InnoDB AUTO_INCREMENT = 8 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '仓库-库存表-记录表'
视图
_directory_user_session
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `_directory_user_session` ASselect`lms_data_repository`.`enterprise_directory_user_session`.`id` AS `id`,`lms_data_repository`.`enterprise_directory_user_session`.`userId` AS `userId`,`lms_data_repository`.`enterprise_directory_user_session`.`userIp` AS `userIp`,`lms_data_repository`.`enterprise_directory_user_session`.`userIpRegion` AS `userIpRegion`,`lms_data_repository`.`enterprise_directory_user_session`.`userAgent` AS `userAgent`,`lms_data_repository`.`enterprise_directory_user_session`.`deviceId` AS `deviceId`,`lms_data_repository`.`enterprise_directory_user_session`.`deviceType` AS `deviceType`,`lms_data_repository`.`enterprise_directory_user_session`.`socketStatus` AS `socketStatus`,`lms_data_repository`.`enterprise_directory_user_session`.`authToken` AS `authToken`,`lms_data_repository`.`enterprise_directory_user_session`.`operation` AS `operation`,`lms_data_repository`.`enterprise_directory_user_session`.`operationByUserId` AS `operationByUserId`,`lms_data_repository`.`enterprise_directory_user_session`.`operationByUser` AS `operationByUser`,`lms_data_repository`.`enterprise_directory_user_session`.`operationAt` AS `operationAt`from`lms_data_repository`.`enterprise_directory_user_session`
_group
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `_group` ASselect`lms_data_repository`.`enterprise_group`.`id` AS `id`,`lms_data_repository`.`enterprise_group`.`groupId` AS `groupId`,`lms_data_repository`.`enterprise_group`.`groupLastId` AS `groupLastId`,`lms_data_repository`.`enterprise_group`.`groupPath` AS `groupPath`,`lms_data_repository`.`enterprise_group`.`groupName` AS `groupName`,`lms_data_repository`.`enterprise_group`.`groupDeptName` AS `groupDeptName`,`lms_data_repository`.`enterprise_group`.`groupAllName` AS `groupAllName`,`lms_data_repository`.`enterprise_group`.`principalId` AS `principalId`,`lms_data_repository`.`enterprise_group`.`headId` AS `headId`,`lms_data_repository`.`enterprise_group`.`leadId` AS `leadId`,`lms_data_repository`.`enterprise_group`.`groupDesc` AS `groupDesc`,`lms_data_repository`.`enterprise_group`.`operation` AS `operation`,`lms_data_repository`.`enterprise_group`.`operationByUserId` AS `operationByUserId`,`lms_data_repository`.`enterprise_group`.`operationByUser` AS `operationByUser`,`lms_data_repository`.`enterprise_group`.`operationAt` AS `operationAt`from`lms_data_repository`.`enterprise_group`
_role
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `_role` ASselect`lms_data_repository`.`enterprise_role`.`id` AS `id`,`lms_data_repository`.`enterprise_role`.`roleId` AS `roleId`,`lms_data_repository`.`enterprise_role`.`roleName` AS `roleName`,`lms_data_repository`.`enterprise_role`.`roleType` AS `roleType`,`lms_data_repository`.`enterprise_role`.`roleDesc` AS `roleDesc`,`lms_data_repository`.`enterprise_role`.`operation` AS `operation`,`lms_data_repository`.`enterprise_role`.`operationByUserId` AS `operationByUserId`,`lms_data_repository`.`enterprise_role`.`operationByUser` AS `operationByUser`,`lms_data_repository`.`enterprise_role`.`operationAt` AS `operationAt`from`lms_data_repository`.`enterprise_role`
_user_group_role
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `_user_group_role` ASselect`lms_data_repository`.`enterprise_user_group_role`.`id` AS `id`,`lms_data_repository`.`enterprise_user_group_role`.`userId` AS `userId`,`lms_data_repository`.`enterprise_user_group_role`.`groupId` AS `groupId`,`lms_data_repository`.`enterprise_user_group_role`.`roleId` AS `roleId`,`lms_data_repository`.`enterprise_user_group_role`.`roleDeadline` AS `roleDeadline`,`lms_data_repository`.`enterprise_user_group_role`.`operation` AS `operation`,`lms_data_repository`.`enterprise_user_group_role`.`operationByUserId` AS `operationByUserId`,`lms_data_repository`.`enterprise_user_group_role`.`operationByUser` AS `operationByUser`,`lms_data_repository`.`enterprise_user_group_role`.`operationAt` AS `operationAt`from`lms_data_repository`.`enterprise_user_group_role`
_user_group_role_page
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `_user_group_role_page` ASselect`lms_data_repository`.`enterprise_user_group_role_page`.`id` AS `id`,`lms_data_repository`.`enterprise_user_group_role_page`.`appId` AS `appId`,`lms_data_repository`.`enterprise_user_group_role_page`.`user` AS `user`,`lms_data_repository`.`enterprise_user_group_role_page`.`group` AS `group`,`lms_data_repository`.`enterprise_user_group_role_page`.`role` AS `role`,`lms_data_repository`.`enterprise_user_group_role_page`.`page` AS `page`,`lms_data_repository`.`enterprise_user_group_role_page`.`allowOrDeny` AS `allowOrDeny`,`lms_data_repository`.`enterprise_user_group_role_page`.`desc` AS `desc`,`lms_data_repository`.`enterprise_user_group_role_page`.`source` AS `source`,`lms_data_repository`.`enterprise_user_group_role_page`.`operation` AS `operation`,`lms_data_repository`.`enterprise_user_group_role_page`.`operationByUserId` AS `operationByUserId`,`lms_data_repository`.`enterprise_user_group_role_page`.`operationByUser` AS `operationByUser`,`lms_data_repository`.`enterprise_user_group_role_page`.`operationAt` AS `operationAt`from`lms_data_repository`.`enterprise_user_group_role_page`where((`lms_data_repository`.`enterprise_user_group_role_page`.`appId` = 'lms-erp')or (`lms_data_repository`.`enterprise_user_group_role_page`.`appId` = '*'))
_user_group_role_resource
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `_user_group_role_resource` ASselect`lms_data_repository`.`enterprise_user_group_role_resource`.`id` AS `id`,`lms_data_repository`.`enterprise_user_group_role_resource`.`appId` AS `appId`,`lms_data_repository`.`enterprise_user_group_role_resource`.`user` AS `user`,`lms_data_repository`.`enterprise_user_group_role_resource`.`group` AS `group`,`lms_data_repository`.`enterprise_user_group_role_resource`.`role` AS `role`,`lms_data_repository`.`enterprise_user_group_role_resource`.`resource` AS `resource`,`lms_data_repository`.`enterprise_user_group_role_resource`.`allowOrDeny` AS `allowOrDeny`,`lms_data_repository`.`enterprise_user_group_role_resource`.`desc` AS `desc`,`lms_data_repository`.`enterprise_user_group_role_resource`.`source` AS `source`,`lms_data_repository`.`enterprise_user_group_role_resource`.`operation` AS `operation`,`lms_data_repository`.`enterprise_user_group_role_resource`.`operationByUserId` AS `operationByUserId`,`lms_data_repository`.`enterprise_user_group_role_resource`.`operationByUser` AS `operationByUser`,`lms_data_repository`.`enterprise_user_group_role_resource`.`operationAt` AS `operationAt`from`lms_data_repository`.`enterprise_user_group_role_resource`where((`lms_data_repository`.`enterprise_user_group_role_resource`.`appId` = 'lms-erp')or (`lms_data_repository`.`enterprise_user_group_role_resource`.`appId` = '*'))
_view01_user
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `_view01_user` ASselect`lms_data_repository`.`enterprise_view01_user`.`id` AS `id`,`lms_data_repository`.`enterprise_view01_user`.`idSequence` AS `idSequence`,`lms_data_repository`.`enterprise_view01_user`.`userId` AS `userId`,`lms_data_repository`.`enterprise_view01_user`.`username` AS `username`,`lms_data_repository`.`enterprise_view01_user`.`phoneNumber` AS `phoneNumber`,`lms_data_repository`.`enterprise_view01_user`.`email` AS `email`,`lms_data_repository`.`enterprise_view01_user`.`userStatus` AS `userStatus`,`lms_data_repository`.`enterprise_view01_user`.`qiweiId` AS `qiweiId`,`lms_data_repository`.`enterprise_view01_user`.`userConfig` AS `userConfig`,`lms_data_repository`.`enterprise_view01_user`.`password` AS `password`,`lms_data_repository`.`enterprise_view01_user`.`md5Salt` AS `md5Salt`,`lms_data_repository`.`enterprise_view01_user`.`clearTextPassword` AS `clearTextPassword`,`lms_data_repository`.`enterprise_view01_user`.`operation` AS `operation`,`lms_data_repository`.`enterprise_view01_user`.`operationByUserId` AS `operationByUserId`,`lms_data_repository`.`enterprise_view01_user`.`operationByUser` AS `operationByUser`,`lms_data_repository`.`enterprise_view01_user`.`operationAt` AS `operationAt`from`lms_data_repository`.`enterprise_view01_user`
_view02_user_app
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `_view02_user_app` ASselect`lms_data_repository`.`enterprise_view02_user_app`.`id` AS `id`,`lms_data_repository`.`enterprise_view02_user_app`.`userId` AS `userId`,`lms_data_repository`.`enterprise_view02_user_app`.`appId` AS `appId`from`lms_data_repository`.`enterprise_view02_user_app`where(`lms_data_repository`.`enterprise_view02_user_app`.`appId` = 'lms-erp')
view01_asset_list_for_apply
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_asset_list_for_apply` ASselect`warehouse_asset`.`assetName` AS `assetName`,group_concat(distinct `warehouse_asset`.`assetSpec` separator ',') AS `assetSpecList`,count(1) AS `assetCount`from`warehouse_asset`group by`warehouse_asset`.`assetName`
view01_customer_sale_order
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_customer_sale_order` ASselect`sale_order`.`id` AS `id`,`sale_order`.`saleOrderId` AS `saleOrderId`,`sale_order`.`customerId` AS `customerId`,`sale_order`.`customerName` AS `customerName`,`sale_order`.`saleOrderDesc` AS `saleOrderDesc`,`sale_order`.`saleProductList` AS `saleProductList`,`sale_order`.`saleProductListCount` AS `saleProductListCount`,`sale_order`.`saleProductTotalCount` AS `saleProductTotalCount`,`sale_order`.`saleTotalAmount` AS `saleTotalAmount`,`sale_order`.`saleOrderStatus` AS `saleOrderStatus`,`sale_order`.`saleOrderStatusDesc` AS `saleOrderStatusDesc`,`sale_order`.`saleCreateAt` AS `saleCreateAt`,`sale_order`.`saleFinishAt` AS `saleFinishAt`,`sale_order`.`operation` AS `operation`,`sale_order`.`operationByUserId` AS `operationByUserId`,`sale_order`.`operationByUser` AS `operationByUser`,`sale_order`.`operationAt` AS `operationAt`,`customer`.`customerAddress` AS `customerAddress`from(`customer`join `sale_order` on ((`customer`.`customerId` = `sale_order`.`customerId`)))
view01_customer_sale_return_order
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_customer_sale_return_order` ASselect`sale_return_order`.`id` AS `id`,`sale_return_order`.`returnOrderId` AS `returnOrderId`,`sale_return_order`.`customerId` AS `customerId`,`sale_return_order`.`customerName` AS `customerName`,`sale_return_order`.`returnOrderDesc` AS `returnOrderDesc`,`sale_return_order`.`returnProductList` AS `returnProductList`,`sale_return_order`.`returnProductListCount` AS `returnProductListCount`,`sale_return_order`.`returnProductTotalCount` AS `returnProductTotalCount`,`sale_return_order`.`returnTotalAmount` AS `returnTotalAmount`,`sale_return_order`.`returnOrderStatus` AS `returnOrderStatus`,`sale_return_order`.`returnCreateAt` AS `returnCreateAt`,`sale_return_order`.`returnFinishAt` AS `returnFinishAt`,`sale_return_order`.`operation` AS `operation`,`sale_return_order`.`operationByUserId` AS `operationByUserId`,`sale_return_order`.`operationByUser` AS `operationByUser`,`sale_return_order`.`operationAt` AS `operationAt`,`customer`.`customerAddress` AS `customerAddress`from(`customer`join `sale_return_order` on ((`customer`.`customerId` = `sale_return_order`.`customerId`)))
view01_finance_asset_info
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_finance_asset_info` ASselect`finance_asset`.`id` AS `id`,`finance_asset`.`idSequence` AS `idSequence`,`warehouse_asset`.`assetId` AS `assetId`,`warehouse_asset`.`assetName` AS `assetName`,`finance_asset`.`currentPeriod` AS `currentPeriod`,`finance_asset`.`depreciationMethod` AS `depreciationMethod`,`finance_asset`.`financeAssetSubject` AS `financeAssetSubject`,`finance_asset`.`financeDepreciationSubject` AS `financeDepreciationSubject`,`finance_asset`.`financeClearSubject` AS `financeClearSubject`,`finance_asset`.`financeDepreciationFeeSubject` AS `financeDepreciationFeeSubject`,`finance_asset`.`startUseAt` AS `startUseAt`,`finance_asset`.`assetValue` AS `assetValue`,`finance_asset`.`residualRate` AS `residualRate`,`finance_asset`.`estimatedUseMonth` AS `estimatedUseMonth`,`finance_asset`.`depreciatedMonths` AS `depreciatedMonths`,`finance_asset`.`remainingMonth` AS `remainingMonth`,`finance_asset`.`monthlyDepreciation` AS `monthlyDepreciation`,`finance_asset`.`totalDepreciation` AS `totalDepreciation`,`finance_asset`.`currentYearDepreciation` AS `currentYearDepreciation`,`finance_asset`.`preYearDepreciation` AS `preYearDepreciation`,`finance_asset`.`currentPeriodDepreciation` AS `currentPeriodDepreciation`,`finance_asset`.`operation` AS `operation`,`finance_asset`.`operationByUserId` AS `operationByUserId`,`finance_asset`.`operationByUser` AS `operationByUser`,`finance_asset`.`operationAt` AS `operationAt`from(`warehouse_asset`left join `finance_asset` on ((`warehouse_asset`.`assetId` = `finance_asset`.`assetId`)))
view01_next_voucher_number
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_next_voucher_number` ASselect`voucher`.`periodId` AS `periodId`,(max(`voucher`.`voucherNumber`) + 1) AS `maxVoucherNumber`from`voucher`group by`voucher`.`periodId`
view01_period_voucher
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_period_voucher` ASselect`finance_period`.`id` AS `id`,`finance_period`.`periodId` AS `periodId`,`finance_period`.`isDepreciation` AS `isDepreciation`,`finance_period`.`isPeriodStart` AS `isPeriodStart`,`voucher`.`voucherName` AS `voucherName`,`voucher`.`voucherNumber` AS `voucherNumber`,`voucher`.`voucherId` AS `voucherId`,`voucher`.`voucherType` AS `voucherType`,`voucher`.`voucherDebitSum` AS `voucherDebitSum`,`voucher`.`voucherCreditSum` AS `voucherCreditSum`,`voucher`.`voucherAt` AS `voucherAt`,`voucher`.`operation` AS `operation`,`voucher`.`operationByUser` AS `operationByUser`,`voucher`.`operationAt` AS `operationAt`from(`finance_period`left join `voucher` on ((`finance_period`.`depreciationVoucherId` = `voucher`.`voucherId`)))
view01_purchase_order
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_purchase_order` ASselect`purchase_order`.`id` AS `id`,`purchase_order`.`idSequence` AS `idSequence`,`purchase_order`.`purchaseOrderId` AS `purchaseOrderId`,`purchase_order`.`supplierId` AS `supplierId`,`purchase_order`.`supplierName` AS `supplierName`,`purchase_order`.`supplierInfo` AS `supplierInfo`,`purchase_order`.`purchaseOrderDesc` AS `purchaseOrderDesc`,`purchase_order`.`purchaseProductList` AS `purchaseProductList`,`purchase_order`.`purchaseProductListCount` AS `purchaseProductListCount`,`purchase_order`.`purchaseProductTotalCount` AS `purchaseProductTotalCount`,`purchase_order`.`purchaseTotalAmount` AS `purchaseTotalAmount`,`purchase_order`.`purchaseOrderStatus` AS `purchaseOrderStatus`,`purchase_order`.`purchaseOrderStatusDesc` AS `purchaseOrderStatusDesc`,`purchase_order`.`purchaseCreateAt` AS `purchaseCreateAt`,`purchase_order`.`purchaseFinishAt` AS `purchaseFinishAt`,`purchase_order`.`operation` AS `operation`,`purchase_order`.`operationByUserId` AS `operationByUserId`,`purchase_order`.`operationByUser` AS `operationByUser`,`purchase_order`.`operationAt` AS `operationAt`,ifnull((selectsum(`warehouse_inventory`.`count`)from`warehouse_inventory`where(`warehouse_inventory`.`inventoryInOrderId` = `purchase_order`.`purchaseOrderId`)),0) AS `inventoryCount`,ifnull((selectsum(`payment_order`.`deductionAmount`)from`payment_order`where((`payment_order`.`orderId` = `purchase_order`.`purchaseOrderId`)and (`payment_order`.`paymentType` = '付款'))),0) AS `purchasePaidAmount`,ifnull((selectsum(`warehouse_inventory_record`.`operationCount`)from`warehouse_inventory_record`where(`warehouse_inventory_record`.`operationTypeOrderId` = `purchase_order`.`purchaseOrderId`)),0) AS `purchaseProductInStoreCount`,`purchase_order`.`purchaseOrderType` AS `purchaseOrderType`from`purchase_order`
view01_purchase_order_v2
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_purchase_order_v2` ASselect`purchase_order`.`id` AS `id`,`purchase_order`.`idSequence` AS `idSequence`,`purchase_order`.`purchaseOrderId` AS `purchaseOrderId`,`purchase_order`.`supplierId` AS `supplierId`,`purchase_order`.`supplierName` AS `supplierName`,`purchase_order`.`supplierInfo` AS `supplierInfo`,`purchase_order`.`purchaseOrderDesc` AS `purchaseOrderDesc`,`purchase_order`.`purchaseProductList` AS `purchaseProductList`,`purchase_order`.`purchaseProductListCount` AS `purchaseProductListCount`,`purchase_order`.`purchaseProductTotalCount` AS `purchaseProductTotalCount`,`purchase_order`.`purchaseTotalAmount` AS `purchaseTotalAmount`,`purchase_order`.`purchaseOrderStatus` AS `purchaseOrderStatus`,`purchase_order`.`purchaseOrderStatusDesc` AS `purchaseOrderStatusDesc`,`purchase_order`.`purchaseCreateAt` AS `purchaseCreateAt`,`purchase_order`.`purchaseFinishAt` AS `purchaseFinishAt`,`purchase_order`.`operation` AS `operation`,`purchase_order`.`operationByUserId` AS `operationByUserId`,`purchase_order`.`operationByUser` AS `operationByUser`,`purchase_order`.`operationAt` AS `operationAt`,(selectcount(`warehouse_asset`.`inventoryInOrderId`)from`warehouse_asset`where(`warehouse_asset`.`inventoryInOrderId` = `purchase_order`.`purchaseOrderId`)) AS `assetCount`,ifnull((selectsum(`warehouse_inventory`.`count`)from`warehouse_inventory`where(`warehouse_inventory`.`inventoryInOrderId` = `purchase_order`.`purchaseOrderId`)),0) AS `inventoryCount`,ifnull((selectsum(`payment_order`.`deductionAmount`)from`payment_order`where((`payment_order`.`orderId` = `purchase_order`.`purchaseOrderId`)and (`payment_order`.`paymentType` = '付款'))),0) AS `purchasePaidAmount`,ifnull((selectsum(`warehouse_inventory_record`.`operationCount`)from`warehouse_inventory_record`where(`warehouse_inventory_record`.`operationTypeOrderId` = `purchase_order`.`purchaseOrderId`)),0) AS `purchaseProductInStoreCount`,`purchase_order`.`purchaseOrderType` AS `purchaseOrderType`from`purchase_order`
view01_purchase_return_order
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_purchase_return_order` ASselect`purchase_return_order`.`id` AS `id`,`purchase_return_order`.`idSequence` AS `idSequence`,`purchase_return_order`.`returnOrderId` AS `returnOrderId`,`purchase_return_order`.`supplierId` AS `supplierId`,`purchase_return_order`.`supplierName` AS `supplierName`,`purchase_return_order`.`supplierInfo` AS `supplierInfo`,`purchase_return_order`.`returnOrderDesc` AS `returnOrderDesc`,`purchase_return_order`.`returnProductList` AS `returnProductList`,`purchase_return_order`.`returnProductListCount` AS `returnProductListCount`,`purchase_return_order`.`returnProductTotalCount` AS `returnProductTotalCount`,`purchase_return_order`.`returnTotalAmount` AS `returnTotalAmount`,`purchase_return_order`.`returnOrderStatus` AS `returnOrderStatus`,`purchase_return_order`.`returnOrderStatusDesc` AS `returnOrderStatusDesc`,`purchase_return_order`.`returnCreateAt` AS `returnCreateAt`,`purchase_return_order`.`returnFinishAt` AS `returnFinishAt`,`purchase_return_order`.`returnOrderType` AS `returnOrderType`,`purchase_return_order`.`returnOrderRemark` AS `returnOrderRemark`,`purchase_return_order`.`operation` AS `operation`,`purchase_return_order`.`operationByUserId` AS `operationByUserId`,`purchase_return_order`.`operationByUser` AS `operationByUser`,`purchase_return_order`.`operationAt` AS `operationAt`,ifnull((selectsum(`payment_order`.`deductionAmount`)from`payment_order`where((`payment_order`.`orderId` = `purchase_return_order`.`returnOrderId`)and (`payment_order`.`paymentType` = '收款')and (`payment_order`.`orderType` = '采购退货订单'))),0) AS `returnPaidAmount`,ifnull((selectsum(`warehouse_inventory_record`.`operationCount`)from`warehouse_inventory_record`where(`warehouse_inventory_record`.`operationTypeOrderId` = `purchase_return_order`.`returnOrderId`)),0) AS `returnProductOutStoreCount`,ifnull((selectcount(`warehouse_asset_record`.`operationType`)from`warehouse_asset_record`where(`warehouse_asset_record`.`operationTypeOrderId` = `purchase_return_order`.`returnOrderId`)),0) AS `returnAssetProductOutStoreCount`from`purchase_return_order`
view01_sale_order
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_sale_order` ASselect`sale_order`.`id` AS `id`,`sale_order`.`idSequence` AS `idSequence`,`sale_order`.`saleOrderId` AS `saleOrderId`,`sale_order`.`customerId` AS `customerId`,`sale_order`.`customerName` AS `customerName`,`sale_order`.`customerInfo` AS `customerInfo`,`sale_order`.`saleOrderDesc` AS `saleOrderDesc`,`sale_order`.`saleProductList` AS `saleProductList`,`sale_order`.`saleProductListCount` AS `saleProductListCount`,`sale_order`.`saleProductTotalCount` AS `saleProductTotalCount`,`sale_order`.`saleTotalAmount` AS `saleTotalAmount`,`sale_order`.`saleOrderStatus` AS `saleOrderStatus`,`sale_order`.`saleOrderStatusDesc` AS `saleOrderStatusDesc`,`sale_order`.`saleCreateAt` AS `saleCreateAt`,`sale_order`.`saleFinishAt` AS `saleFinishAt`,`sale_order`.`operation` AS `operation`,`sale_order`.`operationByUserId` AS `operationByUserId`,`sale_order`.`operationAt` AS `operationAt`,`sale_order`.`operationByUser` AS `operationByUser`,ifnull((selectsum(`payment_order`.`deductionAmount`)from`payment_order`where((`payment_order`.`orderId` = `sale_order`.`saleOrderId`)and (`payment_order`.`paymentType` = '收款'))),0) AS `salePaidAmount`,ifnull((selectsum(`warehouse_inventory_record`.`operationCount`)from`warehouse_inventory_record`where(`warehouse_inventory_record`.`operationTypeOrderId` = `sale_order`.`saleOrderId`)),0) AS `saleProductOutStoreCount`from`sale_order`
view01_sale_return_order
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_sale_return_order` ASselect`sale_return_order`.`id` AS `id`,`sale_return_order`.`idSequence` AS `idSequence`,`sale_return_order`.`returnOrderId` AS `returnOrderId`,`sale_return_order`.`customerId` AS `customerId`,`sale_return_order`.`customerName` AS `customerName`,`sale_return_order`.`customerInfo` AS `customerInfo`,`sale_return_order`.`returnOrderDesc` AS `returnOrderDesc`,`sale_return_order`.`returnProductList` AS `returnProductList`,`sale_return_order`.`returnProductListCount` AS `returnProductListCount`,`sale_return_order`.`returnProductTotalCount` AS `returnProductTotalCount`,`sale_return_order`.`returnTotalAmount` AS `returnTotalAmount`,`sale_return_order`.`returnOrderStatus` AS `returnOrderStatus`,`sale_return_order`.`returnOrderStatusDesc` AS `returnOrderStatusDesc`,`sale_return_order`.`returnCreateAt` AS `returnCreateAt`,`sale_return_order`.`returnOrderRemark` AS `returnOrderRemark`,`sale_return_order`.`returnFinishAt` AS `returnFinishAt`,`sale_return_order`.`operation` AS `operation`,`sale_return_order`.`operationByUserId` AS `operationByUserId`,`sale_return_order`.`operationByUser` AS `operationByUser`,`sale_return_order`.`operationAt` AS `operationAt`,ifnull((selectsum(`warehouse_inventory`.`count`)from`warehouse_inventory`where(`warehouse_inventory`.`inventoryInOrderId` = `sale_return_order`.`returnOrderId`)),0) AS `returnProductOutStoreCount`,ifnull((selectsum(`payment_order`.`deductionAmount`)from`payment_order`where((`payment_order`.`orderId` = `sale_return_order`.`returnOrderId`)and (`payment_order`.`paymentType` = '销售退货付款'))),0) AS `returnPaidAmount`from`sale_return_order`
view01_supplier_info
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_supplier_info` ASselect`supplier`.`id` AS `id`,`supplier`.`supplierId` AS `supplierId`,`supplier`.`idSequence` AS `idSequence`,`supplier`.`supplierName` AS `supplierName`,count(`supplier_product`.`id`) AS `productCount`,`supplier`.`supplierAccountNum` AS `supplierAccountNum`,`supplier`.`supplierBankName` AS `supplierBankName`,`supplier`.`supplierBusinessLicenseNum` AS `supplierBusinessLicenseNum`,`supplier`.`supplierMedicalOperatingLicenseNum` AS `supplierMedicalOperatingLicenseNum`,`supplier`.`supplierPaymentCycle` AS `supplierPaymentCycle`,`supplier`.`supplierAddress` AS `supplierAddress`,`supplier`.`supplierPostalCode` AS `supplierPostalCode`,`supplier`.`supplierContactPerson` AS `supplierContactPerson`,`supplier`.`supplierPhoneNum` AS `supplierPhoneNum`,`supplier`.`remark` AS `remark`,`supplier`.`rowStatus` AS `rowStatus`,`supplier`.`operation` AS `operation`,`supplier`.`operationByUserId` AS `operationByUserId`,`supplier`.`operationByUser` AS `operationByUser`,`supplier`.`operationAt` AS `operationAt`,`supplier`.`supplierBranchBankName` AS `supplierBranchBankName`from(`supplier`left join `supplier_product` on ((`supplier`.`supplierId` = `supplier_product`.`supplierId`)))group by`supplier`.`supplierId`
view01_ticket_order
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_ticket_order` ASselect`ticket`.`id` AS `id`,`ticket`.`idSequence` AS `idSequence`,`ticket`.`ticketId` AS `ticketId`,`purchase_order`.`supplierId` AS `purchaseOrderSupplierId`,`sale_order`.`customerId` AS `saleOrderCustomerId`,`ticket`.`ticketBizId` AS `ticketBizId`,`ticket`.`ticketType` AS `ticketType`,`ticket`.`ticketDesc` AS `ticketDesc`,`ticket`.`ticketContentRequest` AS `ticketContentRequest`,`ticket`.`ticketContent` AS `ticketContent`,`ticket`.`ticketCommentList` AS `ticketCommentList`,`ticket`.`ticketAmount` AS `ticketAmount`,`ticket`.`ticketRequestAt` AS `ticketRequestAt`,`ticket`.`ticketRequestByUserId` AS `ticketRequestByUserId`,`ticket`.`ticketRequestByUser` AS `ticketRequestByUser`,`ticket`.`ticketStatus` AS `ticketStatus`,`ticket`.`ticketStatusAt` AS `ticketStatusAt`,`ticket`.`ticketStatusDesc` AS `ticketStatusDesc`,`ticket`.`ticketStatusByUserId` AS `ticketStatusByUserId`,`ticket`.`ticketStatusByUser` AS `ticketStatusByUser`,`ticket`.`operation` AS `operation`,`ticket`.`operationByUserId` AS `operationByUserId`,`ticket`.`operationByUser` AS `operationByUser`,`ticket`.`operationAt` AS `operationAt`from((`ticket`left join `purchase_order` on ((`ticket`.`ticketBizId` = `purchase_order`.`purchaseOrderId`)))left join `sale_order` on ((`ticket`.`ticketBizId` = `sale_order`.`saleOrderId`)))
view01_ticket_voucher
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_ticket_voucher` ASselect`ticket`.`id` AS `id`,`ticket`.`idSequence` AS `idSequence`,`ticket`.`ticketId` AS `ticketId`,`ticket`.`ticketBizId` AS `ticketBizId`,`ticket`.`ticketType` AS `ticketType`,`ticket`.`ticketDesc` AS `ticketDesc`,`ticket`.`ticketContentRequest` AS `ticketContentRequest`,`ticket`.`ticketContent` AS `ticketContent`,`ticket`.`ticketCommentList` AS `ticketCommentList`,`ticket`.`ticketRequestAmount` AS `ticketRequestAmount`,`ticket`.`ticketAmount` AS `ticketAmount`,`ticket`.`ticketRequestAt` AS `ticketRequestAt`,`ticket`.`ticketRequestByUserId` AS `ticketRequestByUserId`,`ticket`.`ticketRequestByUser` AS `ticketRequestByUser`,`ticket`.`ticketStatus` AS `ticketStatus`,`ticket`.`ticketStatusAt` AS `ticketStatusAt`,`ticket`.`ticketStatusDesc` AS `ticketStatusDesc`,`ticket`.`ticketStatusByUserId` AS `ticketStatusByUserId`,`ticket`.`ticketStatusByUser` AS `ticketStatusByUser`,`ticket`.`operation` AS `operation`,`ticket`.`operationByUserId` AS `operationByUserId`,`ticket`.`operationByUser` AS `operationByUser`,`ticket`.`operationAt` AS `operationAt`,`voucher`.`voucherId` AS `voucherId`from(`ticket`left join `voucher` on ((`voucher`.`ticketIdList` like concat('%', `ticket`.`ticketId`, '%'))))
view01_warehouse_inventory
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_warehouse_inventory` ASselect`wi`.`id` AS `id`,`wi`.`inventoryId` AS `inventoryId`,`wi`.`productName` AS `productName`,`wi`.`warehouseName` AS `warehouseName`,`wi`.`stockName` AS `stockName`,`wi`.`count` AS `count`,`wi`.`countOfInventoryIn` AS `countOfInventoryIn`,`wi`.`productUnit` AS `productUnit`,`wi`.`productSpec` AS `productSpec`,`wi`.`productSpecPrice` AS `productSpecPrice`,`wi`.`productType` AS `productType`,`wi`.`productTransport` AS `productTransport`,`wi`.`supplierId` AS `supplierId`,`wi`.`supplierName` AS `supplierName`,`wi`.`manufacturerName` AS `manufacturerName`,`wi`.`inventoryInType` AS `inventoryInType`,`wi`.`inventoryInOrderId` AS `inventoryInOrderId`,`wi`.`inventoryInAt` AS `inventoryInAt`,`wi`.`productionBatchNum` AS `productionBatchNum`,`wi`.`productionAt` AS `productionAt`,`wi`.`expirationAt` AS `expirationAt`,`wi`.`operation` AS `operation`,`wi`.`operationByUserId` AS `operationByUserId`,`wi`.`operationByUser` AS `operationByUser`,`wi`.`operationAt` AS `operationAt`,`sp`.`manufacturerProductRCNum` AS `manufacturerProductRCNum`,`sp`.`manufacturerProductRCExpireAt` AS `manufacturerProductRCExpireAt`,`sp`.`manufacturerLicenseNum` AS `manufacturerLicenseNum`,`wi`.`purchaseProductSpecPriceWithoutTax` AS `purchaseProductSpecPriceWithoutTax`,`wi`.`purchaseProductTaxRate` AS `purchaseProductTaxRate`,`wi`.`purchaseProductTaxPrice` AS `purchaseProductTaxPrice`,`wi`.`purchaseProductSpecPrice` AS `purchaseProductSpecPrice`,`wi`.`purchaseProductTotalAmount` AS `purchaseProductTotalAmount`,`wi`.`purchaseProductTotalAmountWithoutTax` AS `purchaseProductTotalAmountWithoutTax`from(`warehouse_inventory` `wi`left join `supplier_product` `sp` on (((`sp`.`supplierId` = `wi`.`supplierId`)and (`sp`.`productName` = `wi`.`productName`))))