update.sql 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ALTER TABLE `tmrwatch2`.`tmr`
  2. ADD COLUMN `gps` varchar(50) NULL AFTER `lastinorout`;
  3. ALTER TABLE `tmrwatch2`.`downloadedplan`
  4. ADD COLUMN `driverId` bigint NOT NULL DEFAULT 0 COMMENT '驾驶员' ;
  5. ALTER TABLE `tmrwatch2`.`tmr`
  6. ADD INDEX(`pastureid`, `gps`);
  7. ALTER TABLE `tmrwatch2`.`pasture`
  8. ADD COLUMN `werks` varchar(30) NULL AFTER `isgroups`;
  9. ALTER TABLE `tmrwatch2`.`bar`
  10. ADD COLUMN `AUFNR` varchar(50) NULL COMMENT 'sap牛群订单行号' AFTER `backup2`;
  11. ALTER TABLE `tmrwatch2`.`bar`
  12. ADD COLUMN `class` varchar(50) NULL COMMENT '牛舍类型' AFTER `AUFNR`,
  13. ADD COLUMN `classcode` varchar(50) NULL COMMENT '牛舍类型编码' AFTER `class`,
  14. ADD COLUMN `cattle` varchar(50) NULL COMMENT '牛群' AFTER `classcode`,
  15. ADD COLUMN `cattlecode` varchar(50) NULL COMMENT '牛群编码' AFTER `cattle`;
  16. ALTER TABLE `tmrwatch2`.`bar`
  17. ADD COLUMN `sapCode` varchar(50) NULL AFTER `cattlecode`;
  18. ALTER TABLE `tmrwatch2`.`feed`
  19. ADD COLUMN `sapMtart` bigint(20) DEFAULT NULL COMMENT 'sap编码',
  20. ADD COLUMN `sapGewei` varchar(20) DEFAULT NULL COMMENT 'sap单位',
  21. ADD COLUMN `sapLGPRO` varchar(20) DEFAULT NULL COMMENT 'sap牧场编码',
  22. ADD COLUMN `sapCHARG` varchar(20) DEFAULT NULL,
  23. ADD COLUMN `sapCode` varchar(20) DEFAULT NULL;
  24. ALTER TABLE `tmrwatch2`.`feed`
  25. MODIFY COLUMN `sapCode` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'sap编码' AFTER `sapCHARG`,
  26. ADD COLUMN `sapMaterialtype` varchar(50) NULL COMMENT 'sap物料类型' AFTER `sapCode`,
  27. ADD COLUMN `sapGoods` varchar(50) NULL COMMENT 'sap货位' AFTER `sapMaterialtype`;
  28. ALTER TABLE `tmrwatch2`.`feedtemplet`
  29. ADD COLUMN `cattle` varchar(30) NULL COMMENT '牛群类别' AFTER `backup2`;
  30. CREATE TABLE `saplog` (
  31. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  32. `pastureId` varchar(20) DEFAULT NULL,
  33. `request` longtext DEFAULT NULL,
  34. `response` longtext DEFAULT NULL,
  35. `status` varchar(20) DEFAULT NULL,
  36. `msgtext` varchar(255) DEFAULT NULL,
  37. `url` varchar(255) DEFAULT NULL,
  38. `createTime` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  39. `msgtype` int(1) DEFAULT NULL COMMENT '0饲喂 1剩料 2原料 3栏舍 4配方 5栏舍牛头数 6库存',
  40. `dataDate` varchar(20) DEFAULT NULL COMMENT '数据日期',
  41. PRIMARY KEY (`id`)
  42. ) ENGINE=InnoDB AUTO_INCREMENT=2039 DEFAULT CHARSET=utf8mb3;
  43. CREATE TABLE `dist` (
  44. `id` int(11) NOT NULL AUTO_INCREMENT,
  45. `distType` varchar(30) DEFAULT NULL,
  46. `distName` varchar(50) DEFAULT NULL,
  47. `distCode` varchar(50) DEFAULT NULL,
  48. `remark` varchar(50) DEFAULT NULL,
  49. PRIMARY KEY (`id`) USING BTREE
  50. ) ENGINE=InnoDB AUTO_INCREMENT=321 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;
  51. CREATE TABLE `cattleorder` (
  52. `AUFNR` varchar(20) NOT NULL COMMENT '订单号',
  53. `KTEXT` varchar(50) DEFAULT NULL COMMENT '订单描述',
  54. `ZNZLX` varchar(50) DEFAULT NULL COMMENT '牛只类型 A-母犊牛 B-母育成牛 C-母青年牛 D-母泌乳牛 E-母干奶牛 F-公牛',
  55. `AUART` varchar(50) DEFAULT NULL COMMENT '订单类型编码',
  56. `AUTXT` varchar(50) DEFAULT NULL COMMENT '订单类型名称',
  57. `BUKRS` varchar(50) DEFAULT NULL COMMENT '公司代码',
  58. `BUTXT` varchar(50) DEFAULT NULL COMMENT '公司代码名称',
  59. PRIMARY KEY (`AUFNR`)
  60. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
  61. ALTER TABLE `feedtemplet`
  62. ADD COLUMN
  63. `volume` DECIMAL(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积';
  64. ALTER TABLE `tmr`
  65. ADD COLUMN
  66. `volume` DECIMAL(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积';
  67. ALTER TABLE `feedtemplethistory`
  68. ADD COLUMN
  69. `volume` DECIMAL(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积';
  70. ALTER TABLE `feedtempletdate`
  71. ADD COLUMN
  72. `volume` DECIMAL(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积';
  73. ALTER TABLE `tmrwatch2`.`feedtemplethistory`
  74. ADD COLUMN `userId` varchar(30) NULL COMMENT '修改用户' AFTER `volume`;
  75. ALTER TABLE `tmrwatch2`.`fpdetailhistory`
  76. ADD COLUMN `userId` varchar(30) NULL COMMENT '修改用户' AFTER `createdate`;
  77. ALTER TABLE `tmrwatch2`.`feedphistory`
  78. ADD COLUMN `userId` varchar(30) NULL COMMENT '修改用户' AFTER `createdate`;
  79. ALTER TABLE `tmrwatch2`.`lpplandtl1history`
  80. ADD COLUMN `userId` varchar(30) NULL COMMENT '修改用户' AFTER `createdate`;
  81. ALTER TABLE `tmrwatch2`.`fit_history`
  82. ADD COLUMN `userId` varchar(30) NULL AFTER `feedgroup`;