数据结构
12076表总览
通用表
- _user
- _user_session
- _role
- _page
- _resource
- _group
- _user_group_role
- _user_group_role_page
- _user_group_role_resource
- _constant
- _constant_ui
- _record
- _record_history
- _cache
- _file
- _view01_user
业务表
_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 施工方案'
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) CHARACTER SET utf8 DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
`operationByUserId` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者userId',
`operationByUser` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者用户名',
`operationAt` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 29 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 '资产;',
`assetSpec` varchar(255) DEFAULT NULL COMMENT '资产规格',
`currentPeriod` varchar(255) DEFAULT NULL COMMENT '当前会计期间; 2022-02',
`entryPeriod` 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;',
`assetTypeId` varchar(255) DEFAULT NULL COMMENT '资产类别ID; ZCLB10001',
`assetTypeName` varchar(255) DEFAULT NULL COMMENT '资产类别名称;',
`deptId` varchar(255) DEFAULT NULL COMMENT '部门ID;',
`deptName` varchar(255) DEFAULT NULL COMMENT '部门名称;',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB 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 '资产;',
`assetSpec` varchar(255) DEFAULT NULL COMMENT '资产规格',
`assetOperationType` varchar(255) DEFAULT '折旧' COMMENT '操作类型',
`currentPeriod` varchar(255) DEFAULT NULL COMMENT '当前会计期间; 2022-02',
`entryPeriod` 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;',
`assetTypeId` varchar(255) DEFAULT NULL COMMENT '资产类别ID; ZCLB10001',
`assetTypeName` varchar(255) DEFAULT NULL COMMENT '资产类别名称;',
`deptId` varchar(255) DEFAULT NULL COMMENT '部门ID;',
`deptName` varchar(255) DEFAULT NULL COMMENT '部门名称;',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '财务-资产信息明细表'
finance_asset_type
- 财务-资产信息表
CREATE TABLE `finance_asset_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',
`assetTypeId` varchar(255) DEFAULT NULL COMMENT '资产类别ID; ZCLB10001',
`assetTypeName` varchar(255) DEFAULT NULL COMMENT '资产类别名称;',
`depreciationMethod` varchar(255) DEFAULT NULL COMMENT '折旧方法; 平均年限法、不折旧',
`financeAssetSubject` varchar(255) DEFAULT NULL COMMENT '资产科目; 固定资产',
`financeDepreciationSubject` varchar(255) DEFAULT NULL COMMENT '累计折旧科目; 累计折旧',
`residualRate` decimal(10, 2) DEFAULT NULL COMMENT '残值率',
`financeAssetSubjectId` varchar(255) DEFAULT NULL COMMENT '资产科目ID;',
`financeDepreciationSubjectId` varchar(255) DEFAULT NULL COMMENT '累计折旧科目ID;',
`remark` 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 = 19 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 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 = 45 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 = 45 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '收款&付款表-订单抵扣表'
product_price_record
CREATE TABLE `product_price_record` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`orderType` varchar(255) DEFAULT NULL COMMENT '订单类型',
`customerId` varchar(255) DEFAULT NULL COMMENT '客户ID',
`customerName` varchar(255) DEFAULT NULL COMMENT '客户名',
`supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID; GH10001',
`supplierName` varchar(255) DEFAULT NULL COMMENT '供应商名',
`manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂商名',
`productName` varchar(255) DEFAULT NULL COMMENT '产品名',
`productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格',
`saleProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '销售含税单价/元',
`productSpecPrice` 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',
`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间',
`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin
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 = 122 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '采购订单表'
purchase_price_history
CREATE TABLE `purchase_price_history` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`purchaseOrderId` varchar(255) DEFAULT NULL COMMENT '订单ID',
`orderType` varchar(255) DEFAULT NULL COMMENT '订单类型',
`supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID; GH10001',
`supplierName` varchar(255) DEFAULT NULL COMMENT '供应商名',
`productName` varchar(255) DEFAULT NULL COMMENT '产品名',
`manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂商名',
`productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格',
`productSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '含税单价/元; 采购价格',
`purchaseProductTaxRate` int(11) DEFAULT NULL COMMENT '税率;',
`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间',
`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin
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 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) CHARACTER SET utf8 DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
`operationByUserId` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者userId',
`operationByUser` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者用户名',
`operationAt` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin
sale_price_history
CREATE TABLE `sale_price_history` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`saleOrderId` varchar(255) DEFAULT NULL COMMENT '订单ID',
`orderType` varchar(255) DEFAULT NULL COMMENT '订单类型',
`customerId` varchar(255) DEFAULT NULL COMMENT '客户ID; GH10001',
`supplierName` varchar(255) DEFAULT NULL COMMENT '供应商名',
`productName` varchar(255) DEFAULT NULL COMMENT '产品名',
`manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂商名',
`productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格',
`saleProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '含税单价/元; 销售价格',
`productTaxRate` int(11) DEFAULT NULL COMMENT '税率;',
`operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
`operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
`operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间',
`operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 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) CHARACTER SET utf8 DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
`operationByUserId` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者userId',
`operationByUser` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者用户名',
`operationAt` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '销售退货订单表'
subject
- 科目表
CREATE TABLE `subject` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`appaId` varchar(255) DEFAULT NULL COMMENT '账套ID',
`subjectId` varchar(255) DEFAULT NULL COMMENT '科目编码; 资产类 1001++, 负债类2001++..',
`subjectName` varchar(255) DEFAULT NULL COMMENT '科目名称;',
`subjectLabel` varchar(255) DEFAULT NULL COMMENT '科目标签;',
`subjectCategory` varchar(255) DEFAULT NULL COMMENT '科目分类;资产, 负债, 权益, 成本, 损益',
`subjectLevel` int(11) DEFAULT '1' COMMENT '科目级别; 1级科目、2级科目….',
`subjectHasChildren` varchar(255) DEFAULT '无下级科目' COMMENT '科目类型; 有下级科目, 无下级科目',
`subjectBalanceDirection` varchar(4) DEFAULT NULL COMMENT '科目余额方向; 借、贷',
`assistList` varchar(255) DEFAULT NULL COMMENT '辅助核算配置列表; “,”拼接 E.g: 客户,供应商,职员,项目,部门,拓展1,拓展2 ',
`isShown` varchar(255) DEFAULT '显示' COMMENT '是否显示;显示,隐藏',
`remark` 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,
UNIQUE KEY `appaId_subject_unique` (`appaId`, `subjectId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4840 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '科目表'
subject_balance_period
- 科目余额表-会计期间维度
CREATE TABLE `subject_balance_period` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`appaId` varchar(255) DEFAULT NULL COMMENT '账套ID',
`periodId` varchar(255) DEFAULT NULL COMMENT '会计期间; E.g: 2023-03',
`financeYear` varchar(255) DEFAULT NULL COMMENT '财年;',
`subjectId` varchar(255) DEFAULT NULL COMMENT '科目编码;',
`startDebit` decimal(14, 2) DEFAULT '0.00' COMMENT '期初余额-借方',
`startCredit` decimal(14, 2) DEFAULT '0.00' COMMENT '期初余额-贷方',
`occurDebit` decimal(14, 2) DEFAULT '0.00' COMMENT '本期发生额-借方',
`occurCredit` decimal(14, 2) DEFAULT '0.00' COMMENT '本期发生额-贷方',
`occurAmount` decimal(14, 2) DEFAULT '0.00' COMMENT '本期余额/本期实际损益发生额',
`endDebit` decimal(14, 2) DEFAULT '0.00' COMMENT '期末余额-借方',
`endCredit` decimal(14, 2) DEFAULT '0.00' COMMENT '期末余额-贷方',
`isPeriodStart` 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,
UNIQUE KEY `appaId_periodId_subjectId_unique` (`appaId`, `periodId`, `subjectId`) USING BTREE,
KEY `subjectId_index` (`subjectId`) USING BTREE,
KEY `periodId_index` (`periodId`) USING BTREE
) ENGINE = InnoDB 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 = 47 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 = 936 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 = 467 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 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 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 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 '生产厂家',
`manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '生产厂家-产品注册证号;',
`manufacturerLicenseNum` 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 ',
`purchaseProductTaxPriceRealTime` decimal(10, 2) DEFAULT NULL COMMENT '产品总税额,实时',
`purchaseProductTotalAmountRealTime` decimal(10, 2) DEFAULT NULL COMMENT '产品含税总金额,实时',
`purchaseProductTotalAmountWithoutTaxRealTime` decimal(10, 2) DEFAULT NULL COMMENT '产品不含税总金额,实时',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 199 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 '产品规格;',
`purchaseProductSpecPriceWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '产品去税价格',
`productSpecPrice` decimal(10, 0) DEFAULT NULL COMMENT '产品价格;',
`purchaseProductTaxRate` decimal(10, 2) DEFAULT NULL COMMENT '产品税率',
`purchaseProductTaxPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品税额',
`saleProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品价格;',
`saleProductTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '含税总金额',
`productTotalAmountWithoutTax` 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',
`manufacturerLicenseNum` 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 ',
`productSpecPriceWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '产品去税价格',
`productTaxRate` decimal(10, 2) DEFAULT NULL COMMENT '产品税率',
`productTaxPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品税额',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `inventoryRecordId_unique` (`inventoryRecordId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 170 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '仓库-库存表-记录表'
warehouse_stock
- 仓库货架表
CREATE TABLE `warehouse_stock` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idSequence` int(255) DEFAULT NULL COMMENT '顺序id;',
`warehouseId` varchar(255) DEFAULT NULL COMMENT '仓库编号;',
`warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库名;',
`warehouseType` varchar(255) DEFAULT NULL COMMENT '仓库类型; 冷库, 其它',
`stockCount` int(11) DEFAULT '0' COMMENT '货架个数',
`stockList` text COMMENT '货架列表; [{ stockName, stockType }]',
`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,
UNIQUE KEY `warehouseName_unique` (`warehouseName`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 68 DEFAULT CHARSET = utf8mb4 COMMENT = '仓库货架表'
业务视图
_view02_user_app
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`localhost` SQL SECURITY DEFINER VIEW `_view02_user_app` AS
select
`jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`.`id` AS `id`,
`jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`.`userId` AS `userId`,
`jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`.`appId` AS `appId`
from
`jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`
where
(
`jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`.`appId` = 'jianghu-erp'
)
view01_asset_list_for_apply
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_asset_list_for_apply` AS
select
`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` AS
select
`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` AS
select
`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` AS
select
`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_finance_asset_last
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_finance_asset_last` AS
select
`subquery`.`id` AS `id`,
`subquery`.`idSequence` AS `idSequence`,
`subquery`.`assetId` AS `assetId`,
`subquery`.`assetName` AS `assetName`,
`subquery`.`assetSpec` AS `assetSpec`,
`subquery`.`currentPeriod` AS `currentPeriod`,
`subquery`.`depreciationMethod` AS `depreciationMethod`,
`subquery`.`financeAssetSubject` AS `financeAssetSubject`,
`subquery`.`financeDepreciationSubject` AS `financeDepreciationSubject`,
`subquery`.`financeClearSubject` AS `financeClearSubject`,
`subquery`.`financeDepreciationFeeSubject` AS `financeDepreciationFeeSubject`,
`subquery`.`startUseAt` AS `startUseAt`,
`subquery`.`assetValue` AS `assetValue`,
`subquery`.`residualRate` AS `residualRate`,
`subquery`.`estimatedUseMonth` AS `estimatedUseMonth`,
`subquery`.`depreciatedMonths` AS `depreciatedMonths`,
`subquery`.`remainingMonth` AS `remainingMonth`,
`subquery`.`monthlyDepreciation` AS `monthlyDepreciation`,
`subquery`.`totalDepreciation` AS `totalDepreciation`,
`subquery`.`currentYearDepreciation` AS `currentYearDepreciation`,
`subquery`.`preYearDepreciation` AS `preYearDepreciation`,
`subquery`.`currentPeriodDepreciation` AS `currentPeriodDepreciation`,
`subquery`.`operation` AS `operation`,
`subquery`.`operationByUserId` AS `operationByUserId`,
`subquery`.`operationByUser` AS `operationByUser`,
`subquery`.`operationAt` AS `operationAt`,
`subquery`.`financeAssetSubjectId` AS `financeAssetSubjectId`,
`subquery`.`financeDepreciationSubjectId` AS `financeDepreciationSubjectId`,
`subquery`.`financeClearSubjectId` AS `financeClearSubjectId`,
`subquery`.`financeDepreciationFeeSubjectId` AS `financeDepreciationFeeSubjectId`,
`subquery`.`assetTypeId` AS `assetTypeId`,
`subquery`.`assetTypeName` AS `assetTypeName`,
`subquery`.`deptId` AS `deptId`,
`subquery`.`deptName` AS `deptName`,
max(`subquery`.`currentPeriod`) AS `latestCurrentPeriod`
from
(
select
`jianghu_erp`.`finance_asset`.`id` AS `id`,
`jianghu_erp`.`finance_asset`.`idSequence` AS `idSequence`,
`jianghu_erp`.`finance_asset`.`assetId` AS `assetId`,
`jianghu_erp`.`finance_asset`.`assetName` AS `assetName`,
`jianghu_erp`.`finance_asset`.`assetSpec` AS `assetSpec`,
`jianghu_erp`.`finance_asset`.`currentPeriod` AS `currentPeriod`,
`jianghu_erp`.`finance_asset`.`depreciationMethod` AS `depreciationMethod`,
`jianghu_erp`.`finance_asset`.`financeAssetSubject` AS `financeAssetSubject`,
`jianghu_erp`.`finance_asset`.`financeDepreciationSubject` AS `financeDepreciationSubject`,
`jianghu_erp`.`finance_asset`.`financeClearSubject` AS `financeClearSubject`,
`jianghu_erp`.`finance_asset`.`financeDepreciationFeeSubject` AS `financeDepreciationFeeSubject`,
`jianghu_erp`.`finance_asset`.`startUseAt` AS `startUseAt`,
`jianghu_erp`.`finance_asset`.`assetValue` AS `assetValue`,
`jianghu_erp`.`finance_asset`.`residualRate` AS `residualRate`,
`jianghu_erp`.`finance_asset`.`estimatedUseMonth` AS `estimatedUseMonth`,
`jianghu_erp`.`finance_asset`.`depreciatedMonths` AS `depreciatedMonths`,
`jianghu_erp`.`finance_asset`.`remainingMonth` AS `remainingMonth`,
`jianghu_erp`.`finance_asset`.`monthlyDepreciation` AS `monthlyDepreciation`,
`jianghu_erp`.`finance_asset`.`totalDepreciation` AS `totalDepreciation`,
`jianghu_erp`.`finance_asset`.`currentYearDepreciation` AS `currentYearDepreciation`,
`jianghu_erp`.`finance_asset`.`preYearDepreciation` AS `preYearDepreciation`,
`jianghu_erp`.`finance_asset`.`currentPeriodDepreciation` AS `currentPeriodDepreciation`,
`jianghu_erp`.`finance_asset`.`operation` AS `operation`,
`jianghu_erp`.`finance_asset`.`operationByUserId` AS `operationByUserId`,
`jianghu_erp`.`finance_asset`.`operationByUser` AS `operationByUser`,
`jianghu_erp`.`finance_asset`.`operationAt` AS `operationAt`,
`jianghu_erp`.`finance_asset`.`financeAssetSubjectId` AS `financeAssetSubjectId`,
`jianghu_erp`.`finance_asset`.`financeDepreciationSubjectId` AS `financeDepreciationSubjectId`,
`jianghu_erp`.`finance_asset`.`financeClearSubjectId` AS `financeClearSubjectId`,
`jianghu_erp`.`finance_asset`.`financeDepreciationFeeSubjectId` AS `financeDepreciationFeeSubjectId`,
`jianghu_erp`.`finance_asset`.`assetTypeId` AS `assetTypeId`,
`jianghu_erp`.`finance_asset`.`assetTypeName` AS `assetTypeName`,
`jianghu_erp`.`finance_asset`.`deptId` AS `deptId`,
`jianghu_erp`.`finance_asset`.`deptName` AS `deptName`
from
`jianghu_erp`.`finance_asset`
union all
select
`jianghu_erp`.`finance_asset_record`.`id` AS `id`,
`jianghu_erp`.`finance_asset_record`.`idSequence` AS `idSequence`,
`jianghu_erp`.`finance_asset_record`.`assetId` AS `assetId`,
`jianghu_erp`.`finance_asset_record`.`assetName` AS `assetName`,
`jianghu_erp`.`finance_asset_record`.`assetSpec` AS `assetSpec`,
`jianghu_erp`.`finance_asset_record`.`currentPeriod` AS `currentPeriod`,
`jianghu_erp`.`finance_asset_record`.`depreciationMethod` AS `depreciationMethod`,
`jianghu_erp`.`finance_asset_record`.`financeAssetSubject` AS `financeAssetSubject`,
`jianghu_erp`.`finance_asset_record`.`financeDepreciationSubject` AS `financeDepreciationSubject`,
`jianghu_erp`.`finance_asset_record`.`financeClearSubject` AS `financeClearSubject`,
`jianghu_erp`.`finance_asset_record`.`financeDepreciationFeeSubject` AS `financeDepreciationFeeSubject`,
`jianghu_erp`.`finance_asset_record`.`startUseAt` AS `startUseAt`,
`jianghu_erp`.`finance_asset_record`.`assetValue` AS `assetValue`,
`jianghu_erp`.`finance_asset_record`.`residualRate` AS `residualRate`,
`jianghu_erp`.`finance_asset_record`.`estimatedUseMonth` AS `estimatedUseMonth`,
`jianghu_erp`.`finance_asset_record`.`depreciatedMonths` AS `depreciatedMonths`,
`jianghu_erp`.`finance_asset_record`.`remainingMonth` AS `remainingMonth`,
`jianghu_erp`.`finance_asset_record`.`monthlyDepreciation` AS `monthlyDepreciation`,
`jianghu_erp`.`finance_asset_record`.`totalDepreciation` AS `totalDepreciation`,
`jianghu_erp`.`finance_asset_record`.`currentYearDepreciation` AS `currentYearDepreciation`,
`jianghu_erp`.`finance_asset_record`.`preYearDepreciation` AS `preYearDepreciation`,
`jianghu_erp`.`finance_asset_record`.`currentPeriodDepreciation` AS `currentPeriodDepreciation`,
`jianghu_erp`.`finance_asset_record`.`operation` AS `operation`,
`jianghu_erp`.`finance_asset_record`.`operationByUserId` AS `operationByUserId`,
`jianghu_erp`.`finance_asset_record`.`operationByUser` AS `operationByUser`,
`jianghu_erp`.`finance_asset_record`.`operationAt` AS `operationAt`,
`jianghu_erp`.`finance_asset_record`.`financeAssetSubjectId` AS `financeAssetSubjectId`,
`jianghu_erp`.`finance_asset_record`.`financeDepreciationSubjectId` AS `financeDepreciationSubjectId`,
`jianghu_erp`.`finance_asset_record`.`financeClearSubjectId` AS `financeClearSubjectId`,
`jianghu_erp`.`finance_asset_record`.`financeDepreciationFeeSubjectId` AS `financeDepreciationFeeSubjectId`,
`jianghu_erp`.`finance_asset_record`.`assetTypeId` AS `assetTypeId`,
`jianghu_erp`.`finance_asset_record`.`assetTypeName` AS `assetTypeName`,
`jianghu_erp`.`finance_asset_record`.`deptId` AS `deptId`,
`jianghu_erp`.`finance_asset_record`.`deptName` AS `deptName`
from
`jianghu_erp`.`finance_asset_record`
) `subquery`
group by
`subquery`.`assetId`
view01_next_voucher_number
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_next_voucher_number` AS
select
`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` AS
select
`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` AS
select
`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(
(
select
sum(`warehouse_inventory`.`count`)
from
`warehouse_inventory`
where
(
`warehouse_inventory`.`inventoryInOrderId` = `purchase_order`.`purchaseOrderId`
)
),
0
) AS `inventoryCount`,
ifnull(
(
select
sum(`payment_order`.`deductionAmount`)
from
`payment_order`
where
(
(
`payment_order`.`orderId` = `purchase_order`.`purchaseOrderId`
)
and (`payment_order`.`paymentType` = '付款')
)
),
0
) AS `purchasePaidAmount`,
ifnull(
(
select
sum(`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` AS
select
`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(
(
select
sum(`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(
(
select
sum(`warehouse_inventory_record`.`operationCount`)
from
`warehouse_inventory_record`
where
(
`warehouse_inventory_record`.`operationTypeOrderId` = `purchase_return_order`.`returnOrderId`
)
),
0
) AS `returnProductOutStoreCount`
from
`purchase_return_order`
view01_sale_order
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_sale_order` AS
select
`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(
(
select
sum(`payment_order`.`deductionAmount`)
from
`payment_order`
where
(
(
`payment_order`.`orderId` = `sale_order`.`saleOrderId`
)
and (`payment_order`.`paymentType` = '收款')
)
),
0
) AS `salePaidAmount`,
ifnull(
(
select
sum(`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` AS
select
`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(
(
select
sum(`payment_order`.`deductionAmount`)
from
`payment_order`
where
(
(
`payment_order`.`orderId` = `sale_return_order`.`returnOrderId`
)
and (`payment_order`.`paymentType` = '付款')
)
),
0
) AS `returnPaidAmount`,
ifnull(
(
select
sum(`warehouse_inventory`.`count`)
from
`warehouse_inventory`
where
(
`warehouse_inventory`.`inventoryInOrderId` = `sale_return_order`.`returnOrderId`
)
),
0
) AS `returnProductOutStoreCount`
from
`sale_return_order`
view01_supplier_info
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_supplier_info` AS
select
`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` AS
select
`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` AS
select
`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_voucher_entry
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_voucher_entry` AS
select
`voucher_entry`.`id` AS `id`,
`voucher`.`periodId` AS `periodId`,
`voucher_entry`.`voucherId` AS `voucherId`,
`voucher_entry`.`subjectId` AS `subjectId`,
`voucher_entry`.`subjectName` AS `subjectName`,
`voucher_entry`.`entryAbstract` AS `entryAbstract`,
`voucher_entry`.`debit` AS `debit`,
`voucher_entry`.`credit` AS `credit`,
`voucher_entry`.`assistIdOfCustomer` AS `assistIdOfCustomer`,
`voucher_entry`.`assistIdOfSupplier` AS `assistIdOfSupplier`,
`voucher_entry`.`assistIdOfStaff` AS `assistIdOfStaff`,
`voucher_entry`.`assistIdOfProject` AS `assistIdOfProject`,
`voucher_entry`.`assistIdOfDepart` AS `assistIdOfDepart`,
`voucher_entry`.`assistIdOfExtend1` AS `assistIdOfExtend1`,
`voucher_entry`.`assistIdOfExtend2` AS `assistIdOfExtend2`,
`voucher_entry`.`assistNameOfCustomer` AS `assistNameOfCustomer`,
`voucher_entry`.`assistNameOfSupplier` AS `assistNameOfSupplier`,
`voucher_entry`.`assistNameOfStaff` AS `assistNameOfStaff`,
`voucher_entry`.`assistNameOfProject` AS `assistNameOfProject`,
`voucher_entry`.`assistNameOfDepart` AS `assistNameOfDepart`,
`voucher_entry`.`assistNameOfExtend1` AS `assistNameOfExtend1`,
`voucher_entry`.`assistNameOfExtend2` AS `assistNameOfExtend2`,
`voucher_entry`.`operation` AS `operation`,
`voucher_entry`.`operationByUserId` AS `operationByUserId`,
`voucher_entry`.`operationByUser` AS `operationByUser`,
`voucher_entry`.`operationAt` AS `operationAt`,
`voucher`.`voucherAt` AS `voucherAt`,
`voucher`.`voucherName` AS `voucherName`
from
(
`voucher`
left join `voucher_entry` on (
(
`voucher`.`voucherId` = `voucher_entry`.`voucherId`
)
)
)
view01_warehouse_asset_finance
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_warehouse_asset_finance` AS
select
`jianghu_erp`.`warehouse_asset`.`id` AS `id`,
`jianghu_erp`.`warehouse_asset`.`idSequence` AS `idSequence`,
`jianghu_erp`.`warehouse_asset`.`assetId` AS `assetId`,
`jianghu_erp`.`warehouse_asset`.`assetName` AS `assetName`,
`jianghu_erp`.`warehouse_asset`.`warehouseName` AS `warehouseName`,
`jianghu_erp`.`warehouse_asset`.`stockName` AS `stockName`,
`jianghu_erp`.`warehouse_asset`.`assetUnit` AS `assetUnit`,
`jianghu_erp`.`warehouse_asset`.`assetSpec` AS `assetSpec`,
`jianghu_erp`.`warehouse_asset`.`assetSpecPrice` AS `assetSpecPrice`,
`jianghu_erp`.`warehouse_asset`.`purchaseAssetSpecPriceWithoutTax` AS `purchaseAssetSpecPriceWithoutTax`,
`jianghu_erp`.`warehouse_asset`.`purchaseAssetTaxRate` AS `purchaseAssetTaxRate`,
`jianghu_erp`.`warehouse_asset`.`purchaseAssetTaxPrice` AS `purchaseAssetTaxPrice`,
`jianghu_erp`.`warehouse_asset`.`purchaseAssetSpecPrice` AS `purchaseAssetSpecPrice`,
`jianghu_erp`.`warehouse_asset`.`assetType` AS `assetType`,
`jianghu_erp`.`warehouse_asset`.`assetTransport` AS `assetTransport`,
`jianghu_erp`.`warehouse_asset`.`assetStatus` AS `assetStatus`,
`jianghu_erp`.`warehouse_asset`.`assetUser` AS `assetUser`,
`jianghu_erp`.`warehouse_asset`.`supplierId` AS `supplierId`,
`jianghu_erp`.`warehouse_asset`.`supplierName` AS `supplierName`,
`jianghu_erp`.`warehouse_asset`.`manufacturerName` AS `manufacturerName`,
`jianghu_erp`.`warehouse_asset`.`manufacturerProductRCNum` AS `manufacturerProductRCNum`,
`jianghu_erp`.`warehouse_asset`.`inventoryInType` AS `inventoryInType`,
`jianghu_erp`.`warehouse_asset`.`inventoryInOrderId` AS `inventoryInOrderId`,
`jianghu_erp`.`warehouse_asset`.`inventoryInAt` AS `inventoryInAt`,
`jianghu_erp`.`warehouse_asset`.`productionBatchNum` AS `productionBatchNum`,
`jianghu_erp`.`warehouse_asset`.`productionAt` AS `productionAt`,
`jianghu_erp`.`warehouse_asset`.`expirationAt` AS `expirationAt`,
`jianghu_erp`.`warehouse_asset`.`operation` AS `operation`,
`jianghu_erp`.`warehouse_asset`.`operationByUserId` AS `operationByUserId`,
`jianghu_erp`.`warehouse_asset`.`operationByUser` AS `operationByUser`,
`jianghu_erp`.`warehouse_asset`.`operationAt` AS `operationAt`,
`view01_finance_asset_last`.`id` AS `financeId`
from
(
`jianghu_erp`.`warehouse_asset`
left join `jianghu_erp`.`view01_finance_asset_last` on (
(
`jianghu_erp`.`warehouse_asset`.`assetId` = `view01_finance_asset_last`.`assetId`
)
)
)
view01_warehouse_asset_not_in_finance_asset
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_warehouse_asset_not_in_finance_asset` AS
select
`warehouse_asset`.`id` AS `id`,
`warehouse_asset`.`idSequence` AS `idSequence`,
`warehouse_asset`.`assetId` AS `assetId`,
`warehouse_asset`.`assetName` AS `assetName`,
`warehouse_asset`.`warehouseName` AS `warehouseName`,
`warehouse_asset`.`stockName` AS `stockName`,
`warehouse_asset`.`assetUnit` AS `assetUnit`,
`warehouse_asset`.`assetSpec` AS `assetSpec`,
`warehouse_asset`.`assetSpecPrice` AS `assetSpecPrice`,
`warehouse_asset`.`purchaseAssetSpecPriceWithoutTax` AS `purchaseAssetSpecPriceWithoutTax`,
`warehouse_asset`.`purchaseAssetTaxRate` AS `purchaseAssetTaxRate`,
`warehouse_asset`.`purchaseAssetTaxPrice` AS `purchaseAssetTaxPrice`,
`warehouse_asset`.`purchaseAssetSpecPrice` AS `purchaseAssetSpecPrice`,
`warehouse_asset`.`assetType` AS `assetType`,
`warehouse_asset`.`assetTransport` AS `assetTransport`,
`warehouse_asset`.`assetStatus` AS `assetStatus`,
`warehouse_asset`.`assetUser` AS `assetUser`,
`warehouse_asset`.`supplierId` AS `supplierId`,
`warehouse_asset`.`supplierName` AS `supplierName`,
`warehouse_asset`.`manufacturerName` AS `manufacturerName`,
`warehouse_asset`.`manufacturerProductRCNum` AS `manufacturerProductRCNum`,
`warehouse_asset`.`inventoryInType` AS `inventoryInType`,
`warehouse_asset`.`inventoryInOrderId` AS `inventoryInOrderId`,
`warehouse_asset`.`inventoryInAt` AS `inventoryInAt`,
`warehouse_asset`.`productionBatchNum` AS `productionBatchNum`,
`warehouse_asset`.`productionAt` AS `productionAt`,
`warehouse_asset`.`expirationAt` AS `expirationAt`,
`warehouse_asset`.`operation` AS `operation`,
`warehouse_asset`.`operationByUserId` AS `operationByUserId`,
`warehouse_asset`.`operationByUser` AS `operationByUser`,
`warehouse_asset`.`operationAt` AS `operationAt`
from
`warehouse_asset`
where
(
(
not(
exists (
select
1
from
`finance_asset`
where
(
`finance_asset`.`assetId` = `warehouse_asset`.`assetId`
)
)
)
)
and (
not(
exists (
select
1
from
`finance_asset_record`
where
(
`finance_asset_record`.`assetId` = `warehouse_asset`.`assetId`
)
)
)
)
)
view01_warehouse_inventory
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_warehouse_inventory` AS
select
`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`)
)
)
)
where
(`wi`.`count` > 0)