11111.sql 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  1. CREATE TABLE `bar_sap` (
  2. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '栏舍id',
  3. `pastureid` bigint(20) NOT NULL COMMENT '牧场id',
  4. `bcode` varchar(50) DEFAULT NULL COMMENT '栏舍编号',
  5. `bname` varchar(200) NOT NULL COMMENT '栏舍名称',
  6. `allowratio` int(11) DEFAULT 0 COMMENT '允许误差数',
  7. `autozone` int(11) DEFAULT 0 COMMENT '跳转重量域(kg)',
  8. `autosecond` int(4) DEFAULT 0 COMMENT '跳转延时值',
  9. `autosecondname` varchar(50) DEFAULT NULL COMMENT '跳转延时名称',
  10. `isstart` tinyint(1) DEFAULT 1 COMMENT '确认开始',
  11. `begintag` int(11) DEFAULT NULL,
  12. `endtag` int(11) DEFAULT NULL,
  13. `sort` int(11) DEFAULT 0 COMMENT '排序',
  14. `enable` tinyint(1) DEFAULT 1 COMMENT '是否启用',
  15. `isdelete` tinyint(1) DEFAULT 0 COMMENT '是否删除(0为未删除,1为伪删除)',
  16. `backup1` varchar(255) DEFAULT NULL COMMENT '备用1',
  17. `backup2` varchar(255) DEFAULT NULL COMMENT '备用2',
  18. `AUFNR` varchar(50) DEFAULT NULL COMMENT 'sap牛群订单行号',
  19. `class` varchar(50) DEFAULT NULL COMMENT '牛舍类型',
  20. `classcode` varchar(50) DEFAULT NULL COMMENT '牛舍类型编码',
  21. `cattle` varchar(50) DEFAULT NULL COMMENT '牛群',
  22. `cattlecode` varchar(50) DEFAULT NULL COMMENT '牛群编码',
  23. `sapCode` varchar(50) DEFAULT NULL,
  24. PRIMARY KEY (`id`,`pastureid`) USING BTREE,
  25. UNIQUE KEY `bar_bname` (`bname`,`pastureid`) USING BTREE,
  26. UNIQUE KEY `bar_bcode` (`bcode`,`pastureid`) USING BTREE,
  27. UNIQUE KEY `pastureid` (`pastureid`,`sapCode`)
  28. ) ENGINE=InnoDB AUTO_INCREMENT=4354454795596596571 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='栏舍';
  29. CREATE TABLE `cattleorder` (
  30. `AUFNR` varchar(20) NOT NULL COMMENT '订单号',
  31. `KTEXT` varchar(50) DEFAULT NULL COMMENT '订单描述',
  32. `ZNZLX` varchar(50) DEFAULT NULL COMMENT '牛只类型 A-母犊牛 B-母育成牛 C-母青年牛 D-母泌乳牛 E-母干奶牛 F-公牛',
  33. `AUART` varchar(50) DEFAULT NULL COMMENT '订单类型编码',
  34. `AUTXT` varchar(50) DEFAULT NULL COMMENT '订单类型名称',
  35. `BUKRS` varchar(50) DEFAULT NULL COMMENT '公司代码',
  36. `BUTXT` varchar(50) DEFAULT NULL COMMENT '公司代码名称',
  37. PRIMARY KEY (`AUFNR`)
  38. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
  39. CREATE TABLE `dist` (
  40. `id` int(11) NOT NULL AUTO_INCREMENT,
  41. `distType` varchar(30) DEFAULT NULL,
  42. `distName` varchar(50) DEFAULT NULL,
  43. `distCode` varchar(50) DEFAULT NULL,
  44. `remark` varchar(50) DEFAULT NULL,
  45. PRIMARY KEY (`id`) USING BTREE
  46. ) ENGINE=InnoDB AUTO_INCREMENT=321 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=COMPACT;
  47. CREATE TABLE `downloadedplan_delrecord` (
  48. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  49. `pastureid` bigint(20) NOT NULL,
  50. `mydate` datetime NOT NULL COMMENT '计划日期',
  51. `projname` varchar(12) DEFAULT NULL COMMENT '计划编号',
  52. `datacaptureno` int(11) DEFAULT NULL COMMENT '设备编号',
  53. `tmrid` bigint(20) DEFAULT NULL COMMENT 'tmr主键',
  54. `tmrtname` varchar(20) DEFAULT NULL COMMENT 'tmr名称',
  55. `havebutton` tinyint(1) DEFAULT 0 COMMENT '是否开始执行',
  56. `inbuttontype` int(11) DEFAULT 0 COMMENT '按钮类型',
  57. `plantime` varchar(50) DEFAULT NULL COMMENT '计划时分',
  58. `intime` datetime DEFAULT NULL COMMENT '开始执行时间',
  59. `completedtime` datetime DEFAULT NULL COMMENT '结束执行时间',
  60. `processtime` time DEFAULT NULL COMMENT '过程时间',
  61. `iscompleted` tinyint(4) DEFAULT 0 COMMENT '是否已完成',
  62. `lpplantype` int(11) DEFAULT 0 COMMENT '计算模式: 0、混合,1、上料,2、发料,3、剩料,4、预混',
  63. `times` int(11) DEFAULT 0 COMMENT '班次',
  64. `sort` int(11) DEFAULT 0 COMMENT '顺序',
  65. `remark` varchar(50) DEFAULT NULL COMMENT '备注',
  66. `itemnum` int(11) DEFAULT NULL COMMENT '添加饲料种类数',
  67. `outitems` int(11) DEFAULT NULL COMMENT '发料牛舍数',
  68. `feedpname` varchar(200) DEFAULT NULL COMMENT '牛舍列表',
  69. `feedpcount` int(11) DEFAULT 0 COMMENT '牛头数',
  70. `pid` bigint(20) DEFAULT NULL COMMENT '发料计划编号',
  71. `tempid` bigint(20) DEFAULT NULL COMMENT '配方id',
  72. `templetname` varchar(50) DEFAULT NULL COMMENT '配方模版名称',
  73. `ptstempid` bigint(20) DEFAULT NULL COMMENT '补料配方id',
  74. `ptstempletname` varchar(50) DEFAULT NULL COMMENT '补料配方模版名称',
  75. `thoweight` char(20) DEFAULT NULL COMMENT '配方理论干物质',
  76. `fpweight` char(20) DEFAULT NULL COMMENT '配方总重',
  77. `lweight` decimal(38,2) DEFAULT NULL COMMENT '应做料总量',
  78. `iweight` int(11) DEFAULT NULL COMMENT '实际做料总量',
  79. `oweight` int(11) DEFAULT NULL COMMENT '实发料重量',
  80. `tversion` int(11) DEFAULT 0 COMMENT '配方版本',
  81. `ptversion` int(11) DEFAULT 0 COMMENT '补料配方版本',
  82. `enable` tinyint(4) DEFAULT 1 COMMENT '是否启用',
  83. `isUse` int(11) DEFAULT 0 COMMENT '是否使用(1 为已使用)格润富德接口使用',
  84. `deletetime` datetime DEFAULT NULL,
  85. PRIMARY KEY (`id`) USING BTREE,
  86. KEY `newindex1` (`mydate`) USING BTREE,
  87. KEY `newindex2` (`lpplantype`) USING BTREE,
  88. KEY `newindex3` (`havebutton`) USING BTREE,
  89. KEY `pid` (`pid`) USING BTREE,
  90. KEY `downloadedplan_uni` (`pastureid`,`mydate`,`pid`,`lpplantype`,`tmrid`) USING BTREE
  91. ) ENGINE=InnoDB AUTO_INCREMENT=3275835 DEFAULT CHARSET=utf8mb3 COMMENT='计划';
  92. CREATE TABLE `downloadedplan_log` (
  93. `id` bigint(20) NOT NULL DEFAULT 0,
  94. `times` tinyint(2) DEFAULT NULL,
  95. `date` date DEFAULT NULL,
  96. `status` tinyint(1) DEFAULT 0 COMMENT '同步状态',
  97. `push_status` tinyint(1) DEFAULT NULL COMMENT '微信推送状态',
  98. `classes` tinyint(1) DEFAULT 0 COMMENT '班次状态',
  99. `dailyplan` tinyint(1) DEFAULT 0 COMMENT '当日计划',
  100. `log` int(11) DEFAULT NULL,
  101. PRIMARY KEY (`id`),
  102. KEY `date` (`date`)
  103. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  104. CREATE TABLE `downloadplandtl1_delrecord` (
  105. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  106. `pastureid` bigint(20) NOT NULL,
  107. `pid` bigint(20) NOT NULL COMMENT '计划id',
  108. `flpid` bigint(20) DEFAULT NULL COMMENT '发料计划的主id',
  109. `fid` bigint(20) NOT NULL COMMENT '饲料id',
  110. `lweight` decimal(10,2) NOT NULL COMMENT '理论重量',
  111. `sort` int(11) NOT NULL DEFAULT 0 COMMENT '顺序',
  112. `lastactualweight` decimal(10,2) DEFAULT NULL COMMENT '上次重量',
  113. `actualweight` decimal(10,2) DEFAULT NULL COMMENT '实际重量',
  114. `actualweightminus` decimal(10,2) DEFAULT NULL COMMENT '实际重量',
  115. `havebuttom` tinyint(1) DEFAULT 0 COMMENT '是否操作',
  116. `begintime` datetime DEFAULT NULL COMMENT '操作开始时间',
  117. `intime` datetime DEFAULT NULL COMMENT '操作结束时间',
  118. `buttontype` int(11) DEFAULT 0 COMMENT '操作类型',
  119. `optdevice` bigint(20) DEFAULT NULL COMMENT '操作车id',
  120. `feedcode` varchar(50) DEFAULT NULL COMMENT '饲料编码',
  121. `fname` varchar(20) DEFAULT NULL COMMENT '饲料名称',
  122. `feedsort` int(11) DEFAULT 0 COMMENT '饲料顺序',
  123. `feedallowratio` float DEFAULT 0 COMMENT '饲料允许误差率',
  124. `stirdelay` int(11) DEFAULT 0 COMMENT '搅拌延时(分钟)',
  125. `fweight` decimal(10,3) DEFAULT NULL COMMENT '配方明细量',
  126. `tmrloadname` varchar(20) DEFAULT NULL COMMENT '相同饲料顺序在tmr车上的显示名称',
  127. `dryfeed` decimal(38,2) DEFAULT NULL COMMENT '饲料干物质',
  128. `pricefeed` decimal(38,2) DEFAULT NULL COMMENT '饲料单价',
  129. `outweight` int(11) DEFAULT NULL COMMENT '人工确认出库量',
  130. `errratio` decimal(38,2) DEFAULT NULL,
  131. `date` date NOT NULL,
  132. `buttonsucc` tinyint(4) DEFAULT NULL,
  133. `type` tinyint(4) DEFAULT 0 COMMENT '类型 1是tmr 0 是饲料',
  134. PRIMARY KEY (`id`,`pastureid`,`date`) USING BTREE,
  135. KEY `ai_id` (`id`) USING BTREE,
  136. KEY `newindex1` (`fid`) USING BTREE,
  137. KEY `fk_downloadplandtl1` (`pid`) USING BTREE,
  138. KEY `date` (`date`) USING BTREE,
  139. KEY `flpid` (`flpid`) USING BTREE,
  140. KEY `downloadplandtl1_uni` (`pastureid`,`flpid`,`fid`,`date`,`pid`) USING BTREE
  141. ) ENGINE=InnoDB AUTO_INCREMENT=24611703 DEFAULT CHARSET=utf8mb3 COMMENT='计划1';
  142. CREATE TABLE `downloadplandtl1_exec_delrecord` (
  143. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  144. `pastureid` bigint(20) NOT NULL,
  145. `pid` bigint(20) NOT NULL COMMENT '计划id',
  146. `flpid` bigint(20) DEFAULT NULL,
  147. `lastactualweight` decimal(10,2) DEFAULT NULL COMMENT '上次重量',
  148. `actualweight` decimal(10,2) DEFAULT NULL COMMENT '本次重量',
  149. `lweight` decimal(10,2) NOT NULL COMMENT '理论重量',
  150. `actualweightminus` decimal(10,2) DEFAULT NULL COMMENT '实际重量',
  151. `begintime` datetime DEFAULT NULL COMMENT '操作开始时间',
  152. `intime` datetime DEFAULT NULL COMMENT '操作结束时间',
  153. `havebuttom` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否已操作',
  154. `buttontype` int(11) DEFAULT 0 COMMENT '按钮类型',
  155. `optdevice` bigint(20) DEFAULT NULL COMMENT '操作车id',
  156. `sort` int(11) NOT NULL DEFAULT 0 COMMENT '顺序',
  157. `fname` varchar(50) DEFAULT NULL COMMENT '饲料名称,多饲料,逗号分开',
  158. `fcount` int(11) DEFAULT NULL COMMENT '饲料数',
  159. `tmrloadname` varchar(20) DEFAULT NULL COMMENT '相同饲料顺序在tmr车上的显示名称',
  160. `feedallowratio` float DEFAULT 0 COMMENT '饲料允许误差公斤',
  161. `processtime` time DEFAULT NULL COMMENT '过程时间',
  162. `stirdelay` int(11) DEFAULT 0 COMMENT '搅拌延时(分钟)',
  163. `buttonsucc` tinyint(4) DEFAULT 0,
  164. `errratio` decimal(38,2) DEFAULT NULL,
  165. `date` date NOT NULL,
  166. `type` tinyint(4) DEFAULT 0 COMMENT '类型 1是tmr 0 是饲料',
  167. PRIMARY KEY (`id`,`pastureid`,`date`) USING BTREE,
  168. KEY `ai_id` (`id`) USING BTREE,
  169. KEY `fk_downloadplandtl1_exec` (`pid`) USING BTREE,
  170. KEY `p-pid` (`pastureid`,`pid`) USING BTREE,
  171. KEY `date` (`date`,`pastureid`) USING BTREE,
  172. KEY `intime` (`intime`,`pastureid`) USING BTREE,
  173. KEY `flpid` (`flpid`) USING BTREE,
  174. KEY `downloadplandtl1_exec_sort` (`pastureid`,`pid`,`sort`,`date`,`type`) USING BTREE
  175. ) ENGINE=InnoDB AUTO_INCREMENT=24611703 DEFAULT CHARSET=utf8mb3 COMMENT='计划1_exec';
  176. CREATE TABLE `downloadplandtl1_log` (
  177. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  178. `sort` int(11) DEFAULT NULL,
  179. `planid` bigint(20) DEFAULT NULL COMMENT 'downloadedplan id ',
  180. `pastureid` int(11) DEFAULT NULL,
  181. `date` date DEFAULT NULL,
  182. `plandtl1` bigint(20) DEFAULT NULL COMMENT 'downloadplandtl1 id ',
  183. `type` tinyint(1) DEFAULT NULL,
  184. `InventoryWarning` tinyint(1) DEFAULT NULL,
  185. `abnormalMixingDelay` tinyint(1) DEFAULT NULL,
  186. PRIMARY KEY (`id`)
  187. ) ENGINE=InnoDB AUTO_INCREMENT=110179 DEFAULT CHARSET=utf8mb4;
  188. CREATE TABLE `downloadplandtl2_delrecord` (
  189. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  190. `pastureid` bigint(20) NOT NULL,
  191. `pid` bigint(20) NOT NULL COMMENT '计划id',
  192. `flpid` bigint(20) DEFAULT NULL COMMENT ',发料计划的主id',
  193. `fbarid` bigint(20) NOT NULL COMMENT '牛舍id',
  194. `fname` varchar(50) DEFAULT NULL COMMENT '牛舍名称',
  195. `lastactualweight` decimal(10,0) DEFAULT NULL COMMENT '上次重量',
  196. `actualweight` decimal(10,2) DEFAULT NULL COMMENT '本次重量',
  197. `lweight` decimal(10,2) DEFAULT NULL COMMENT '理论重量',
  198. `lweighthis` decimal(10,2) DEFAULT NULL COMMENT '历史理论重量(剩料)',
  199. `remainleftw` decimal(10,2) DEFAULT NULL COMMENT '剩料量',
  200. `allowrw` decimal(10,2) DEFAULT NULL COMMENT '允许分配剩料量',
  201. `actualweightminus` decimal(10,2) DEFAULT NULL COMMENT '实际重量',
  202. `sort` int(11) NOT NULL DEFAULT 0 COMMENT '顺序',
  203. `havebuttom` tinyint(1) DEFAULT 0 COMMENT '是否操作',
  204. `begintime` datetime DEFAULT NULL COMMENT '操作开始时间',
  205. `begintag` varchar(50) DEFAULT NULL COMMENT '开始标签',
  206. `intime` datetime DEFAULT NULL COMMENT '操作完成时间',
  207. `endtag` varchar(50) DEFAULT NULL COMMENT '结束标签',
  208. `buttontype` int(11) DEFAULT 0 COMMENT '操作按键类型',
  209. `optdevice` bigint(20) DEFAULT NULL COMMENT '操作车id',
  210. `cowcount` int(11) DEFAULT 0 COMMENT '牛头数',
  211. `cowclassid` bigint(20) DEFAULT NULL COMMENT '牛只类型id',
  212. `cowclassname` varchar(50) DEFAULT NULL COMMENT '类型名称',
  213. `bigcowname` varchar(50) DEFAULT NULL,
  214. `pweight` decimal(10,2) DEFAULT NULL COMMENT '通过加料计算出重量',
  215. `ccountratio` float DEFAULT 100 COMMENT '牛头系数',
  216. `sumrtime` float DEFAULT 0 COMMENT '该班次比例(%)',
  217. `feedtempletid` bigint(20) DEFAULT NULL COMMENT '配方模版id',
  218. `feedtempletname` varchar(20) DEFAULT NULL COMMENT '配方模版名称',
  219. `dryweight` decimal(10,2) DEFAULT NULL COMMENT '配方干物质',
  220. `sumweight` decimal(10,2) DEFAULT NULL COMMENT '配方饲料总重量',
  221. `priceweight` decimal(10,2) DEFAULT NULL COMMENT '配方单价',
  222. `processtime` time DEFAULT NULL COMMENT '过程时间',
  223. `fpid` bigint(20) DEFAULT NULL COMMENT '栏舍配方id',
  224. `useinbartype` bigint(20) DEFAULT NULL COMMENT '转投栏舍类型(0收集剩料,1撒剩料)',
  225. `date` date NOT NULL,
  226. `allowratio` int(11) DEFAULT NULL COMMENT '栏舍允许误差',
  227. `errratio` decimal(38,2) DEFAULT NULL,
  228. `buttonsucc` tinyint(4) DEFAULT NULL,
  229. `type` tinyint(4) DEFAULT 0 COMMENT '类型 1是铲车 0 是栏舍',
  230. PRIMARY KEY (`id`,`pastureid`,`date`) USING BTREE,
  231. KEY `ai_id` (`fbarid`) USING BTREE,
  232. KEY `newindex2` (`flpid`) USING BTREE,
  233. KEY `newindex1` (`pid`) USING BTREE,
  234. KEY `intime` (`intime`) USING BTREE,
  235. KEY `date` (`date`) USING BTREE,
  236. KEY `pastureid` (`pastureid`,`pid`) USING BTREE
  237. ) ENGINE=InnoDB AUTO_INCREMENT=13146290 DEFAULT CHARSET=utf8mb3 COMMENT='计划2';
  238. CREATE TABLE `feed_detail_version` (
  239. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键自增id',
  240. `pasture_id` bigint(20) unsigned NOT NULL COMMENT '牧场id',
  241. `feed_template_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '配方id',
  242. `group_version` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '版本号',
  243. `belong` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '配方归属 0 无效 1 归属集团端 2 归属牧场端',
  244. `created_at` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
  245. `updated_at` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
  246. PRIMARY KEY (`id`),
  247. KEY `idx_feed_template_id` (`feed_template_id`)
  248. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配方版本更新记录表';
  249. CREATE TABLE `feed_detail_version_log` (
  250. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键自增id',
  251. `pasture_id` bigint(20) unsigned NOT NULL COMMENT '牧场id',
  252. `version_id` int(11) unsigned NOT NULL COMMENT 'feed_detail_version表id',
  253. `feed_template_id` bigint(20) unsigned NOT NULL COMMENT '配方id',
  254. `forage_id` int(11) unsigned NOT NULL COMMENT '饲料id',
  255. `forage_name` varchar(255) NOT NULL DEFAULT '' COMMENT '饲料名称',
  256. `forage_group_name` varchar(155) NOT NULL DEFAULT '' COMMENT '饲料分组名称',
  257. `weight` int(11) unsigned NOT NULL COMMENT '重量',
  258. `stir_delay` int(11) unsigned NOT NULL COMMENT '搅拌延迟',
  259. `allow_error` int(11) unsigned NOT NULL COMMENT '允许误差',
  260. `is_modify` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '是否可修改 0 无效 1 是 2 否',
  261. `is_lock_cow_count_ratio` tinyint(1) unsigned NOT NULL DEFAULT 2 COMMENT '是否锁定牛头数比例 1 是 2 否',
  262. `sort` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '排序',
  263. `is_show` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '是否删除 0 无效 1 未删除 2 已删除',
  264. `created` datetime NOT NULL COMMENT '创建时间',
  265. `updated` datetime NOT NULL COMMENT '更新时间',
  266. PRIMARY KEY (`id`),
  267. KEY `idx_feed_template_id` (`feed_template_id`)
  268. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集团端最新配方详情表';
  269. CREATE TABLE `feedphistory` (
  270. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  271. `pastureid` bigint(20) NOT NULL,
  272. `barname` char(20) DEFAULT NULL,
  273. `barid` bigint(20) NOT NULL COMMENT '舍栏id',
  274. `softccount` int(11) DEFAULT NULL COMMENT '软件牛头数',
  275. `ccount` int(11) NOT NULL DEFAULT 0 COMMENT '实际头数',
  276. `ratio` decimal(38,2) DEFAULT NULL COMMENT '系数',
  277. `ccountratio` decimal(38,2) DEFAULT 100.00 COMMENT '系数牛头数',
  278. `ftid` bigint(20) DEFAULT NULL COMMENT '配方模版id(不是补料模版的id)',
  279. `ftname` varchar(50) DEFAULT NULL COMMENT '配方名称',
  280. `ptsfid` bigint(20) DEFAULT NULL COMMENT '配方模版id(补料模版的id)',
  281. `ptsfname` varchar(50) DEFAULT NULL COMMENT '补料名称',
  282. `feedweight` decimal(38,3) DEFAULT NULL COMMENT '投喂量',
  283. `ftweight` decimal(38,3) DEFAULT NULL COMMENT '配方重量',
  284. `supplyweight` decimal(38,3) DEFAULT 0.000 COMMENT '补料重量',
  285. `owner` varchar(20) DEFAULT NULL COMMENT '编制人',
  286. `createdate` datetime DEFAULT NULL,
  287. `userId` varchar(30) DEFAULT NULL COMMENT '修改用户',
  288. PRIMARY KEY (`id`)
  289. ) ENGINE=InnoDB AUTO_INCREMENT=3976043477267438868 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='栏舍';
  290. CREATE TABLE `feedtemplethistory` (
  291. `id` bigint(20) NOT NULL COMMENT '配方模板id',
  292. `pastureid` bigint(20) NOT NULL,
  293. `tcode` varchar(50) DEFAULT NULL COMMENT '配方编码',
  294. `tname` varchar(50) NOT NULL COMMENT '配方名称',
  295. `tcolor` varchar(50) DEFAULT '#ccc' COMMENT '配方模板颜色',
  296. `ccid` bigint(20) DEFAULT NULL COMMENT '牲畜类别id',
  297. `ccname` varchar(50) DEFAULT NULL COMMENT '类别名称',
  298. `fttype` varchar(50) DEFAULT NULL COMMENT '配方类型',
  299. `fttypeid` tinyint(1) DEFAULT 0 COMMENT '配方类型id(1饲喂,2预混,3补料)',
  300. `source` varchar(50) DEFAULT NULL COMMENT '来源',
  301. `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  302. `enable` tinyint(1) DEFAULT 1 COMMENT '启用',
  303. `sort` int(11) DEFAULT 1 COMMENT '排序',
  304. `owner` varchar(50) DEFAULT NULL COMMENT '来源',
  305. `weight` decimal(38,3) DEFAULT NULL COMMENT '总重',
  306. `dryweight` decimal(38,3) DEFAULT NULL COMMENT '干物质含量',
  307. `isdelete` tinyint(1) DEFAULT 0 COMMENT '是否删除(0为未删除,1为伪删除)',
  308. `version` int(11) DEFAULT 1 COMMENT '修改一次增加版本号',
  309. `savetime` datetime DEFAULT current_timestamp() COMMENT '保存日期',
  310. `isissue` tinyint(4) DEFAULT 0 COMMENT '下发是否为当前配方(1是,0否)',
  311. `issueversion` int(11) DEFAULT 0 COMMENT '下发时的版本',
  312. `issueid` bigint(20) DEFAULT NULL COMMENT '下发时的id',
  313. `backup1` varchar(255) DEFAULT NULL COMMENT '备用1',
  314. `backup2` varchar(255) DEFAULT NULL COMMENT '备用2',
  315. `createdate` datetime DEFAULT NULL,
  316. `volume` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积',
  317. `userId` varchar(30) DEFAULT NULL COMMENT '修改用户'
  318. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
  319. CREATE TABLE `fit_history` (
  320. `id` int(11) NOT NULL AUTO_INCREMENT,
  321. `name` varchar(50) DEFAULT NULL COMMENT '饲料名称',
  322. `weight` decimal(10,2) DEFAULT NULL COMMENT '修改前重量',
  323. `pastureId` bigint(20) DEFAULT NULL COMMENT '牧场id',
  324. `fitId` bigint(20) DEFAULT NULL COMMENT '配方id',
  325. `dateTime1` datetime DEFAULT NULL COMMENT '修改时间',
  326. `Eweight` decimal(10,2) DEFAULT NULL COMMENT '修改后重量',
  327. `change` varchar(20) DEFAULT NULL COMMENT '判断是否改变',
  328. `autosecond` int(11) DEFAULT NULL,
  329. `preftid` bigint(20) DEFAULT 0,
  330. `feedgroup` varchar(50) DEFAULT NULL,
  331. `userId` varchar(30) DEFAULT NULL,
  332. PRIMARY KEY (`id`) USING BTREE
  333. ) ENGINE=InnoDB AUTO_INCREMENT=23382 DEFAULT CHARSET=utf8mb3;
  334. CREATE TABLE `fpdetailhistory` (
  335. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '配方子表id',
  336. `pastureid` bigint(20) NOT NULL,
  337. `barid` bigint(20) NOT NULL COMMENT '栏舍id',
  338. `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  339. `times` tinyint(4) DEFAULT NULL COMMENT '班次',
  340. `tratio` decimal(38,1) DEFAULT NULL COMMENT '班次比例',
  341. `weight` decimal(38,2) unsigned DEFAULT 0.00 COMMENT '重量',
  342. `ptsrate` decimal(38,6) unsigned zerofill DEFAULT 00000000000000000000000000000000.000000 COMMENT '补料比例',
  343. `cowcount` char(20) DEFAULT NULL COMMENT '牛头数',
  344. `ccountradio` char(20) DEFAULT NULL COMMENT '牛头系数',
  345. `ptid` bigint(20) DEFAULT -1 COMMENT '配方模板',
  346. `ptsid` bigint(20) DEFAULT -1 COMMENT '补料配方',
  347. `ptuse` decimal(38,2) unsigned NOT NULL DEFAULT 0.00 COMMENT '0 未分配 大于0分配',
  348. `ptsuse` decimal(38,2) unsigned NOT NULL DEFAULT 0.00 COMMENT '0 未分配 大于0分配',
  349. `supplement` decimal(38,2) DEFAULT 0.00,
  350. `createdate` datetime DEFAULT NULL,
  351. `userId` varchar(30) DEFAULT NULL COMMENT '修改用户',
  352. PRIMARY KEY (`id`,`pastureid`) USING BTREE
  353. ) ENGINE=InnoDB AUTO_INCREMENT=3976043477519271054 DEFAULT CHARSET=utf8mb3 COMMENT='栏舍配方子表历史记录';
  354. CREATE TABLE `ftdry_history` (
  355. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  356. `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  357. `times` varchar(50) DEFAULT NULL COMMENT '班次',
  358. `freshweight` decimal(20,2) DEFAULT NULL COMMENT '新鲜重量',
  359. `dryweight` decimal(20,2) DEFAULT NULL COMMENT '烘干重量',
  360. `thoweight` decimal(20,0) DEFAULT NULL COMMENT '理论干物质',
  361. `actweight` decimal(20,0) DEFAULT NULL COMMENT '实际干物质',
  362. `barid` bigint(20) DEFAULT NULL COMMENT '栏舍id',
  363. `changeTime` datetime DEFAULT NULL COMMENT '操作时间',
  364. `pastureid` bigint(20) DEFAULT NULL COMMENT '牧场id',
  365. PRIMARY KEY (`id`) USING BTREE
  366. ) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8mb3;
  367. CREATE TABLE `log` (
  368. `id` int(11) NOT NULL AUTO_INCREMENT,
  369. `method` varchar(255) DEFAULT NULL,
  370. `status` varchar(255) DEFAULT NULL,
  371. `data` longtext DEFAULT NULL,
  372. `date` datetime DEFAULT NULL,
  373. PRIMARY KEY (`id`)
  374. ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb3;
  375. CREATE TABLE `lpplandtl1history` (
  376. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '发料计划详情',
  377. `pastureid` bigint(20) NOT NULL,
  378. `lppid` bigint(20) DEFAULT NULL COMMENT '计划id',
  379. `barid` bigint(20) DEFAULT NULL COMMENT '栏舍id',
  380. `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  381. `fpdid` bigint(20) DEFAULT NULL COMMENT '栏舍配方子id',
  382. `fttype` tinyint(4) DEFAULT 1 COMMENT '配方类型(1饲喂,0补料)',
  383. `lweight` decimal(10,2) unsigned DEFAULT NULL COMMENT '重量',
  384. `sort` int(11) DEFAULT 0 COMMENT '顺序',
  385. `tmrid` bigint(20) DEFAULT NULL COMMENT '撒料车id',
  386. `tmrname` varchar(50) DEFAULT NULL COMMENT '撒料车名称',
  387. `background` varchar(50) DEFAULT NULL COMMENT '颜色',
  388. `cowcount` int(11) DEFAULT NULL COMMENT '牛头数',
  389. `ccountradio` decimal(38,2) DEFAULT NULL COMMENT '牛头系数',
  390. `lweighthis` decimal(10,2) DEFAULT NULL,
  391. `createdate` datetime DEFAULT NULL,
  392. `userId` varchar(30) DEFAULT NULL COMMENT '修改用户',
  393. PRIMARY KEY (`id`,`pastureid`) USING BTREE,
  394. KEY `fpdid` (`fpdid`) USING BTREE,
  395. KEY `lppid` (`lppid`) USING BTREE
  396. ) ENGINE=InnoDB AUTO_INCREMENT=3932719861084108929 DEFAULT CHARSET=utf8mb3;
  397. CREATE TABLE `pennsieve_history` (
  398. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  399. `barname` varchar(50) DEFAULT NULL COMMENT '栏舍名称',
  400. `times` varchar(50) DEFAULT NULL COMMENT '班次',
  401. `onerate` decimal(20,2) DEFAULT NULL COMMENT '第一层比例',
  402. `oneweight` decimal(20,2) DEFAULT NULL COMMENT '第一层重量',
  403. `tworate` decimal(20,2) DEFAULT NULL COMMENT '第二层比列',
  404. `twoweight` decimal(20,2) DEFAULT NULL COMMENT '第二层重量',
  405. `threerate` decimal(20,2) DEFAULT NULL COMMENT '第三层比列',
  406. `threeweight` decimal(20,2) DEFAULT NULL COMMENT '第三层重量',
  407. `fourrate` decimal(20,2) DEFAULT NULL COMMENT '第四层比列',
  408. `fourweight` decimal(20,2) DEFAULT NULL COMMENT '第四层重量',
  409. `operatetime` datetime DEFAULT NULL COMMENT '操作时间',
  410. `barid` bigint(20) DEFAULT NULL COMMENT '栏舍id',
  411. `pastureid` bigint(20) DEFAULT NULL COMMENT '牧场id',
  412. `species` varchar(50) DEFAULT NULL COMMENT '种类',
  413. PRIMARY KEY (`id`) USING BTREE
  414. ) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb3;
  415. CREATE TABLE `pushing` (
  416. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  417. `pastureid` bigint(20) NOT NULL,
  418. `barid` bigint(20) DEFAULT NULL,
  419. `barname` varchar(50) DEFAULT NULL,
  420. `tmrid` bigint(20) DEFAULT NULL,
  421. `tmrname` varchar(50) DEFAULT NULL,
  422. `tmrcode` varchar(50) DEFAULT NULL,
  423. `allowableerror` int(5) DEFAULT NULL COMMENT '误差时间',
  424. `enable` tinyint(1) DEFAULT NULL,
  425. PRIMARY KEY (`id`,`pastureid`) USING BTREE,
  426. UNIQUE KEY `pastureid` (`pastureid`,`barid`) USING BTREE,
  427. KEY `id` (`id`) USING BTREE
  428. ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COMMENT='推料计划';
  429. CREATE TABLE `pushing_history` (
  430. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  431. `pastureid` bigint(20) NOT NULL,
  432. `barid` bigint(20) DEFAULT NULL,
  433. `barname` varchar(50) DEFAULT NULL,
  434. `tmrid` bigint(20) DEFAULT NULL,
  435. `tmrname` varchar(50) DEFAULT NULL,
  436. `tmrcode` varchar(50) DEFAULT NULL,
  437. `allowableerror` int(5) DEFAULT NULL COMMENT '误差时间',
  438. `tisms` varchar(100) DEFAULT NULL,
  439. `createTime` datetime DEFAULT NULL COMMENT '创建时间',
  440. PRIMARY KEY (`id`,`pastureid`) USING BTREE,
  441. KEY `createTime` (`createTime`) USING BTREE
  442. ) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8mb4 COMMENT='推料计划历史记录';
  443. CREATE TABLE `pushingdetail` (
  444. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  445. `pastureid` bigint(20) NOT NULL,
  446. `date` time DEFAULT NULL,
  447. `pushingid` bigint(20) NOT NULL,
  448. PRIMARY KEY (`id`,`pastureid`) USING BTREE,
  449. KEY `pushingid` (`pushingid`) USING BTREE,
  450. CONSTRAINT `pushingdetail_ibfk_1` FOREIGN KEY (`pushingid`) REFERENCES `pushing` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  451. ) ENGINE=InnoDB AUTO_INCREMENT=133 DEFAULT CHARSET=utf8mb4 COMMENT='推料计划详情';
  452. CREATE TABLE `remainplanrecord` (
  453. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  454. `pastureid` bigint(20) DEFAULT NULL,
  455. `eqname` varchar(50) DEFAULT NULL COMMENT '设备名称',
  456. `eqcode` varchar(50) DEFAULT NULL COMMENT '设备编码',
  457. `tclassid` int(11) DEFAULT NULL COMMENT '设备类型',
  458. `tclassname` varchar(50) DEFAULT NULL,
  459. `barid` bigint(20) DEFAULT NULL COMMENT '栏舍',
  460. `barname` varchar(50) DEFAULT NULL,
  461. `createtime` datetime DEFAULT NULL COMMENT '收集时间',
  462. `weight` decimal(38,2) DEFAULT NULL COMMENT '重量',
  463. `beginweight` decimal(38,2) DEFAULT NULL COMMENT '开始重量',
  464. `endweight` decimal(38,2) DEFAULT NULL COMMENT '结束重量',
  465. `driver` varchar(30) DEFAULT NULL COMMENT '司机',
  466. PRIMARY KEY (`id`)
  467. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3;
  468. CREATE TABLE `remind` (
  469. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  470. `message` varchar(100) DEFAULT NULL,
  471. `trigger` varchar(100) DEFAULT NULL COMMENT '触发',
  472. `pastureid` int(11) NOT NULL,
  473. `user` longtext NOT NULL,
  474. `function` varchar(100) DEFAULT NULL,
  475. `service_id` int(3) DEFAULT NULL COMMENT '返回得类型id',
  476. PRIMARY KEY (`id`,`pastureid`) USING BTREE
  477. ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4;
  478. CREATE TABLE `resetplan` (
  479. `id` bigint(20) NOT NULL,
  480. `sort` int(11) NOT NULL DEFAULT 0,
  481. `status` tinyint(1) NOT NULL DEFAULT 0,
  482. `mydate` datetime NOT NULL,
  483. `plansort` int(11) DEFAULT 0,
  484. `lastsort` int(11) DEFAULT 0,
  485. `lastweight` decimal(12,4) DEFAULT NULL,
  486. `weight` decimal(12,4) DEFAULT 0.0000,
  487. `datacaptureno` int(11) DEFAULT NULL,
  488. PRIMARY KEY (`id`),
  489. UNIQUE KEY `id` (`id`)
  490. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
  491. CREATE TABLE `saplog` (
  492. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  493. `pastureId` varchar(20) DEFAULT NULL,
  494. `request` longtext DEFAULT NULL,
  495. `response` longtext DEFAULT NULL,
  496. `status` varchar(20) DEFAULT NULL,
  497. `msgtext` varchar(255) DEFAULT NULL,
  498. `url` varchar(255) DEFAULT NULL,
  499. `createTime` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  500. `msgtype` int(1) DEFAULT NULL COMMENT '0饲喂 1剩料 2原料 3栏舍 4配方 5栏舍牛头数 6库存',
  501. `dataDate` varchar(20) DEFAULT NULL COMMENT '数据日期',
  502. PRIMARY KEY (`id`)
  503. ) ENGINE=InnoDB AUTO_INCREMENT=2526 DEFAULT CHARSET=utf8mb3;
  504. CREATE TABLE `scheduled` (
  505. `id` int(11) NOT NULL AUTO_INCREMENT,
  506. `sname` varchar(50) DEFAULT NULL COMMENT '任务名称',
  507. `action` int(11) DEFAULT NULL COMMENT '触发条件 0 上传 1 下载',
  508. `childid` int(11) DEFAULT NULL COMMENT '上传任务表id',
  509. `times` varchar(5) DEFAULT '0' COMMENT '触发周期 0 每车次结束 1 每班次结束 2 每天计划完成后',
  510. `enable` varchar(5) DEFAULT '0' COMMENT '自动同步启用状态 0启用 1关闭',
  511. PRIMARY KEY (`id`) USING BTREE
  512. ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COMMENT='定时任务';
  513. CREATE TABLE `scheduled_down` (
  514. `id` int(11) NOT NULL AUTO_INCREMENT,
  515. `datatype` int(11) DEFAULT NULL COMMENT '数据类型(饲料、配方、栏舍.....)',
  516. `company` varchar(50) DEFAULT NULL COMMENT '公司',
  517. `addres` varchar(255) DEFAULT NULL COMMENT 'api地址',
  518. `adressparam` varchar(100) DEFAULT NULL COMMENT 'api的入参(待商议)',
  519. `targetdata` varchar(100) DEFAULT NULL COMMENT '解剖原数据获取目标数据',
  520. `manual` tinyint(1) DEFAULT 0,
  521. `methods` varchar(50) DEFAULT NULL,
  522. PRIMARY KEY (`id`) USING BTREE
  523. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='任务-下发数据';
  524. CREATE TABLE `scheduled_down_child` (
  525. `id` int(11) NOT NULL AUTO_INCREMENT,
  526. `parentid` int(11) DEFAULT NULL COMMENT 'scheduled_down表id',
  527. `fieldname` varchar(50) DEFAULT NULL COMMENT '字段名称',
  528. `checksql` varchar(100) DEFAULT NULL COMMENT '验证sql',
  529. `dosql` varchar(150) DEFAULT NULL COMMENT '执行sql',
  530. PRIMARY KEY (`id`) USING BTREE
  531. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='任务-下发子表';
  532. CREATE TABLE `scheduled_up` (
  533. `id` int(11) NOT NULL AUTO_INCREMENT,
  534. `company` varchar(50) DEFAULT NULL COMMENT '公司',
  535. `addres` varchar(50) DEFAULT NULL COMMENT 'api地址',
  536. `datatype` int(11) DEFAULT NULL COMMENT '数据类型(栏舍、配方、搅拌、发料...)',
  537. `package` text DEFAULT NULL COMMENT '数据的外层包裹',
  538. `datasql` text DEFAULT NULL COMMENT '执行sql',
  539. `automatic` tinyint(1) DEFAULT 0,
  540. `manual` tinyint(1) DEFAULT 0,
  541. `targetdata` varchar(255) DEFAULT NULL,
  542. PRIMARY KEY (`id`) USING BTREE
  543. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='任务-上传数据';
  544. CREATE TABLE `surplus` (
  545. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  546. `pastureId` int(11) DEFAULT NULL,
  547. `surplus` varchar(50) DEFAULT NULL,
  548. `feedId` bigint(20) DEFAULT NULL,
  549. PRIMARY KEY (`id`),
  550. UNIQUE KEY `surplus` (`surplus`)
  551. ) ENGINE=InnoDB AUTO_INCREMENT=172 DEFAULT CHARSET=utf8mb3;
  552. CREATE TABLE `templetdry` (
  553. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  554. `templetId` varchar(100) DEFAULT NULL COMMENT '配方主键',
  555. `cdate` date DEFAULT NULL COMMENT '日期',
  556. `tdry` decimal(10,2) DEFAULT NULL COMMENT '干物质',
  557. `tprice` float DEFAULT 0 COMMENT '价格',
  558. PRIMARY KEY (`id`)
  559. ) ENGINE=InnoDB AUTO_INCREMENT=47088 DEFAULT CHARSET=utf8mb3 COMMENT='配方干物质';
  560. CREATE TABLE `tmr_equipment` (
  561. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  562. `tmrId` bigint(20) DEFAULT NULL COMMENT '设备id',
  563. `pastureId` bigint(20) DEFAULT NULL COMMENT '关联牧场',
  564. `date` time DEFAULT NULL COMMENT '时间',
  565. `remark` varchar(100) DEFAULT NULL COMMENT '备注',
  566. `enable` tinyint(4) DEFAULT NULL COMMENT '是否启用',
  567. `barId` varchar(200) DEFAULT NULL COMMENT '设备类型id',
  568. PRIMARY KEY (`id`) USING BTREE
  569. ) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8mb3;
  570. CREATE TABLE `tmr_equipment_date` (
  571. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  572. `tmrId` bigint(20) DEFAULT NULL COMMENT '设备id',
  573. `pastureId` bigint(20) DEFAULT NULL COMMENT '关联牧场',
  574. `date` time DEFAULT NULL COMMENT '时间',
  575. `remark` varchar(100) DEFAULT NULL COMMENT '备注',
  576. `enable` tinyint(4) DEFAULT NULL COMMENT '是否启用',
  577. `barId` varchar(200) DEFAULT NULL COMMENT '设备类型id',
  578. `plandate` date NOT NULL,
  579. `startdate` datetime DEFAULT NULL,
  580. `enddate` datetime DEFAULT NULL,
  581. `pid` bigint(20) DEFAULT NULL,
  582. PRIMARY KEY (`id`) USING BTREE,
  583. UNIQUE KEY `plandate` (`plandate`,`pid`) USING BTREE
  584. ) ENGINE=InnoDB AUTO_INCREMENT=286 DEFAULT CHARSET=utf8mb3;
  585. CREATE TABLE `tmr_equipment_muster` (
  586. `pid` int(11) DEFAULT NULL,
  587. `gptjson` longtext DEFAULT NULL
  588. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
  589. CREATE TABLE `tmr_gear` (
  590. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  591. `tmrId` int(11) NOT NULL,
  592. `gear` varchar(30) DEFAULT NULL COMMENT '档位',
  593. `rev` int(11) DEFAULT NULL COMMENT '转速/分钟',
  594. `volume` decimal(12,5) DEFAULT NULL COMMENT '每转体积',
  595. PRIMARY KEY (`id`)
  596. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
  597. ALTER TABLE `bar`
  598. ADD COLUMN `AUFNR` varchar(50) DEFAULT NULL COMMENT 'sap牛群订单行号',
  599. ADD COLUMN `class` varchar(50) DEFAULT NULL COMMENT '牛舍类型',
  600. ADD COLUMN `classcode` varchar(50) DEFAULT NULL COMMENT '牛舍类型编码',
  601. ADD COLUMN `cattle` varchar(50) DEFAULT NULL COMMENT '牛群',
  602. ADD COLUMN `cattlecode` varchar(50) DEFAULT NULL COMMENT '牛群编码',
  603. ADD COLUMN `sapCode` varchar(50) DEFAULT NULL,
  604. ADD COLUMN `udcode` varchar(50) DEFAULT NULL,
  605. ADD COLUMN `udname` varchar(50) DEFAULT NULL,
  606. ADD COLUMN `length` decimal(12,0) NOT NULL DEFAULT 0 COMMENT '栏舍长度',
  607. ADD COLUMN `pen` varchar(30) DEFAULT NULL COMMENT '圈舍';
  608. ALTER TABLE `barfeedremain`
  609. ADD COLUMN `dry` decimal(12,2) DEFAULT NULL COMMENT '干物质';
  610. ALTER TABLE `downloadedplan`
  611. ADD COLUMN `oldtmrid` bigint(20) DEFAULT NULL,
  612. ADD COLUMN `driverId` bigint(20) DEFAULT NULL COMMENT '驾驶员',
  613. ADD COLUMN `artificial` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1 为手动完成';
  614. ALTER TABLE `downloadedplan`
  615. ADD COLUMN `oldtmrid` bigint(20) DEFAULT NULL,
  616. ADD COLUMN `driverId` bigint(20) DEFAULT NULL COMMENT '驾驶员',
  617. ADD COLUMN `artificial` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1 为手动完成';
  618. ALTER TABLE `downloadplandtl1`
  619. ADD COLUMN `deviation` int(11) DEFAULT NULL COMMENT '搅拌延时值允许延时偏差',
  620. ADD COLUMN `xxwFeedCode` varchar(100) DEFAULT NULL;
  621. ALTER TABLE `downloadplandtl1_exec`
  622. ADD COLUMN `deviation` int(11) DEFAULT NULL COMMENT '搅拌延时值允许延时偏差',
  623. ADD COLUMN `xxwFeedCode` varchar(100) DEFAULT NULL,
  624. ADD COLUMN `surplus` decimal(10,2) DEFAULT NULL COMMENT '剩料重量';
  625. ALTER TABLE `downloadplandtl2`
  626. ADD COLUMN `xxwTempletCode` varchar(100) DEFAULT NULL,
  627. ADD COLUMN `xxwBarCode` varchar(100) DEFAULT NULL;
  628. ALTER TABLE `feedclass`
  629. ADD COLUMN `group_id` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '集团端id';
  630. ALTER TABLE feedtemplet
  631. ADD COLUMN `cattle` varchar(30) DEFAULT NULL COMMENT '牛群类别',
  632. ADD COLUMN `volume` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积',
  633. ADD COLUMN `is_modify` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '是否可修改 0 无效 1 是 2 否',
  634. ADD COLUMN `group_data_id` bigint(11) unsigned NOT NULL DEFAULT 0 COMMENT '集团端数据ID',
  635. ADD COLUMN `group_version` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '集团端版本号',
  636. ADD COLUMN `autozone` int(11) NOT NULL DEFAULT 0,
  637. ADD COLUMN `surplus` int(11) DEFAULT NULL COMMENT '剩料配置';
  638. ALTER TABLE fpdetail
  639. ADD COLUMN
  640. `supplement` decimal(38,2) DEFAULT 0.00;
  641. ALTER TABLE ftdetail
  642. ADD COLUMN `deviation` int(11) DEFAULT NULL COMMENT '搅拌延时值允许延时偏差',
  643. ADD COLUMN `is_modify` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '是否可修改 0 无效 1 是 2 否',
  644. ADD COLUMN `is_show` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '是否显示 0 无效 1 显示 2 隐藏',
  645. ADD COLUMN `shutdown` tinyint(1) NOT NULL DEFAULT 0 COMMENT '停机时间 秒',
  646. ADD COLUMN `is_surplus` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0 不是剩料';
  647. ALTER TABLE ftdry
  648. ADD COLUMN `excess` tinyint(1) DEFAULT 0 COMMENT '是否剩料';
  649. ALTER TABLE tmr
  650. ADD COLUMN `lastinorout` int(1) DEFAULT 0,
  651. ADD COLUMN `gps` varchar(50) DEFAULT NULL,
  652. ADD COLUMN `volume` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '容积',
  653. ADD COLUMN `speed` decimal(12,0) NOT NULL DEFAULT 0 COMMENT '速度',
  654. ADD COLUMN `shutdown` tinyint(1) DEFAULT 0 COMMENT '停机时间 秒',
  655. ADD COLUMN `appoint` int(11) DEFAULT NULL COMMENT '撒料车指定搅拌车';
  656. ALTER TABLE pasture
  657. ADD COLUMN `werks` varchar(255) DEFAULT NULL;