haiyuan.sql 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. CREATE TABLE `dist` (
  2. `id` INT(11) NOT NULL AUTO_INCREMENT,
  3. `distType` VARCHAR(30) DEFAULT NULL,
  4. `distName` VARCHAR(50) DEFAULT NULL,
  5. `distCode` VARCHAR(50) DEFAULT NULL,
  6. `remark` VARCHAR(50) DEFAULT NULL,
  7. PRIMARY KEY (`id`) USING BTREE
  8. ) ENGINE=INNODB AUTO_INCREMENT=321 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;
  9. CREATE TABLE `bar_sap` (
  10. `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '栏舍id',
  11. `pastureid` BIGINT(20) NOT NULL COMMENT '牧场id',
  12. `bcode` VARCHAR(50) DEFAULT NULL COMMENT '栏舍编号',
  13. `bname` VARCHAR(200) NOT NULL COMMENT '栏舍名称',
  14. `allowratio` INT(11) DEFAULT 0 COMMENT '允许误差数',
  15. `autozone` INT(11) DEFAULT 0 COMMENT '跳转重量域(kg)',
  16. `autosecond` INT(4) DEFAULT 0 COMMENT '跳转延时值',
  17. `autosecondname` VARCHAR(50) DEFAULT NULL COMMENT '跳转延时名称',
  18. `isstart` TINYINT(1) DEFAULT 1 COMMENT '确认开始',
  19. `begintag` INT(11) DEFAULT NULL,
  20. `endtag` INT(11) DEFAULT NULL,
  21. `sort` INT(11) DEFAULT 0 COMMENT '排序',
  22. `enable` TINYINT(1) DEFAULT 1 COMMENT '是否启用',
  23. `isdelete` TINYINT(1) DEFAULT 0 COMMENT '是否删除(0为未删除,1为伪删除)',
  24. `backup1` VARCHAR(255) DEFAULT NULL COMMENT '备用1',
  25. `backup2` VARCHAR(255) DEFAULT NULL COMMENT '备用2',
  26. `AUFNR` VARCHAR(50) DEFAULT NULL COMMENT 'sap牛群订单行号',
  27. `class` VARCHAR(50) DEFAULT NULL COMMENT '牛舍类型',
  28. `classcode` VARCHAR(50) DEFAULT NULL COMMENT '牛舍类型编码',
  29. `cattle` VARCHAR(50) DEFAULT NULL COMMENT '牛群',
  30. `cattlecode` VARCHAR(50) DEFAULT NULL COMMENT '牛群编码',
  31. `sapCode` VARCHAR(50) DEFAULT NULL,
  32. PRIMARY KEY (`id`,`pastureid`) USING BTREE,
  33. UNIQUE KEY `bar_bname` (`bname`,`pastureid`) USING BTREE,
  34. UNIQUE KEY `bar_bcode` (`bcode`,`pastureid`) USING BTREE,
  35. UNIQUE KEY `pastureid` (`pastureid`,`sapCode`)
  36. ) ENGINE=INNODB AUTO_INCREMENT=4354454795596596571 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='栏舍';
  37. CREATE TABLE `cattleorder` (
  38. `AUFNR` VARCHAR(20) NOT NULL COMMENT '订单号',
  39. `KTEXT` VARCHAR(50) DEFAULT NULL COMMENT '订单描述',
  40. `ZNZLX` VARCHAR(50) DEFAULT NULL COMMENT '牛只类型 A-母犊牛 B-母育成牛 C-母青年牛 D-母泌乳牛 E-母干奶牛 F-公牛',
  41. `AUART` VARCHAR(50) DEFAULT NULL COMMENT '订单类型编码',
  42. `AUTXT` VARCHAR(50) DEFAULT NULL COMMENT '订单类型名称',
  43. `BUKRS` VARCHAR(50) DEFAULT NULL COMMENT '公司代码',
  44. `BUTXT` VARCHAR(50) DEFAULT NULL COMMENT '公司代码名称',
  45. PRIMARY KEY (`AUFNR`)
  46. ) ENGINE=INNODB DEFAULT CHARSET=utf8mb3;
  47. CREATE TABLE `feed_sap` (
  48. `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  49. `MATNR` VARCHAR(50) DEFAULT NULL COMMENT '物料号',
  50. `MTART` VARCHAR(50) DEFAULT NULL COMMENT '物料类型',
  51. `MATKL` VARCHAR(50) DEFAULT NULL COMMENT '物料组',
  52. `MAKTX` VARCHAR(50) DEFAULT NULL COMMENT '物料描述',
  53. `MEINS` VARCHAR(50) DEFAULT NULL COMMENT '基本计量单位',
  54. `UMREZ` VARCHAR(50) DEFAULT NULL COMMENT '基本计量单位数量',
  55. `MEINH` VARCHAR(50) DEFAULT NULL COMMENT '转换单位',
  56. `UMREN` VARCHAR(50) DEFAULT NULL COMMENT '转换单位数量',
  57. `ZMINC` VARCHAR(50) DEFAULT NULL COMMENT '物料名称',
  58. `ZGUIG` VARCHAR(50) DEFAULT NULL COMMENT '规格型号',
  59. `LVORM` VARCHAR(50) DEFAULT NULL COMMENT '物料删除标记',
  60. `LAEDA` VARCHAR(50) DEFAULT NULL COMMENT '修改日期',
  61. PRIMARY KEY (`id`)
  62. ) ENGINE=INNODB AUTO_INCREMENT=1156 DEFAULT CHARSET=utf8mb3;
  63. CREATE TABLE `saplog` (
  64. `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  65. `pastureId` VARCHAR(20) DEFAULT NULL,
  66. `request` LONGTEXT DEFAULT NULL,
  67. `response` LONGTEXT DEFAULT NULL,
  68. `status` VARCHAR(20) DEFAULT NULL,
  69. `msgtext` VARCHAR(255) DEFAULT NULL,
  70. `url` VARCHAR(255) DEFAULT NULL,
  71. `createTime` DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(),
  72. `msgtype` INT(1) DEFAULT NULL COMMENT '0饲喂 1剩料 2原料 3栏舍 4配方 5栏舍牛头数 6库存',
  73. `dataDate` VARCHAR(20) DEFAULT NULL COMMENT '数据日期',
  74. PRIMARY KEY (`id`)
  75. ) ENGINE=INNODB AUTO_INCREMENT=2039 DEFAULT CHARSET=utf8mb3;
  76. ALTER TABLE `tmr`
  77. ADD COLUMN `gps` VARCHAR(50) NULL;
  78. ALTER TABLE `tmr`
  79. ADD INDEX(`pastureid`, `gps`);
  80. ALTER TABLE `pasture`
  81. ADD COLUMN `werks` VARCHAR(30) NULL ;
  82. ALTER TABLE `bar`
  83. ADD COLUMN `AUFNR` VARCHAR(50) NULL COMMENT 'sap牛群订单行号';
  84. ALTER TABLE `bar`
  85. ADD COLUMN `class` VARCHAR(50) NULL COMMENT '牛舍类型' AFTER `AUFNR`,
  86. ADD COLUMN `classcode` VARCHAR(50) NULL COMMENT '牛舍类型编码' AFTER `class`,
  87. ADD COLUMN `cattle` VARCHAR(50) NULL COMMENT '牛群' AFTER `classcode`,
  88. ADD COLUMN `cattlecode` VARCHAR(50) NULL COMMENT '牛群编码' AFTER `cattle`;
  89. ALTER TABLE `bar`
  90. ADD COLUMN `sapCode` VARCHAR(50) NULL AFTER `cattlecode`;
  91. ALTER TABLE `feed`
  92. ADD COLUMN `sapMtart` BIGINT(20) DEFAULT NULL COMMENT 'sap编码',
  93. ADD COLUMN `sapGewei` VARCHAR(20) DEFAULT NULL COMMENT 'sap单位',
  94. ADD COLUMN `sapLGPRO` VARCHAR(20) DEFAULT NULL COMMENT 'sap牧场编码',
  95. ADD COLUMN `sapCHARG` VARCHAR(20) DEFAULT NULL,
  96. ADD COLUMN `sapCode` VARCHAR(20) DEFAULT NULL;
  97. ALTER TABLE `feed`
  98. MODIFY COLUMN `sapCode` VARCHAR(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'sap编码' AFTER `sapCHARG`,
  99. ADD COLUMN `sapMaterialtype` VARCHAR(50) NULL COMMENT 'sap物料类型' AFTER `sapCode`,
  100. ADD COLUMN `sapGoods` VARCHAR(50) NULL COMMENT 'sap货位' AFTER `sapMaterialtype`;
  101. ALTER TABLE `feedtemplet`
  102. ADD COLUMN `cattle` VARCHAR(30) NULL COMMENT '牛群类别' AFTER `backup2`;
  103. ALTER TABLE `feedtemplet`
  104. ADD COLUMN
  105. `volume` DECIMAL(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积';
  106. ALTER TABLE `tmr`
  107. ADD COLUMN
  108. `volume` DECIMAL(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积';
  109. ALTER TABLE `feedtemplethistory`
  110. ADD COLUMN
  111. `volume` DECIMAL(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积';
  112. ALTER TABLE `feedtempletdate`
  113. ADD COLUMN
  114. `volume` DECIMAL(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积';
  115. ALTER TABLE `feedtemplethistory`
  116. ADD COLUMN
  117. `userId` VARCHAR(30) DEFAULT NULL COMMENT '修改用户';
  118. ALTER TABLE `feedtempletdate`
  119. ADD COLUMN
  120. `userId` VARCHAR(30) DEFAULT NULL COMMENT '修改用户';
  121. ALTER TABLE `feedphistory`
  122. ADD COLUMN
  123. `userId` VARCHAR(30) DEFAULT NULL COMMENT '修改用户';
  124. ALTER TABLE `fpdetailhistory`
  125. ADD COLUMN
  126. `userId` VARCHAR(30) DEFAULT NULL COMMENT '修改用户';
  127. ALTER TABLE `lpplandtl1history`
  128. ADD COLUMN
  129. `userId` VARCHAR(30) DEFAULT NULL COMMENT '修改用户';
  130. ALTER TABLE `fit_history`
  131. ADD COLUMN
  132. `userId` VARCHAR(30) DEFAULT NULL COMMENT '修改用户';
  133. ALTER TABLE `downloadedplan`
  134. ADD COLUMN
  135. `driverId` BIGINT(20) DEFAULT NULL COMMENT '驾驶员';
  136. CREATE TABLE `remind` (
  137. `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  138. `message` VARCHAR(100) DEFAULT NULL,
  139. `trigger` VARCHAR(100) DEFAULT NULL COMMENT '触发',
  140. `pastureid` INT(11) NOT NULL,
  141. `user` LONGTEXT NOT NULL,
  142. `function` VARCHAR(100) DEFAULT NULL,
  143. `service_id` INT(3) DEFAULT NULL COMMENT '返回得类型id',
  144. PRIMARY KEY (`id`,`pastureid`) USING BTREE
  145. ) ENGINE=INNODB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4;