数据结构

12076

表总览

通用表

业务表

_ui

  • ui 施工方案
  1. CREATE TABLE `_ui` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `pageId` varchar(255) DEFAULT NULL COMMENT 'page id; E.g: index',
  4. `uiActionType` varchar(255) DEFAULT NULL COMMENT 'ui 动作类型,如:fetchData, postData, changeUi',
  5. `uiActionId` varchar(255) DEFAULT NULL COMMENT 'action id; E.g: selectXXXByXXX',
  6. `desc` varchar(255) DEFAULT NULL COMMENT '描述',
  7. `uiActionConfig` text COMMENT 'ui 动作数据',
  8. `appDataSchema` text COMMENT 'ui 校验数据',
  9. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  10. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  11. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  12. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  13. PRIMARY KEY (`id`) USING BTREE
  14. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'ui 施工方案'

customer

  1. CREATE TABLE `customer` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(11) DEFAULT NULL COMMENT '业务自增ID, 1001++',
  4. `customerId` varchar(255) DEFAULT NULL COMMENT '客户ID; KH1001',
  5. `customerName` varchar(255) DEFAULT NULL COMMENT '客户名',
  6. `customerAccountNum` varchar(255) DEFAULT NULL COMMENT '银行账号',
  7. `customerBankName` varchar(255) DEFAULT NULL COMMENT '开户银行',
  8. `customerBranchBankName` varchar(255) DEFAULT NULL COMMENT '开户分行\\支行',
  9. `customerAddress` varchar(255) DEFAULT NULL COMMENT '客户地址',
  10. `customerPostalCode` varchar(255) DEFAULT NULL COMMENT '邮政编码',
  11. `customerContactPerson` varchar(255) DEFAULT NULL COMMENT '联系人',
  12. `customerPhoneNum` varchar(255) DEFAULT NULL COMMENT '联系电话',
  13. `customerCollectionCycle` varchar(255) DEFAULT NULL COMMENT '收款账期;单位:天',
  14. `customerBusinessLicenseNum` varchar(255) DEFAULT NULL COMMENT '营业执照',
  15. `customerMedicalOperatingLicenseNum` varchar(255) DEFAULT NULL COMMENT '医疗器械经营许可证',
  16. `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  17. `rowStatus` varchar(255) DEFAULT '正常' COMMENT '数据状态; 正常、停用',
  18. `operation` varchar(255) CHARACTER SET utf8 DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  19. `operationByUserId` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者userId',
  20. `operationByUser` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者用户名',
  21. `operationAt` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  22. PRIMARY KEY (`id`) USING BTREE
  23. ) ENGINE = InnoDB AUTO_INCREMENT = 29 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin

finance_asset

  • 财务-资产信息表
  1. CREATE TABLE `finance_asset` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',
  4. `assetId` varchar(255) DEFAULT NULL COMMENT '资产ID; ZC10001',
  5. `assetName` varchar(255) DEFAULT NULL COMMENT '资产;',
  6. `assetSpec` varchar(255) DEFAULT NULL COMMENT '资产规格',
  7. `currentPeriod` varchar(255) DEFAULT NULL COMMENT '当前会计期间; 2022-02',
  8. `entryPeriod` varchar(255) DEFAULT NULL COMMENT '录入期间; 2022-02',
  9. `depreciationMethod` varchar(255) DEFAULT NULL COMMENT '折旧方法; 平均年限法、不折旧',
  10. `financeAssetSubject` varchar(255) DEFAULT NULL COMMENT '资产科目; 固定资产',
  11. `financeDepreciationSubject` varchar(255) DEFAULT NULL COMMENT '累计折旧科目; 累计折旧',
  12. `financeClearSubject` varchar(255) DEFAULT NULL COMMENT '资产清理科目; 固定资产清理',
  13. `financeDepreciationFeeSubject` varchar(255) DEFAULT NULL COMMENT '折旧费用科目; 管理费用-折旧费',
  14. `startUseAt` varchar(255) DEFAULT NULL COMMENT '开始使用日期; 2020-02-02',
  15. `assetValue` decimal(10, 2) DEFAULT NULL COMMENT '资产原值',
  16. `residualRate` decimal(10, 2) DEFAULT NULL COMMENT '残值率',
  17. `estimatedUseMonth` int(11) DEFAULT NULL COMMENT '预计使用月份',
  18. `depreciatedMonths` int(11) DEFAULT NULL COMMENT '已折旧月份',
  19. `remainingMonth` int(11) DEFAULT NULL COMMENT '剩余使用月份',
  20. `monthlyDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '每月折旧额',
  21. `totalDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '累计折旧',
  22. `currentYearDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '本年累计折旧;',
  23. `preYearDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '以前年度累计折旧',
  24. `currentPeriodDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '本期折旧',
  25. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  26. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  27. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  28. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  29. `financeAssetSubjectId` varchar(255) DEFAULT NULL COMMENT '资产科目ID;',
  30. `financeDepreciationSubjectId` varchar(255) DEFAULT NULL COMMENT '累计折旧科目ID;',
  31. `financeClearSubjectId` varchar(255) DEFAULT NULL COMMENT '资产清理科目ID;',
  32. `financeDepreciationFeeSubjectId` varchar(255) DEFAULT NULL COMMENT '折旧费用科目ID;',
  33. `assetTypeId` varchar(255) DEFAULT NULL COMMENT '资产类别ID; ZCLB10001',
  34. `assetTypeName` varchar(255) DEFAULT NULL COMMENT '资产类别名称;',
  35. `deptId` varchar(255) DEFAULT NULL COMMENT '部门ID;',
  36. `deptName` varchar(255) DEFAULT NULL COMMENT '部门名称;',
  37. PRIMARY KEY (`id`) USING BTREE
  38. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '财务-资产信息表'

finance_asset_record

  • 财务-资产信息明细表
  1. CREATE TABLE `finance_asset_record` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',
  4. `assetId` varchar(255) DEFAULT NULL COMMENT '资产ID; ZC10001',
  5. `assetName` varchar(255) DEFAULT NULL COMMENT '资产;',
  6. `assetSpec` varchar(255) DEFAULT NULL COMMENT '资产规格',
  7. `assetOperationType` varchar(255) DEFAULT '折旧' COMMENT '操作类型',
  8. `currentPeriod` varchar(255) DEFAULT NULL COMMENT '当前会计期间; 2022-02',
  9. `entryPeriod` varchar(255) DEFAULT NULL COMMENT '录入期间; 2022-02',
  10. `depreciationMethod` varchar(255) DEFAULT NULL COMMENT '折旧方法; 平均年限法、不折旧',
  11. `financeAssetSubject` varchar(255) DEFAULT NULL COMMENT '资产科目; 固定资产',
  12. `financeDepreciationSubject` varchar(255) DEFAULT NULL COMMENT '累计折旧科目; 累计折旧',
  13. `financeClearSubject` varchar(255) DEFAULT NULL COMMENT '资产清理科目; 固定资产清理',
  14. `financeDepreciationFeeSubject` varchar(255) DEFAULT NULL COMMENT '折旧费用科目; 管理费用-折旧费',
  15. `startUseAt` varchar(255) DEFAULT NULL COMMENT '开始使用日期; 2020-02-02',
  16. `assetValue` decimal(10, 2) DEFAULT NULL COMMENT '资产原值',
  17. `residualRate` decimal(10, 2) DEFAULT NULL COMMENT '残值率',
  18. `estimatedUseMonth` int(11) DEFAULT NULL COMMENT '预计使用月份',
  19. `depreciatedMonths` int(11) DEFAULT NULL COMMENT '已折旧月份',
  20. `remainingMonth` int(11) DEFAULT NULL COMMENT '剩余使用月份',
  21. `monthlyDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '每月折旧额',
  22. `totalDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '期初累计折旧',
  23. `currentYearDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '本年累计折旧',
  24. `preYearDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '以前年度累计折旧',
  25. `currentPeriodDepreciation` decimal(10, 2) DEFAULT NULL COMMENT '本期折旧',
  26. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  27. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  28. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  29. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  30. `financeAssetSubjectId` varchar(255) DEFAULT NULL COMMENT '资产科目ID;',
  31. `financeDepreciationSubjectId` varchar(255) DEFAULT NULL COMMENT '累计折旧科目ID;',
  32. `financeClearSubjectId` varchar(255) DEFAULT NULL COMMENT '资产清理科目ID;',
  33. `financeDepreciationFeeSubjectId` varchar(255) DEFAULT NULL COMMENT '折旧费用科目ID;',
  34. `assetTypeId` varchar(255) DEFAULT NULL COMMENT '资产类别ID; ZCLB10001',
  35. `assetTypeName` varchar(255) DEFAULT NULL COMMENT '资产类别名称;',
  36. `deptId` varchar(255) DEFAULT NULL COMMENT '部门ID;',
  37. `deptName` varchar(255) DEFAULT NULL COMMENT '部门名称;',
  38. PRIMARY KEY (`id`) USING BTREE
  39. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '财务-资产信息明细表'

finance_asset_type

  • 财务-资产信息表
  1. CREATE TABLE `finance_asset_type` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',
  4. `assetTypeId` varchar(255) DEFAULT NULL COMMENT '资产类别ID; ZCLB10001',
  5. `assetTypeName` varchar(255) DEFAULT NULL COMMENT '资产类别名称;',
  6. `depreciationMethod` varchar(255) DEFAULT NULL COMMENT '折旧方法; 平均年限法、不折旧',
  7. `financeAssetSubject` varchar(255) DEFAULT NULL COMMENT '资产科目; 固定资产',
  8. `financeDepreciationSubject` varchar(255) DEFAULT NULL COMMENT '累计折旧科目; 累计折旧',
  9. `residualRate` decimal(10, 2) DEFAULT NULL COMMENT '残值率',
  10. `financeAssetSubjectId` varchar(255) DEFAULT NULL COMMENT '资产科目ID;',
  11. `financeDepreciationSubjectId` varchar(255) DEFAULT NULL COMMENT '累计折旧科目ID;',
  12. `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  13. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  14. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  15. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  16. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  17. PRIMARY KEY (`id`) USING BTREE
  18. ) ENGINE = InnoDB AUTO_INCREMENT = 19 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '财务-资产信息表'

finance_period

  • 折旧-会计区间表
  1. CREATE TABLE `finance_period` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `periodId` varchar(255) DEFAULT NULL COMMENT '会计期间; 月份维度 E.g: 2023-03',
  4. `financeYear` varchar(255) DEFAULT NULL COMMENT '财年;',
  5. `isDepreciation` varchar(255) DEFAULT NULL COMMENT '是否折旧; 已折旧、待折旧',
  6. `isPeriodStart` varchar(255) DEFAULT '否' COMMENT '是否初始会计期间; 是, 否',
  7. `depreciationVoucherId` varchar(255) DEFAULT NULL COMMENT '折旧凭证ID',
  8. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  9. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  10. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  11. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  12. PRIMARY KEY (`id`) USING BTREE,
  13. UNIQUE KEY `periodId_unique` (`periodId`) USING BTREE
  14. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '折旧-会计区间表'

payment

  • 收款&付款表;
  1. CREATE TABLE `payment` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  3. `idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',
  4. `paymentId` varchar(255) DEFAULT NULL COMMENT '收款/付款ID; SK10001 FK10001',
  5. `paymentType` varchar(20) DEFAULT NULL COMMENT '类型; 收款、付款',
  6. `paymentAmount` decimal(10, 2) DEFAULT NULL COMMENT '金额',
  7. `paymentPayee` varchar(50) DEFAULT NULL COMMENT '收款账户; 人、公司、账号',
  8. `paymentPayeeAccount` varchar(255) DEFAULT NULL COMMENT '收款账号; ',
  9. `paymentPayeeBank` varchar(255) DEFAULT NULL COMMENT '收款账号银行',
  10. `paymentPayeeBranchBank` varchar(255) DEFAULT NULL COMMENT '收款账号开户分行\\支行',
  11. `paymentPayer` varchar(50) DEFAULT NULL COMMENT '付款账户; 人、公司、账号',
  12. `paymentPayerAccount` varchar(255) DEFAULT NULL COMMENT '付款账号;',
  13. `paymentPayerBank` varchar(255) DEFAULT NULL COMMENT '付款账号银行',
  14. `paymentPayerBranchBank` varchar(255) DEFAULT NULL COMMENT '付款账号开户分行\\支行',
  15. `paymentMethod` varchar(50) DEFAULT NULL COMMENT '方式',
  16. `paymentStatus` varchar(20) NOT NULL DEFAULT '未付款' COMMENT '付款状态; 未付款、已付款',
  17. `invoiceStatus` varchar(255) DEFAULT '未开票' COMMENT '开票状态; 未开票、已开票',
  18. `paymentAt` varchar(255) DEFAULT NULL COMMENT '时间; E.g: 2021-05-28T10:24:54+08:00',
  19. `supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID;',
  20. `customerId` varchar(255) DEFAULT NULL COMMENT '客户ID;',
  21. `ticketId` varchar(255) DEFAULT NULL COMMENT '工单id',
  22. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  23. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  24. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  25. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  26. PRIMARY KEY (`id`) USING BTREE
  27. ) ENGINE = InnoDB AUTO_INCREMENT = 45 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '收款&付款表;'

payment_order

  • 收款&付款表-订单抵扣表
  1. CREATE TABLE `payment_order` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  3. `paymentId` varchar(255) DEFAULT NULL COMMENT '收款/付款ID; SK10001 FK10001',
  4. `paymentType` varchar(20) DEFAULT NULL COMMENT '类型; 收款、付款',
  5. `orderType` varchar(20) DEFAULT NULL COMMENT '订单类型; 采购订单、销售订单、采退订单、销退订单',
  6. `orderId` varchar(255) NOT NULL COMMENT '订单ID',
  7. `deductionAmount` decimal(10, 2) NOT NULL COMMENT '抵扣金额',
  8. `ticketId` varchar(255) DEFAULT NULL COMMENT '工单id',
  9. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  10. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  11. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  12. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  13. PRIMARY KEY (`id`) USING BTREE
  14. ) ENGINE = InnoDB AUTO_INCREMENT = 45 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '收款&付款表-订单抵扣表'

product_price_record

  1. CREATE TABLE `product_price_record` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `orderType` varchar(255) DEFAULT NULL COMMENT '订单类型',
  4. `customerId` varchar(255) DEFAULT NULL COMMENT '客户ID',
  5. `customerName` varchar(255) DEFAULT NULL COMMENT '客户名',
  6. `supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID; GH10001',
  7. `supplierName` varchar(255) DEFAULT NULL COMMENT '供应商名',
  8. `manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂商名',
  9. `productName` varchar(255) DEFAULT NULL COMMENT '产品名',
  10. `productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格',
  11. `saleProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '销售含税单价/元',
  12. `productSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '含税单价/元',
  13. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  14. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  15. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间',
  16. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  17. PRIMARY KEY (`id`) USING BTREE
  18. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin

purchase_order

  • 采购订单表
  1. CREATE TABLE `purchase_order` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(11) DEFAULT NULL COMMENT '自增ID, 10001++',
  4. `purchaseOrderId` varchar(255) DEFAULT NULL COMMENT '订单ID; CG10001',
  5. `supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',
  6. `supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',
  7. `supplierInfo` mediumtext COMMENT '供货商信息; json',
  8. `purchaseOrderType` varchar(255) DEFAULT '普通采购' COMMENT '采购订单类型; 普通采购、资产采购',
  9. `purchaseOrderDesc` varchar(255) DEFAULT NULL COMMENT '采购订单描述;',
  10. `purchaseProductList` text COMMENT '采购产品列表; [{}, {}]',
  11. `purchaseProductListCount` int(11) DEFAULT NULL COMMENT '采购产品列表个数',
  12. `purchaseProductTotalCount` int(11) DEFAULT NULL COMMENT '采购产品总个数',
  13. `purchaseTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '订单金额',
  14. `purchaseOrderStatus` varchar(255) DEFAULT NULL COMMENT '订单状态; 待采购、采购中、订单完成/订单取消',
  15. `purchaseOrderStatusDesc` varchar(255) DEFAULT NULL COMMENT '订单状态描述; 例如: 填写订单取消原因',
  16. `purchaseCreateAt` varchar(255) DEFAULT NULL COMMENT '订单创建日期',
  17. `purchaseFinishAt` varchar(255) DEFAULT NULL COMMENT '订单完成时间',
  18. `purchaseOrderRemark` varchar(255) DEFAULT NULL COMMENT '订单备注',
  19. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  20. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  21. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  22. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  23. PRIMARY KEY (`id`) USING BTREE
  24. ) ENGINE = InnoDB AUTO_INCREMENT = 122 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '采购订单表'

purchase_price_history

  1. CREATE TABLE `purchase_price_history` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `purchaseOrderId` varchar(255) DEFAULT NULL COMMENT '订单ID',
  4. `orderType` varchar(255) DEFAULT NULL COMMENT '订单类型',
  5. `supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID; GH10001',
  6. `supplierName` varchar(255) DEFAULT NULL COMMENT '供应商名',
  7. `productName` varchar(255) DEFAULT NULL COMMENT '产品名',
  8. `manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂商名',
  9. `productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格',
  10. `productSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '含税单价/元; 采购价格',
  11. `purchaseProductTaxRate` int(11) DEFAULT NULL COMMENT '税率;',
  12. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  13. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  14. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间',
  15. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  16. PRIMARY KEY (`id`) USING BTREE
  17. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin

purchase_return_order

  • 采购退货订单表
  1. CREATE TABLE `purchase_return_order` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(11) DEFAULT NULL COMMENT '自增ID, 10001++',
  4. `returnOrderId` varchar(255) DEFAULT NULL COMMENT '退款订单ID; XSTK10001',
  5. `supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',
  6. `supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',
  7. `supplierInfo` mediumtext COMMENT '供货商信息; json',
  8. `returnOrderDesc` varchar(255) DEFAULT NULL COMMENT '退货订单描述;',
  9. `returnProductList` text COMMENT '退货产品列表; [{}, {}]',
  10. `returnProductListCount` int(11) DEFAULT NULL COMMENT '退货产品列表个数',
  11. `returnProductTotalCount` int(11) DEFAULT NULL COMMENT '退货产品总个数',
  12. `returnTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '订单金额',
  13. `returnOrderStatus` varchar(255) DEFAULT NULL COMMENT '订单状态; 待退货、退货中、订单完成/订单取消',
  14. `returnOrderStatusDesc` varchar(255) DEFAULT NULL COMMENT '订单状态描述; 例如: 填写订单取消原因',
  15. `returnCreateAt` varchar(255) DEFAULT NULL COMMENT '订单创建日期',
  16. `returnFinishAt` varchar(255) DEFAULT NULL COMMENT '订单完成时间',
  17. `returnOrderRemark` varchar(255) DEFAULT NULL COMMENT '订单备注',
  18. `returnOrderType` varchar(255) DEFAULT NULL COMMENT '订单类型;普通退货、资产退货',
  19. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  20. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  21. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  22. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  23. PRIMARY KEY (`id`) USING BTREE
  24. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '采购退货订单表'

sale_order

  1. CREATE TABLE `sale_order` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(11) DEFAULT NULL COMMENT '主键ID, 10001++',
  4. `saleOrderId` varchar(255) DEFAULT NULL COMMENT '订单ID; CG10001',
  5. `customerId` varchar(255) DEFAULT NULL COMMENT '客户ID',
  6. `customerName` varchar(255) DEFAULT NULL COMMENT '客户',
  7. `customerInfo` text COMMENT '客户',
  8. `saleOrderDesc` varchar(255) DEFAULT NULL COMMENT '销售订单描述;',
  9. `saleProductList` text COMMENT '销售产品列表; [{}, {}]',
  10. `saleProductListCount` int(11) DEFAULT NULL COMMENT '销售产品列表个数',
  11. `saleProductTotalCount` int(11) DEFAULT NULL COMMENT '销售产品总个数',
  12. `saleTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '订单金额',
  13. `saleOrderStatus` varchar(255) DEFAULT NULL COMMENT '订单状态; 待销售、销售中、订单完成/订单取消',
  14. `saleOrderStatusDesc` varchar(255) DEFAULT NULL COMMENT '订单状态描述; 例如: 填写订单失败原因',
  15. `saleCreateAt` varchar(255) DEFAULT NULL COMMENT '订单创建日期',
  16. `saleOrderRemark` varchar(255) DEFAULT NULL COMMENT '订单备注',
  17. `saleFinishAt` varchar(255) DEFAULT NULL COMMENT '订单完成时间',
  18. `operation` varchar(255) CHARACTER SET utf8 DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  19. `operationByUserId` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者userId',
  20. `operationByUser` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者用户名',
  21. `operationAt` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  22. PRIMARY KEY (`id`) USING BTREE
  23. ) ENGINE = InnoDB AUTO_INCREMENT = 3 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin

sale_price_history

  1. CREATE TABLE `sale_price_history` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `saleOrderId` varchar(255) DEFAULT NULL COMMENT '订单ID',
  4. `orderType` varchar(255) DEFAULT NULL COMMENT '订单类型',
  5. `customerId` varchar(255) DEFAULT NULL COMMENT '客户ID; GH10001',
  6. `supplierName` varchar(255) DEFAULT NULL COMMENT '供应商名',
  7. `productName` varchar(255) DEFAULT NULL COMMENT '产品名',
  8. `manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂商名',
  9. `productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格',
  10. `saleProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '含税单价/元; 销售价格',
  11. `productTaxRate` int(11) DEFAULT NULL COMMENT '税率;',
  12. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  13. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  14. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间',
  15. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  16. PRIMARY KEY (`id`) USING BTREE
  17. ) ENGINE = InnoDB AUTO_INCREMENT = 9 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin

sale_return_order

  • 销售退货订单表
  1. CREATE TABLE `sale_return_order` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(11) DEFAULT NULL COMMENT '主键ID, 10001++',
  4. `returnOrderId` varchar(255) DEFAULT NULL COMMENT '退款订单ID; CGTK10001',
  5. `customerId` varchar(255) DEFAULT NULL COMMENT '客户ID',
  6. `customerName` varchar(255) DEFAULT NULL COMMENT '客户',
  7. `customerInfo` text COMMENT '客户',
  8. `returnOrderDesc` varchar(255) DEFAULT NULL COMMENT '退货订单描述;',
  9. `returnProductList` text COMMENT '退货产品列表; [{}, {}]',
  10. `returnProductListCount` int(11) DEFAULT NULL COMMENT '退货产品列表个数',
  11. `returnProductTotalCount` int(11) DEFAULT NULL COMMENT '退货产品总个数',
  12. `returnTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '订单金额',
  13. `returnOrderStatus` varchar(255) DEFAULT NULL COMMENT '订单状态; 待退货、退货中、订单完成/订单取消',
  14. `returnOrderStatusDesc` varchar(255) DEFAULT NULL COMMENT '订单状态描述; 例如: 填写订单失败原因',
  15. `returnCreateAt` varchar(255) DEFAULT NULL COMMENT '订单创建日期',
  16. `returnOrderRemark` varchar(255) DEFAULT NULL COMMENT '订单备注',
  17. `returnFinishAt` varchar(255) DEFAULT NULL COMMENT '订单完成时间',
  18. `operation` varchar(255) CHARACTER SET utf8 DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  19. `operationByUserId` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者userId',
  20. `operationByUser` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作者用户名',
  21. `operationAt` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  22. PRIMARY KEY (`id`) USING BTREE
  23. ) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '销售退货订单表'

subject

  • 科目表
  1. CREATE TABLE `subject` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `appaId` varchar(255) DEFAULT NULL COMMENT '账套ID',
  4. `subjectId` varchar(255) DEFAULT NULL COMMENT '科目编码; 资产类 1001++, 负债类2001++..',
  5. `subjectName` varchar(255) DEFAULT NULL COMMENT '科目名称;',
  6. `subjectLabel` varchar(255) DEFAULT NULL COMMENT '科目标签;',
  7. `subjectCategory` varchar(255) DEFAULT NULL COMMENT '科目分类;资产, 负债, 权益, 成本, 损益',
  8. `subjectLevel` int(11) DEFAULT '1' COMMENT '科目级别; 1级科目、2级科目….',
  9. `subjectHasChildren` varchar(255) DEFAULT '无下级科目' COMMENT '科目类型; 有下级科目, 无下级科目',
  10. `subjectBalanceDirection` varchar(4) DEFAULT NULL COMMENT '科目余额方向; 借、贷',
  11. `assistList` varchar(255) DEFAULT NULL COMMENT '辅助核算配置列表; “,”拼接 E.g: 客户,供应商,职员,项目,部门,拓展1,拓展2 ',
  12. `isShown` varchar(255) DEFAULT '显示' COMMENT '是否显示;显示,隐藏',
  13. `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  14. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  15. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  16. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  17. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  18. PRIMARY KEY (`id`) USING BTREE,
  19. UNIQUE KEY `appaId_subject_unique` (`appaId`, `subjectId`) USING BTREE
  20. ) ENGINE = InnoDB AUTO_INCREMENT = 4840 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '科目表'

subject_balance_period

  • 科目余额表-会计期间维度
  1. CREATE TABLE `subject_balance_period` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `appaId` varchar(255) DEFAULT NULL COMMENT '账套ID',
  4. `periodId` varchar(255) DEFAULT NULL COMMENT '会计期间; E.g: 2023-03',
  5. `financeYear` varchar(255) DEFAULT NULL COMMENT '财年;',
  6. `subjectId` varchar(255) DEFAULT NULL COMMENT '科目编码;',
  7. `startDebit` decimal(14, 2) DEFAULT '0.00' COMMENT '期初余额-借方',
  8. `startCredit` decimal(14, 2) DEFAULT '0.00' COMMENT '期初余额-贷方',
  9. `occurDebit` decimal(14, 2) DEFAULT '0.00' COMMENT '本期发生额-借方',
  10. `occurCredit` decimal(14, 2) DEFAULT '0.00' COMMENT '本期发生额-贷方',
  11. `occurAmount` decimal(14, 2) DEFAULT '0.00' COMMENT '本期余额/本期实际损益发生额',
  12. `endDebit` decimal(14, 2) DEFAULT '0.00' COMMENT '期末余额-借方',
  13. `endCredit` decimal(14, 2) DEFAULT '0.00' COMMENT '期末余额-贷方',
  14. `isPeriodStart` varchar(255) DEFAULT '否' COMMENT '是否初始会计期间; 是, 否',
  15. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  16. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  17. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  18. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  19. PRIMARY KEY (`id`) USING BTREE,
  20. UNIQUE KEY `appaId_periodId_subjectId_unique` (`appaId`, `periodId`, `subjectId`) USING BTREE,
  21. KEY `subjectId_index` (`subjectId`) USING BTREE,
  22. KEY `periodId_index` (`periodId`) USING BTREE
  23. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '科目余额表-会计期间维度'

supplier

  • 供货商
  1. CREATE TABLE `supplier` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(11) DEFAULT NULL COMMENT '自增ID, 1001++',
  4. `supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID; GH1001',
  5. `supplierName` varchar(255) DEFAULT NULL COMMENT '供应商名',
  6. `supplierAccountNum` varchar(255) DEFAULT NULL COMMENT '付款账号',
  7. `supplierBankName` varchar(255) DEFAULT NULL COMMENT '开户银行',
  8. `supplierBranchBankName` varchar(255) DEFAULT NULL COMMENT '分行名称',
  9. `supplierBusinessLicenseNum` varchar(255) DEFAULT NULL COMMENT '营业执照',
  10. `supplierMedicalOperatingLicenseNum` varchar(255) DEFAULT NULL COMMENT '医疗器械经营许可证',
  11. `supplierPaymentCycle` varchar(255) DEFAULT NULL COMMENT '账期;单位:天',
  12. `supplierAddress` varchar(255) DEFAULT NULL COMMENT '地址',
  13. `supplierPostalCode` varchar(255) DEFAULT NULL COMMENT '邮政编码',
  14. `supplierContactPerson` varchar(255) DEFAULT NULL COMMENT '联系人',
  15. `supplierPhoneNum` varchar(255) DEFAULT NULL COMMENT '联系电话',
  16. `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  17. `rowStatus` varchar(255) DEFAULT '正常' COMMENT '数据状态; 正常、停用',
  18. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  19. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  20. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  21. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间',
  22. PRIMARY KEY (`id`) USING BTREE,
  23. UNIQUE KEY `supplierId_unique` (`supplierId`) USING BTREE,
  24. UNIQUE KEY `supplierName_unique` (`supplierName`) USING BTREE
  25. ) ENGINE = InnoDB AUTO_INCREMENT = 47 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '供货商'

supplier_product

  • 供货商产品表; productId=supplierId-productName-manufacturerName- 在view或者前端拼接
  1. CREATE TABLE `supplier_product` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `supplierId` varchar(255) DEFAULT NULL COMMENT '供应商ID; GH10001',
  4. `supplierName` varchar(255) DEFAULT NULL,
  5. `productName` varchar(255) DEFAULT NULL COMMENT '产品名称',
  6. `manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',
  7. `productSpecList` varchar(512) DEFAULT NULL COMMENT '规格/型号列表; “15ml/袋, 20ml/袋”',
  8. `productUnit` varchar(255) DEFAULT NULL COMMENT '单位',
  9. `productType` varchar(255) DEFAULT NULL COMMENT '产品类型',
  10. `manufacturerLicenseNum` varchar(255) DEFAULT NULL COMMENT '生产许可证号',
  11. `manufacturerLicenseExpireAt` varchar(255) DEFAULT NULL COMMENT '生产许可证到期日; E.g: 2024-05-28',
  12. `manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '产品注册证号;',
  13. `manufacturerProductRCExpireAt` varchar(255) DEFAULT NULL COMMENT '产品注册证到期日; E.g: 2024-03-28',
  14. `productTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',
  15. `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  16. `rowStatus` varchar(255) DEFAULT '正常' COMMENT '数据状态; 正常、停用',
  17. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  18. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  19. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  20. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  21. PRIMARY KEY (`id`) USING BTREE
  22. ) ENGINE = InnoDB AUTO_INCREMENT = 936 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '供货商产品表; productId=supplierId-productName-manufacturerName- 在view或者前端拼接'

ticket

  • 工单表;
  1. CREATE TABLE `ticket` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(11) DEFAULT NULL COMMENT '自增ID, 10001++',
  4. `ticketId` varchar(255) DEFAULT NULL COMMENT '工单ID; T10001',
  5. `ticketBizId` varchar(255) DEFAULT NULL COMMENT '业务ID; 采购订单ID、销售订单ID',
  6. `ticketType` varchar(255) DEFAULT NULL COMMENT '工单类型; 采购付款、销售收款、采购入库、采购资产入库、资产入库、销售出库',
  7. `ticketDesc` varchar(255) DEFAULT NULL COMMENT '工单描述;',
  8. `ticketContentRequest` text COMMENT '申请内容; {}',
  9. `ticketContent` text COMMENT '完成内容; {}',
  10. `ticketCommentList` text COMMENT '评论列表; [{}, {}] (后期再做)',
  11. `ticketAmount` int(11) DEFAULT NULL COMMENT '工单处理金额',
  12. `ticketRequestAmount` int(11) DEFAULT NULL COMMENT '申请金额',
  13. `ticketRequestAt` varchar(255) DEFAULT NULL COMMENT '申请时间; E.g: 2021-05-28T10:24:54+08:00',
  14. `ticketRequestByUserId` varchar(255) DEFAULT NULL COMMENT '申请人Id',
  15. `ticketRequestByUser` varchar(255) DEFAULT NULL COMMENT '申请人',
  16. `ticketStatus` varchar(255) DEFAULT '申请' COMMENT '工单状态; 申请、处理中、完成、拒绝',
  17. `ticketStatusAt` varchar(255) DEFAULT NULL COMMENT '处理时间; E.g: 2021-05-28T10:24:54+08:00',
  18. `ticketStatusDesc` varchar(255) DEFAULT NULL COMMENT '处理描述; 拒绝描述',
  19. `ticketStatusByUserId` varchar(255) DEFAULT NULL COMMENT '处理人Id',
  20. `ticketStatusByUser` varchar(255) DEFAULT NULL COMMENT '处理人',
  21. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  22. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  23. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  24. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  25. PRIMARY KEY (`id`) USING BTREE
  26. ) ENGINE = InnoDB AUTO_INCREMENT = 467 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '工单表;'

voucher

  • 凭证表
  1. CREATE TABLE `voucher` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `periodId` varchar(255) DEFAULT NULL COMMENT '会计期间; E.g: 2023-03',
  4. `ticketIdList` varchar(255) DEFAULT NULL COMMENT '工单ID; 用‘,’分隔',
  5. `voucherName` varchar(255) DEFAULT NULL COMMENT '凭证字; 记2022',
  6. `voucherNumber` int(11) DEFAULT NULL COMMENT '凭证号; 10001',
  7. `voucherId` varchar(255) DEFAULT NULL COMMENT '凭证字号; periodId + voucherName + voucherNumber',
  8. `voucherType` varchar(255) DEFAULT '普通凭证' COMMENT '凭证类型; 普通凭证、结转凭证',
  9. `voucherTemplateId` varchar(255) DEFAULT NULL COMMENT '凭证模板ID;',
  10. `voucherTemplateName` varchar(255) DEFAULT NULL COMMENT '凭证模板名称;',
  11. `voucherAccountant` varchar(255) DEFAULT '' COMMENT '制单人',
  12. `voucherAudit` varchar(255) DEFAULT '' COMMENT '审核人; 预留字段',
  13. `voucherDebitSum` decimal(10, 2) DEFAULT NULL COMMENT '借方总额',
  14. `voucherCreditSum` decimal(10, 2) DEFAULT NULL COMMENT '贷方总额',
  15. `voucherAt` varchar(255) DEFAULT NULL COMMENT '凭证时间; E.g: 2021-05-28',
  16. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  17. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  18. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  19. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  20. PRIMARY KEY (`id`) USING BTREE,
  21. UNIQUE KEY `voucherId_unique` (`voucherId`) USING BTREE
  22. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '凭证表'

voucher_entry

  • 凭证条目表
  1. CREATE TABLE `voucher_entry` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `voucherId` varchar(255) DEFAULT NULL COMMENT '凭证Id;',
  4. `subjectId` varchar(255) DEFAULT NULL COMMENT '科目id;',
  5. `subjectName` varchar(255) DEFAULT NULL COMMENT '科目名称;',
  6. `entryAbstract` varchar(255) DEFAULT NULL COMMENT '摘要',
  7. `debit` decimal(14, 2) DEFAULT '0.00' COMMENT '借方金额',
  8. `credit` decimal(14, 2) DEFAULT '0.00' COMMENT '贷方金额',
  9. `assistIdOfCustomer` varchar(255) DEFAULT NULL COMMENT '辅助核算-客户Id',
  10. `assistIdOfSupplier` varchar(255) DEFAULT NULL COMMENT '辅助核算-供应商Id',
  11. `assistIdOfStaff` varchar(255) DEFAULT NULL COMMENT '辅助核算-员工Id',
  12. `assistIdOfProject` varchar(255) DEFAULT NULL COMMENT '辅助核算-项目Id',
  13. `assistIdOfDepart` varchar(255) DEFAULT NULL COMMENT '辅助核算-部门Id',
  14. `assistIdOfExtend1` varchar(255) DEFAULT NULL COMMENT '辅助核算-拓展1; 预留字段 assist_bank',
  15. `assistIdOfExtend2` varchar(255) DEFAULT NULL COMMENT '辅助核算-拓展2; 预留字段',
  16. `assistNameOfCustomer` varchar(255) DEFAULT NULL,
  17. `assistNameOfSupplier` varchar(255) DEFAULT NULL,
  18. `assistNameOfStaff` varchar(255) DEFAULT NULL,
  19. `assistNameOfProject` varchar(255) DEFAULT NULL,
  20. `assistNameOfDepart` varchar(255) DEFAULT NULL,
  21. `assistNameOfExtend1` varchar(255) DEFAULT NULL,
  22. `assistNameOfExtend2` varchar(255) DEFAULT NULL,
  23. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  24. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  25. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  26. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  27. PRIMARY KEY (`id`) USING BTREE
  28. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '凭证条目表'

warehouse_asset

  • 仓库-资产表
  1. CREATE TABLE `warehouse_asset` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 10001++',
  4. `assetId` varchar(255) DEFAULT NULL COMMENT '资产ID; ZC10001',
  5. `assetName` varchar(255) DEFAULT NULL COMMENT '资产;',
  6. `warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库',
  7. `stockName` varchar(255) DEFAULT NULL COMMENT '货架',
  8. `assetUnit` varchar(255) DEFAULT NULL COMMENT '单位;',
  9. `assetSpec` varchar(255) DEFAULT NULL COMMENT '规格;',
  10. `assetSpecPrice` decimal(10, 0) DEFAULT NULL COMMENT '价格;',
  11. `purchaseAssetSpecPriceWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '产品去税价格',
  12. `purchaseAssetTaxRate` decimal(10, 2) DEFAULT NULL COMMENT '产品税率',
  13. `purchaseAssetTaxPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品税额',
  14. `purchaseAssetSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品价格',
  15. `assetType` varchar(255) DEFAULT NULL COMMENT '类型;',
  16. `assetTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',
  17. `assetStatus` varchar(255) DEFAULT NULL COMMENT '资产状态;在库,已领用,已报废,维修中',
  18. `assetUser` varchar(255) DEFAULT NULL COMMENT '资产最新相关人',
  19. `supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',
  20. `supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',
  21. `manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',
  22. `manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '生产厂家-产品注册证号;',
  23. `inventoryInType` varchar(255) DEFAULT NULL COMMENT '入库类型; 采购入库',
  24. `inventoryInOrderId` varchar(255) DEFAULT NULL COMMENT '入库关联订单ID',
  25. `inventoryInAt` varchar(255) DEFAULT NULL COMMENT '入库时间; E.g: 2021-05-28T10:24:54+08:00',
  26. `productionBatchNum` varchar(255) DEFAULT NULL COMMENT '生产批号;',
  27. `productionAt` varchar(255) DEFAULT NULL COMMENT '生产日期; E.g: 2021-05-28T10:24:54+08:00',
  28. `expirationAt` varchar(255) DEFAULT NULL COMMENT '有效期至; E.g: 2021-05-28T10:24:54+08:00',
  29. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  30. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  31. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  32. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  33. PRIMARY KEY (`id`) USING BTREE
  34. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '仓库-资产表'

warehouse_asset_record

  • 仓库-资产表-记录表
  1. CREATE TABLE `warehouse_asset_record` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(255) DEFAULT NULL COMMENT '顺序id; 1++',
  4. `assetRecordId` varchar(255) DEFAULT NULL COMMENT '资产操作ID; ZC10001-001',
  5. `ticketId` varchar(255) DEFAULT NULL COMMENT '申请单号',
  6. `assetId` varchar(255) DEFAULT NULL COMMENT '资产ID; ZC10001',
  7. `assetName` varchar(255) DEFAULT NULL COMMENT '资产;',
  8. `assetUnit` varchar(255) DEFAULT NULL COMMENT '单位;',
  9. `assetSpec` varchar(255) DEFAULT NULL COMMENT '规格;',
  10. `assetUser` varchar(255) DEFAULT NULL COMMENT '资产相关人',
  11. `warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库',
  12. `stockName` varchar(255) DEFAULT NULL COMMENT '货架',
  13. `assetSpecPrice` decimal(10, 0) DEFAULT NULL COMMENT '价格;',
  14. `supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',
  15. `supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',
  16. `assetTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',
  17. `manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',
  18. `manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '生产厂家-产品注册证号;',
  19. `operationType` varchar(255) DEFAULT NULL COMMENT '操作类型;',
  20. `operationTypeOrderId` varchar(255) DEFAULT NULL COMMENT '操作类型对应的订单ID;',
  21. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  22. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  23. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  24. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  25. PRIMARY KEY (`id`) USING BTREE
  26. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '仓库-资产表-记录表'

warehouse_inventory

  • 仓库-库存表(产品库存)
  1. CREATE TABLE `warehouse_inventory` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `inventoryId` varchar(255) DEFAULT NULL COMMENT '库存ID; 230603-022713-01 YYMMDD-ddhhss-XX',
  4. `ticketId` varchar(255) DEFAULT NULL COMMENT '工单id',
  5. `productName` varchar(255) DEFAULT NULL COMMENT '产品;',
  6. `warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库',
  7. `stockName` varchar(255) DEFAULT NULL COMMENT '货架',
  8. `count` int(11) DEFAULT NULL COMMENT '数量',
  9. `countOfInventoryIn` int(11) DEFAULT NULL COMMENT '入库数量',
  10. `productUnit` varchar(255) DEFAULT NULL COMMENT '产品单位;',
  11. `productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格;',
  12. `productSpecPrice` decimal(10, 0) DEFAULT NULL COMMENT '产品价格;',
  13. `purchaseProductSpecPriceWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '产品去税价格',
  14. `purchaseProductTaxRate` decimal(10, 2) DEFAULT NULL COMMENT '产品税率',
  15. `purchaseProductTaxPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品税额',
  16. `purchaseProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品价格;',
  17. `purchaseProductTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '含税总金额',
  18. `purchaseProductTotalAmountWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '不含税总金额',
  19. `productType` varchar(255) DEFAULT NULL COMMENT '产品类型;',
  20. `productTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',
  21. `supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',
  22. `supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',
  23. `manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',
  24. `manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '生产厂家-产品注册证号;',
  25. `manufacturerLicenseNum` varchar(255) DEFAULT NULL COMMENT '生产许可证号',
  26. `inventoryInType` varchar(255) DEFAULT NULL COMMENT '入库类型; 采购入库',
  27. `inventoryInOrderId` varchar(255) DEFAULT NULL COMMENT '入库关联订单ID',
  28. `inventoryInAt` varchar(255) DEFAULT NULL COMMENT '入库时间; E.g: 2021-05-28T10:24:54+08:00',
  29. `productionBatchNum` varchar(255) DEFAULT NULL COMMENT '生产批号;',
  30. `productionAt` varchar(255) DEFAULT NULL COMMENT '生产日期; E.g: 2021-05-28T10:24:54+08:00',
  31. `expirationAt` varchar(255) DEFAULT NULL COMMENT '有效期至; E.g: 2021-05-28T10:24:54+08:00',
  32. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  33. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  34. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  35. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  36. `purchaseProductTaxPriceRealTime` decimal(10, 2) DEFAULT NULL COMMENT '产品总税额,实时',
  37. `purchaseProductTotalAmountRealTime` decimal(10, 2) DEFAULT NULL COMMENT '产品含税总金额,实时',
  38. `purchaseProductTotalAmountWithoutTaxRealTime` decimal(10, 2) DEFAULT NULL COMMENT '产品不含税总金额,实时',
  39. PRIMARY KEY (`id`) USING BTREE
  40. ) ENGINE = InnoDB AUTO_INCREMENT = 199 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '仓库-库存表(产品库存)'

warehouse_inventory_record

  • 仓库-库存表-记录表
  1. CREATE TABLE `warehouse_inventory_record` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `inventoryId` varchar(255) DEFAULT NULL COMMENT '库存ID',
  4. `inventoryRecordId` varchar(255) DEFAULT NULL COMMENT '库存ID; 库存ID-0XX',
  5. `ticketId` varchar(255) DEFAULT NULL COMMENT '工单id',
  6. `warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库',
  7. `stockName` varchar(255) DEFAULT NULL COMMENT '货架',
  8. `operationCount` int(11) DEFAULT NULL COMMENT '操作数量',
  9. `operationType` varchar(255) DEFAULT NULL COMMENT '操作类型',
  10. `operationTypeOrderId` varchar(255) DEFAULT NULL COMMENT '操作类型对应的订单ID',
  11. `operationTargetCompanyName` varchar(255) DEFAULT NULL COMMENT '操作对象; 客户/供货商',
  12. `operationTargetCompanyAddress` varchar(255) DEFAULT NULL COMMENT '操作对象地址; 客户或者供货商',
  13. `productName` varchar(255) DEFAULT NULL COMMENT '产品;',
  14. `productUnit` varchar(255) DEFAULT NULL COMMENT '产品单位;',
  15. `productSpec` varchar(255) DEFAULT NULL COMMENT '产品规格;',
  16. `purchaseProductSpecPriceWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '产品去税价格',
  17. `productSpecPrice` decimal(10, 0) DEFAULT NULL COMMENT '产品价格;',
  18. `purchaseProductTaxRate` decimal(10, 2) DEFAULT NULL COMMENT '产品税率',
  19. `purchaseProductTaxPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品税额',
  20. `saleProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品价格;',
  21. `saleProductTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '含税总金额',
  22. `productTotalAmountWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '不含税总金额',
  23. `purchaseProductSpecPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品价格;',
  24. `purchaseProductTotalAmount` decimal(10, 2) DEFAULT NULL COMMENT '含税总金额',
  25. `purchaseProductTotalAmountWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '不含税总金额',
  26. `productType` varchar(255) DEFAULT NULL COMMENT '产品类型;',
  27. `productTransport` varchar(255) DEFAULT NULL COMMENT '储运条件;',
  28. `supplierId` varchar(255) DEFAULT NULL COMMENT '供货商ID',
  29. `supplierName` varchar(255) DEFAULT NULL COMMENT '供货商',
  30. `manufacturerName` varchar(255) DEFAULT NULL COMMENT '生产厂家',
  31. `manufacturerProductRCNum` varchar(255) DEFAULT NULL COMMENT '生产厂家-产品注册证号;',
  32. `productionBatchNum` varchar(255) DEFAULT NULL COMMENT '生产批号',
  33. `productionAt` varchar(255) DEFAULT NULL COMMENT '生产日期; E.g: 2021-05-28T10:24:54+08:00',
  34. `expirationAt` varchar(255) DEFAULT NULL COMMENT '有效期至; E.g: 2021-05-28T10:24:54+08:00',
  35. `manufacturerLicenseNum` varchar(255) DEFAULT NULL COMMENT '生产许可证号',
  36. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  37. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  38. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  39. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  40. `productSpecPriceWithoutTax` decimal(10, 2) DEFAULT NULL COMMENT '产品去税价格',
  41. `productTaxRate` decimal(10, 2) DEFAULT NULL COMMENT '产品税率',
  42. `productTaxPrice` decimal(10, 2) DEFAULT NULL COMMENT '产品税额',
  43. PRIMARY KEY (`id`) USING BTREE,
  44. UNIQUE KEY `inventoryRecordId_unique` (`inventoryRecordId`) USING BTREE
  45. ) ENGINE = InnoDB AUTO_INCREMENT = 170 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '仓库-库存表-记录表'

warehouse_stock

  • 仓库货架表
  1. CREATE TABLE `warehouse_stock` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `idSequence` int(255) DEFAULT NULL COMMENT '顺序id;',
  4. `warehouseId` varchar(255) DEFAULT NULL COMMENT '仓库编号;',
  5. `warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库名;',
  6. `warehouseType` varchar(255) DEFAULT NULL COMMENT '仓库类型; 冷库, 其它',
  7. `stockCount` int(11) DEFAULT '0' COMMENT '货架个数',
  8. `stockList` text COMMENT '货架列表; [{ stockName, stockType }]',
  9. `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  10. `rowStatus` varchar(255) DEFAULT '正常' COMMENT '数据状态;草稿,回收站,正常',
  11. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  12. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  13. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  14. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  15. PRIMARY KEY (`id`) USING BTREE,
  16. UNIQUE KEY `warehouseName_unique` (`warehouseName`) USING BTREE
  17. ) ENGINE = InnoDB AUTO_INCREMENT = 68 DEFAULT CHARSET = utf8mb4 COMMENT = '仓库货架表'

业务视图

_view02_user_app

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`localhost` SQL SECURITY DEFINER VIEW `_view02_user_app` AS
  2. select
  3. `jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`.`id` AS `id`,
  4. `jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`.`userId` AS `userId`,
  5. `jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`.`appId` AS `appId`
  6. from
  7. `jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`
  8. where
  9. (
  10. `jh_enterprise_v2_data_repository`.`enterprise_view02_user_app`.`appId` = 'jianghu-erp'
  11. )

view01_asset_list_for_apply

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_asset_list_for_apply` AS
  2. select
  3. `warehouse_asset`.`assetName` AS `assetName`,
  4. group_concat(
  5. distinct `warehouse_asset`.`assetSpec` separator ','
  6. ) AS `assetSpecList`,
  7. count(1) AS `assetCount`
  8. from
  9. `warehouse_asset`
  10. group by
  11. `warehouse_asset`.`assetName`

view01_customer_sale_order

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_customer_sale_order` AS
  2. select
  3. `sale_order`.`id` AS `id`,
  4. `sale_order`.`saleOrderId` AS `saleOrderId`,
  5. `sale_order`.`customerId` AS `customerId`,
  6. `sale_order`.`customerName` AS `customerName`,
  7. `sale_order`.`saleOrderDesc` AS `saleOrderDesc`,
  8. `sale_order`.`saleProductList` AS `saleProductList`,
  9. `sale_order`.`saleProductListCount` AS `saleProductListCount`,
  10. `sale_order`.`saleProductTotalCount` AS `saleProductTotalCount`,
  11. `sale_order`.`saleTotalAmount` AS `saleTotalAmount`,
  12. `sale_order`.`saleOrderStatus` AS `saleOrderStatus`,
  13. `sale_order`.`saleOrderStatusDesc` AS `saleOrderStatusDesc`,
  14. `sale_order`.`saleCreateAt` AS `saleCreateAt`,
  15. `sale_order`.`saleFinishAt` AS `saleFinishAt`,
  16. `sale_order`.`operation` AS `operation`,
  17. `sale_order`.`operationByUserId` AS `operationByUserId`,
  18. `sale_order`.`operationByUser` AS `operationByUser`,
  19. `sale_order`.`operationAt` AS `operationAt`,
  20. `customer`.`customerAddress` AS `customerAddress`
  21. from
  22. (
  23. `customer`
  24. join `sale_order` on (
  25. (
  26. `customer`.`customerId` = `sale_order`.`customerId`
  27. )
  28. )
  29. )

view01_customer_sale_return_order

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_customer_sale_return_order` AS
  2. select
  3. `sale_return_order`.`id` AS `id`,
  4. `sale_return_order`.`returnOrderId` AS `returnOrderId`,
  5. `sale_return_order`.`customerId` AS `customerId`,
  6. `sale_return_order`.`customerName` AS `customerName`,
  7. `sale_return_order`.`returnOrderDesc` AS `returnOrderDesc`,
  8. `sale_return_order`.`returnProductList` AS `returnProductList`,
  9. `sale_return_order`.`returnProductListCount` AS `returnProductListCount`,
  10. `sale_return_order`.`returnProductTotalCount` AS `returnProductTotalCount`,
  11. `sale_return_order`.`returnTotalAmount` AS `returnTotalAmount`,
  12. `sale_return_order`.`returnOrderStatus` AS `returnOrderStatus`,
  13. `sale_return_order`.`returnCreateAt` AS `returnCreateAt`,
  14. `sale_return_order`.`returnFinishAt` AS `returnFinishAt`,
  15. `sale_return_order`.`operation` AS `operation`,
  16. `sale_return_order`.`operationByUserId` AS `operationByUserId`,
  17. `sale_return_order`.`operationByUser` AS `operationByUser`,
  18. `sale_return_order`.`operationAt` AS `operationAt`,
  19. `customer`.`customerAddress` AS `customerAddress`
  20. from
  21. (
  22. `customer`
  23. join `sale_return_order` on (
  24. (
  25. `customer`.`customerId` = `sale_return_order`.`customerId`
  26. )
  27. )
  28. )

view01_finance_asset_info

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_finance_asset_info` AS
  2. select
  3. `finance_asset`.`id` AS `id`,
  4. `finance_asset`.`idSequence` AS `idSequence`,
  5. `warehouse_asset`.`assetId` AS `assetId`,
  6. `warehouse_asset`.`assetName` AS `assetName`,
  7. `finance_asset`.`currentPeriod` AS `currentPeriod`,
  8. `finance_asset`.`depreciationMethod` AS `depreciationMethod`,
  9. `finance_asset`.`financeAssetSubject` AS `financeAssetSubject`,
  10. `finance_asset`.`financeDepreciationSubject` AS `financeDepreciationSubject`,
  11. `finance_asset`.`financeClearSubject` AS `financeClearSubject`,
  12. `finance_asset`.`financeDepreciationFeeSubject` AS `financeDepreciationFeeSubject`,
  13. `finance_asset`.`startUseAt` AS `startUseAt`,
  14. `finance_asset`.`assetValue` AS `assetValue`,
  15. `finance_asset`.`residualRate` AS `residualRate`,
  16. `finance_asset`.`estimatedUseMonth` AS `estimatedUseMonth`,
  17. `finance_asset`.`depreciatedMonths` AS `depreciatedMonths`,
  18. `finance_asset`.`remainingMonth` AS `remainingMonth`,
  19. `finance_asset`.`monthlyDepreciation` AS `monthlyDepreciation`,
  20. `finance_asset`.`totalDepreciation` AS `totalDepreciation`,
  21. `finance_asset`.`currentYearDepreciation` AS `currentYearDepreciation`,
  22. `finance_asset`.`preYearDepreciation` AS `preYearDepreciation`,
  23. `finance_asset`.`currentPeriodDepreciation` AS `currentPeriodDepreciation`,
  24. `finance_asset`.`operation` AS `operation`,
  25. `finance_asset`.`operationByUserId` AS `operationByUserId`,
  26. `finance_asset`.`operationByUser` AS `operationByUser`,
  27. `finance_asset`.`operationAt` AS `operationAt`
  28. from
  29. (
  30. `warehouse_asset`
  31. left join `finance_asset` on (
  32. (
  33. `warehouse_asset`.`assetId` = `finance_asset`.`assetId`
  34. )
  35. )
  36. )

view01_finance_asset_last

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_finance_asset_last` AS
  2. select
  3. `subquery`.`id` AS `id`,
  4. `subquery`.`idSequence` AS `idSequence`,
  5. `subquery`.`assetId` AS `assetId`,
  6. `subquery`.`assetName` AS `assetName`,
  7. `subquery`.`assetSpec` AS `assetSpec`,
  8. `subquery`.`currentPeriod` AS `currentPeriod`,
  9. `subquery`.`depreciationMethod` AS `depreciationMethod`,
  10. `subquery`.`financeAssetSubject` AS `financeAssetSubject`,
  11. `subquery`.`financeDepreciationSubject` AS `financeDepreciationSubject`,
  12. `subquery`.`financeClearSubject` AS `financeClearSubject`,
  13. `subquery`.`financeDepreciationFeeSubject` AS `financeDepreciationFeeSubject`,
  14. `subquery`.`startUseAt` AS `startUseAt`,
  15. `subquery`.`assetValue` AS `assetValue`,
  16. `subquery`.`residualRate` AS `residualRate`,
  17. `subquery`.`estimatedUseMonth` AS `estimatedUseMonth`,
  18. `subquery`.`depreciatedMonths` AS `depreciatedMonths`,
  19. `subquery`.`remainingMonth` AS `remainingMonth`,
  20. `subquery`.`monthlyDepreciation` AS `monthlyDepreciation`,
  21. `subquery`.`totalDepreciation` AS `totalDepreciation`,
  22. `subquery`.`currentYearDepreciation` AS `currentYearDepreciation`,
  23. `subquery`.`preYearDepreciation` AS `preYearDepreciation`,
  24. `subquery`.`currentPeriodDepreciation` AS `currentPeriodDepreciation`,
  25. `subquery`.`operation` AS `operation`,
  26. `subquery`.`operationByUserId` AS `operationByUserId`,
  27. `subquery`.`operationByUser` AS `operationByUser`,
  28. `subquery`.`operationAt` AS `operationAt`,
  29. `subquery`.`financeAssetSubjectId` AS `financeAssetSubjectId`,
  30. `subquery`.`financeDepreciationSubjectId` AS `financeDepreciationSubjectId`,
  31. `subquery`.`financeClearSubjectId` AS `financeClearSubjectId`,
  32. `subquery`.`financeDepreciationFeeSubjectId` AS `financeDepreciationFeeSubjectId`,
  33. `subquery`.`assetTypeId` AS `assetTypeId`,
  34. `subquery`.`assetTypeName` AS `assetTypeName`,
  35. `subquery`.`deptId` AS `deptId`,
  36. `subquery`.`deptName` AS `deptName`,
  37. max(`subquery`.`currentPeriod`) AS `latestCurrentPeriod`
  38. from
  39. (
  40. select
  41. `jianghu_erp`.`finance_asset`.`id` AS `id`,
  42. `jianghu_erp`.`finance_asset`.`idSequence` AS `idSequence`,
  43. `jianghu_erp`.`finance_asset`.`assetId` AS `assetId`,
  44. `jianghu_erp`.`finance_asset`.`assetName` AS `assetName`,
  45. `jianghu_erp`.`finance_asset`.`assetSpec` AS `assetSpec`,
  46. `jianghu_erp`.`finance_asset`.`currentPeriod` AS `currentPeriod`,
  47. `jianghu_erp`.`finance_asset`.`depreciationMethod` AS `depreciationMethod`,
  48. `jianghu_erp`.`finance_asset`.`financeAssetSubject` AS `financeAssetSubject`,
  49. `jianghu_erp`.`finance_asset`.`financeDepreciationSubject` AS `financeDepreciationSubject`,
  50. `jianghu_erp`.`finance_asset`.`financeClearSubject` AS `financeClearSubject`,
  51. `jianghu_erp`.`finance_asset`.`financeDepreciationFeeSubject` AS `financeDepreciationFeeSubject`,
  52. `jianghu_erp`.`finance_asset`.`startUseAt` AS `startUseAt`,
  53. `jianghu_erp`.`finance_asset`.`assetValue` AS `assetValue`,
  54. `jianghu_erp`.`finance_asset`.`residualRate` AS `residualRate`,
  55. `jianghu_erp`.`finance_asset`.`estimatedUseMonth` AS `estimatedUseMonth`,
  56. `jianghu_erp`.`finance_asset`.`depreciatedMonths` AS `depreciatedMonths`,
  57. `jianghu_erp`.`finance_asset`.`remainingMonth` AS `remainingMonth`,
  58. `jianghu_erp`.`finance_asset`.`monthlyDepreciation` AS `monthlyDepreciation`,
  59. `jianghu_erp`.`finance_asset`.`totalDepreciation` AS `totalDepreciation`,
  60. `jianghu_erp`.`finance_asset`.`currentYearDepreciation` AS `currentYearDepreciation`,
  61. `jianghu_erp`.`finance_asset`.`preYearDepreciation` AS `preYearDepreciation`,
  62. `jianghu_erp`.`finance_asset`.`currentPeriodDepreciation` AS `currentPeriodDepreciation`,
  63. `jianghu_erp`.`finance_asset`.`operation` AS `operation`,
  64. `jianghu_erp`.`finance_asset`.`operationByUserId` AS `operationByUserId`,
  65. `jianghu_erp`.`finance_asset`.`operationByUser` AS `operationByUser`,
  66. `jianghu_erp`.`finance_asset`.`operationAt` AS `operationAt`,
  67. `jianghu_erp`.`finance_asset`.`financeAssetSubjectId` AS `financeAssetSubjectId`,
  68. `jianghu_erp`.`finance_asset`.`financeDepreciationSubjectId` AS `financeDepreciationSubjectId`,
  69. `jianghu_erp`.`finance_asset`.`financeClearSubjectId` AS `financeClearSubjectId`,
  70. `jianghu_erp`.`finance_asset`.`financeDepreciationFeeSubjectId` AS `financeDepreciationFeeSubjectId`,
  71. `jianghu_erp`.`finance_asset`.`assetTypeId` AS `assetTypeId`,
  72. `jianghu_erp`.`finance_asset`.`assetTypeName` AS `assetTypeName`,
  73. `jianghu_erp`.`finance_asset`.`deptId` AS `deptId`,
  74. `jianghu_erp`.`finance_asset`.`deptName` AS `deptName`
  75. from
  76. `jianghu_erp`.`finance_asset`
  77. union all
  78. select
  79. `jianghu_erp`.`finance_asset_record`.`id` AS `id`,
  80. `jianghu_erp`.`finance_asset_record`.`idSequence` AS `idSequence`,
  81. `jianghu_erp`.`finance_asset_record`.`assetId` AS `assetId`,
  82. `jianghu_erp`.`finance_asset_record`.`assetName` AS `assetName`,
  83. `jianghu_erp`.`finance_asset_record`.`assetSpec` AS `assetSpec`,
  84. `jianghu_erp`.`finance_asset_record`.`currentPeriod` AS `currentPeriod`,
  85. `jianghu_erp`.`finance_asset_record`.`depreciationMethod` AS `depreciationMethod`,
  86. `jianghu_erp`.`finance_asset_record`.`financeAssetSubject` AS `financeAssetSubject`,
  87. `jianghu_erp`.`finance_asset_record`.`financeDepreciationSubject` AS `financeDepreciationSubject`,
  88. `jianghu_erp`.`finance_asset_record`.`financeClearSubject` AS `financeClearSubject`,
  89. `jianghu_erp`.`finance_asset_record`.`financeDepreciationFeeSubject` AS `financeDepreciationFeeSubject`,
  90. `jianghu_erp`.`finance_asset_record`.`startUseAt` AS `startUseAt`,
  91. `jianghu_erp`.`finance_asset_record`.`assetValue` AS `assetValue`,
  92. `jianghu_erp`.`finance_asset_record`.`residualRate` AS `residualRate`,
  93. `jianghu_erp`.`finance_asset_record`.`estimatedUseMonth` AS `estimatedUseMonth`,
  94. `jianghu_erp`.`finance_asset_record`.`depreciatedMonths` AS `depreciatedMonths`,
  95. `jianghu_erp`.`finance_asset_record`.`remainingMonth` AS `remainingMonth`,
  96. `jianghu_erp`.`finance_asset_record`.`monthlyDepreciation` AS `monthlyDepreciation`,
  97. `jianghu_erp`.`finance_asset_record`.`totalDepreciation` AS `totalDepreciation`,
  98. `jianghu_erp`.`finance_asset_record`.`currentYearDepreciation` AS `currentYearDepreciation`,
  99. `jianghu_erp`.`finance_asset_record`.`preYearDepreciation` AS `preYearDepreciation`,
  100. `jianghu_erp`.`finance_asset_record`.`currentPeriodDepreciation` AS `currentPeriodDepreciation`,
  101. `jianghu_erp`.`finance_asset_record`.`operation` AS `operation`,
  102. `jianghu_erp`.`finance_asset_record`.`operationByUserId` AS `operationByUserId`,
  103. `jianghu_erp`.`finance_asset_record`.`operationByUser` AS `operationByUser`,
  104. `jianghu_erp`.`finance_asset_record`.`operationAt` AS `operationAt`,
  105. `jianghu_erp`.`finance_asset_record`.`financeAssetSubjectId` AS `financeAssetSubjectId`,
  106. `jianghu_erp`.`finance_asset_record`.`financeDepreciationSubjectId` AS `financeDepreciationSubjectId`,
  107. `jianghu_erp`.`finance_asset_record`.`financeClearSubjectId` AS `financeClearSubjectId`,
  108. `jianghu_erp`.`finance_asset_record`.`financeDepreciationFeeSubjectId` AS `financeDepreciationFeeSubjectId`,
  109. `jianghu_erp`.`finance_asset_record`.`assetTypeId` AS `assetTypeId`,
  110. `jianghu_erp`.`finance_asset_record`.`assetTypeName` AS `assetTypeName`,
  111. `jianghu_erp`.`finance_asset_record`.`deptId` AS `deptId`,
  112. `jianghu_erp`.`finance_asset_record`.`deptName` AS `deptName`
  113. from
  114. `jianghu_erp`.`finance_asset_record`
  115. ) `subquery`
  116. group by
  117. `subquery`.`assetId`

view01_next_voucher_number

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_next_voucher_number` AS
  2. select
  3. `voucher`.`periodId` AS `periodId`,
  4. (max(`voucher`.`voucherNumber`) + 1) AS `maxVoucherNumber`
  5. from
  6. `voucher`
  7. group by
  8. `voucher`.`periodId`

view01_period_voucher

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_period_voucher` AS
  2. select
  3. `finance_period`.`id` AS `id`,
  4. `finance_period`.`periodId` AS `periodId`,
  5. `finance_period`.`isDepreciation` AS `isDepreciation`,
  6. `finance_period`.`isPeriodStart` AS `isPeriodStart`,
  7. `voucher`.`voucherName` AS `voucherName`,
  8. `voucher`.`voucherNumber` AS `voucherNumber`,
  9. `voucher`.`voucherId` AS `voucherId`,
  10. `voucher`.`voucherType` AS `voucherType`,
  11. `voucher`.`voucherDebitSum` AS `voucherDebitSum`,
  12. `voucher`.`voucherCreditSum` AS `voucherCreditSum`,
  13. `voucher`.`voucherAt` AS `voucherAt`,
  14. `voucher`.`operation` AS `operation`,
  15. `voucher`.`operationByUser` AS `operationByUser`,
  16. `voucher`.`operationAt` AS `operationAt`
  17. from
  18. (
  19. `finance_period`
  20. left join `voucher` on (
  21. (
  22. `finance_period`.`depreciationVoucherId` = `voucher`.`voucherId`
  23. )
  24. )
  25. )

view01_purchase_order

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_purchase_order` AS
  2. select
  3. `purchase_order`.`id` AS `id`,
  4. `purchase_order`.`idSequence` AS `idSequence`,
  5. `purchase_order`.`purchaseOrderId` AS `purchaseOrderId`,
  6. `purchase_order`.`supplierId` AS `supplierId`,
  7. `purchase_order`.`supplierName` AS `supplierName`,
  8. `purchase_order`.`supplierInfo` AS `supplierInfo`,
  9. `purchase_order`.`purchaseOrderDesc` AS `purchaseOrderDesc`,
  10. `purchase_order`.`purchaseProductList` AS `purchaseProductList`,
  11. `purchase_order`.`purchaseProductListCount` AS `purchaseProductListCount`,
  12. `purchase_order`.`purchaseProductTotalCount` AS `purchaseProductTotalCount`,
  13. `purchase_order`.`purchaseTotalAmount` AS `purchaseTotalAmount`,
  14. `purchase_order`.`purchaseOrderStatus` AS `purchaseOrderStatus`,
  15. `purchase_order`.`purchaseOrderStatusDesc` AS `purchaseOrderStatusDesc`,
  16. `purchase_order`.`purchaseCreateAt` AS `purchaseCreateAt`,
  17. `purchase_order`.`purchaseFinishAt` AS `purchaseFinishAt`,
  18. `purchase_order`.`operation` AS `operation`,
  19. `purchase_order`.`operationByUserId` AS `operationByUserId`,
  20. `purchase_order`.`operationByUser` AS `operationByUser`,
  21. `purchase_order`.`operationAt` AS `operationAt`,
  22. ifnull(
  23. (
  24. select
  25. sum(`warehouse_inventory`.`count`)
  26. from
  27. `warehouse_inventory`
  28. where
  29. (
  30. `warehouse_inventory`.`inventoryInOrderId` = `purchase_order`.`purchaseOrderId`
  31. )
  32. ),
  33. 0
  34. ) AS `inventoryCount`,
  35. ifnull(
  36. (
  37. select
  38. sum(`payment_order`.`deductionAmount`)
  39. from
  40. `payment_order`
  41. where
  42. (
  43. (
  44. `payment_order`.`orderId` = `purchase_order`.`purchaseOrderId`
  45. )
  46. and (`payment_order`.`paymentType` = '付款')
  47. )
  48. ),
  49. 0
  50. ) AS `purchasePaidAmount`,
  51. ifnull(
  52. (
  53. select
  54. sum(`warehouse_inventory_record`.`operationCount`)
  55. from
  56. `warehouse_inventory_record`
  57. where
  58. (
  59. `warehouse_inventory_record`.`operationTypeOrderId` = `purchase_order`.`purchaseOrderId`
  60. )
  61. ),
  62. 0
  63. ) AS `purchaseProductInStoreCount`,
  64. `purchase_order`.`purchaseOrderType` AS `purchaseOrderType`
  65. from
  66. `purchase_order`

view01_purchase_return_order

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_purchase_return_order` AS
  2. select
  3. `purchase_return_order`.`id` AS `id`,
  4. `purchase_return_order`.`idSequence` AS `idSequence`,
  5. `purchase_return_order`.`returnOrderId` AS `returnOrderId`,
  6. `purchase_return_order`.`supplierId` AS `supplierId`,
  7. `purchase_return_order`.`supplierName` AS `supplierName`,
  8. `purchase_return_order`.`supplierInfo` AS `supplierInfo`,
  9. `purchase_return_order`.`returnOrderDesc` AS `returnOrderDesc`,
  10. `purchase_return_order`.`returnProductList` AS `returnProductList`,
  11. `purchase_return_order`.`returnProductListCount` AS `returnProductListCount`,
  12. `purchase_return_order`.`returnProductTotalCount` AS `returnProductTotalCount`,
  13. `purchase_return_order`.`returnTotalAmount` AS `returnTotalAmount`,
  14. `purchase_return_order`.`returnOrderStatus` AS `returnOrderStatus`,
  15. `purchase_return_order`.`returnOrderStatusDesc` AS `returnOrderStatusDesc`,
  16. `purchase_return_order`.`returnCreateAt` AS `returnCreateAt`,
  17. `purchase_return_order`.`returnFinishAt` AS `returnFinishAt`,
  18. `purchase_return_order`.`returnOrderType` AS `returnOrderType`,
  19. `purchase_return_order`.`returnOrderRemark` AS `returnOrderRemark`,
  20. `purchase_return_order`.`operation` AS `operation`,
  21. `purchase_return_order`.`operationByUserId` AS `operationByUserId`,
  22. `purchase_return_order`.`operationByUser` AS `operationByUser`,
  23. `purchase_return_order`.`operationAt` AS `operationAt`,
  24. ifnull(
  25. (
  26. select
  27. sum(`payment_order`.`deductionAmount`)
  28. from
  29. `payment_order`
  30. where
  31. (
  32. (
  33. `payment_order`.`orderId` = `purchase_return_order`.`returnOrderId`
  34. )
  35. and (`payment_order`.`paymentType` = '收款')
  36. and (`payment_order`.`orderType` = '采购退货订单')
  37. )
  38. ),
  39. 0
  40. ) AS `returnPaidAmount`,
  41. ifnull(
  42. (
  43. select
  44. sum(`warehouse_inventory_record`.`operationCount`)
  45. from
  46. `warehouse_inventory_record`
  47. where
  48. (
  49. `warehouse_inventory_record`.`operationTypeOrderId` = `purchase_return_order`.`returnOrderId`
  50. )
  51. ),
  52. 0
  53. ) AS `returnProductOutStoreCount`
  54. from
  55. `purchase_return_order`

view01_sale_order

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_sale_order` AS
  2. select
  3. `sale_order`.`id` AS `id`,
  4. `sale_order`.`idSequence` AS `idSequence`,
  5. `sale_order`.`saleOrderId` AS `saleOrderId`,
  6. `sale_order`.`customerId` AS `customerId`,
  7. `sale_order`.`customerName` AS `customerName`,
  8. `sale_order`.`customerInfo` AS `customerInfo`,
  9. `sale_order`.`saleOrderDesc` AS `saleOrderDesc`,
  10. `sale_order`.`saleProductList` AS `saleProductList`,
  11. `sale_order`.`saleProductListCount` AS `saleProductListCount`,
  12. `sale_order`.`saleProductTotalCount` AS `saleProductTotalCount`,
  13. `sale_order`.`saleTotalAmount` AS `saleTotalAmount`,
  14. `sale_order`.`saleOrderStatus` AS `saleOrderStatus`,
  15. `sale_order`.`saleOrderStatusDesc` AS `saleOrderStatusDesc`,
  16. `sale_order`.`saleCreateAt` AS `saleCreateAt`,
  17. `sale_order`.`saleFinishAt` AS `saleFinishAt`,
  18. `sale_order`.`operation` AS `operation`,
  19. `sale_order`.`operationByUserId` AS `operationByUserId`,
  20. `sale_order`.`operationAt` AS `operationAt`,
  21. `sale_order`.`operationByUser` AS `operationByUser`,
  22. ifnull(
  23. (
  24. select
  25. sum(`payment_order`.`deductionAmount`)
  26. from
  27. `payment_order`
  28. where
  29. (
  30. (
  31. `payment_order`.`orderId` = `sale_order`.`saleOrderId`
  32. )
  33. and (`payment_order`.`paymentType` = '收款')
  34. )
  35. ),
  36. 0
  37. ) AS `salePaidAmount`,
  38. ifnull(
  39. (
  40. select
  41. sum(`warehouse_inventory_record`.`operationCount`)
  42. from
  43. `warehouse_inventory_record`
  44. where
  45. (
  46. `warehouse_inventory_record`.`operationTypeOrderId` = `sale_order`.`saleOrderId`
  47. )
  48. ),
  49. 0
  50. ) AS `saleProductOutStoreCount`
  51. from
  52. `sale_order`

view01_sale_return_order

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_sale_return_order` AS
  2. select
  3. `sale_return_order`.`id` AS `id`,
  4. `sale_return_order`.`idSequence` AS `idSequence`,
  5. `sale_return_order`.`returnOrderId` AS `returnOrderId`,
  6. `sale_return_order`.`customerId` AS `customerId`,
  7. `sale_return_order`.`customerName` AS `customerName`,
  8. `sale_return_order`.`customerInfo` AS `customerInfo`,
  9. `sale_return_order`.`returnOrderDesc` AS `returnOrderDesc`,
  10. `sale_return_order`.`returnProductList` AS `returnProductList`,
  11. `sale_return_order`.`returnProductListCount` AS `returnProductListCount`,
  12. `sale_return_order`.`returnProductTotalCount` AS `returnProductTotalCount`,
  13. `sale_return_order`.`returnTotalAmount` AS `returnTotalAmount`,
  14. `sale_return_order`.`returnOrderStatus` AS `returnOrderStatus`,
  15. `sale_return_order`.`returnOrderStatusDesc` AS `returnOrderStatusDesc`,
  16. `sale_return_order`.`returnCreateAt` AS `returnCreateAt`,
  17. `sale_return_order`.`returnOrderRemark` AS `returnOrderRemark`,
  18. `sale_return_order`.`returnFinishAt` AS `returnFinishAt`,
  19. `sale_return_order`.`operation` AS `operation`,
  20. `sale_return_order`.`operationByUserId` AS `operationByUserId`,
  21. `sale_return_order`.`operationByUser` AS `operationByUser`,
  22. `sale_return_order`.`operationAt` AS `operationAt`,
  23. ifnull(
  24. (
  25. select
  26. sum(`payment_order`.`deductionAmount`)
  27. from
  28. `payment_order`
  29. where
  30. (
  31. (
  32. `payment_order`.`orderId` = `sale_return_order`.`returnOrderId`
  33. )
  34. and (`payment_order`.`paymentType` = '付款')
  35. )
  36. ),
  37. 0
  38. ) AS `returnPaidAmount`,
  39. ifnull(
  40. (
  41. select
  42. sum(`warehouse_inventory`.`count`)
  43. from
  44. `warehouse_inventory`
  45. where
  46. (
  47. `warehouse_inventory`.`inventoryInOrderId` = `sale_return_order`.`returnOrderId`
  48. )
  49. ),
  50. 0
  51. ) AS `returnProductOutStoreCount`
  52. from
  53. `sale_return_order`

view01_supplier_info

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_supplier_info` AS
  2. select
  3. `supplier`.`id` AS `id`,
  4. `supplier`.`supplierId` AS `supplierId`,
  5. `supplier`.`idSequence` AS `idSequence`,
  6. `supplier`.`supplierName` AS `supplierName`,
  7. count(`supplier_product`.`id`) AS `productCount`,
  8. `supplier`.`supplierAccountNum` AS `supplierAccountNum`,
  9. `supplier`.`supplierBankName` AS `supplierBankName`,
  10. `supplier`.`supplierBusinessLicenseNum` AS `supplierBusinessLicenseNum`,
  11. `supplier`.`supplierMedicalOperatingLicenseNum` AS `supplierMedicalOperatingLicenseNum`,
  12. `supplier`.`supplierPaymentCycle` AS `supplierPaymentCycle`,
  13. `supplier`.`supplierAddress` AS `supplierAddress`,
  14. `supplier`.`supplierPostalCode` AS `supplierPostalCode`,
  15. `supplier`.`supplierContactPerson` AS `supplierContactPerson`,
  16. `supplier`.`supplierPhoneNum` AS `supplierPhoneNum`,
  17. `supplier`.`remark` AS `remark`,
  18. `supplier`.`rowStatus` AS `rowStatus`,
  19. `supplier`.`operation` AS `operation`,
  20. `supplier`.`operationByUserId` AS `operationByUserId`,
  21. `supplier`.`operationByUser` AS `operationByUser`,
  22. `supplier`.`operationAt` AS `operationAt`,
  23. `supplier`.`supplierBranchBankName` AS `supplierBranchBankName`
  24. from
  25. (
  26. `supplier`
  27. left join `supplier_product` on (
  28. (
  29. `supplier`.`supplierId` = `supplier_product`.`supplierId`
  30. )
  31. )
  32. )
  33. group by
  34. `supplier`.`supplierId`

view01_ticket_order

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_ticket_order` AS
  2. select
  3. `ticket`.`id` AS `id`,
  4. `ticket`.`idSequence` AS `idSequence`,
  5. `ticket`.`ticketId` AS `ticketId`,
  6. `purchase_order`.`supplierId` AS `purchaseOrderSupplierId`,
  7. `sale_order`.`customerId` AS `saleOrderCustomerId`,
  8. `ticket`.`ticketBizId` AS `ticketBizId`,
  9. `ticket`.`ticketType` AS `ticketType`,
  10. `ticket`.`ticketDesc` AS `ticketDesc`,
  11. `ticket`.`ticketContentRequest` AS `ticketContentRequest`,
  12. `ticket`.`ticketContent` AS `ticketContent`,
  13. `ticket`.`ticketCommentList` AS `ticketCommentList`,
  14. `ticket`.`ticketAmount` AS `ticketAmount`,
  15. `ticket`.`ticketRequestAt` AS `ticketRequestAt`,
  16. `ticket`.`ticketRequestByUserId` AS `ticketRequestByUserId`,
  17. `ticket`.`ticketRequestByUser` AS `ticketRequestByUser`,
  18. `ticket`.`ticketStatus` AS `ticketStatus`,
  19. `ticket`.`ticketStatusAt` AS `ticketStatusAt`,
  20. `ticket`.`ticketStatusDesc` AS `ticketStatusDesc`,
  21. `ticket`.`ticketStatusByUserId` AS `ticketStatusByUserId`,
  22. `ticket`.`ticketStatusByUser` AS `ticketStatusByUser`,
  23. `ticket`.`operation` AS `operation`,
  24. `ticket`.`operationByUserId` AS `operationByUserId`,
  25. `ticket`.`operationByUser` AS `operationByUser`,
  26. `ticket`.`operationAt` AS `operationAt`
  27. from
  28. (
  29. (
  30. `ticket`
  31. left join `purchase_order` on (
  32. (
  33. `ticket`.`ticketBizId` = `purchase_order`.`purchaseOrderId`
  34. )
  35. )
  36. )
  37. left join `sale_order` on (
  38. (
  39. `ticket`.`ticketBizId` = `sale_order`.`saleOrderId`
  40. )
  41. )
  42. )

view01_ticket_voucher

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_ticket_voucher` AS
  2. select
  3. `ticket`.`id` AS `id`,
  4. `ticket`.`idSequence` AS `idSequence`,
  5. `ticket`.`ticketId` AS `ticketId`,
  6. `ticket`.`ticketBizId` AS `ticketBizId`,
  7. `ticket`.`ticketType` AS `ticketType`,
  8. `ticket`.`ticketDesc` AS `ticketDesc`,
  9. `ticket`.`ticketContentRequest` AS `ticketContentRequest`,
  10. `ticket`.`ticketContent` AS `ticketContent`,
  11. `ticket`.`ticketCommentList` AS `ticketCommentList`,
  12. `ticket`.`ticketRequestAmount` AS `ticketRequestAmount`,
  13. `ticket`.`ticketAmount` AS `ticketAmount`,
  14. `ticket`.`ticketRequestAt` AS `ticketRequestAt`,
  15. `ticket`.`ticketRequestByUserId` AS `ticketRequestByUserId`,
  16. `ticket`.`ticketRequestByUser` AS `ticketRequestByUser`,
  17. `ticket`.`ticketStatus` AS `ticketStatus`,
  18. `ticket`.`ticketStatusAt` AS `ticketStatusAt`,
  19. `ticket`.`ticketStatusDesc` AS `ticketStatusDesc`,
  20. `ticket`.`ticketStatusByUserId` AS `ticketStatusByUserId`,
  21. `ticket`.`ticketStatusByUser` AS `ticketStatusByUser`,
  22. `ticket`.`operation` AS `operation`,
  23. `ticket`.`operationByUserId` AS `operationByUserId`,
  24. `ticket`.`operationByUser` AS `operationByUser`,
  25. `ticket`.`operationAt` AS `operationAt`,
  26. `voucher`.`voucherId` AS `voucherId`
  27. from
  28. (
  29. `ticket`
  30. left join `voucher` on (
  31. (
  32. `voucher`.`ticketIdList` like concat('%', `ticket`.`ticketId`, '%')
  33. )
  34. )
  35. )

view01_voucher_entry

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_voucher_entry` AS
  2. select
  3. `voucher_entry`.`id` AS `id`,
  4. `voucher`.`periodId` AS `periodId`,
  5. `voucher_entry`.`voucherId` AS `voucherId`,
  6. `voucher_entry`.`subjectId` AS `subjectId`,
  7. `voucher_entry`.`subjectName` AS `subjectName`,
  8. `voucher_entry`.`entryAbstract` AS `entryAbstract`,
  9. `voucher_entry`.`debit` AS `debit`,
  10. `voucher_entry`.`credit` AS `credit`,
  11. `voucher_entry`.`assistIdOfCustomer` AS `assistIdOfCustomer`,
  12. `voucher_entry`.`assistIdOfSupplier` AS `assistIdOfSupplier`,
  13. `voucher_entry`.`assistIdOfStaff` AS `assistIdOfStaff`,
  14. `voucher_entry`.`assistIdOfProject` AS `assistIdOfProject`,
  15. `voucher_entry`.`assistIdOfDepart` AS `assistIdOfDepart`,
  16. `voucher_entry`.`assistIdOfExtend1` AS `assistIdOfExtend1`,
  17. `voucher_entry`.`assistIdOfExtend2` AS `assistIdOfExtend2`,
  18. `voucher_entry`.`assistNameOfCustomer` AS `assistNameOfCustomer`,
  19. `voucher_entry`.`assistNameOfSupplier` AS `assistNameOfSupplier`,
  20. `voucher_entry`.`assistNameOfStaff` AS `assistNameOfStaff`,
  21. `voucher_entry`.`assistNameOfProject` AS `assistNameOfProject`,
  22. `voucher_entry`.`assistNameOfDepart` AS `assistNameOfDepart`,
  23. `voucher_entry`.`assistNameOfExtend1` AS `assistNameOfExtend1`,
  24. `voucher_entry`.`assistNameOfExtend2` AS `assistNameOfExtend2`,
  25. `voucher_entry`.`operation` AS `operation`,
  26. `voucher_entry`.`operationByUserId` AS `operationByUserId`,
  27. `voucher_entry`.`operationByUser` AS `operationByUser`,
  28. `voucher_entry`.`operationAt` AS `operationAt`,
  29. `voucher`.`voucherAt` AS `voucherAt`,
  30. `voucher`.`voucherName` AS `voucherName`
  31. from
  32. (
  33. `voucher`
  34. left join `voucher_entry` on (
  35. (
  36. `voucher`.`voucherId` = `voucher_entry`.`voucherId`
  37. )
  38. )
  39. )

view01_warehouse_asset_finance

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_warehouse_asset_finance` AS
  2. select
  3. `jianghu_erp`.`warehouse_asset`.`id` AS `id`,
  4. `jianghu_erp`.`warehouse_asset`.`idSequence` AS `idSequence`,
  5. `jianghu_erp`.`warehouse_asset`.`assetId` AS `assetId`,
  6. `jianghu_erp`.`warehouse_asset`.`assetName` AS `assetName`,
  7. `jianghu_erp`.`warehouse_asset`.`warehouseName` AS `warehouseName`,
  8. `jianghu_erp`.`warehouse_asset`.`stockName` AS `stockName`,
  9. `jianghu_erp`.`warehouse_asset`.`assetUnit` AS `assetUnit`,
  10. `jianghu_erp`.`warehouse_asset`.`assetSpec` AS `assetSpec`,
  11. `jianghu_erp`.`warehouse_asset`.`assetSpecPrice` AS `assetSpecPrice`,
  12. `jianghu_erp`.`warehouse_asset`.`purchaseAssetSpecPriceWithoutTax` AS `purchaseAssetSpecPriceWithoutTax`,
  13. `jianghu_erp`.`warehouse_asset`.`purchaseAssetTaxRate` AS `purchaseAssetTaxRate`,
  14. `jianghu_erp`.`warehouse_asset`.`purchaseAssetTaxPrice` AS `purchaseAssetTaxPrice`,
  15. `jianghu_erp`.`warehouse_asset`.`purchaseAssetSpecPrice` AS `purchaseAssetSpecPrice`,
  16. `jianghu_erp`.`warehouse_asset`.`assetType` AS `assetType`,
  17. `jianghu_erp`.`warehouse_asset`.`assetTransport` AS `assetTransport`,
  18. `jianghu_erp`.`warehouse_asset`.`assetStatus` AS `assetStatus`,
  19. `jianghu_erp`.`warehouse_asset`.`assetUser` AS `assetUser`,
  20. `jianghu_erp`.`warehouse_asset`.`supplierId` AS `supplierId`,
  21. `jianghu_erp`.`warehouse_asset`.`supplierName` AS `supplierName`,
  22. `jianghu_erp`.`warehouse_asset`.`manufacturerName` AS `manufacturerName`,
  23. `jianghu_erp`.`warehouse_asset`.`manufacturerProductRCNum` AS `manufacturerProductRCNum`,
  24. `jianghu_erp`.`warehouse_asset`.`inventoryInType` AS `inventoryInType`,
  25. `jianghu_erp`.`warehouse_asset`.`inventoryInOrderId` AS `inventoryInOrderId`,
  26. `jianghu_erp`.`warehouse_asset`.`inventoryInAt` AS `inventoryInAt`,
  27. `jianghu_erp`.`warehouse_asset`.`productionBatchNum` AS `productionBatchNum`,
  28. `jianghu_erp`.`warehouse_asset`.`productionAt` AS `productionAt`,
  29. `jianghu_erp`.`warehouse_asset`.`expirationAt` AS `expirationAt`,
  30. `jianghu_erp`.`warehouse_asset`.`operation` AS `operation`,
  31. `jianghu_erp`.`warehouse_asset`.`operationByUserId` AS `operationByUserId`,
  32. `jianghu_erp`.`warehouse_asset`.`operationByUser` AS `operationByUser`,
  33. `jianghu_erp`.`warehouse_asset`.`operationAt` AS `operationAt`,
  34. `view01_finance_asset_last`.`id` AS `financeId`
  35. from
  36. (
  37. `jianghu_erp`.`warehouse_asset`
  38. left join `jianghu_erp`.`view01_finance_asset_last` on (
  39. (
  40. `jianghu_erp`.`warehouse_asset`.`assetId` = `view01_finance_asset_last`.`assetId`
  41. )
  42. )
  43. )

view01_warehouse_asset_not_in_finance_asset

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_warehouse_asset_not_in_finance_asset` AS
  2. select
  3. `warehouse_asset`.`id` AS `id`,
  4. `warehouse_asset`.`idSequence` AS `idSequence`,
  5. `warehouse_asset`.`assetId` AS `assetId`,
  6. `warehouse_asset`.`assetName` AS `assetName`,
  7. `warehouse_asset`.`warehouseName` AS `warehouseName`,
  8. `warehouse_asset`.`stockName` AS `stockName`,
  9. `warehouse_asset`.`assetUnit` AS `assetUnit`,
  10. `warehouse_asset`.`assetSpec` AS `assetSpec`,
  11. `warehouse_asset`.`assetSpecPrice` AS `assetSpecPrice`,
  12. `warehouse_asset`.`purchaseAssetSpecPriceWithoutTax` AS `purchaseAssetSpecPriceWithoutTax`,
  13. `warehouse_asset`.`purchaseAssetTaxRate` AS `purchaseAssetTaxRate`,
  14. `warehouse_asset`.`purchaseAssetTaxPrice` AS `purchaseAssetTaxPrice`,
  15. `warehouse_asset`.`purchaseAssetSpecPrice` AS `purchaseAssetSpecPrice`,
  16. `warehouse_asset`.`assetType` AS `assetType`,
  17. `warehouse_asset`.`assetTransport` AS `assetTransport`,
  18. `warehouse_asset`.`assetStatus` AS `assetStatus`,
  19. `warehouse_asset`.`assetUser` AS `assetUser`,
  20. `warehouse_asset`.`supplierId` AS `supplierId`,
  21. `warehouse_asset`.`supplierName` AS `supplierName`,
  22. `warehouse_asset`.`manufacturerName` AS `manufacturerName`,
  23. `warehouse_asset`.`manufacturerProductRCNum` AS `manufacturerProductRCNum`,
  24. `warehouse_asset`.`inventoryInType` AS `inventoryInType`,
  25. `warehouse_asset`.`inventoryInOrderId` AS `inventoryInOrderId`,
  26. `warehouse_asset`.`inventoryInAt` AS `inventoryInAt`,
  27. `warehouse_asset`.`productionBatchNum` AS `productionBatchNum`,
  28. `warehouse_asset`.`productionAt` AS `productionAt`,
  29. `warehouse_asset`.`expirationAt` AS `expirationAt`,
  30. `warehouse_asset`.`operation` AS `operation`,
  31. `warehouse_asset`.`operationByUserId` AS `operationByUserId`,
  32. `warehouse_asset`.`operationByUser` AS `operationByUser`,
  33. `warehouse_asset`.`operationAt` AS `operationAt`
  34. from
  35. `warehouse_asset`
  36. where
  37. (
  38. (
  39. not(
  40. exists (
  41. select
  42. 1
  43. from
  44. `finance_asset`
  45. where
  46. (
  47. `finance_asset`.`assetId` = `warehouse_asset`.`assetId`
  48. )
  49. )
  50. )
  51. )
  52. and (
  53. not(
  54. exists (
  55. select
  56. 1
  57. from
  58. `finance_asset_record`
  59. where
  60. (
  61. `finance_asset_record`.`assetId` = `warehouse_asset`.`assetId`
  62. )
  63. )
  64. )
  65. )
  66. )

view01_warehouse_inventory

  1. CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `view01_warehouse_inventory` AS
  2. select
  3. `wi`.`id` AS `id`,
  4. `wi`.`inventoryId` AS `inventoryId`,
  5. `wi`.`productName` AS `productName`,
  6. `wi`.`warehouseName` AS `warehouseName`,
  7. `wi`.`stockName` AS `stockName`,
  8. `wi`.`count` AS `count`,
  9. `wi`.`countOfInventoryIn` AS `countOfInventoryIn`,
  10. `wi`.`productUnit` AS `productUnit`,
  11. `wi`.`productSpec` AS `productSpec`,
  12. `wi`.`productSpecPrice` AS `productSpecPrice`,
  13. `wi`.`productType` AS `productType`,
  14. `wi`.`productTransport` AS `productTransport`,
  15. `wi`.`supplierId` AS `supplierId`,
  16. `wi`.`supplierName` AS `supplierName`,
  17. `wi`.`manufacturerName` AS `manufacturerName`,
  18. `wi`.`inventoryInType` AS `inventoryInType`,
  19. `wi`.`inventoryInOrderId` AS `inventoryInOrderId`,
  20. `wi`.`inventoryInAt` AS `inventoryInAt`,
  21. `wi`.`productionBatchNum` AS `productionBatchNum`,
  22. `wi`.`productionAt` AS `productionAt`,
  23. `wi`.`expirationAt` AS `expirationAt`,
  24. `wi`.`operation` AS `operation`,
  25. `wi`.`operationByUserId` AS `operationByUserId`,
  26. `wi`.`operationByUser` AS `operationByUser`,
  27. `wi`.`operationAt` AS `operationAt`,
  28. `sp`.`manufacturerProductRCNum` AS `manufacturerProductRCNum`,
  29. `sp`.`manufacturerProductRCExpireAt` AS `manufacturerProductRCExpireAt`,
  30. `sp`.`manufacturerLicenseNum` AS `manufacturerLicenseNum`,
  31. `wi`.`purchaseProductSpecPriceWithoutTax` AS `purchaseProductSpecPriceWithoutTax`,
  32. `wi`.`purchaseProductTaxRate` AS `purchaseProductTaxRate`,
  33. `wi`.`purchaseProductTaxPrice` AS `purchaseProductTaxPrice`,
  34. `wi`.`purchaseProductSpecPrice` AS `purchaseProductSpecPrice`,
  35. `wi`.`purchaseProductTotalAmount` AS `purchaseProductTotalAmount`,
  36. `wi`.`purchaseProductTotalAmountWithoutTax` AS `purchaseProductTotalAmountWithoutTax`
  37. from
  38. (
  39. `warehouse_inventory` `wi`
  40. left join `supplier_product` `sp` on (
  41. (
  42. (`sp`.`supplierId` = `wi`.`supplierId`)
  43. and (`sp`.`productName` = `wi`.`productName`)
  44. )
  45. )
  46. )
  47. where
  48. (`wi`.`count` > 0)