update.sql 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ALTER TABLE `tmrwatch2`.`feedlaid`
  2. ADD COLUMN `status` int(1) NOT NULL DEFAULT 0 COMMENT '0 已出库 \r\n1 未出库 \r\n2 已撤销\r\n' AFTER `pricenew`;
  3. alter table feedtemplet
  4. add updatetime datetime default CURRENT_TIMESTAMP null;
  5. ALTER TABLE `tmrwatch`.`tmr`
  6. ADD COLUMN `lastinorout` int(1) NULL DEFAULT 0 AFTER `autosecondname`
  7. alter table fpdetail
  8. alter column ptuse set default 0;
  9. alter table fpdetail
  10. alter column ptsuse set default 0;
  11. -- 修改饲料表顺序
  12. -- update
  13. -- (SELECT @rownum:=0)r ,feed fn
  14. -- set fn.sort = @rownum := @rownum+1
  15. -- WHERE fn.pastureid = 1647917519
  16. -- ORDER BY fn.sort DESC
  17. update
  18. (SELECT @rownum:=0)r ,bar fn
  19. set fn.sort = @rownum := @rownum+1
  20. WHERE fn.pastureid = 1648637190
  21. ORDER BY fn.id DESC
  22. -- 宾州筛bug
  23. -- `barid`, `times`, `operatetime` 唯一索引
  24. -- 宾州筛历史记录表
  25. -- CREATE TABLE `pennsieve_history` (
  26. -- `id` bigint(20) NOT NULL AUTO_INCREMENT,
  27. -- `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  28. -- `times` varchar(50) DEFAULT NULL COMMENT '班次',
  29. -- `onerate` decimal(20,2) DEFAULT NULL COMMENT '第一层比例',
  30. -- `oneweight` decimal(20,2) DEFAULT NULL COMMENT '第一层重量',
  31. -- `tworate` decimal(20,2) DEFAULT NULL COMMENT '第二层比列',
  32. -- `twoweight` decimal(20,2) DEFAULT NULL COMMENT '第二层重量',
  33. -- `threerate` decimal(20,2) DEFAULT NULL COMMENT '第三层比列',
  34. -- `threeweight` decimal(20,2) DEFAULT NULL COMMENT '第三层重量',
  35. -- `fourrate` decimal(20,2) DEFAULT NULL COMMENT '第四层比列',
  36. -- `fourweight` decimal(20,2) DEFAULT NULL COMMENT '第四层重量',
  37. -- `operatetime` datetime DEFAULT NULL COMMENT '操作时间',
  38. -- `barid` bigint(20) DEFAULT NULL COMMENT '栏舍id',
  39. -- `pastureid` bigint(20) DEFAULT NULL COMMENT '牧场id',
  40. -- `species` varchar(50) DEFAULT NULL COMMENT '种类',
  41. -- PRIMARY KEY (`id`)
  42. -- ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
  43. -- 配方干物质
  44. -- 到体况评分bug
  45. CREATE TABLE `ftdry_history` (
  46. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  47. `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  48. `times` varchar(50) DEFAULT NULL COMMENT '班次',
  49. `freshweight` decimal(20,2) DEFAULT NULL COMMENT '新鲜重量',
  50. `dryweight` decimal(20,2) DEFAULT NULL COMMENT '烘干重量',
  51. `thoweight` decimal(20,0) DEFAULT NULL COMMENT '理论干物质',
  52. `actweight` decimal(20,0) DEFAULT NULL COMMENT '实际干物质',
  53. `barid` bigint(20) DEFAULT NULL COMMENT '栏舍id',
  54. `changeTime` datetime DEFAULT NULL COMMENT '操作时间',
  55. `pastureid` bigint(20) DEFAULT NULL COMMENT '牧场id',
  56. PRIMARY KEY (`id`)
  57. ) ENGINE=InnoDB
  58. CREATE TABLE `dungandbodyhistory` (
  59. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  60. `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  61. `standardscore` varchar(50) DEFAULT NULL COMMENT '标准分数',
  62. `barid` bigint(20) DEFAULT NULL COMMENT '栏舍id',
  63. `cowsum` varchar(50) DEFAULT NULL COMMENT '牛头数',
  64. `onescore` varchar(50) DEFAULT NULL COMMENT '1',
  65. `twoscore` varchar(50) DEFAULT NULL COMMENT '2',
  66. `threescore` varchar(50) DEFAULT NULL COMMENT '3',
  67. `fourscore` varchar(50) DEFAULT NULL COMMENT '4',
  68. `fivescore` varchar(50) DEFAULT NULL COMMENT '5',
  69. `pastureid` bigint(20) DEFAULT NULL COMMENT '牧场id',
  70. `species` varchar(50) DEFAULT NULL COMMENT '种类',
  71. `changetime` datetime DEFAULT NULL COMMENT '操作时间',
  72. `sixscore` varchar(50) DEFAULT NULL COMMENT '6',
  73. `sevenscore` varchar(50) DEFAULT NULL COMMENT '7',
  74. PRIMARY KEY (`id`)
  75. ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
  76. -- 增加牲畜类别其他
  77. INSERT INTO `tmrwatch2`.`dictlist`(`pid`, `label`, `value`, `orderby`) VALUES (17, '其他', '6', 6)
  78. downloadplandtl2 `pastureid`, `pid` 索引
  79. feedpdate 调整索引顺序 `pastureid`, `date`, `barid`