erp-2024-05-03.sql 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : 127.0.0.1 MySQL
  4. Source Server Type : MySQL
  5. Source Server Version : 80200 (8.2.0)
  6. Source Host : 127.0.0.1:3306
  7. Source Schema : ruoyi-vue-pro
  8. Target Server Type : MySQL
  9. Target Server Version : 80200 (8.2.0)
  10. File Encoding : 65001
  11. Date: 03/05/2024 10:51:51
  12. */
  13. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for erp_account
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `erp_account`;
  19. CREATE TABLE `erp_account` (
  20. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '结算账户编号',
  21. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '账户名称',
  22. `no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '账户编码',
  23. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  24. `status` tinyint NOT NULL COMMENT '开启状态',
  25. `sort` int NOT NULL COMMENT '排序',
  26. `default_status` bit(1) NULL DEFAULT b'0' COMMENT '是否默认',
  27. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  28. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  29. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  30. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  31. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  32. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  33. PRIMARY KEY (`id` DESC) USING BTREE
  34. ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 结算账户';
  35. -- ----------------------------
  36. -- Records of erp_account
  37. -- ----------------------------
  38. BEGIN;
  39. COMMIT;
  40. -- ----------------------------
  41. -- Table structure for erp_customer
  42. -- ----------------------------
  43. DROP TABLE IF EXISTS `erp_customer`;
  44. CREATE TABLE `erp_customer` (
  45. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '客户编号',
  46. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '客户名称',
  47. `contact` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '联系人',
  48. `mobile` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '手机号码',
  49. `telephone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '联系电话',
  50. `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '电子邮箱',
  51. `fax` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '传真',
  52. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  53. `status` tinyint NOT NULL COMMENT '开启状态',
  54. `sort` int NOT NULL COMMENT '排序',
  55. `tax_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '纳税人识别号',
  56. `tax_percent` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率',
  57. `bank_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '开户行',
  58. `bank_account` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '开户账号',
  59. `bank_address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '开户地址',
  60. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  61. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  62. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  63. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  64. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  65. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  66. PRIMARY KEY (`id` DESC) USING BTREE
  67. ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 客户表';
  68. -- ----------------------------
  69. -- Records of erp_customer
  70. -- ----------------------------
  71. BEGIN;
  72. COMMIT;
  73. -- ----------------------------
  74. -- Table structure for erp_finance_payment
  75. -- ----------------------------
  76. DROP TABLE IF EXISTS `erp_finance_payment`;
  77. CREATE TABLE `erp_finance_payment` (
  78. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  79. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '付款单号',
  80. `status` tinyint NOT NULL COMMENT '状态',
  81. `payment_time` datetime NOT NULL COMMENT '付款时间',
  82. `finance_user_id` bigint NULL DEFAULT NULL COMMENT '财务人员编号',
  83. `supplier_id` bigint NOT NULL COMMENT '供应商编号',
  84. `account_id` bigint NOT NULL COMMENT '付款账户编号',
  85. `total_price` decimal(24, 6) NOT NULL COMMENT '合计价格,单位:元',
  86. `discount_price` decimal(24, 6) NOT NULL COMMENT '优惠金额,单位:元',
  87. `payment_price` decimal(24, 6) NOT NULL COMMENT '实付金额,单位:分',
  88. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  89. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  90. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  91. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  92. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  93. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  94. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  95. PRIMARY KEY (`id`) USING BTREE
  96. ) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 付款单表';
  97. -- ----------------------------
  98. -- Records of erp_finance_payment
  99. -- ----------------------------
  100. BEGIN;
  101. INSERT INTO `erp_finance_payment` (`id`, `no`, `status`, `payment_time`, `finance_user_id`, `supplier_id`, `account_id`, `total_price`, `discount_price`, `payment_price`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, 'FKD20240214000001', 10, '2024-02-26 00:00:00', 112, 1, 1, 300.000000, 10.000000, 290.000000, '哈哈哈哈', '1', '2024-02-14 15:05:19', '1', '2024-02-14 09:00:22', b'1', 1), (3, 'FKD20240214000002', 10, '2024-02-20 00:00:00', NULL, 1, 1, -10.000000, 4.000000, -14.000000, NULL, '1', '2024-02-14 15:34:11', '1', '2024-02-14 09:00:18', b'1', 1), (4, 'FKD20240214000003', 10, '2024-02-18 00:00:00', NULL, 1, 1, 114.700000, 0.000000, 114.700000, NULL, '1', '2024-02-14 16:43:59', '1', '2024-02-14 08:58:43', b'1', 1), (5, 'FKD20240214000004', 10, '2024-02-19 00:00:00', NULL, 1, 1, 114.700000, 0.000000, 114.700000, NULL, '1', '2024-02-14 16:44:31', '1', '2024-02-14 08:55:13', b'1', 1), (6, 'FKD20240214000005', 10, '2024-02-19 00:00:00', NULL, 1, 1, -20.000000, 0.000000, -20.000000, NULL, '1', '2024-02-14 16:59:30', '1', '2024-02-14 09:00:16', b'1', 1), (7, 'FKD20240214000006', 10, '2024-02-20 00:00:00', NULL, 1, 1, -20.000000, 0.000000, -20.000000, NULL, '1', '2024-02-14 17:00:11', '1', '2024-02-14 09:00:41', b'1', 1), (8, 'FKD20240214000007', 10, '2024-02-20 00:00:00', 115, 1, 1, -20.000000, 0.000000, -20.000000, NULL, '1', '2024-02-14 17:01:27', '1', '2024-02-14 09:05:28', b'1', 1), (9, 'FKD20240214000008', 10, '2024-02-27 00:00:00', NULL, 1, 1, -143.200000, 0.000000, -143.200000, NULL, '1', '2024-02-14 17:04:03', '1', '2024-02-14 09:04:35', b'1', 1);
  102. COMMIT;
  103. -- ----------------------------
  104. -- Table structure for erp_finance_payment_item
  105. -- ----------------------------
  106. DROP TABLE IF EXISTS `erp_finance_payment_item`;
  107. CREATE TABLE `erp_finance_payment_item` (
  108. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  109. `payment_id` bigint NOT NULL COMMENT '付款单编号',
  110. `biz_type` tinyint NOT NULL COMMENT '业务类型',
  111. `biz_id` bigint NOT NULL COMMENT '业务编号',
  112. `biz_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '业务单号',
  113. `total_price` decimal(24, 6) NOT NULL COMMENT '应付欠款,单位:分',
  114. `paid_price` decimal(24, 6) NOT NULL COMMENT '已付欠款,单位:分',
  115. `payment_price` decimal(24, 6) NOT NULL COMMENT '本次付款,单位:分',
  116. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  117. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  118. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  119. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  120. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  121. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  122. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  123. PRIMARY KEY (`id`) USING BTREE
  124. ) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 付款项表';
  125. -- ----------------------------
  126. -- Records of erp_finance_payment_item
  127. -- ----------------------------
  128. BEGIN;
  129. INSERT INTO `erp_finance_payment_item` (`id`, `payment_id`, `biz_type`, `biz_id`, `biz_no`, `total_price`, `paid_price`, `payment_price`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (11, 2, 11, 16, 'CGRK20240213000001', 414.700000, 0.000000, 300.000000, '测试一下', '1', '2024-02-14 15:05:19', '1', '2024-02-14 09:00:22', b'1', 1), (12, 3, 12, 24, 'CGTH20240213000001', -163.200000, 0.000000, -10.000000, NULL, '1', '2024-02-14 15:34:11', '1', '2024-02-14 09:00:18', b'1', 1), (13, 4, 11, 16, 'CGRK20240213000001', 414.700000, 300.000000, 114.700000, NULL, '1', '2024-02-14 16:43:59', '1', '2024-02-14 08:58:43', b'1', 1), (14, 5, 11, 16, 'CGRK20240213000001', 414.700000, 300.000000, 114.700000, NULL, '1', '2024-02-14 16:44:31', '1', '2024-02-14 08:55:13', b'1', 1), (15, 6, 12, 24, 'CGTH20240213000001', -163.200000, -10.000000, -20.000000, NULL, '1', '2024-02-14 16:59:30', '1', '2024-02-14 09:00:16', b'1', 1), (16, 7, 12, 24, 'CGTH20240213000001', -163.200000, -10.000000, -20.000000, NULL, '1', '2024-02-14 17:00:11', '1', '2024-02-14 09:00:41', b'1', 1), (17, 8, 12, 24, 'CGTH20240213000001', -163.200000, 0.000000, -20.000000, NULL, '1', '2024-02-14 17:01:27', '1', '2024-02-14 09:05:29', b'1', 1), (18, 9, 12, 24, 'CGTH20240213000001', -163.200000, -20.000000, -143.200000, NULL, '1', '2024-02-14 17:04:03', '1', '2024-02-14 09:04:35', b'1', 1);
  130. COMMIT;
  131. -- ----------------------------
  132. -- Table structure for erp_finance_receipt
  133. -- ----------------------------
  134. DROP TABLE IF EXISTS `erp_finance_receipt`;
  135. CREATE TABLE `erp_finance_receipt` (
  136. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  137. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '收款单号',
  138. `status` tinyint NOT NULL COMMENT '状态',
  139. `receipt_time` datetime NOT NULL COMMENT '收款时间',
  140. `finance_user_id` bigint NULL DEFAULT NULL COMMENT '财务人员编号',
  141. `customer_id` bigint NOT NULL COMMENT '客户编号',
  142. `account_id` bigint NOT NULL COMMENT '收款账户编号',
  143. `total_price` decimal(24, 6) NOT NULL COMMENT '合计价格,单位:元',
  144. `discount_price` decimal(24, 6) NOT NULL COMMENT '优惠金额,单位:元',
  145. `receipt_price` decimal(24, 6) NOT NULL COMMENT '实收金额,单位:分',
  146. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  147. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  148. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  149. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  150. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  151. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  152. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  153. PRIMARY KEY (`id`) USING BTREE
  154. ) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 收款单表';
  155. -- ----------------------------
  156. -- Records of erp_finance_receipt
  157. -- ----------------------------
  158. BEGIN;
  159. INSERT INTO `erp_finance_receipt` (`id`, `no`, `status`, `receipt_time`, `finance_user_id`, `customer_id`, `account_id`, `total_price`, `discount_price`, `receipt_price`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, 'FKD20240214000001', 10, '2024-02-26 00:00:00', 112, 1, 1, 300.000000, 10.000000, 290.000000, '哈哈哈哈', '1', '2024-02-14 15:05:19', '1', '2024-02-14 09:00:22', b'1', 1), (3, 'FKD20240214000002', 10, '2024-02-20 00:00:00', NULL, 1, 1, -10.000000, 4.000000, -14.000000, NULL, '1', '2024-02-14 15:34:11', '1', '2024-02-14 09:00:18', b'1', 1), (4, 'FKD20240214000003', 10, '2024-02-18 00:00:00', NULL, 1, 1, 114.700000, 0.000000, 114.700000, NULL, '1', '2024-02-14 16:43:59', '1', '2024-02-14 08:58:43', b'1', 1), (5, 'FKD20240214000004', 10, '2024-02-19 00:00:00', NULL, 1, 1, 114.700000, 0.000000, 114.700000, NULL, '1', '2024-02-14 16:44:31', '1', '2024-02-14 08:55:13', b'1', 1), (6, 'FKD20240214000005', 10, '2024-02-19 00:00:00', NULL, 1, 1, -20.000000, 0.000000, -20.000000, NULL, '1', '2024-02-14 16:59:30', '1', '2024-02-14 09:00:16', b'1', 1), (7, 'FKD20240214000006', 10, '2024-02-20 00:00:00', NULL, 1, 1, -20.000000, 0.000000, -20.000000, NULL, '1', '2024-02-14 17:00:11', '1', '2024-02-14 09:00:41', b'1', 1), (8, 'FKD20240214000007', 10, '2024-02-20 00:00:00', 115, 1, 1, -20.000000, 0.000000, -20.000000, NULL, '1', '2024-02-14 17:01:27', '1', '2024-02-14 09:05:28', b'1', 1), (9, 'FKD20240214000008', 10, '2024-02-27 00:00:00', NULL, 1, 1, -143.200000, 0.000000, -143.200000, NULL, '1', '2024-02-14 17:04:03', '1', '2024-02-14 09:04:35', b'1', 1), (11, 'SKD20240216000001', 10, '2024-02-16 00:00:00', NULL, 2, 1, 50.000000, 10.000000, 40.000000, NULL, '1', '2024-02-16 07:59:54', '1', '2024-02-16 00:04:53', b'1', 1), (12, 'SKD20240216000002', 10, '2024-02-08 00:00:00', NULL, 2, 1, 50.000000, 0.000000, 50.000000, NULL, '1', '2024-02-16 08:02:24', '1', '2024-02-16 00:04:55', b'1', 1);
  160. COMMIT;
  161. -- ----------------------------
  162. -- Table structure for erp_finance_receipt_item
  163. -- ----------------------------
  164. DROP TABLE IF EXISTS `erp_finance_receipt_item`;
  165. CREATE TABLE `erp_finance_receipt_item` (
  166. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  167. `receipt_id` bigint NOT NULL COMMENT '收款单编号',
  168. `biz_type` tinyint NOT NULL COMMENT '业务类型',
  169. `biz_id` bigint NOT NULL COMMENT '业务编号',
  170. `biz_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '业务单号',
  171. `total_price` decimal(24, 6) NOT NULL COMMENT '应收金额,单位:分',
  172. `receipted_price` decimal(24, 6) NOT NULL COMMENT '已收金额,单位:分',
  173. `receipt_price` decimal(24, 6) NOT NULL COMMENT '本次收款,单位:分',
  174. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  175. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  176. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  177. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  178. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  179. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  180. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  181. PRIMARY KEY (`id`) USING BTREE
  182. ) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 收款项表';
  183. -- ----------------------------
  184. -- Records of erp_finance_receipt_item
  185. -- ----------------------------
  186. BEGIN;
  187. INSERT INTO `erp_finance_receipt_item` (`id`, `receipt_id`, `biz_type`, `biz_id`, `biz_no`, `total_price`, `receipted_price`, `receipt_price`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (11, 2, 11, 16, 'CGRK20240213000001', 414.700000, 0.000000, 300.000000, '测试一下', '1', '2024-02-14 15:05:19', '1', '2024-02-14 09:00:22', b'1', 1), (12, 3, 12, 24, 'CGTH20240213000001', -163.200000, 0.000000, -10.000000, NULL, '1', '2024-02-14 15:34:11', '1', '2024-02-14 09:00:18', b'1', 1), (13, 4, 11, 16, 'CGRK20240213000001', 414.700000, 300.000000, 114.700000, NULL, '1', '2024-02-14 16:43:59', '1', '2024-02-14 08:58:43', b'1', 1), (14, 5, 11, 16, 'CGRK20240213000001', 414.700000, 300.000000, 114.700000, NULL, '1', '2024-02-14 16:44:31', '1', '2024-02-14 08:55:13', b'1', 1), (15, 6, 12, 24, 'CGTH20240213000001', -163.200000, -10.000000, -20.000000, NULL, '1', '2024-02-14 16:59:30', '1', '2024-02-14 09:00:16', b'1', 1), (16, 7, 12, 24, 'CGTH20240213000001', -163.200000, -10.000000, -20.000000, NULL, '1', '2024-02-14 17:00:11', '1', '2024-02-14 09:00:41', b'1', 1), (17, 8, 12, 24, 'CGTH20240213000001', -163.200000, 0.000000, -20.000000, NULL, '1', '2024-02-14 17:01:27', '1', '2024-02-14 09:05:29', b'1', 1), (18, 9, 12, 24, 'CGTH20240213000001', -163.200000, -20.000000, -143.200000, NULL, '1', '2024-02-14 17:04:03', '1', '2024-02-14 09:04:35', b'1', 1), (20, 11, 21, 14, 'XSCK20240215000001', 67.590000, 0.000000, 50.000000, NULL, '1', '2024-02-16 07:59:54', '1', '2024-02-16 00:04:53', b'1', 1), (21, 12, 21, 14, 'XSCK20240215000001', 67.590000, 0.000000, 50.000000, NULL, '1', '2024-02-16 08:02:24', '1', '2024-02-16 00:04:55', b'1', 1);
  188. COMMIT;
  189. -- ----------------------------
  190. -- Table structure for erp_product
  191. -- ----------------------------
  192. DROP TABLE IF EXISTS `erp_product`;
  193. CREATE TABLE `erp_product` (
  194. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '产品编号',
  195. `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '产品名称',
  196. `bar_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '产品条码',
  197. `category_id` bigint NOT NULL COMMENT '产品分类编号',
  198. `unit_id` int NOT NULL COMMENT '单位编号',
  199. `status` tinyint NOT NULL COMMENT '产品状态',
  200. `standard` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '产品规格',
  201. `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '产品备注',
  202. `expiry_day` int NULL DEFAULT NULL COMMENT '保质期天数',
  203. `weight` decimal(24, 6) NULL DEFAULT NULL COMMENT '基础重量(kg)',
  204. `purchase_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '采购价格,单位:元',
  205. `sale_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '销售价格,单位:元',
  206. `min_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '最低价格,单位:元',
  207. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  208. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  209. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  210. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  211. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  212. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  213. PRIMARY KEY (`id`) USING BTREE
  214. ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 产品表';
  215. -- ----------------------------
  216. -- Records of erp_product
  217. -- ----------------------------
  218. BEGIN;
  219. COMMIT;
  220. -- ----------------------------
  221. -- Table structure for erp_product_category
  222. -- ----------------------------
  223. DROP TABLE IF EXISTS `erp_product_category`;
  224. CREATE TABLE `erp_product_category` (
  225. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '分类编号',
  226. `parent_id` bigint NOT NULL COMMENT '父分类编号',
  227. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分类名称',
  228. `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分类编码',
  229. `sort` int NULL DEFAULT 0 COMMENT '分类排序',
  230. `status` tinyint NOT NULL COMMENT '开启状态',
  231. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  232. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  233. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  234. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  235. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  236. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  237. PRIMARY KEY (`id`) USING BTREE
  238. ) ENGINE = InnoDB AUTO_INCREMENT = 87 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 产品分类';
  239. -- ----------------------------
  240. -- Records of erp_product_category
  241. -- ----------------------------
  242. BEGIN;
  243. COMMIT;
  244. -- ----------------------------
  245. -- Table structure for erp_product_unit
  246. -- ----------------------------
  247. DROP TABLE IF EXISTS `erp_product_unit`;
  248. CREATE TABLE `erp_product_unit` (
  249. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '单位编号',
  250. `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '单位名字',
  251. `status` tinyint NOT NULL COMMENT '单位状态',
  252. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  253. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  254. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  255. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  256. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  257. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  258. PRIMARY KEY (`id`) USING BTREE
  259. ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 产品单位表';
  260. -- ----------------------------
  261. -- Records of erp_product_unit
  262. -- ----------------------------
  263. BEGIN;
  264. COMMIT;
  265. -- ----------------------------
  266. -- Table structure for erp_purchase_in
  267. -- ----------------------------
  268. DROP TABLE IF EXISTS `erp_purchase_in`;
  269. CREATE TABLE `erp_purchase_in` (
  270. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  271. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '采购入库编号',
  272. `status` tinyint NOT NULL COMMENT '采购状态',
  273. `supplier_id` bigint NOT NULL COMMENT '供应商编号',
  274. `account_id` bigint NOT NULL COMMENT '结算账户编号',
  275. `in_time` datetime NOT NULL COMMENT '入库时间',
  276. `order_id` bigint NOT NULL COMMENT '采购订单编号',
  277. `order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '采购订单号',
  278. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  279. `total_price` decimal(24, 6) NOT NULL COMMENT '合计价格,单位:元',
  280. `payment_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '已付款金额,单位:元',
  281. `total_product_price` decimal(24, 6) NOT NULL COMMENT '合计产品价格,单位:元',
  282. `total_tax_price` decimal(24, 6) NOT NULL COMMENT '合计税额,单位:元',
  283. `discount_percent` decimal(24, 6) NOT NULL COMMENT '优惠率,百分比',
  284. `discount_price` decimal(24, 6) NOT NULL COMMENT '优惠金额,单位:元',
  285. `other_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '其它金额,单位:元',
  286. `file_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件地址',
  287. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  288. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  289. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  290. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  291. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  292. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  293. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  294. PRIMARY KEY (`id`) USING BTREE,
  295. UNIQUE INDEX `no`(`no` ASC) USING BTREE
  296. ) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 采购入库表';
  297. -- ----------------------------
  298. -- Records of erp_purchase_in
  299. -- ----------------------------
  300. BEGIN;
  301. COMMIT;
  302. -- ----------------------------
  303. -- Table structure for erp_purchase_in_items
  304. -- ----------------------------
  305. DROP TABLE IF EXISTS `erp_purchase_in_items`;
  306. CREATE TABLE `erp_purchase_in_items` (
  307. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  308. `in_id` bigint NOT NULL COMMENT '采购入库编号',
  309. `order_item_id` bigint NOT NULL COMMENT '采购订单项编号',
  310. `warehouse_id` bigint NOT NULL COMMENT '仓库编号',
  311. `product_id` bigint NOT NULL COMMENT '产品编号',
  312. `product_unit_id` bigint NOT NULL COMMENT '产品单位单位',
  313. `product_price` decimal(24, 6) NOT NULL COMMENT '产品单价',
  314. `count` decimal(24, 6) NOT NULL COMMENT '数量',
  315. `total_price` decimal(24, 6) NOT NULL COMMENT '总价',
  316. `tax_percent` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率,百分比',
  317. `tax_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '税额,单位:元',
  318. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  319. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  320. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  321. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  322. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  323. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  324. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  325. PRIMARY KEY (`id`) USING BTREE
  326. ) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 销售入库项表';
  327. -- ----------------------------
  328. -- Records of erp_purchase_in_items
  329. -- ----------------------------
  330. BEGIN;
  331. COMMIT;
  332. -- ----------------------------
  333. -- Table structure for erp_purchase_order
  334. -- ----------------------------
  335. DROP TABLE IF EXISTS `erp_purchase_order`;
  336. CREATE TABLE `erp_purchase_order` (
  337. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  338. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '采购单编号',
  339. `status` tinyint NOT NULL COMMENT '采购状态',
  340. `supplier_id` bigint NOT NULL COMMENT '供应商编号',
  341. `account_id` bigint NULL DEFAULT NULL COMMENT '结算账户编号',
  342. `order_time` datetime NOT NULL COMMENT '采购时间',
  343. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  344. `total_price` decimal(24, 6) NOT NULL COMMENT '合计价格,单位:元',
  345. `total_product_price` decimal(24, 6) NOT NULL COMMENT '合计产品价格,单位:元',
  346. `total_tax_price` decimal(24, 6) NOT NULL COMMENT '合计税额,单位:元',
  347. `discount_percent` decimal(24, 6) NOT NULL COMMENT '优惠率,百分比',
  348. `discount_price` decimal(24, 6) NOT NULL COMMENT '优惠金额,单位:元',
  349. `deposit_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '定金金额,单位:元',
  350. `file_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件地址',
  351. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  352. `in_count` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '采购入库数量',
  353. `return_count` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '采购退货数量',
  354. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  355. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  356. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  357. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  358. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  359. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  360. PRIMARY KEY (`id`) USING BTREE,
  361. UNIQUE INDEX `no`(`no` ASC) USING BTREE
  362. ) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 采购订单表';
  363. -- ----------------------------
  364. -- Records of erp_purchase_order
  365. -- ----------------------------
  366. BEGIN;
  367. COMMIT;
  368. -- ----------------------------
  369. -- Table structure for erp_purchase_order_items
  370. -- ----------------------------
  371. DROP TABLE IF EXISTS `erp_purchase_order_items`;
  372. CREATE TABLE `erp_purchase_order_items` (
  373. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  374. `order_id` bigint NOT NULL COMMENT '采购订单编号',
  375. `product_id` bigint NOT NULL COMMENT '产品编号',
  376. `product_unit_id` bigint NOT NULL COMMENT '产品单位单位',
  377. `product_price` decimal(24, 6) NOT NULL COMMENT '产品单价',
  378. `count` decimal(24, 6) NOT NULL COMMENT '数量',
  379. `total_price` decimal(24, 6) NOT NULL COMMENT '总价',
  380. `tax_percent` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率,百分比',
  381. `tax_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '税额,单位:元',
  382. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  383. `in_count` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '采购入库数量',
  384. `return_count` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '采购退货数量',
  385. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  386. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  387. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  388. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  389. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  390. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  391. PRIMARY KEY (`id`) USING BTREE
  392. ) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 采购订单项表';
  393. -- ----------------------------
  394. -- Records of erp_purchase_order_items
  395. -- ----------------------------
  396. BEGIN;
  397. COMMIT;
  398. -- ----------------------------
  399. -- Table structure for erp_purchase_return
  400. -- ----------------------------
  401. DROP TABLE IF EXISTS `erp_purchase_return`;
  402. CREATE TABLE `erp_purchase_return` (
  403. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  404. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '采购退货编号',
  405. `status` tinyint NOT NULL COMMENT '退货状态',
  406. `supplier_id` bigint NOT NULL COMMENT '供应商编号',
  407. `account_id` bigint NOT NULL COMMENT '结算账户编号',
  408. `return_time` datetime NOT NULL COMMENT '退货时间',
  409. `order_id` bigint NOT NULL COMMENT '采购订单编号',
  410. `order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '采购订单号',
  411. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  412. `total_price` decimal(24, 6) NOT NULL COMMENT '合计价格,单位:元',
  413. `refund_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '已退款金额,单位:元',
  414. `total_product_price` decimal(24, 6) NOT NULL COMMENT '合计产品价格,单位:元',
  415. `total_tax_price` decimal(24, 6) NOT NULL COMMENT '合计税额,单位:元',
  416. `discount_percent` decimal(24, 6) NOT NULL COMMENT '优惠率,百分比',
  417. `discount_price` decimal(24, 6) NOT NULL COMMENT '优惠金额,单位:元',
  418. `other_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '其它金额,单位:元',
  419. `file_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件地址',
  420. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  421. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  422. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  423. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  424. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  425. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  426. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  427. PRIMARY KEY (`id`) USING BTREE,
  428. UNIQUE INDEX `no`(`no` ASC) USING BTREE
  429. ) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 采购退货表';
  430. -- ----------------------------
  431. -- Records of erp_purchase_return
  432. -- ----------------------------
  433. BEGIN;
  434. COMMIT;
  435. -- ----------------------------
  436. -- Table structure for erp_purchase_return_items
  437. -- ----------------------------
  438. DROP TABLE IF EXISTS `erp_purchase_return_items`;
  439. CREATE TABLE `erp_purchase_return_items` (
  440. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  441. `return_id` bigint NOT NULL COMMENT '采购退货编号',
  442. `order_item_id` bigint NOT NULL COMMENT '采购订单项编号',
  443. `warehouse_id` bigint NOT NULL COMMENT '仓库编号',
  444. `product_id` bigint NOT NULL COMMENT '产品编号',
  445. `product_unit_id` bigint NOT NULL COMMENT '产品单位单位',
  446. `product_price` decimal(24, 6) NOT NULL COMMENT '产品单价',
  447. `count` decimal(24, 6) NOT NULL COMMENT '数量',
  448. `total_price` decimal(24, 6) NOT NULL COMMENT '总价',
  449. `tax_percent` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率,百分比',
  450. `tax_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '税额,单位:元',
  451. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  452. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  453. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  454. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  455. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  456. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  457. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  458. PRIMARY KEY (`id`) USING BTREE
  459. ) ENGINE = InnoDB AUTO_INCREMENT = 47 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 采购退货项表';
  460. -- ----------------------------
  461. -- Records of erp_purchase_return_items
  462. -- ----------------------------
  463. BEGIN;
  464. COMMIT;
  465. -- ----------------------------
  466. -- Table structure for erp_sale_order
  467. -- ----------------------------
  468. DROP TABLE IF EXISTS `erp_sale_order`;
  469. CREATE TABLE `erp_sale_order` (
  470. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  471. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '销售单编号',
  472. `status` tinyint NOT NULL COMMENT '销售状态',
  473. `customer_id` bigint NOT NULL COMMENT '客户编号',
  474. `account_id` bigint NULL DEFAULT NULL COMMENT '结算账户编号',
  475. `sale_user_id` bigint NULL DEFAULT NULL COMMENT '销售用户编号',
  476. `order_time` datetime NOT NULL COMMENT '下单时间',
  477. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  478. `total_price` decimal(24, 6) NOT NULL COMMENT '合计价格,单位:元',
  479. `total_product_price` decimal(24, 6) NOT NULL COMMENT '合计产品价格,单位:元',
  480. `total_tax_price` decimal(24, 6) NOT NULL COMMENT '合计税额,单位:元',
  481. `discount_percent` decimal(24, 6) NOT NULL COMMENT '优惠率,百分比',
  482. `discount_price` decimal(24, 6) NOT NULL COMMENT '优惠金额,单位:元',
  483. `deposit_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '定金金额,单位:元',
  484. `file_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件地址',
  485. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  486. `out_count` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '销售出库数量',
  487. `return_count` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '销售退货数量',
  488. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  489. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  490. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  491. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  492. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  493. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  494. PRIMARY KEY (`id`) USING BTREE,
  495. UNIQUE INDEX `no`(`no` ASC) USING BTREE
  496. ) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 销售订单表';
  497. -- ----------------------------
  498. -- Records of erp_sale_order
  499. -- ----------------------------
  500. BEGIN;
  501. COMMIT;
  502. -- ----------------------------
  503. -- Table structure for erp_sale_order_items
  504. -- ----------------------------
  505. DROP TABLE IF EXISTS `erp_sale_order_items`;
  506. CREATE TABLE `erp_sale_order_items` (
  507. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  508. `order_id` bigint NOT NULL COMMENT '销售订单编号',
  509. `product_id` bigint NOT NULL COMMENT '产品编号',
  510. `product_unit_id` bigint NOT NULL COMMENT '产品单位单位',
  511. `product_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '产品单价',
  512. `count` decimal(24, 6) NOT NULL COMMENT '数量',
  513. `total_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '总价',
  514. `tax_percent` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率,百分比',
  515. `tax_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '税额,单位:元',
  516. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  517. `out_count` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '销售出库数量',
  518. `return_count` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '销售退货数量',
  519. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  520. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  521. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  522. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  523. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  524. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  525. PRIMARY KEY (`id`) USING BTREE
  526. ) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 销售订单项表';
  527. -- ----------------------------
  528. -- Records of erp_sale_order_items
  529. -- ----------------------------
  530. BEGIN;
  531. COMMIT;
  532. -- ----------------------------
  533. -- Table structure for erp_sale_out
  534. -- ----------------------------
  535. DROP TABLE IF EXISTS `erp_sale_out`;
  536. CREATE TABLE `erp_sale_out` (
  537. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  538. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '销售出库编号',
  539. `status` tinyint NOT NULL COMMENT '出库状态',
  540. `customer_id` bigint NOT NULL COMMENT '客户编号',
  541. `account_id` bigint NOT NULL COMMENT '结算账户编号',
  542. `sale_user_id` bigint NULL DEFAULT NULL COMMENT '销售用户编号',
  543. `out_time` datetime NOT NULL COMMENT '出库时间',
  544. `order_id` bigint NOT NULL COMMENT '销售订单编号',
  545. `order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '销售订单号',
  546. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  547. `total_price` decimal(24, 6) NOT NULL COMMENT '合计价格,单位:元',
  548. `receipt_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '已收款金额,单位:元',
  549. `total_product_price` decimal(24, 6) NOT NULL COMMENT '合计产品价格,单位:元',
  550. `total_tax_price` decimal(24, 6) NOT NULL COMMENT '合计税额,单位:元',
  551. `discount_percent` decimal(24, 6) NOT NULL COMMENT '优惠率,百分比',
  552. `discount_price` decimal(24, 6) NOT NULL COMMENT '优惠金额,单位:元',
  553. `other_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '其它金额,单位:元',
  554. `file_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件地址',
  555. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  556. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  557. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  558. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  559. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  560. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  561. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  562. PRIMARY KEY (`id`) USING BTREE,
  563. UNIQUE INDEX `no`(`no` ASC) USING BTREE
  564. ) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 销售出库表';
  565. -- ----------------------------
  566. -- Records of erp_sale_out
  567. -- ----------------------------
  568. BEGIN;
  569. COMMIT;
  570. -- ----------------------------
  571. -- Table structure for erp_sale_out_items
  572. -- ----------------------------
  573. DROP TABLE IF EXISTS `erp_sale_out_items`;
  574. CREATE TABLE `erp_sale_out_items` (
  575. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  576. `out_id` bigint NOT NULL COMMENT '销售出库编号',
  577. `order_item_id` bigint NOT NULL COMMENT '销售订单项编号',
  578. `warehouse_id` bigint NOT NULL COMMENT '仓库编号',
  579. `product_id` bigint NOT NULL COMMENT '产品编号',
  580. `product_unit_id` bigint NOT NULL COMMENT '产品单位单位',
  581. `product_price` decimal(24, 6) NOT NULL COMMENT '产品单价',
  582. `count` decimal(24, 6) NOT NULL COMMENT '数量',
  583. `total_price` decimal(24, 6) NOT NULL COMMENT '总价',
  584. `tax_percent` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率,百分比',
  585. `tax_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '税额,单位:元',
  586. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  587. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  588. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  589. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  590. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  591. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  592. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  593. PRIMARY KEY (`id`) USING BTREE
  594. ) ENGINE = InnoDB AUTO_INCREMENT = 30 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 销售出库项表';
  595. -- ----------------------------
  596. -- Records of erp_sale_out_items
  597. -- ----------------------------
  598. BEGIN;
  599. COMMIT;
  600. -- ----------------------------
  601. -- Table structure for erp_sale_return
  602. -- ----------------------------
  603. DROP TABLE IF EXISTS `erp_sale_return`;
  604. CREATE TABLE `erp_sale_return` (
  605. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  606. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '销售退货编号',
  607. `status` tinyint NOT NULL COMMENT '退货状态',
  608. `customer_id` bigint NOT NULL COMMENT '客户编号',
  609. `account_id` bigint NOT NULL COMMENT '结算账户编号',
  610. `sale_user_id` bigint NULL DEFAULT NULL COMMENT '销售用户编号',
  611. `return_time` datetime NOT NULL COMMENT '退货时间',
  612. `order_id` bigint NOT NULL COMMENT '销售订单编号',
  613. `order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '销售订单号',
  614. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  615. `total_price` decimal(24, 6) NOT NULL COMMENT '合计价格,单位:元',
  616. `refund_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '已退款金额,单位:元',
  617. `total_product_price` decimal(24, 6) NOT NULL COMMENT '合计产品价格,单位:元',
  618. `total_tax_price` decimal(24, 6) NOT NULL COMMENT '合计税额,单位:元',
  619. `discount_percent` decimal(24, 6) NOT NULL COMMENT '优惠率,百分比',
  620. `discount_price` decimal(24, 6) NOT NULL COMMENT '优惠金额,单位:元',
  621. `other_price` decimal(24, 6) NOT NULL DEFAULT 0.000000 COMMENT '其它金额,单位:元',
  622. `file_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件地址',
  623. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  624. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  625. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  626. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  627. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  628. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  629. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  630. PRIMARY KEY (`id`) USING BTREE,
  631. UNIQUE INDEX `no`(`no` ASC) USING BTREE
  632. ) ENGINE = InnoDB AUTO_INCREMENT = 25 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 销售退货表';
  633. -- ----------------------------
  634. -- Records of erp_sale_return
  635. -- ----------------------------
  636. BEGIN;
  637. COMMIT;
  638. -- ----------------------------
  639. -- Table structure for erp_sale_return_items
  640. -- ----------------------------
  641. DROP TABLE IF EXISTS `erp_sale_return_items`;
  642. CREATE TABLE `erp_sale_return_items` (
  643. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  644. `return_id` bigint NOT NULL COMMENT '销售退货编号',
  645. `order_item_id` bigint NOT NULL COMMENT '销售订单项编号',
  646. `warehouse_id` bigint NOT NULL COMMENT '仓库编号',
  647. `product_id` bigint NOT NULL COMMENT '产品编号',
  648. `product_unit_id` bigint NOT NULL COMMENT '产品单位单位',
  649. `product_price` decimal(24, 6) NOT NULL COMMENT '产品单价',
  650. `count` decimal(24, 6) NOT NULL COMMENT '数量',
  651. `total_price` decimal(24, 6) NOT NULL COMMENT '总价',
  652. `tax_percent` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率,百分比',
  653. `tax_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '税额,单位:元',
  654. `remark` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  655. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  656. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  657. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  658. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  659. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  660. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  661. PRIMARY KEY (`id`) USING BTREE
  662. ) ENGINE = InnoDB AUTO_INCREMENT = 45 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 销售退货项表';
  663. -- ----------------------------
  664. -- Records of erp_sale_return_items
  665. -- ----------------------------
  666. BEGIN;
  667. COMMIT;
  668. -- ----------------------------
  669. -- Table structure for erp_stock
  670. -- ----------------------------
  671. DROP TABLE IF EXISTS `erp_stock`;
  672. CREATE TABLE `erp_stock` (
  673. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  674. `product_id` bigint NOT NULL COMMENT '产品编号',
  675. `warehouse_id` bigint NOT NULL COMMENT '仓库编号',
  676. `count` decimal(24, 6) NOT NULL COMMENT '库存数量',
  677. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  678. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  679. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  680. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  681. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  682. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  683. PRIMARY KEY (`id`) USING BTREE
  684. ) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 产品库存表';
  685. -- ----------------------------
  686. -- Records of erp_stock
  687. -- ----------------------------
  688. BEGIN;
  689. COMMIT;
  690. -- ----------------------------
  691. -- Table structure for erp_stock_check
  692. -- ----------------------------
  693. DROP TABLE IF EXISTS `erp_stock_check`;
  694. CREATE TABLE `erp_stock_check` (
  695. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '盘点编号',
  696. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '盘点单号',
  697. `check_time` datetime NOT NULL COMMENT '盘点时间',
  698. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  699. `total_price` decimal(24, 6) NOT NULL COMMENT '合计金额,单位:元',
  700. `status` tinyint NOT NULL COMMENT '状态',
  701. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  702. `file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件 URL',
  703. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  704. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  705. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  706. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  707. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  708. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  709. PRIMARY KEY (`id`) USING BTREE
  710. ) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 库存盘点单表';
  711. -- ----------------------------
  712. -- Records of erp_stock_check
  713. -- ----------------------------
  714. BEGIN;
  715. INSERT INTO `erp_stock_check` (`id`, `no`, `check_time`, `total_count`, `total_price`, `status`, `remark`, `file_url`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (10, 'QCDB20240207000002', '2024-02-06 00:00:00', 23.000000, 76.590000, 10, NULL, NULL, '1', '2024-02-07 19:34:47', '1', '2024-02-08 00:49:53', b'1', 1);
  716. COMMIT;
  717. -- ----------------------------
  718. -- Table structure for erp_stock_check_item
  719. -- ----------------------------
  720. DROP TABLE IF EXISTS `erp_stock_check_item`;
  721. CREATE TABLE `erp_stock_check_item` (
  722. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '盘点项编号',
  723. `check_id` bigint NOT NULL COMMENT '盘点编号',
  724. `warehouse_id` bigint NOT NULL COMMENT '仓库编号',
  725. `product_id` bigint NOT NULL COMMENT '产品编号',
  726. `product_unit_id` bigint NOT NULL COMMENT '产品单位编号',
  727. `product_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '产品单价',
  728. `stock_count` decimal(24, 6) NOT NULL COMMENT '账面数量(当前库存)',
  729. `actual_count` decimal(24, 6) NOT NULL COMMENT '实际数量(实际库存)',
  730. `count` decimal(24, 6) NOT NULL COMMENT '盈亏数量',
  731. `total_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '合计金额,单位:元',
  732. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  733. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  734. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  735. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  736. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  737. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  738. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  739. PRIMARY KEY (`id`) USING BTREE
  740. ) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 库存盘点项表';
  741. -- ----------------------------
  742. -- Records of erp_stock_check_item
  743. -- ----------------------------
  744. BEGIN;
  745. INSERT INTO `erp_stock_check_item` (`id`, `check_id`, `warehouse_id`, `product_id`, `product_unit_id`, `product_price`, `stock_count`, `actual_count`, `count`, `total_price`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (10, 10, 2, 1, 2, 3.330000, 0.000000, 0.000000, 23.000000, 76.590000, NULL, '1', '2024-02-07 19:34:47', '1', '2024-02-08 00:49:53', b'1', 1);
  746. COMMIT;
  747. -- ----------------------------
  748. -- Table structure for erp_stock_in
  749. -- ----------------------------
  750. DROP TABLE IF EXISTS `erp_stock_in`;
  751. CREATE TABLE `erp_stock_in` (
  752. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '入库编号',
  753. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '入库单号',
  754. `supplier_id` bigint NULL DEFAULT NULL COMMENT '供应商编号',
  755. `in_time` datetime NOT NULL COMMENT '入库时间',
  756. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  757. `total_price` decimal(24, 6) NOT NULL COMMENT '合计金额,单位:元',
  758. `status` tinyint NOT NULL COMMENT '状态',
  759. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  760. `file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件 URL',
  761. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  762. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  763. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  764. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  765. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  766. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  767. PRIMARY KEY (`id`) USING BTREE
  768. ) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 其它入库单表';
  769. -- ----------------------------
  770. -- Records of erp_stock_in
  771. -- ----------------------------
  772. BEGIN;
  773. INSERT INTO `erp_stock_in` (`id`, `no`, `supplier_id`, `in_time`, `total_count`, `total_price`, `status`, `remark`, `file_url`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'AAA', NULL, '2024-02-06 00:00:00', 5.010000, 14.683300, 10, NULL, NULL, '1', '2024-02-06 14:43:04', '1', '2024-02-16 09:26:55', b'1', 1), (2, '单据2', 1, '2024-02-22 00:00:00', 2.000000, 6.660000, 10, '测试一下', 'http://test.yudao.iocoder.cn/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.xls', '1', '2024-02-06 15:54:58', '1', '2024-02-16 09:26:53', b'1', 1), (3, '001', 1, '2024-02-06 00:00:00', 1.000000, 3.330000, 10, '给一个', NULL, '1', '2024-02-06 19:55:05', '1', '2024-02-16 09:26:50', b'1', 1), (4, '10', 1, '2024-02-06 00:00:00', 1.000000, 2.000000, 10, NULL, NULL, '1', '2024-02-06 20:18:48', '1', '2024-02-16 09:26:48', b'1', 1);
  774. COMMIT;
  775. -- ----------------------------
  776. -- Table structure for erp_stock_in_item
  777. -- ----------------------------
  778. DROP TABLE IF EXISTS `erp_stock_in_item`;
  779. CREATE TABLE `erp_stock_in_item` (
  780. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '入库项编号',
  781. `in_id` bigint NOT NULL COMMENT '入库编号',
  782. `warehouse_id` bigint NOT NULL COMMENT '仓库编号',
  783. `product_id` bigint NOT NULL COMMENT '产品编号',
  784. `product_unit_id` bigint NOT NULL COMMENT '产品单位编号',
  785. `product_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '产品单价',
  786. `count` decimal(24, 6) NOT NULL COMMENT '产品数量',
  787. `total_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '合计金额,单位:元',
  788. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  789. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  790. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  791. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  792. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  793. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  794. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  795. PRIMARY KEY (`id`) USING BTREE
  796. ) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 其它入库单项表';
  797. -- ----------------------------
  798. -- Records of erp_stock_in_item
  799. -- ----------------------------
  800. BEGIN;
  801. INSERT INTO `erp_stock_in_item` (`id`, `in_id`, `warehouse_id`, `product_id`, `product_unit_id`, `product_price`, `count`, `total_price`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 1, 1, 1, 2, 2.330000, 2.000000, 4.660000, NULL, '1', '2024-02-06 14:43:04', '1', '2024-02-16 09:26:55', b'1', 1), (2, 1, 2, 1, 2, 3.330000, 3.010000, 10.023300, NULL, '1', '2024-02-06 15:15:07', '1', '2024-02-16 09:26:55', b'1', 1), (3, 2, 2, 2, 2, 3.330000, 2.000000, 6.660000, NULL, '1', '2024-02-06 15:54:58', '1', '2024-02-16 09:26:53', b'1', 1), (4, 3, 2, 1, 2, 3.330000, 1.000000, 3.330000, NULL, '1', '2024-02-06 19:55:05', '1', '2024-02-16 09:26:50', b'1', 1), (5, 4, 2, 2, 2, 2.000000, 1.000000, 2.000000, NULL, '1', '2024-02-06 20:18:48', '1', '2024-02-16 09:26:48', b'1', 1);
  802. COMMIT;
  803. -- ----------------------------
  804. -- Table structure for erp_stock_move
  805. -- ----------------------------
  806. DROP TABLE IF EXISTS `erp_stock_move`;
  807. CREATE TABLE `erp_stock_move` (
  808. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '调拨编号',
  809. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '调拨单号',
  810. `move_time` datetime NOT NULL COMMENT '调拨时间',
  811. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  812. `total_price` decimal(24, 6) NOT NULL COMMENT '合计金额,单位:元',
  813. `status` tinyint NOT NULL COMMENT '状态',
  814. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  815. `file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件 URL',
  816. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  817. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  818. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  819. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  820. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  821. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  822. PRIMARY KEY (`id`) USING BTREE
  823. ) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 库存调拨单表';
  824. -- ----------------------------
  825. -- Records of erp_stock_move
  826. -- ----------------------------
  827. BEGIN;
  828. COMMIT;
  829. -- ----------------------------
  830. -- Table structure for erp_stock_move_item
  831. -- ----------------------------
  832. DROP TABLE IF EXISTS `erp_stock_move_item`;
  833. CREATE TABLE `erp_stock_move_item` (
  834. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '调拨项编号',
  835. `move_id` bigint NOT NULL COMMENT '调拨编号',
  836. `from_warehouse_id` bigint NOT NULL COMMENT '调出仓库编号',
  837. `to_warehouse_id` bigint NOT NULL COMMENT '调入仓库编号',
  838. `product_id` bigint NOT NULL COMMENT '产品编号',
  839. `product_unit_id` bigint NOT NULL COMMENT '产品单位编号',
  840. `product_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '产品单价',
  841. `count` decimal(24, 6) NOT NULL COMMENT '产品数量',
  842. `total_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '合计金额,单位:元',
  843. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  844. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  845. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  846. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  847. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  848. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  849. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  850. PRIMARY KEY (`id`) USING BTREE
  851. ) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 库存调拨项表';
  852. -- ----------------------------
  853. -- Records of erp_stock_move_item
  854. -- ----------------------------
  855. BEGIN;
  856. COMMIT;
  857. -- ----------------------------
  858. -- Table structure for erp_stock_out
  859. -- ----------------------------
  860. DROP TABLE IF EXISTS `erp_stock_out`;
  861. CREATE TABLE `erp_stock_out` (
  862. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '出库编号',
  863. `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '出库单号',
  864. `customer_id` bigint NULL DEFAULT NULL COMMENT '客户编号',
  865. `out_time` datetime NOT NULL COMMENT '出库时间',
  866. `total_count` decimal(24, 6) NOT NULL COMMENT '合计数量',
  867. `total_price` decimal(24, 6) NOT NULL COMMENT '合计金额,单位:元',
  868. `status` tinyint NOT NULL COMMENT '状态',
  869. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  870. `file_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件 URL',
  871. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  872. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  873. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  874. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  875. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  876. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  877. PRIMARY KEY (`id`) USING BTREE
  878. ) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 其它入库单表';
  879. -- ----------------------------
  880. -- Records of erp_stock_out
  881. -- ----------------------------
  882. BEGIN;
  883. INSERT INTO `erp_stock_out` (`id`, `no`, `customer_id`, `out_time`, `total_count`, `total_price`, `status`, `remark`, `file_url`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (9, 'QCKD20240207000001', NULL, '2024-02-14 00:00:00', 1.000000, 2.000000, 10, '333', NULL, '1', '2024-02-07 14:59:53', '1', '2024-02-07 07:00:13', b'1', 1);
  884. COMMIT;
  885. -- ----------------------------
  886. -- Table structure for erp_stock_out_item
  887. -- ----------------------------
  888. DROP TABLE IF EXISTS `erp_stock_out_item`;
  889. CREATE TABLE `erp_stock_out_item` (
  890. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '出库项编号',
  891. `out_id` bigint NOT NULL COMMENT '出库编号',
  892. `warehouse_id` bigint NOT NULL COMMENT '仓库编号',
  893. `product_id` bigint NOT NULL COMMENT '产品编号',
  894. `product_unit_id` bigint NOT NULL COMMENT '产品单位编号',
  895. `product_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '产品单价',
  896. `count` decimal(24, 6) NOT NULL COMMENT '产品数量',
  897. `total_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '合计金额,单位:元',
  898. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  899. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  900. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  901. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  902. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  903. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  904. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  905. PRIMARY KEY (`id`) USING BTREE
  906. ) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 其它出库单项表';
  907. -- ----------------------------
  908. -- Records of erp_stock_out_item
  909. -- ----------------------------
  910. BEGIN;
  911. INSERT INTO `erp_stock_out_item` (`id`, `out_id`, `warehouse_id`, `product_id`, `product_unit_id`, `product_price`, `count`, `total_price`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (10, 9, 2, 2, 2, 2.000000, 1.000000, 2.000000, NULL, '1', '2024-02-07 14:59:53', '1', '2024-02-07 07:00:13', b'1', 1);
  912. COMMIT;
  913. -- ----------------------------
  914. -- Table structure for erp_stock_record
  915. -- ----------------------------
  916. DROP TABLE IF EXISTS `erp_stock_record`;
  917. CREATE TABLE `erp_stock_record` (
  918. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  919. `product_id` bigint NOT NULL COMMENT '产品编号',
  920. `warehouse_id` bigint NOT NULL COMMENT '仓库编号',
  921. `count` decimal(24, 6) NOT NULL COMMENT '出入库数量',
  922. `total_count` decimal(24, 6) NOT NULL COMMENT '总库存量',
  923. `biz_type` tinyint NOT NULL COMMENT '业务类型',
  924. `biz_id` bigint NOT NULL COMMENT '业务编号',
  925. `biz_item_id` bigint NOT NULL COMMENT '业务项编号',
  926. `biz_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '业务单号',
  927. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  928. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  929. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  930. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  931. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  932. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  933. PRIMARY KEY (`id`) USING BTREE
  934. ) ENGINE = InnoDB AUTO_INCREMENT = 104 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 产品库存明细表';
  935. -- ----------------------------
  936. -- Records of erp_stock_record
  937. -- ----------------------------
  938. BEGIN;
  939. COMMIT;
  940. -- ----------------------------
  941. -- Table structure for erp_supplier
  942. -- ----------------------------
  943. DROP TABLE IF EXISTS `erp_supplier`;
  944. CREATE TABLE `erp_supplier` (
  945. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '供应商编号',
  946. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '供应商名称',
  947. `contact` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '联系人',
  948. `mobile` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '手机号码',
  949. `telephone` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '联系电话',
  950. `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '电子邮箱',
  951. `fax` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '传真',
  952. `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  953. `status` tinyint NOT NULL COMMENT '开启状态',
  954. `sort` int NOT NULL COMMENT '排序',
  955. `tax_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '纳税人识别号',
  956. `tax_percent` decimal(24, 6) NULL DEFAULT NULL COMMENT '税率',
  957. `bank_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '开户行',
  958. `bank_account` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '开户账号',
  959. `bank_address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '开户地址',
  960. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  961. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  962. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  963. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  964. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  965. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  966. PRIMARY KEY (`id` DESC) USING BTREE
  967. ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 供应商表';
  968. -- ----------------------------
  969. -- Records of erp_supplier
  970. -- ----------------------------
  971. BEGIN;
  972. COMMIT;
  973. -- ----------------------------
  974. -- Table structure for erp_warehouse
  975. -- ----------------------------
  976. DROP TABLE IF EXISTS `erp_warehouse`;
  977. CREATE TABLE `erp_warehouse` (
  978. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '仓库编号',
  979. `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '仓库名称',
  980. `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '仓库地址',
  981. `sort` bigint NOT NULL COMMENT '排序',
  982. `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
  983. `principal` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '负责人',
  984. `warehouse_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '仓储费,单位:元',
  985. `truckage_price` decimal(24, 6) NULL DEFAULT NULL COMMENT '搬运费,单位:元',
  986. `status` tinyint NOT NULL COMMENT '开启状态',
  987. `default_status` bit(1) NULL DEFAULT b'0' COMMENT '是否默认',
  988. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  989. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  990. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  991. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  992. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  993. `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  994. PRIMARY KEY (`id`) USING BTREE
  995. ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 仓库表';
  996. -- ----------------------------
  997. -- Records of erp_warehouse
  998. -- ----------------------------
  999. BEGIN;
  1000. COMMIT;
  1001. SET FOREIGN_KEY_CHECKS = 1;