1.sql 724 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. /*
  2. SQLyog Ultimate v12.3.1 (64 bit)
  3. MySQL - 5.7.25 : Database - tmrgo
  4. *********************************************************************
  5. */
  6. /*!40101 SET NAMES utf8 */;
  7. /*!40101 SET SQL_MODE=''*/;
  8. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  9. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  10. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  11. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  12. CREATE DATABASE /*!32312 IF NOT EXISTS*/`tmrgo` /*!40100 DEFAULT CHARACTER SET utf8 */;
  13. USE `test`;
  14. /*Table structure for table `apisql` */
  15. DROP TABLE IF EXISTS `apisql`;
  16. CREATE TABLE `apisql` (
  17. `id` int(11) NOT NULL AUTO_INCREMENT,
  18. `menuid` int(11) DEFAULT NULL,
  19. `sqlstr` text,
  20. `params` varchar(1000) DEFAULT NULL,
  21. `sqlname` varchar(50) DEFAULT NULL,
  22. `method` varchar(50) DEFAULT NULL COMMENT '报表、列表、操作',
  23. `name` varchar(255) DEFAULT NULL COMMENT '注释',
  24. `remark` varchar(255) DEFAULT NULL,
  25. `request_body` varchar(1000) DEFAULT '',
  26. `return_body` varchar(1000) DEFAULT '',
  27. `sort` int(11) DEFAULT '0',
  28. `enable` tinyint(4) DEFAULT '1',
  29. `created_on` int(11) DEFAULT '0',
  30. `modified_on` int(11) DEFAULT '0',
  31. `deleted_on` int(11) DEFAULT '0',
  32. PRIMARY KEY (`id`),
  33. KEY `sqlname` (`sqlname`)
  34. ) ENGINE=InnoDB AUTO_INCREMENT=1884 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  35. /*Data for the table `apisql` */
  36. insert into `apisql`(`id`,`menuid`,`sqlstr`,`params`,`sqlname`,`method`,`name`,`remark`,`request_body`,`return_body`,`sort`,`enable`,`created_on`,`modified_on`,`deleted_on`) values
  37. (8,39,'SELECT\n \'品牌\' AS brandName,\n \'设备名称\' AS eqCode,\n \'型号\' AS specification,\n \'mingc\' AS eqName,\n \'饲养处\' AS deptName,\n \'宝鸡\' AS pastureName,\n \'闲置\' AS `status`,\n \'05.02.01.03\' AS assetCode,\n \'张三\' AS employeName,\n 15531 AS id\nUNION\n\nSELECT\n \'品牌1\' AS brandName,\n \'设备名称\' AS eqCode,\n \'型号\' AS specification,\n \'mingc\' AS eqName,\n \'饲养处\' AS deptName,\n \'宝鸡\' AS pastureName,\n \'闲置\' AS `status`,\n \'02.02.01.03\' AS assetCode,\n \'张三w\' AS employeName,\n 15531 AS id','','getAssetList','GetDataByName','资产列表','tmrgo','{\"name\":\"getAssetList\",\"page\":1,\"offset\":1,\"pagecount\":10,\"returntype\":\"Map\",\"parammaps\":{\"eqCode\":\"08.ZZJ011\",\"pastureId\":\"17\"}}: ','',1,1,0,0,0),
  38. (339,22,'SELECT DISTINCT\n menu.id,\n menu.`path`,\n menu.`redirect`,\n menu.`component`,\n menu.`title`,\n menu.`icon`,\n menu.`parentId`,\n menu.`name`,\n ifnull(role_menu.seebutton,0) seebutton,\n ifnull(role_menu.editbutton,0) editbutton,\n (SELECT\n COUNT(m.id)\n FROM\n menu m\n WHERE m.parentid = menu.id\n AND m.`enable` > 0) haschildren,\nmenu.sort\nFROM\n `user`\n \n JOIN `role_menu` ON role_menu.`pastureid` = user.`pastureid` AND role_menu.`role_id` = user.`roleid`\n JOIN `menu` ON menu.`id` = role_menu.`menu_id`\n JOIN `menu_pasture` ON menu_pasture.`pastureid` = user.`pastureid` AND user.`isgroups` = menu_pasture.isgroups AND \nmenu_pasture.`id` = menu.`id`\nWHERE user.`username` = ?\n AND menu.`menutype` = \'menu\'\n AND menu.enable = 1\nAND IF(user.`isgroups`=1,menu.isg>=1,\'\'=\'\')\n\nUNION \n\nSELECT TRIM(d.id) id,CONCAT(\'Addboard~\',TRIM(d.id),\'~3\') AS path,\'\',\'customboard/addboard/index\',d.dname,\'自定义报表\',249,d.dname,1,0,0,(@i:=@i+1) i\nFROM (SELECT @i:=100) AS i, `dashboard` d\nINNER JOIN `dashboard_role` dr\nON d.id =dr.did and d.pastureid = dr.pastureid \nINNER JOIN role r\nON r.id =dr.roleid and d.pastureid = r.pastureid \nINNER JOIN `user` u\nON u.roleid = r.id and d.pastureid = u.pastureid \n\nWHERE u.username = ? AND d.reportenable=1\n \nORDER BY sort','jwt_username,jwt_username','getmenu','GetDataByName','获取菜单','tmrgo','{\"name\":\"getmenu\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"-1\",\"drivername\":\"李五\",\"enable\":1}}','\"Error 1054: Unknown column \'menu.id\' in \'field list\'\"',0,1,0,0,0),
  39. (343,27,'UPDATE apisql SET sqlstr = ? , sqlname = ?, params=?, menuid= ?,remark=?,sort=?,`enable`=?,`method`=?,`name`=?,`request_body`=?,`return_body`=? WHERE id = ?','','updateapisql','PostDataByName','更新接口','tmrgo','','',0,1,0,0,0),
  40. (344,27,'delete from apisql where id = ?','','deleteapisql','GetDataByName','删除接口','tmrgo','','',0,1,0,0,0),
  41. (345,27,'INSERT INTO apisql(sqlstr,sqlname,params,menuid,remark,sort,`enable`,`method`,`name`,`request_body`,`return_body`) VALUES(?,?,?,?,?,?,?,?,?,?,?)','','createapisql','GetDataByName','新建接口','tmrgo','','',1,1,0,0,0),
  42. (346,22,'SELECT * FROM (SELECT -1 AS id,\'菜单\' title ,-2 parentid FROM menu WHERE \'-2\' = ? LIMIT 1) temp\nUNION ALL\nSELECT * FROM (SELECT id,title,parentid FROM menu WHERE parentid=? AND menutype=\'menu\' and enable=1 ORDER BY sort) temp1','id, id','getMenuListBRecu','query','菜单维护中按钮上级菜单','tmrgo','','',0,1,0,0,0),
  43. (347,22,'SELECT id,name,menutype,path,method,icon,redirect,title,parentid,component,sort,enable FROM menu WHERE (menutype=\'menu\' or menutype=\'button\') order by sort','','getMenuandButtonRecu','GetDataByName','菜单首页列表','tmrgo','','',0,1,0,0,0),
  44. (348,22,'insert into menu(parentid,name,title,path,component,icon,redirect,sort,menutype,enable,method) values(?,?,?,?,?,?,?,?,?,?,\'post\')\r\n','','createMenu','query','创建菜单','tmrgo','','',0,1,0,0,0),
  45. (349,22,'delete from menu where id=?','','deleteMenu','query','删除菜单','tmrgo','','',0,1,0,0,0),
  46. (350,22,'update menu\nset parentid=?,name=?,title=?,\npath=?,component=?,icon=?,redirect=?,sort=?,menutype=? ,enable=? \nwhere id =?','','updateMenu','query','更新菜单','tmrgo','','',0,1,0,0,0),
  47. (352,370,'insert into user(id,pastureid,password,username,empname,phone,createmp,enable,roleid,rolename,isgroups) values(?,?,\'e10adc3949ba59abbe56e057f20f883e\',?,?,?,?,?,?,?,if(?=\'\',0,?))','snowid,pastureid,username,empname,phone,createmp,enable,roleid,rolename,isgroups,isgroups','createUser','PostDataByName','用户新增','tmrgo','{\"name\":\"createUser\",\"parammaps\":{\"username\":\"14522\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":0}}','{\"LastInsertId\":3020949660526707700,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  48. (353,370,'update user set username=? ,empname=?,phone=?,createmp=?,enable=?,roleid=?, rolename=? where pastureid=? and id=?','username,empname,phone,createmp,enable,roleid,rolename,pastureid,id','updateUser','PostDataByName','修改用户','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  49. (354,370,'update user set isdelete=1 where pastureid=? and id = ? ','pastureid,id','deleteUser1','PostDataByName','删除用户','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  50. (355,369,'SELECT trim(id) id,role.name rolename,enable,remark FROM role \nwhere pastureid=? and deleted_on=0 and enable=1\nORDER BY id desc','pastureid','getRoleAll','GetDataByName','角色首页列表','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  51. (356,369,'insert into role(id,pastureid,name,enable,remark,createmp) values(?,?,?,?,?,?)','snowid,pastureid,rolename,enable,remark,createmp','createRole','PostDataByName','创建角色','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  52. (357,369,'update role set `name`=?,remark=?,enable=? where pastureid=? and `id` =? ','rolename,remark,enable,pastureid,id','updateRole','PostDataByName','更新角色','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  53. (358,369,'delete from role where pastureid=? and id = ? ','pastureid,id','deleteRole','PostDataByName','删除角色','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  54. (383,22,'SELECT a.id,a.title,a.parentid,(SELECT COUNT(m.id) FROM menu m WHERE m.parentid=a.id AND m.`enable`>0) haschildren FROM menu a WHERE a.menutype=\'menu\' AND a.enable=1 ORDER BY a.sort','','getMenuRecu','query','getMenuRecu','tmrgo','','',0,1,0,0,0),
  55. (384,24,'select id,label,value,orderby,enable from dictlist where pid = ? or ? = \'\'','','getDictList','query','字典列表','tmrgo','','',0,1,0,0,0),
  56. (385,24,'select id,name,pid,orderby,enable from dict where pid=? ','','getDictclass','query','获取字典分类','tmrgo','','',0,1,0,0,0),
  57. (386,24,'insert into dictlist(label,value,orderby,enable,pid) values(?,?,?,?,?)','','insertDictList','query','创建字典列表','tmrgo','','',0,1,0,0,0),
  58. (387,24,'update dictlist set label=?,value=?,orderby=?,enable=?,pid=? where id =?','','updateDictList','query','修改字典列表','tmrgo','','',0,1,0,0,0),
  59. (388,24,'delete from dictlist where id =?','','deleteDictList','query','删除字典列表','tmrgo','','',0,1,0,0,0),
  60. (389,22,'SELECT * FROM (SELECT -1 AS id,\'菜单\' title ,-2 parentid FROM DUAL) temp \nUNION ALL \nSELECT * FROM (SELECT id,title,parentid FROM menu WHERE menutype=\'menu\' AND ENABLE=1 ORDER BY sort) temp1\n','id, id','getMenuListRecu','query','菜单维护中上级菜单','tmrgo','','',0,1,0,0,0),
  61. (390,334,'INSERT INTO apisql(\nmenuid,sqlstr,params,sqlname,method,name,remark,request_body,return_body,sort,enable,created_on,modified_on,deleted_on\n)\nSELECT menuid,sqlstr,params,concat(sqlname,\'V2\'),method,name,remark,request_body,return_body,sort,enable,created_on,modified_on,deleted_on FROM apisql WHERE id = ?','ftid,pastureid','copySQL','PostDataByName','复制SQL','tmrgo','','',0,1,0,0,0),
  62. (391,24,'SELECT dictlist.id,dictlist.label,dictlist.value FROM dictlist JOIN `dict` ON `dict`.`id`=dictlist.`pid` WHERE `dict`.`name`=? AND `dict`.ENABLE=1 and dictlist .enable=1 ORDER BY `dictlist`.orderby ','dictname','getDictByName','query','字典','tmrgo','','',2,1,0,0,0),
  63. (673,370,'SELECT m.path,m.`id`, \n IFNULL(rm.seebutton,0) seebutton,\n IFNULL(rm.editbutton,0) editbutton\n FROM menu m \nLEFT JOIN role_menu rm \nON rm.`menu_id` = m.`id` AND rm.pastureid = ?\nLEFT JOIN role r \nON r.`id` = rm.`role_id` AND r.pastureid = ?\nLEFT JOIN `user` u \nON u.`roleid` = r.`id` AND u.pastureid = ?\nWHERE u.`username`= ? ','pastureid,pastureid,pastureid,username','getUserPCButtons','GetDataByName','页面按钮权限-PC端','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  64. (674,31,'update user set `password` = MD5(?) WHERE username = ?','password,username','updatePwd','query','用户修改密码','tmrgo','','',0,1,0,0,0),
  65. (675,370,'SELECT\n trim( `user`.id) id,\n trim(user.pastureid) pastureid,\n `user`.username,\n user.`empname`,\n user.sort,\n user.enable,\n r.`name` rolename,\n trim(user.roleid) roleid,\n DATE_FORMAT(user.`createdtime`, \'%Y-%m-%d\')createdtime,\n user.`createmp`,\n user.phone\nFROM\n `user`\n LEFT JOIN role r\n ON user.roleid = r.id and r.pastureid=?\nWHERE user.pastureid = ? and user.isdelete=0 \n AND (`user`.username LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (user.`empname` LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (user.`enable` =? OR ? = \'\')\nAND ( (DATE_FORMAT(user.`createdtime`, \'%Y-%m-%d\') >=? and DATE_FORMAT(user.`createdtime`, \'%Y-%m-%d\') <=? ) or ? = \'\')\nORDER BY user.id desc','pastureid,pastureid,empCode,empCode,empname,empname,enable,enable,startTime,stopTime,startTime','getuserallL','GetDataByName','用户','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  66. (676,369,'SELECT trim(id) id,trim(role.pastureid) pastureid,role.name rolename,enable,remark ,DATE_FORMAT(`createdtime`, \'%Y-%m-%d\')createdtime,createmp FROM role \nwhere pastureid =? and deleted_on=0\n and (role.name LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n and (createmp LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nand (enable=? OR ? = \'\')\nAND ( (DATE_FORMAT(createdtime, \'%Y-%m-%d\') >=? and DATE_FORMAT(createdtime, \'%Y-%m-%d\') <=? ) or ? = \'\')\nAND (isgroups=? OR ?=\'\')\nORDER BY id desc','pastureid,rolename,rolename,createmp ,createmp ,enable,enable,startTime,stopTime,startTime,isgroups,isgroups','getRoleList','GetDataByName','角色首页列表','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  67. (677,369,'SELECT IF((SELECT COUNT(*) \nFROM `user` \nWHERE pastureid=? AND roleid =?)=0,\'\',\'该角色已分配用户\') vmsg','pastureid,roleid','checkroleuser','GetDataByName','检查角色删除','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  68. (678,349,'INSERT INTO sysopt( id,pasturid,inforname,inforvalue )\n VALUES (?,?,?,? )ON DUPLICATE KEY UPDATE inforvalue=?','snowid,pasturid,inforname,inforvalue,inforvalue','insertsysopt(未用)','PostDataByName','默认参数','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  69. (679,369,'SELECT trim(m.id)id,m.id menu_id,m.`name`,ifnull(rm.`seebutton`,0) seebutton,ifnull(rm.`editbutton`,0)editbutton,trim(m.`parentId`) pid,(SELECT COUNT(id) childrens FROM menu where parentId=m.id) childrens\nFROM menu_pasture mp\njoin menu m\non m.id = mp.id AND mp.pastureid=? AND (mp.isgroups=? or ?=\'\')\nLEFT JOIN role_menu rm\nON m.`id`= rm.`menu_id` AND rm.role_id = ? AND rm.pastureid=? and m.enable=1\nwhere if(?=1,m.isg =1,\'\'=\'\' )','pastureid,isgroups,isgroups,roleid,pastureid,isgroups','getMenuByRole','GetDataByName','角色菜单','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  70. (680,369,'INSERT INTO role_menu(id, pastureid, role_id, menu_id,seebutton,editbutton) VALUES (?,?,?,?,?,?) ON DUPLICATE KEY UPDATE seebutton=?,editbutton=?','snowid,pastureid,roleid,menuid,seebutton,editbutton,seebutton,editbutton','insertRolemenu','PostDataByName','角色菜单','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  71. (681,370,'delete from user where pastureid=? and id = ? ','pastureid,id','deleteUser','PostDataByName','删除用户','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  72. (682,22,'SELECT id,name,menutype,path,method,icon,redirect,title,parentid,component,sort,enable FROM menu WHERE (menutype=\'menu\' or menutype=\'button\') AND parentid=? order by sort','','getMenuandButtonRecuRule','GetRecuDataByName','菜单首页列表-角色管理','tmrgo','','',0,1,0,0,0),
  73. (1256,368,'UPDATE `pasture` \nSET emp =?,address =?,phone =?\nWHERE pastureid = ? ','contact,address,phone,pastureid','updatepastureinfo','PostDataByName','更新牧场信息','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  74. (1257,367,'SELECT trim(g.pastureid) id,trim(g.pastureid)pastureid,pasture_name pasturename , pasture_code pasturecode,emp,phone,\n(select pasture_name from pasture where pastureid= g.groupsid) groupsnames\n FROM\npasture g\njoin groups_pasture gp\non gp.pastureid = g.pastureid\n WHERE gp.groupsid=? and g.isgroups = 0 \nand (g.pasture_name LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\') \n\nunion\n\nSELECT trim(g.pastureid) id,trim(g.pastureid)pastureid,pasture_name pasturename , pasture_code pasturecode,emp,phone,\n(select pasture_name from pasture where pastureid= g.groupsid) groupsnames\n FROM\npasture g\n WHERE g.groupsid=? and g.isgroups = 0 \nand (g.pasture_name LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\') ','pastureid,pasturename,pasturename,pastureid,pasturename,pasturename','getPastureListJT','GetDataByName','牧场列表','tmrgo','{\"name\":\"getPastureListJT\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  75. (1258,342,'SELECT\nd.`drivercode`,\nd.`drivername`,\nd.`enable`,\nTRIM(d.`id`) id,\nTRIM(d.`pastureid`)pastureid\nFROM\n `driver` d\nWHERE d.pastureid = ? \n AND (d.`drivername` LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (d.`drivercode` LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (d.`enable` =? OR ? = \'\')\nORDER BY d.id DESC','pastureid,drivername,drivername,drivercode,drivercode,enable,enable','getDriverList','GetDataByName','驾驶员列表','tmrgo','{\"name\":\"getDriverList\",\"parammaps\":{\"pastureId\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"drivercode\":\"00028\",\"drivername\":\"麻子\",\"enable\":1,\"id\":\"3025176271438481111\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  76. (1259,342,'INSERT INTO driver(id, pastureid, drivercode, drivername,enable,remark) VALUES (?,?,?,?,?,?) ','snowid,pastureid,drivercode, drivername,enable,remark','insertDriver','PostDataByName','新增驾驶员','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  77. (1260,342,'update driver set drivercode=? ,drivername=?,enable=? where pastureid=? and id=?','drivercode,drivername,enable,pastureid,id','updateDriver','PostDataByName','修改驾驶员','tmrgo','{\"name\":\"updateDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  78. (1261,342,'delete from driver where pastureid=? and id = ? ','pastureid,id','deleteDriver','PostDataByName','删除驾驶员','tmrgo','{\"name\":\"deleteDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  79. (1262,343,'INSERT INTO tmr(id,pastureid,eqcode,tname,datacaptureno,tclassid,tclassname,maxstirfeed,\n`enable`,remark,ttype,tcolor,imei,datainterface,autozone,autosecond,autosecondname) VALUES (?,?,?,?,?,?,?,?,?,?,if(?<>0,1,0),?,if(?=\'\',null,?),?,if(?=\'\',null,?),if(?=\'\',null,?),?) ','snowid,pastureid,eqcode,tname,datacaptureno,tclassid,tclassname,maxstirfeed,enable,remark,tclassid,tcolor,imei,imei,datainterface,autozone,autozone,autosecond,autosecond,autosecondname','insertTMR','PostDataByName','新增tmr','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  80. (1263,343,'update tmr set eqcode=? ,tname=? ,datacaptureno=?,tclassid=?,tclassname=? ,maxstirfeed=?,enable=?,remark=? ,tcolor = ?\n,imei=if(?=\'\',null,?),datainterface=?,autozone=if(?=\'\',null,?),autosecond=if(?=\'\',null,?),autosecondname=?\nwhere pastureid=? and id=?','eqcode,tname,datacaptureno,tclassid,tclassname,maxstirfeed,enable,remark,tcolor,imei,imei,datainterface,autozone,autozone,autosecond,autosecond,autosecondname,pastureid,id','updateTMR','PostDataByName','修改tmr','tmrgo','{\"name\":\"updateDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  81. (1264,343,'delete from tmr where pastureid=? and id = ? ','pastureid,id','deleteTMR','PostDataByName','删除tmr','tmrgo','{\"name\":\"deleteDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  82. (1265,343,'SELECT\n1 islock,\neqcode,\ntname,\ndatacaptureno,\ntrim(tclassid) tclassid,\ntclassname,\nmaxstirfeed,\nremark,\n`enable`,\nTRIM(id) id,\nTRIM(pastureid)pastureid,\ntcolor,imei,datainterface,autozone,autosecond,autosecondname\nFROM\n tmr\nWHERE pastureid = ? and if(?=0,tclassid in (0,6,7),tclassid in (1,2,3,4))\n AND (tmr.`eqcode` LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (tmr.`tclassname` =? OR ? = \'\')\nAND (tmr.`tname` =? OR ? = \'\')\n AND (tmr.`enable` =? OR ? = \'\')\nORDER BY tmr.id DESC','pastureid,eqtype,eqcode,eqcode,classname,classname,tname,tname,enable,enable','getTMRList','GetDataByName','tmr列表','tmrgo','{\"name\":\"getTMRList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":0,\"enable\":1,\"eqcode\":\"1\",\"id\":\"1\",\"maxstirfeed\":4,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"3\",\"tclassname\":\"3\",\"tname\":\"2\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  83. (1266,345,'INSERT INTO cowclass(id,pastureid,classcode,classname,parentid,parentname,`enable`) VALUES (?,?,?,?,?,?,?) ','snowid,pastureid,classcode,classname,parentid,parentname,enable','insertCowclass','PostDataByName','新增牲畜类别','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  84. (1267,345,'update cowclass set classcode=? ,classname=?,parentid=? ,parentname=?,enable=?\nwhere pastureid=? and id=?','classcode,classname,parentid,parentname,enable,pastureid,id','updateCowclass','PostDataByName','修改牲畜类别','tmrgo','{\"name\":\"updateCowclass\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  85. (1268,345,'delete from cowclass where pastureid=? and id = ? ','pastureid,id','deleteCowclass','PostDataByName','删除牲畜类别','tmrgo','{\"name\":\"deleteDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  86. (1269,345,'SELECT\nclasscode,\nclassname,\nsort,\nenable,\nparentid,\nparentname,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n cowclass\nWHERE pastureid = ? \n AND ( classname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (parentname = ? OR ? = \'\')\n AND (enable =? OR ? = \'\')\nORDER BY id DESC','pastureid,classname,classname,parentname ,parentname ,enable,enable','getCowclassList','GetDataByName','牲畜类别列表','tmrgo','{\"name\":\"getTMRList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":0,\"enable\":1,\"eqcode\":\"1\",\"id\":\"1\",\"maxstirfeed\":4,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"3\",\"tclassname\":\"3\",\"tname\":\"2\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  87. (1270,350,'SELECT\nbcode,bname,allowratio,autozone,autosecond,isstart,begintag,endtag,sort,enable,autosecondname,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n bar\nWHERE pastureid = ? \n AND ( bname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND ( bcode LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (allowratio = ? OR ? = \'\')\n AND (enable =? OR ? = \'\')\nAND (autozone= ? OR ? = \'\')\nAND (autosecond = ? OR ? = \'\')\nORDER BY id DESC','pastureid,bname,bname,bcode ,bcode ,allowratio ,allowratio ,enable ,enable ,autozone,autozone,autosecond,autosecond ','getBarList','GetDataByName','栏舍列表','tmrgo','{\"name\":\"getTMRList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":0,\"enable\":1,\"eqcode\":\"1\",\"id\":\"1\",\"maxstirfeed\":4,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"3\",\"tclassname\":\"3\",\"tname\":\"2\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  88. (1271,350,'delete from bar where pastureid=? and id = ? ','pastureid,id','deleteBar','PostDataByName','删除栏舍','tmrgo','{\"name\":\"deleteDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  89. (1272,350,'update bar set bcode=? ,bname=?,allowratio=? ,autozone=?,autosecond=?,autosecondname=?,isstart=? ,enable=?\nwhere pastureid=? and id=?','bcode,bname,allowratio,autozone,autosecond,autosecondname,isstart,enable,pastureid,id','updateBar','PostDataByName','修改栏舍','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  90. (1273,350,'INSERT INTO bar(id,pastureid,bcode,bname,allowratio,autozone,autosecond,autosecondname,isstart,enable) VALUES (?,?,?,?,?,?,?,?,?,?) ','snowid,pastureid,bcode,bname,allowratio,autozone,autosecond,autosecondname,isstart,enable','insertBar','PostDataByName','新增栏舍','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  91. (1274,346,'SELECT\nfcname,fccode,enable,bigfeedclassid,bigfeedclassname,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n feedclass\nWHERE pastureid = ? \n AND ( fcname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND ( fccode LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (bigfeedclassname = ? OR ? = \'\')\n AND (enable =? OR ? = \'\')\nORDER BY id DESC','pastureid,fcname ,fcname ,fccode ,fccode ,bigfeedclassname ,bigfeedclassname ,enable ,enable','getFeedclassList','GetDataByName','饲料类别列表','tmrgo','{\"name\":\"getFeedclassList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bigfeedclassid\":1,\"bigfeedclassname\":\"精料\",\"enable\":1,\"fccode\":\"0851\",\"fcname\":\"饲料1\",\"id\":\"3025176271438480543\",\"pastureid\":\"3025176271438480383\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  92. (1275,346,'delete from feedclass where pastureid=? and id = ? ','pastureid,id','deleteFeedclass','PostDataByName','删除饲料类别','tmrgo','{\"name\":\"deleteDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  93. (1276,346,'update feedclass set fcname=? ,fccode=?,bigfeedclassid=? ,bigfeedclassname=?,enable=?\nwhere pastureid=? and id=?','fcname,fccode,bigfeedclassid,bigfeedclassname,enable,pastureid,id','updateFeedclass','PostDataByName','修改饲料类别','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  94. (1277,346,'INSERT INTO feedclass(id,pastureid,fcname,fccode,bigfeedclassid,bigfeedclassname,enable) VALUES (?,?,?,?,?,?,?) ','snowid,pastureid,fcname,fccode,bigfeedclassid,bigfeedclassname,enable','insertFeedclass','PostDataByName','新增饲料类别','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  95. (1278,347,'SELECT\nfn.feedcode,fn.fname,(concat(fc.bigfeedclassname,\'/\',fc.fcname))fclass,TRIM(fn.fclassid)fclassid,fn.allowratio,\nfn.printgroupid,fn.printgroup,fn.unitweight,fn.uprice,fn.autozone,fn.autosecond,fn.confirmstart,fn.trgaddress,fn.enable,\nfn.backup1,fn.backup2,fn.backup3,fn.autosecondname,fn.source, IF(fn.confirmstart=1,\'启用\',\'禁用\') confirmstartname,\nTRIM(fn.id) id,\nTRIM(fn.pastureid)pastureid,TRIM(smtmrid) smtmrid,smtmrname,\nfnr.dry,starch,\ncp,ca,p,n,fat,adf,ndf,ndip,ash,fpercent,iscu,fn.jmp\nFROM\n feed fn\n LEFT JOIN feednur fnr\n ON fnr.fid = fn.id and fnr.pastureid = fn.pastureid\n LEFT JOIN feedclass fc\n ON fc.id= fn.fclassid and fc.pastureid = fn.pastureid\nWHERE fn.pastureid = ? \n AND ( fn.fname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND ( fn.fclassid =? OR ? = \'\')\n AND (if(?=0,fn.source = \'系统内置\',fn.source <> \'系统内置\') OR ? = \'\')\n AND (fn.printgroup= ? OR ? = \'\')\nAND (fn.allowratio= ? OR ? = \'\')\nAND (fn.autozone= ? OR ? = \'\')\nAND (fn.autosecond= ? OR ? = \'\')\n AND (fn.enable =? OR ? = \'\')\nORDER BY fn.id DESC','pastureid,fname ,fname ,fclassid ,fclassid ,source ,source ,printgroup,printgroup,allowratio,allowratio,autozone,autozone,autosecond,autosecond,enable ,enable','getFeedList','GetDataByName','饲料列表','tmrgo','{\"name\":\"getFeedclassList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bigfeedclassid\":1,\"bigfeedclassname\":\"精料\",\"enable\":1,\"fccode\":\"0851\",\"fcname\":\"饲料1\",\"id\":\"3025176271438480543\",\"pastureid\":\"3025176271438480383\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  96. (1279,347,'DELETE fs,f FROM feed f\nleft JOIN feedstorage fs\nON fs.pastureid = f.pastureid AND fs.`feedid` = f.id\nWHERE f.pastureid=? AND f.id = ?','pastureid,id','deleteFeed','PostDataByName','删除饲料','tmrgo','{\"name\":\"deleteDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  97. (1280,347,'update feed set feedcode=?,fname=?,fclass=?,fclassid=?,allowratio=?,printgroupid=?,printgroup=?,unitweight=?,uprice=?,autozone=?,autosecond=?,autosecondname=?,confirmstart=?,trgaddress=?,source=?,enable=?,backup1=?,backup2=?,backup3=?,smtmrid=if(?=\'\',-1,?),smtmrname = ?,jmp=?\nwhere pastureid=? and id=?','feedcode,fname,fclass,fclassid,allowratio,printgroupid,printgroup,unitweight,uprice,autozone,autosecond,autosecondname,confirmstart,trgaddress,source,enable,backup1,backup2,backup3,smtmrid,smtmrid,smtmrname,jmp,pastureid,id','updateFeed','PostDataByName','修改饲料','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  98. (1281,347,'INSERT INTO feed(id,pastureid,feedcode,fname,fclass,fclassid,allowratio,printgroupid,printgroup,unitweight,uprice,autozone,autosecond,autosecondname,confirmstart,trgaddress,enable,source,backup1,backup2,backup3,smtmrid,smtmrname,jmp) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,if(?=\'\',-1,?),?,?) ','snowid,pastureid,feedcode,fname,fclass,fclassid,allowratio,printgroupid,printgroup,unitweight,uprice,autozone,autosecond,autosecondname,confirmstart,trgaddress,enable,source,backup1,backup2,backup3,smtmrid,smtmrid,smtmrname,jmp','insertFeed','PostDataByName','新增饲料','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  99. (1282,347,'SELECT\nTRIM(id) id,\nTRIM(pastureid)pastureid,fid,fname,feedcode,price,remark,dry,starch,\ncp,ca,p,n,fat,adf,ndf,ndip,ash,fpercent,iscu,sources,fndate,sort,`enable`,\nIF((SELECT COUNT(*) FROM feednur fu WHERE fu.pastureid=feednur.pastureid AND fu.feednurid=feednur.id)>0,1,0) statue\nFROM\n feednur \n WHERE pastureid = ? AND sources = \'0\'\n AND ( fname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND ((SELECT COUNT(*) FROM feednur fr WHERE fr.pastureid=feednur.pastureid AND fr.feednurid=feednur.id) = ? OR ?=\'\')\norder by fname','pastureid,fname,fname,statue,statue ','getFeednurList','GetDataByName','饲料库列表','tmrgo','{\"name\":\"getFeednurList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"adf\":\"1.00\",\"ash\":\"1.00\",\"ca\":\"1.00\",\"cp\":\"1.00\",\"dry\":\"1.00\",\"enable\":1,\"fat\":\"1.00\",\"feedcode\":\"1\",\"fid\":1,\"fname\":\"1\",\"fndate\":\"2020-08-26T00:00:00+08:00\",\"fpercent\":\"1.00\",\"id\":\"3545176271438480383\",\"iscu\":1,\"n\":\"1.00\",\"ndf\":\"1.00\",\"ndip\":\"1.00\",\"p\":\"1.00\",\"pastureid\":\"3025176271438480383\",\"price\":\"1.000\",\"remark\":\"1\",\"sort\":0,\"sources\":\"0\",\"statue\":0}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  100. (1283,347,'INSERT INTO feednur(id,pastureid,fid,fname,feedcode,price,remark,dry,starch,cp,ca,p,n,fat,adf,ndf,ndip,ash,fpercent,iscu,sources,feednurid) VALUES (?,?,?,?,?,?,?,if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),if(?=\'\',null,?),1,if(?=\'\',null,?)) ON DUPLICATE KEY UPDATE dry=if(?=\'\',null,?),starch=if(?=\'\',null,?),cp=if(?=\'\',null,?),ca=if(?=\'\',null,?),p=if(?=\'\',null,?),n=if(?=\'\',null,?),fat=if(?=\'\',null,?),adf=if(?=\'\',null,?),ndf=if(?=\'\',null,?),ndip=if(?=\'\',null,?),ash=if(?=\'\',null,?),fpercent=if(?=\'\',null,?),iscu=if(?=\'\',null,?),feednurid=if(?=\'\',null,?)','snowid,pastureid,fid,fname,feedcode,price,remark,dry,dry,starch,starch,cp,cp,ca,ca,p,p,n,n,fat,fat,adf,adf,ndf,ndf,ndip,ndip,ash,ash,fpercent,fpercent,iscu,iscu,feednurid,feednurid,dry,dry,starch,starch,cp,cp,ca,ca,p,p,n,n,fat,fat,adf,adf,ndf,ndf,ndip,ndip,ash,ash,fpercent,fpercent,iscu,iscu,feednurid,feednurid','insertFeednur','PostDataByName','新增饲料库(营养价值)','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  101. (1284,347,'update feednur set feednurid = null\nwhere pastureid=? and fid= ? ','pastureid,fid','updateFeedrelation','PostDataByName','饲料与营养价值解绑','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  102. (1285,376,'SELECT\nproviderName,providerNumber,linkman,telphone,remark,enable,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n provider\nWHERE pastureid = ? \n AND ( providerName LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND ( providerNumber LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (enable =? OR ? = \'\')\nORDER BY id DESC','pastureid,providerName,providerName,providerNumber,providerNumber,enable,enable','getProviderList','GetDataByName','供应商列表','tmrgo','{\"name\":\"getFeedclassList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bigfeedclassid\":1,\"bigfeedclassname\":\"精料\",\"enable\":1,\"fccode\":\"0851\",\"fcname\":\"饲料1\",\"id\":\"3025176271438480543\",\"pastureid\":\"3025176271438480383\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  103. (1286,376,'delete from provider where pastureid=? and id = ? ','pastureid,id','deleteProvider','PostDataByName','删除供应商','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  104. (1287,376,'update provider set providerName=?,providerNumber=?,linkman=?,telphone=?,remark=?,enable=?\nwhere pastureid=? and id=?','providerName,providerNumber,linkman,telphone,remark,enable,pastureid,id','updateProvider','PostDataByName','修改供应商','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  105. (1288,376,'INSERT INTO provider(id,pastureid,providerName,providerNumber,linkman,telphone,remark,enable) VALUES (?,?,?,?,?,?,?,?) ','snowid,pastureid,providerName,providerNumber,linkman,telphone,remark,enable','insertProvider','PostDataByName','新增供应商','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  106. (1289,346,'SELECT\nfcname,fccode,enable,bigfeedclassid,bigfeedclassname,\nconcat(bigfeedclassname,\' / \',fcname) mixname,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n feedclass\nWHERE pastureid = ? \nand enable=1 \nORDER BY id DESC','pastureid','getFeedclassByBig','GetDataByName','饲料类别列表','tmrgo','{\"name\":\"getFeedclassList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bigfeedclassid\":1,\"bigfeedclassname\":\"精料\",\"enable\":1,\"fccode\":\"0851\",\"fcname\":\"饲料1\",\"id\":\"3025176271438480543\",\"pastureid\":\"3025176271438480383\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  107. (1290,347,'SELECT\nTRIM(id) id,\nTRIM(pastureid)pastureid,fid,fname,feedcode,price,remark,dry,starch,\ncp,ca,p,n,fat,adf,ndf,ndip,ash,fpercent,iscu,sources,fndate,sort,`enable`,\nIF((SELECT COUNT(id) FROM feednur fr WHERE fr.pastureid=? AND fr.feednurid=feednur.id AND fr.fid=? )>0,1,0) statueRelation\nFROM\n feednur\nWHERE pastureid = ? AND sources = \'0\' \n AND ( fname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nORDER BY id','pastureid,fid,pastureid,fname,fname','getFeednurRelation','GetDataByName','饲料库列表','tmrgo','{\"name\":\"getFeednurList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"adf\":\"1.00\",\"ash\":\"1.00\",\"ca\":\"1.00\",\"cp\":\"1.00\",\"dry\":\"1.00\",\"enable\":1,\"fat\":\"1.00\",\"feedcode\":\"1\",\"fid\":1,\"fname\":\"1\",\"fndate\":\"2020-08-26T00:00:00+08:00\",\"fpercent\":\"1.00\",\"id\":\"3545176271438480383\",\"iscu\":1,\"n\":\"1.00\",\"ndf\":\"1.00\",\"ndip\":\"1.00\",\"p\":\"1.00\",\"pastureid\":\"3025176271438480383\",\"price\":\"1.000\",\"remark\":\"1\",\"sort\":0,\"sources\":\"0\",\"statue\":0}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  108. (1291,348,'SELECT ft.tname ftname,trim(os.id) id, trim(ft.id) ftid,trim(ft.`pastureid`)pastureid ,\nbodystandard,bodysource,dungstandard,dungsource\nFROM feedtemplet ft\nLEFT JOIN optscore os\nON os.ftid = ft.`id` AND os.`pastureid` = ?\nWHERE ft.`pastureid`= ?\nORDER BY ft.id DESC','pastureid,pastureid','getOptscoreList','GetDataByName','体况粪便评分标准列表','tmrgo','{\"name\":\"getOptscoreList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bodysource\":\"4\",\"bodystandard\":\"3\",\"dungsource\":\"6\",\"dungstandard\":\"5\",\"id\":2,\"tname\":\"配方2\"},{\"bodysource\":\"4\",\"bodystandard\":\"2\",\"dungsource\":\"6\",\"dungstandard\":\"5\",\"id\":1,\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  109. (1292,348,'INSERT INTO optscore(id,pastureid,ftid,ftname,bodystandard,bodysource,dungstandard,dungsource) VALUES (?,?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE\nbodystandard=?,bodysource=?,dungstandard=?,dungsource=?\n','snowid,pastureid,ftid,ftname,bodystandard,bodysource,dungstandard,dungsource,bodystandard,bodysource,dungstandard,dungsource','updateOptscore','PostDataByName','修改体况粪便评分标准','tmrgo','{\"name\":\"updateOptscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  110. (1293,348,'SELECT trim(cc.id)cowclassid,cc.classname cowname,cc.parentname,org.id,fbonemin,fbonemax,fbtwomin,fbtwomax,fbthreemin,fbthreemax,trim(cc.pastureid)pastureid,\nfbsource,bzonemin,bzonemax,bztwomin,bztwomax,bzthreemin,bzthreemax,bzfourmin,bzfourmax,bzsource\nFROM cowclass cc \nLEFT JOIN optrange org\nON org.cowclassid = cc.`id` AND org.`pastureid` = ?\nWHERE cc.`pastureid`= ?\nORDER BY cc.id DESC','pastureid,pastureid','getOptrangeList','GetDataByName','宾州筛粪便筛标准范围列表','tmrgo','{\"name\":\"getOptscoreList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bodysource\":\"4\",\"bodystandard\":\"3\",\"dungsource\":\"6\",\"dungstandard\":\"5\",\"id\":2,\"tname\":\"配方2\"},{\"bodysource\":\"4\",\"bodystandard\":\"2\",\"dungsource\":\"6\",\"dungstandard\":\"5\",\"id\":1,\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  111. (1294,348,'INSERT INTO optrange(id,pastureid,cowname,cowclassid,fbonemin,fbonemax,fbtwomin,fbtwomax,fbthreemin,fbthreemax,fbsource,bzonemin,bzonemax,bztwomin,bztwomax,bzthreemin,bzthreemax,bzfourmin,bzfourmax,bzsource) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE\nfbonemin=?,fbonemax=?,fbtwomin=?,fbtwomax=?,fbthreemin=?,fbthreemax=?,fbsource=?,bzonemin=?,bzonemax=?,bztwomin=?,bztwomax=?,bzthreemin=?,bzthreemax=?,bzfourmin=?,bzfourmax=?,bzsource=?','snowid,pastureid,cowname,cowclassid,fbonemin,fbonemax,fbtwomin,fbtwomax,fbthreemin,fbthreemax,fbsource,bzonemin,bzonemax,bztwomin,bztwomax,bzthreemin,bzthreemax,bzfourmin,bzfourmax,bzsource,fbonemin,fbonemax,fbtwomin,fbtwomax,fbthreemin,fbthreemax,fbsource,bzonemin,bzonemax,bztwomin,bztwomax,bzthreemin,bzthreemax,bzfourmin,bzfourmax,bzsource','insertOptrange','PostDataByName','修改宾州筛粪便筛标准范围','tmrgo','{\"name\":\"updateOptscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  112. (1295,24,'SELECT dictlist.id,dictlist.label,dictlist.value FROM dictlist JOIN `dict` ON `dict`.`id`=dictlist.`pid` WHERE `dict`.`name`=? AND `dict`.ENABLE=1 and dictlist .enable=1 ORDER BY `dictlist`.orderby ','dictname','getDictByName2','query','字典','tmrgo','','',2,1,0,0,0),
  113. (1296,24,'SELECT dictlist.id,dictlist.label,dictlist.value FROM dictlist JOIN `dict` ON `dict`.`id`=dictlist.`pid` WHERE `dict`.`name`=? AND `dict`.ENABLE=1 and dictlist .enable=1 ORDER BY `dictlist`.orderby ','dictname','getDictByName3','query','字典','tmrgo','','',2,1,0,0,0),
  114. (1297,24,'SELECT dictlist.id,dictlist.label,dictlist.value FROM dictlist JOIN `dict` ON `dict`.`id`=dictlist.`pid` WHERE `dict`.`name`=? AND `dict`.ENABLE=1 and dictlist .enable=1 ORDER BY `dictlist`.orderby ','dictname','getDictByName4','query','字典','tmrgo','','',2,1,0,0,0),
  115. (1298,349,'INSERT INTO sysopt(id,pastureid,inforname,inforvalue)\nVALUES \n(?,?,\'isGetLastPlan\',0),\n(?,?,\'isGetNextPlan\',0),\n(?,?,\'isEnableSupplyFeed\',0),\n(?,?,\'isEnableRemainFeed\',1),\n(?,?,\'reportDigit\',1),\n(?,?,\'isLockCount\',0),\n(?,?,\'remainOpt\',\'不处理\'),\n(?,?,\'waterOpt\',\'不处理\'),\n(?,?,\'overweightWarnRate\',20),\n(?,?,\'overweightBanRate\',50),\n(?,?,\'repertoryWarn\',7),\n(?,?,\'isfeedstorage\',1),\n(?,?,\'times\',3),\n(?,?,\'isEnableContract\',1)\n','snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid,snowid,pastureid','initsysopt','PostDataByName','初始化参数(未用)','tmrgo','{\"name\":\"initsysopt\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":14,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  116. (1300,349,'delete from sysopt where pastureid=?','pastureid','deleteSysopt','PostDataByName','删除参数配置(未用)','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  117. (1301,349,'UPDATE `sysopt` \nSET inforvalue = CASE inforname\nWHEN \'isGetLastPlan\' THEN ? \nWHEN \'isGetNextPlan\' THEN ? \nWHEN \'isEnableSupplyFeed\' THEN ? \nWHEN \'isEnableRemainFeed\' THEN ? \nWHEN \'reportDigit\' THEN ? \nWHEN \'isLockCount\' THEN ? \nWHEN \'remainOpt\' THEN ? \nWHEN \'waterOpt\' THEN ? \nWHEN \'overweightWarnRate\' THEN ? \nWHEN \'overweightBanRate\' THEN ? \nWHEN \'repertoryWarn\' THEN ? \nWHEN \'isfeedstorage\' THEN ? \nWHEN \'times\' THEN ? \nWHEN \'isEnableContract\' THEN ? \nWHEN \'remainOptDis\' THEN ? \nWHEN \'remainOptRate\' THEN round(?/100,2)\nWHEN \'isSmallMaterial\' THEN ? \nWHEN \'decimalPlaces\' THEN ? \nWHEN \'isDataSync\' THEN ? \nEND \nWHERE pastureid= ? ','isGetLastPlan,isGetNextPlan,isEnableSupplyFeed,isEnableRemainFeed,reportDigit,isLockCount,remainOpt,waterOpt,overweightWarnRate,overweightBanRate,repertoryWarn,isfeedstorage,times,isEnableContract,remainOptDis,remainOptRate,isSmallMaterial,decimalPlaces,isDataSync,pastureid','updatesysopt','PostDataByName','-- 更新参数配置','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  118. (1302,349,'SELECT TRIM(pastureid) pastureid,\n \nMAX(CASE\n WHEN inforname = \'isGetLastPlan\' THEN\n inforvalue\n END\n) AS isGetLastPlan,\n MAX(CASE\n WHEN inforname = \'isGetNextPlan\' THEN\n inforvalue\n END\n) AS isGetNextPlan,\n MAX(CASE\n WHEN inforname = \'isEnableSupplyFeed\' THEN\n inforvalue\n END\n) AS isEnableSupplyFeed,\n MAX(CASE\n WHEN inforname = \'isEnableRemainFeed\' THEN\n inforvalue\n END\n) AS isEnableRemainFeed,\n MAX(CASE\n WHEN inforname = \'reportDigit\' THEN\n inforvalue\n END\n) AS reportDigit,\n MAX(CASE\n WHEN inforname = \'isLockCount\' THEN\n inforvalue\n END\n) AS isLockCount,\n MAX(CASE\n WHEN inforname = \'remainOpt\' THEN\n inforvalue\n END\n) AS remainOpt,\n MAX(CASE\n WHEN inforname = \'waterOpt\' THEN\n inforvalue\n END\n) AS waterOpt,\n MAX(CASE\n WHEN inforname = \'overweightWarnRate\' THEN\n inforvalue\n END\n) AS overweightWarnRate,\n MAX(CASE\n WHEN inforname = \'overweightBanRate\' THEN\n inforvalue\n END\n) AS overweightBanRate,\n MAX(CASE\n WHEN inforname = \'repertoryWarn\' THEN\n inforvalue\n END\n) AS repertoryWarn,\n MAX(CASE\n WHEN inforname = \'isfeedstorage\' THEN\n inforvalue\n END\n) AS isfeedstorage,\n MAX(CASE\n WHEN inforname = \'times\' THEN\n inforvalue\n END\n) AS times,\n MAX(CASE\n WHEN inforname = \'isEnableContract\' THEN\n inforvalue\n END\n) AS isEnableContract,\n MAX(CASE\n WHEN inforname = \'remainOptDis\' THEN\n inforvalue\n END\n) AS remainOptDis,\n MAX(CASE\n WHEN inforname = \'remainOptRate\' THEN\n inforvalue*100\n END\n) AS remainOptRate,\n MAX(CASE\n WHEN inforname = \'isSmallMaterial\' THEN\n inforvalue\n END\n) AS isSmallMaterial,\n MAX(CASE\n WHEN inforname = \'decimalPlaces\' THEN\n inforvalue\n END\n) AS decimalPlaces,\n MAX(CASE\n WHEN inforname = \'isDataSync\' THEN\n inforvalue\n END\n) AS isDataSync\n \n FROM `sysopt` \n WHERE pastureid = ?','pastureid','getysoptList','GetDataByName','-- 默认参数配置列表','tmrgo','{\"name\":\"getysoptList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bodysource\":\"4\",\"bodystandard\":\"3\",\"dungsource\":\"6\",\"dungstandard\":\"5\",\"id\":2,\"tname\":\"配方2\"},{\"bodysource\":\"4\",\"bodystandard\":\"2\",\"dungsource\":\"6\",\"dungstandard\":\"5\",\"id\":1,\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  119. (1303,349,'UPDATE `sysopt` \nSET inforvalue= CASE inforname \nWHEN \'isGetLastPlan\' THEN 0\nWHEN \'isGetNextPlan\' THEN 0\nWHEN \'isEnableSupplyFeed\' THEN 0\nWHEN \'isEnableRemainFeed\' THEN 1\nWHEN \'reportDigit\' THEN 1\nWHEN \'isLockCount\' THEN 0\nWHEN \'remainOpt\' THEN \'2\'\nWHEN \'waterOpt\' THEN \'2\'\nWHEN \'overweightWarnRate\' THEN 20\nWHEN \'overweightBanRate\' THEN 50\nWHEN \'repertoryWarn\' THEN 7\nWHEN \'isfeedstorage\' THEN 1\nWHEN \'times\' THEN 3\nWHEN \'isEnableContract\' THEN 1\nWHEN \'remainOptDis\' THEN \'顶额分配\'\nWHEN \'remainOptRate\' THEN 0.2 \nWHEN \'isSmallMaterial\' THEN 0\nWHEN \'decimalPlaces\' THEN 2\nWHEN \'isDataSync\' THEN 0\nEND \nWHERE pastureid= ? ','pastureid','updatesysoptinit','PostDataByName','-- 更新参数配置','tmrgo','{\"name\":\"updatesysoptinit\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":12,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  120. (1304,334,'SELECT\ntname,tcolor,ccid,ccname,fttype, remark,`enable`,source,fttypeid,\ntcode,\nTRIM(id) id,\nTRIM(pastureid)pastureid,concat(\'V\',version)version,\nROUND(IFNULL((SELECT SUM(\nIF(ftd.preftid<>0,\n ftd.`fweight`*IFNULL((SELECT SUM(ftd1.`fweight`*f1.dry/100)/SUM(ftd1.`fweight`) FROM `ftdetail` ftd1\nJOIN feednur f1 ON f1.fid= ftd1.fid AND f1.pastureid = ftd1.pastureid\nWHERE ftd1.pastureid = feedtemplet.`pastureid` AND ftd1.ftid = ftd.preftid),0),\nftd.`fweight`*dry/100)\n)\n FROM `ftdetail` ftd\nLEFT JOIN feednur f ON f.fid= ftd.fid AND f.pastureid = ftd.pastureid\nWHERE ftd.pastureid = feedtemplet.`pastureid` AND ftd.ftid = feedtemplet.`id`),0),2) dryweight\n\n\nFROM\n feedtemplet\nWHERE pastureid = ? \n AND ( ccname =? OR ? = \'\')\n AND ( fttype =? OR ? = \'\')\n AND (enable =? OR ? = \'\')\n AND ( tname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nAND ( remark LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nORDER BY id DESC','pastureid,ccname ,ccname ,fttype ,fttype ,enable,enable,tname,tname,remark,remark','getFTList','GetDataByName','配方模板列表','tmrgo','{\"name\":\"getFTList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"预混配方\",\"id\":\"8874176271438480590\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方2\"},{\"ccid\":1,\"enable\":1,\"fttype\":\"饲喂配方\",\"id\":\"8874176271438480589\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  121. (1305,334,'DELETE ft,ftd FROM `feedtemplet` ft \nleft JOIN `ftdetail` ftd\nON ft.`pastureid` = ftd.`pastureid` AND ft.id = ftd.`ftid`\nWHERE ft.pastureid=? AND ft.id = ? ','pastureid,id','deleteFT','PostDataByName','删除配方模板','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  122. (1306,334,'update feedtemplet set tname=?,tcode=?,tcolor=?,ccid=?,ccname=?,remark=?,enable=?,isissue=0\nwhere pastureid=? and id=?','tname,tcode,tcolor,ccid,ccname,remark,enable,pastureid,id','updateFT','PostDataByName','修改配方模板','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  123. (1307,334,'INSERT INTO feedtemplet(id,pastureid,tname,tcode,tcolor,ccid,ccname,fttype,fttypeid,source,\nremark,`enable`) \nVALUES (?,?,?,?,?,?,?,?,?,?,?,?) ','snowid,pastureid,tname,tcode,tcolor,ccid,ccname,fttype,fttypeid,source, remark,enable','insertFT','PostDataByName','新增配方模板','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  124. (1308,334,'SELECT\nTRIM(ftid)ftid,TRIM(fid)fid,\nifnull((select fname from feed where pastureid =ftdetail.pastureid and id = ftdetail.fid),ftdetail. fname) fname,\nfweight,islockcount,sort,feedgroup,TRIM(preftid)preftid,autosecond,trim(splitftpreid)splitftpreid,\nTRIM(ftdetail.id) id,\nTRIM(ftdetail.pastureid)pastureid\nFROM\n ftdetail\nWHERE ftdetail.pastureid = ? AND ( ftid=?)\n AND ( fweight =? OR ? = \'\') \n AND ( autosecondname =? OR ? = \'\')\n AND (islockcount =? OR ? = \'\')\n AND (sort =? OR ? = \'\')\n AND ( fname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nAND ( feedgroup LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nORDER BY ftdetail.sort,ftdetail.id','pastureid,ftid,fweight ,fweight,autosecondname ,autosecondname ,islockcount ,islockcount ,sort ,sort ,fname ,fname,feedgroup,feedgroup ','getFTdetailList','GetDataByName','配方模板详情列表','tmrgo','{\"name\":\"getFTdetailList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"autosecond\":10,\"autosecondname\":\"11\",\"feedgroup\":\"8\",\"fid\":3,\"fname\":\"4\",\"ftid\":1,\"fweight\":\"0.000\",\"id\":\"1\",\"inforvalue\":\"0\",\"islockcount\":0,\"pastureid\":\"3025176271438480383\",\"preftid\":9,\"sort\":0}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  125. (1309,334,'delete from ftdetail where pastureid=? and id = ? ','pastureid,id','deleteFTdetail','PostDataByName','删除配方模板详情','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  126. (1310,334,'UPDATE ftdetail fd \nJOIN feedtemplet ft ON ft.pastureid = fd.pastureid AND ft.id = fd.ftid\nSET fd.ftid=?,fd.fid=?,fd.fname=?,fd.fweight=?,fd.islockcount=?,fd.sort=?,fd.feedgroup=?,fd.preftid=?,fd.autosecond=?,fd.autosecondname=?,\nft.version = ft.version+1\nWHERE fd.pastureid=? AND fd.id=?','ftid,fid,fname,fweight,islockcount,sort,feedgroup,preftid,autosecond,autosecondname,pastureid,id','updateFTdetail','PostDataByName','修改配方模板详情','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  127. (1311,334,'INSERT INTO ftdetail(id,pastureid,ftid,fid,fname,fweight,islockcount,sort,feedgroup,preftid,autosecond,autosecondname) \nVALUES (?,?,?,?,?,?,?,?,?,?,?,?)','snowid,pastureid,ftid,fid,fname,fweight,islockcount,sort,feedgroup,preftid,autosecond,autosecondname','insertFTdetail','PostDataByName','新增配方模板详情','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  128. (1312,334,'SELECT\ntname,tcolor,ccid,ccname,fttype, remark,`enable`,\nTRIM(id) id,\nTRIM(pastureid)pastureid,date,concat(\'V\',version)version,DATE_FORMAT(savetime,\'%H:%i:%s\') versiontime,\nround(ifnull((SELECT SUM(ftd.`fweight`*dry/100) FROM `ftdetaildate` ftd\nJOIN feednur f ON f.fid= ftd.fid AND f.pastureid = ftd.pastureid\nWHERE ftd.pastureid = feedtempletdate.`pastureid` AND ftd.ftid = feedtempletdate.`id` AND \nftd.`date` = feedtempletdate.`date` AND ftd.`version` = feedtempletdate.`version`),0),2) dryweight\nFROM\n feedtempletdate\nWHERE pastureid = ? AND ( if(?=\'\',date= (select max(date) from feedtempletdate where pastureid=?),date= ?))\n AND ( ccname =? OR ? = \'\')\n AND ( fttype =? OR ? = \'\')\n AND (enable =? OR ? = \'\')\n AND ( tname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nAND ( remark LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n\nORDER BY id DESC','pastureid,date,pastureid,date,ccname ,ccname ,fttype ,fttype ,enable,enable,tname,tname,remark,remark','getFTListDate','GetDataByName','配方模板列表历史记录','tmrgo','{\"name\":\"getFTList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"预混配方\",\"id\":\"8874176271438480590\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方2\"},{\"ccid\":1,\"enable\":1,\"fttype\":\"饲喂配方\",\"id\":\"8874176271438480589\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  129. (1313,334,'delete from feedtempletdate where pastureid=? and id = ? ','pastureid,id','deleteFTDate','PostDataByName','删除配方模板历史记录','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  130. (1314,334,'update feedtempletdate set tname=?,tcolor=?,ccid=?,ccname=?,fttype=?,fttypeid=?,remark=?,enable=?\nwhere pastureid=? and id=?','tname,tcolor,ccid,ccname,fttype,fttypeid, remark,enable,pastureid,id','updateFTDate','PostDataByName','修改配方模板历史记录','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  131. (1315,334,'INSERT INTO feedtempletdate(id,pastureid,tname,tcolor,ccid,ccname,fttype,fttypeid,source,\nremark,`enable`) \nVALUES (?,?,?,?,?,?,?,?,?,?,?) ','snowid,pastureid,tname,tcolor,ccid,ccname,fttype,fttypeid,source, remark,enable','insertFTDate','PostDataByName','新增配方模板历史记录','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  132. (1316,334,'SELECT\nTRIM(ftid)ftid,TRIM(fid)fid,fname,fweight,islockcount,sort,feedgroup,TRIM(preftid)preftid,autosecond,autosecondname,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n ftdetaildate\nWHERE pastureid = ? AND ( ftid=?) and version = RIGHT(?,LENGTH(?)-1) AND `date` = ?\n AND ( fweight =? OR ? = \'\')\n AND ( autosecondname =? OR ? = \'\')\n AND (islockcount =? OR ? = \'\')\n AND (sort =? OR ? = \'\')\n AND ( fname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nAND ( feedgroup LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nORDER BY sort,id','pastureid,ftid,version,version,date,fweight ,fweight ,autosecondname ,autosecondname ,islockcount ,islockcount ,sort ,sort ,fname ,fname,feedgroup,feedgroup ','getFTdetailListDate','GetDataByName','配方模板详情列表历史记录','tmrgo','{\"name\":\"getFTList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"预混配方\",\"id\":\"8874176271438480590\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方2\"},{\"ccid\":1,\"enable\":1,\"fttype\":\"饲喂配方\",\"id\":\"8874176271438480589\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  133. (1317,334,'delete from ftdetaildate where pastureid=? and id = ? ','pastureid,id','deleteFTdetailDate','PostDataByName','删除配方模板详情历史记录','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  134. (1318,334,'update ftdetaildate set ftid=?,fid=?,fname=?,fweight=?,islockcount=?,sort=?,feedgroup=?,autosecond=?,autosecondname=?\nwhere pastureid=? and id=?','ftid,fid,fname,fweight,islockcount,sort,feedgroup,preftid,autosecond,autosecondname,pastureid,id','updateFTdetailDate','PostDataByName','修改配方模板详情历史记录','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  135. (1319,334,'INSERT INTO ftdetaildate(id,pastureid,ftid,fid,fname,fweight,islockcount,sort,feedgroup,preftid,autosecond,autosecondname) \nVALUES (?,?,?,?,?,?,?,?,?,?,?,?)','snowid,pastureid,ftid,fid,fname,fweight,islockcount,sort,feedgroup,preftid,autosecond,autosecondname','insertFTdetailDate','PostDataByName','新增配方模板详情历史记录','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  136. (1320,27,'SELECT apisql.id,sqlstr,sqlname,params,remark,apisql.sort,apisql.`enable`,apisql.`method`,apisql.`name`,`request_body`,`return_body` ,apisql.`menuid`,`menu`.`name` AS menuname\nFROM apisql left JOIN `menu` ON apisql.`menuid`=`menu`.`id`\nWHERE (apisql.menuid = ? OR ? = \'0\' ) AND (apisql.sqlname LIKE CONCAT(\"%\",?,\"%\") OR ? = \'\')\nORDER BY apisql.id','menuid,menuid ,sqlname,sqlname','getapisqlall','GetDataByName','获取SQL列表','tmrgo','{\"name\":\"getapisqlall\",\"offset\":1,\"pagecount\":8,\"params\":[27,27]}','',0,1,0,0,0),
  137. (1321,345,'SELECT\nclasscode,\nclassname,\nsort,\nenable,\nparentid,\nparentname,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n cowclass\nWHERE pastureid = ? \n AND ( classname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\n AND (parentname = ? OR ? = \'\')\n AND (enable =? OR ? = \'\')\nORDER BY id DESC','pastureid,classname,classname,parentname ,parentname ,enable,enable','getCowclassEnable','GetDataByName','牲畜类别列表','tmrgo','{\"name\":\"getTMRList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":0,\"enable\":1,\"eqcode\":\"1\",\"id\":\"1\",\"maxstirfeed\":4,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"3\",\"tclassname\":\"3\",\"tname\":\"2\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  138. (1322,334,'call copyFT(?,?)','ftid,pastureid','copyFT','PostDataByName','复制配方','tmrgo','','',0,1,0,0,0),
  139. (1323,334,'select if(DATE_FORMAT(max(date), \'%Y-%m-%d\')>DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(max(date), \'%Y-%m-%d\'))\n maxdate from feedtempletdate where pastureid=?','pastureid','getFTMaxDate','GetDataByName','配方模板列表历史最近日全球','tmrgo','{\"name\":\"getFTMaxDate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"maxdate\":\"2020-08-31\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  140. (1324,334,'SELECT\nfn.fname,\nTRIM(fn.id) id,0 AS ispreft\nFROM\n feed fn\nWHERE fn.pastureid = ? AND fn.enable = 1\nUNION ALL\nSELECT\ntname,\nTRIM(id) id,1 AS ispreft\nFROM\n feedtemplet \nWHERE pastureid = ? AND fttypeid = 2 AND ?=\'\' AND (SELECT COUNT(*) FROM `ftdetail` ftd WHERE ftd.pastureid =feedtemplet.`pastureid` AND ftd.`ftid` = feedtemplet.`id` )>0\n \nORDER BY id DESC','pastureid,pastureid,type','getFeedAndPre','GetDataByName','饲料和预混配方列表','tmrgo','{\"name\":\"getFeedAndPre\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"fname\":\"饲料名称1\",\"id\":\"3029213841008886784\",\"ispreft\":0},{\"fname\":\"预混1\",\"id\":\"3025176272438480391\",\"ispreft\":1}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  141. (1325,334,'call splitFTpre(?,?,?,?,?,?,?)','ftid,preftid,ftdid,pastureid,feedgroup,sort,fweight','splitFTpre','GetDataByName','饲料和预混配方列表','tmrgo','{\"name\":\"getFeedAndPre\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"fname\":\"饲料名称1\",\"id\":\"3029213841008886784\",\"ispreft\":0},{\"fname\":\"预混1\",\"id\":\"3025176272438480391\",\"ispreft\":1}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  142. (1326,334,'SELECT\nsysopt.inforvalue,inforname\nFROM\n sysopt \nwhere sysopt.`pastureid`= ? AND sysopt.`inforname`= ?','pastureid,inforname','getSysoptEnable','GetDataByName','饲料和预混配方列表','tmrgo','{\"name\":\"getIslockcountEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"inforname\":\"isLockCount\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"inforname\":\"isLockCount\",\"inforvalue\":\"0\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  143. (1327,335,'SELECT IFNULL(GROUP_CONCAT(fpd.`times`,\':\',fpd.tratio,\':\',\nROUND(IF((SELECT inforvalue FROM sysopt WHERE sysopt.`pastureid`=bar.pastureid AND sysopt.`inforname`= \'isEnableSupplyFeed\')=1,fpd.weight,fpd.weight*(1-ptsrate)),2)),\n \n CASE (SELECT inforvalue FROM sysopt \nWHERE sysopt.`pastureid`=bar.pastureid AND sysopt.`inforname`= \'times\')\nWHEN 1 THEN\n\'1:100:0\'\nWHEN 2 THEN\n\'1:50:0,2:50:0\'\nWHEN 3 THEN\n\'1:30:0,2:30:0,3:40:0\'\nWHEN 4 THEN\n\'1:25:0,2:25:0,3:25:0,4:25:0\'\nEND \n) timesopt,\nbar.`bname` barname,TRIM(bar.`id`) barid,\n(SELECT bm.cowsum FROM barmilk bm WHERE bm.`barid` =bar.`id` AND bm.pastureid=bar.pastureid ORDER BY bm.productdate DESC LIMIT 1) softccount,\n(SELECT bigcowclass FROM barmilk bm WHERE bm.`barid` =bar.`id` AND bm.pastureid=bar.pastureid ORDER BY bm.productdate DESC LIMIT 1) bigcowclass,\nccount,ROUND(ratio,2)ratio,ROUND(ccountratio,2)ccountratio,TRIM(ftid) ftid,TRIM(ptsfid)ptsfid,\n if((SELECT inforvalue FROM sysopt WHERE sysopt.`pastureid`=bar.pastureid AND sysopt.`inforname`= \'isEnableSupplyFeed\') = 1,round(ftweight+supplyweight,2),ROUND(ftweight,2)) feedweight,\n\nROUND(ftweight,2)ftweight,ROUND(supplyweight,2)supplyweight,ft.`tname` ftname,ft1.`tname` ptsfname,\nTRIM(fp.id) id,\nTRIM(bar.pastureid)pastureid\nFROM\nbar \nLEFT JOIN feedp fp\nON bar.`id` = fp.`barid` AND fp.pastureid=?\nLEFT JOIN fpdetail fpd\nON fp.`barid` = fpd.`barid` AND fpd.pastureid=? AND fpd.`times`<=(SELECT inforvalue FROM sysopt \nWHERE sysopt.`pastureid`= ? AND sysopt.`inforname`= \'times\')\nLEFT JOIN `feedtemplet` ft\nON ft.id = fp.`ftid` and ft.pastureid=bar.pastureid\nLEFT JOIN `feedtemplet` ft1\nON ft1.id = fp.`ptsfid` and ft1.pastureid=bar.pastureid\nWHERE bar.pastureid=? AND bar.enable=1 \nGROUP BY bar.`id`\nORDER BY bar.bcode','pastureid,pastureid,pastureid,pastureid','getFPList','GetDataByName','栏舍配方列表','tmrgo','{\"name\":\"getFPList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1052: Column \'OWNER\' in field list is ambiguous\"',0,1,0,0,0),
  144. (1330,335,'INSERT INTO feedp(id,pastureid,barname,barid,softccount,ccount,ratio,ccountratio,ftid,ftname,ptsfid,ptsfname,feedweight,ftweight,supplyweight,r1,r2,r3,r4,r5,r6,w1,w2,w3,w4,w5,w6) \nVALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?)) \nON DUPLICATE KEY UPDATE barname=?,barid=?,softccount=?,ccount=?,ratio=?,ccountratio=?,ftid=?,ftname=?,ptsfid=?,ptsfname=?,feedweight=?,ftweight=?,supplyweight=?,r1=if(?=\'\',0,?),r2=if(?=\'\',0,?),r3=if(?=\'\',0,?),r4=if(?=\'\',0,?),r5=if(?=\'\',0,?),r6=if(?=\'\',0,?),w1=if(?=\'\',0,?),w2=if(?=\'\',0,?),w3=if(?=\'\',0,?),w4=if(?=\'\',0,?),w5=if(?=\'\',0,?),w6=if(?=\'\',0,?)','snowid,pastureid,barname,barid,softccount,ccount,ratio,ccountratio,ftid,ftname,ptsfid,ptsfname,feedweight,ftweight,supplyweight,r1,r1,r2,r2,r3,r3,r4,r4,r5,r5,r6,r6,w1,w1,w2,w2,w3,w3,w4,w4,w5,w5,w6,w6,barname,barid,softccount,ccount,ratio,ccountratio,ftid,ftname,ptsfid,ptsfname,feedweight,ftweight,supplyweight,r1,r1,r2,r2,r3,r3,r4,r4,r5,r5,r6,r6,w1,w1,w2,w2,w3,w3,w4,w4,w5,w5,w6,w6','updateFP','PostDataByName','新增配方模板','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  145. (1331,335,'SELECT\nccname,\ntname,\nTRIM(id) id,\nIFNULL((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`=feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN 0\nWHEN 1 THEN( SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=1 )\nEND),0) SfweightLock,\n\nIFNULL ((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid)\nWHEN 1 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=0 )\nEND),0) Sfweight,\nROUND(IFNULL((SELECT SUM(\nIF(ftd.preftid<>0,\n ftd.`fweight`*IFNULL((SELECT SUM(ftd1.`fweight`*f1.dry/100)/SUM(ftd1.`fweight`) FROM `ftdetail` ftd1\nJOIN feednur f1 ON f1.fid= ftd1.fid AND f1.pastureid = ftd1.pastureid\nWHERE ftd1.pastureid = feedtemplet.`pastureid` AND ftd1.ftid = ftd.preftid),0),\nftd.`fweight`*dry/100)\n)\n FROM `ftdetail` ftd\nLEFT JOIN feednur f ON f.fid= ftd.fid AND f.pastureid = ftd.pastureid\nWHERE ftd.pastureid = feedtemplet.`pastureid` AND ftd.ftid = feedtemplet.`id`),0),2) dryweight\nFROM\nfeedtemplet\nWHERE pastureid=? AND ENABLE=1 AND fttypeid=1 and (select count(*) from ftdetail where pastureid = feedtemplet.pastureid and ftid= feedtemplet.id)>0\nORDER BY id DESC','pastureid','getFTSWList','GetDataByName','配方模板列表-饲喂','tmrgo','{\"name\":\"getFTSWList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":\"3025176272438480385\",\"tname\":\"配方2\"},{\"id\":\"3025176271437480384\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  146. (1332,335,'SELECT\nccname,\ntname,\nTRIM(id) id,\n(SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid) Bfweight,\nIFNULL((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`=feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN 0\nWHEN 1 THEN( SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=1 )\nEND),0) SfweightLock,\n\nIFNULL ((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid)\nWHEN 1 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=0 )\nEND),0) Sfweight\nFROM\nfeedtemplet\nwhere pastureid=? and enable=1 and fttypeid=3 and (select count(*) from ftdetail where pastureid = feedtemplet.pastureid and ftid= feedtemplet.id)>0\nORDER BY id desc','pastureid','getFTBLList','GetDataByName','配方模板列表-补料','tmrgo','{\"name\":\"getFTBLList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"Bfweight\":\"45.00\",\"Sfweight\":\"5.00\",\"SfweightLock\":\"40.00\",\"id\":\"3051208869281268743\",\"tname\":\"中产泌乳补料\"},{\"Bfweight\":\"44.00\",\"Sfweight\":\"44.00\",\"SfweightLock\":\"0.00\",\"id\":\"3051208869281268738\",\"tname\":\"低产泌乳补料\"},{\"Bfweight\":\"21.00\",\"Sfweight\":\"21.00\",\"SfweightLock\":\"0.00\",\"id\":\"3051208869281268737\",\"tname\":\"高产泌乳补料\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  147. (1333,334,'SELECT\nsysopt.inforvalue,inforname\nFROM\n sysopt \nwhere sysopt.`pastureid`= ? AND sysopt.`inforname`= ?','pastureid,inforname','getSysoptEnable1','GetDataByName','饲料和预混配方列表','tmrgo','{\"name\":\"getIslockcountEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"inforname\":\"isLockCount\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"inforname\":\"isLockCount\",\"inforvalue\":\"0\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  148. (1334,335,'SELECT\ntname,\nTRIM(id) id\nFROM\nfeedtemplet\nwhere pastureid=? and enable=1 and fttypeid=2\nORDER BY id desc','pastureid','getFTYHListV2','GetDataByName','配方模板列表','tmrgo','{\"name\":\"getFTBLList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  149. (1335,335,'SELECT GROUP_CONCAT(fpd.`times`,\':\',fpd.tratio,\':\',fpd.weight) timesopt,\nfp.barname,trim(fp.barid) barid,IFNULL(softccount,(SELECT bm.cowsum FROM barmilk bm WHERE bm.`barid` =fp.barid AND bm.pastureid=3025176271438480383 ORDER BY bm.productdate DESC LIMIT 1)) softccount,\nccount,ratio,ccountratio,trim(ftid) ftid,trim(ptsfid)ptsfid,feedweight,ftweight,supplyweight,OWNER,ftname,ptsfname,\nTRIM(fp.id) id,sumr,\nTRIM(fp.pastureid)pastureid\nFROM\n feedpdate fp\nLEFT JOIN fpdetaildate fpd\nON fp.`barid` = fpd.`barid` AND fpd.pastureid=? AND fpd.`times`<=(SELECT inforvalue FROM sysopt \nWHERE sysopt.`pastureid`= ? AND sysopt.`inforname`= \'times\')\nwhere fp.pastureid=? and fp.date =?\nGROUP BY fp.barid \nORDER BY fp.barid ','pastureid,pastureid,pastureid,date','getFPListDate','GetDataByName','栏舍配方列表','tmrgo','{\"name\":\"getFPListDate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":3027996177498375000,\"bname\":\"22222\",\"pastureid\":\"3025176271438480383\"},{\"barid\":3029338044232107000,\"bname\":\"东区#1\",\"pastureid\":\"3025176271438480383\"},{\"barid\":3028020121085412400,\"bname\":\"东区#2\",\"pastureid\":\"3025176271438480383\"},{\"barid\":3028015437557794000,\"bname\":\"西区#2\",\"pastureid\":\"3025176271438480383\"},{\"barid\":3028006959913108500,\"barname\":\"dd\",\"bname\":\"15\",\"ccount\":0,\"ccountratio\":\"100.000\",\"id\":\"3025176271438445878\",\"pastureid\":\"3025176271438480383\",\"ratio\":\"1.000\",\"softccount\":1}],\"message\":\"ok\",\"pageSize\":0,\"total\":5}',0,1,0,0,0),
  150. (1336,334,'UPDATE ftdetail \nINNER JOIN `feedtemplet` ft ON ft.pastureid = ftdetail.`pastureid` AND ft.id =ftdetail.`ftid`\n SET ftdetail.sort=?, ftdetail.feedgroup=?,ft.isissue = 0\nWHERE ftdetail.pastureid=? AND ftdetail.id=?','sort,feedgroup,pastureid,id','updateFTdetailSort','PostDataByName','修改配方模板详情','tmrgo','{\"name\":\"updateFTdetailSort\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3040887789920453632\",\"feedgroup\":\"饲料名称2\",\"id\":\"3026386153072231424\",\"sort\":\"7\"}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'INNER JOIN `feedtemplet` ft ON ft.pastureid = ftdetail.`pastureid` AND ft.id =ft\' at line 2\"',0,1,0,0,0),
  151. (1338,351,'SELECT\nTRIM(barid) barid,(select bname from bar where pastureid =barmilk. pastureid and id = barmilk.barid)barname,DATE_FORMAT(productdate, \'%Y-%m-%d\')productdate,product,avgmonthage,bw,dayw,fetal,avgdim,dayspre,fat,pro,lactose,source,tem,cowsum,cowclass,TRIM(cowclassid) cowclassid,bigcowclass,emp,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n barmilk\nWHERE pastureid = ? \n AND (( productdate >=? and productdate <=?) OR ? = \'\')\n AND (barid=? OR ? = \'\' )\n AND (cowclass=? OR ? = \'\')\nORDER BY productdate DESC,id desc','pastureid,startTime,stopTime,startTime,barid,barid,cowclass,cowclass','getBarmilkList','GetDataByName','栏舍生产性能列表','tmrgo','{\"name\":\"getBarmilkList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'TRIM(id) id,\\nTRIM(pastureid) pastureid\\nFROM\\n barmilk\\nWHERE pastureid = ? \\n AN\' at line 3\"',0,1,0,0,0),
  152. (1339,351,'delete from barmilk where pastureid=? and id = ? ','pastureid,id','deleteBarmilk','PostDataByName','删除栏舍生产性能','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  153. (1340,351,'update barmilk set barid =?,barname=?,productdate =?,product =IF(?=\'\',0,?),avgmonthage =IF(?=\'\',0,?),bw =IF(?=\'\',0,?),dayw =IF(?=\'\',0,?),fetal =IF(?=\'\',0,?),avgdim =IF(?=\'\',0,?),dayspre =IF(?=\'\',0,?),fat =IF(?=\'\',0,?),pro =IF(?=\'\',0,?),lactose =IF(?=\'\',0,?),source =?,tem =IF(?=\'\',0,?),cowsum =IF(?=\'\',0,?),emp =?\nwhere pastureid=? and id=?','barid,barname,productdate,product,product,avgmonthage,avgmonthage,bw,bw,dayw,dayw,fetal,fetal,avgdim,avgdim,dayspre,dayspre,fat,fat,pro,pro,lactose,lactose,source,tem,tem,cowsum,cowsum,emp,pastureid,id','updateBarmilk','PostDataByName','修改栏舍生产性能','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  154. (1341,351,'INSERT INTO barmilk(id,pastureid,barid,barname,productdate,product,avgmonthage,bw,dayw,fetal,avgdim,dayspre,fat,pro,lactose,source,tem,cowsum,cowclass,cowclassid,bigcowclass,emp)\nVALUES (?,?,?,?,?,\nif(?=\'\',0,?),IF(?=\'\',0,?),IF(?=\'\',0,?),IF(?=\'\',0,?),IF(?=\'\',0,?),IF(?=\'\',0,?),IF(?=\'\',0,?),IF(?=\'\',0,?),IF(?=\'\',0,?),IF(?=\'\',0,?),?,IF(?=\'\',0,?),IF(?=\'\',0,?),\n?,?,?,?) ','snowid,pastureid,barid,barname,productdate,product,product,avgmonthage,avgmonthage,bw,bw,dayw,dayw,fetal,fetal,avgdim,avgdim,dayspre,dayspre,fat,fat,pro,pro,lactose,lactose,source,tem,tem,cowsum,cowsum,cowclass,cowclassid,bigcowclass,emp','insertBarmilk','PostDataByName','新增栏舍生产性能','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  155. (1342,351,'SELECT\nemp\nFROM\n barmilk\nWHERE pastureid = ?\nGROUP BY emp\nORDER BY id DESC','pastureid','getBarmilkEmpHis','GetDataByName','栏舍生产性能列表','tmrgo','{\"name\":\"getBarmilkEmpHis\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"emp\":\"3\"},{\"emp\":\"2\"},{\"emp\":\"1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  156. (1343,334,'call applyFTdate(?,?)','date,pastureid','applyFTdate','PostDataByName','应用配方模板','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  157. (1344,21,'SELECT\n TRIM(u.`pastureid`) pastureId ,\n u.empname employeName,\n TRIM(u.id) employeId,\n u.password,\n p.`pasture_name` pastureName,\n 0 ispastureuse,\nu.isgroups\nFROM\n `user` u\n INNER JOIN pasture p\n ON p.`pastureid` = u.`pastureid`\n where u.username = ?','jwt_username','findByUserPastureName','GetDataByName','用户登录-获取牧场信息(新1)','tmrgo','{\"name\":\"findByUserPastureName\",\"parammaps\":{\"jwt_username\":\"00028\"}}','',0,1,0,0,0),
  158. (1345,350,'SELECT\nbname,\nTRIM(id) id\nFROM\n bar\nWHERE pastureid = ? and enable=1\nORDER BY id DESC','pastureid','getBarListEnable','GetDataByName','栏舍列表','tmrgo','{\"name\":\"getTMRList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":0,\"enable\":1,\"eqcode\":\"1\",\"id\":\"1\",\"maxstirfeed\":4,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"3\",\"tclassname\":\"3\",\"tname\":\"2\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  159. (1346,345,'SELECT\nclassname,\nparentname,\nTRIM(id) id,\nconcat(parentname,\' / \',classname) mixname\n\nFROM\n cowclass\nWHERE pastureid = ? \n AND enable=1\nORDER BY id DESC','pastureid','getCowclassListEnable','GetDataByName','牲畜类别列表','tmrgo','{\"name\":\"getTMRList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":0,\"enable\":1,\"eqcode\":\"1\",\"id\":\"1\",\"maxstirfeed\":4,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"3\",\"tclassname\":\"3\",\"tname\":\"2\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  160. (1347,334,'call creatFTdate(?)','pastureid','creatFTdate','PostDataByName','应用配方模板','tmrgo','{\"name\":\"creatFTdate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  161. (1348,334,'SELECT \ntrim(id) id,trim(pastureid) trim,tcode,tname,tcolor,trim(ccid)ccid,ccname,fttype,fttypeid,source,remark,`enable`,\n(SELECT SUM(fweight) FROM `ftdetail` WHERE ftid= ? AND pastureid=?) sumWeight\n FROM `feedtemplet` WHERE id= ? AND pastureid=?','ftid,pastureid,ftid,pastureid','getFTCompare','GetDataByName','主配方对比','tmrgo','{\"name\":\"getFTCompare\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"ftid\":\"3041025691337884672\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"countWeight\":2,\"enable\":1,\"fttype\":\"预混配方\",\"fttypeid\":2,\"id\":3041025691337884700,\"pastureid\":3025176271438480400,\"remark\":\"22\",\"source\":\"自定义\",\"sumWeight\":\"2.00\",\"tcolor\":\"#ccc\",\"tname\":\"ggg\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  162. (1349,334,'SELECT \ntrim(id) id,trim(pastureid) pastureid,trim(fid) fid,fname,lweight,fweight,islockcount,sort,\n(SELECT SUM(fweight) FROM `ftdetail` WHERE ftid= ? AND pastureid=?) sumWeight\nFROM `ftdetail` WHERE ftid= ? AND pastureid=?\nORDER BY fid','ftid,pastureid,ftid,pastureid','getFTDetailCompare','GetDataByName','子配方对比','tmrgo','{\"name\":\"getFTDetailCompare\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"ftid\":\"3041025691337884672\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"fid\":\"3029213841008886785\",\"fname\":\"饲料名称2\",\"fweight\":\"1.00\",\"id\":\"3041025691589542912\",\"islockcount\":0,\"pastureid\":\"3025176271438480383\",\"sort\":3},{\"fid\":\"3029213841008886786\",\"fname\":\"饲料名称3\",\"fweight\":\"1.00\",\"id\":\"3041025692461958144\",\"islockcount\":0,\"pastureid\":\"3025176271438480383\",\"sort\":3}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  163. (1350,352,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d %H:%i\')operatetime,emp,remain,pid,times,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND timesstr,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n barfeedremain\nWHERE pastureid = ? \n AND (( remaindate>=? and remaindate<=?) OR ? = \'\')\n AND (barid=? OR ? = \'\' )\nORDER BY id DESC','pastureid,startTime,stopTime,startTime,barid,barid','getBarfeedremainList','GetDataByName','剩料记录列表','tmrgo','{\"name\":\"getBarfeedremainList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3041025691337884674\",\"barname\":\"22\",\"emp\":\"1\",\"id\":\"3041025691337884673\",\"operatetime\":\"2020-09-07 10:50\",\"pastureid\":\"3025176271438480383\",\"pid\":1,\"remain\":\"33.00\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  164. (1351,352,'delete from barfeedremain where pastureid=? and id = ? ','pastureid,id','deleteBarfeedremain','PostDataByName','删除剩料记录','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  165. (1352,352,'update barfeedremain set operatetime =?,emp =?,barname =?,barid =?,remaindate =?,remain =?,times =?\nwhere pastureid=? and id=?','operatetime,emp,barname,barid,operatetime,remain,times,pastureid,id','updateBarfeedremain','PostDataByName','修改剩料记录','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  166. (1353,352,'INSERT INTO barfeedremain(id,pastureid,operatetime,emp,barname,barid,remaindate,remain,times) VALUES (?,?,?,?,?,?,?,?,?) ','snowid,pastureid,operatetime,emp,barname,barid,operatetime,remain,times','insertBarfeedremain','PostDataByName','新增剩料记录','tmrgo','{\"name\":\"insertBarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  167. (1354,352,'call copybarfeedremain(?,?) ','id,pastureid','copybarfeedremainV1','PostDataByName','新增剩料记录','tmrgo','{\"name\":\"insertBarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  168. (1355,351,'call copybarmilk(?,?)','id,pastureid','copybarmilkV1','PostDataByName','新增栏舍生产性能','tmrgo','{\"name\":\"insertBarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  169. (1356,352,'INSERT INTO barfeedremain(id,pastureid,operatetime,emp,barname,barid,remaindate,remain,pid,times) \n\nSELECT\n?, pastureid,NOW(),emp,barname,barid,NOW(),remain,pid,times\nFROM\n barfeedremain WHERE id=? AND pastureid=?','snowid,id,pastureid','copybarfeedremain','PostDataByName','复制剩料记录','tmrgo','{\"name\":\"copybarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  170. (1357,352,'INSERT INTO barmilk(id,pastureid,barid,barname,productdate,product,avgmonthage,bw,dayw,fetal,avgdim,dayspre,fat,pro,lactose,\n source,tem,cowsum,cowclass,cowclassid,bigcowclass,emp) \nSELECT\n ?, pastureid,barid,barname,NOW(),product,avgmonthage,bw,dayw,fetal,avgdim,dayspre,fat,pro,lactose,\n source,tem,cowsum,cowclass,cowclassid,bigcowclass,emp\nFROM\n barmilk WHERE id=? AND pastureid=?','snowid,id,pastureid','copybarmilk','PostDataByName','复制栏舍生产性能','tmrgo','{\"name\":\"copybarmilk\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3045249988721902592\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":3045249988721902600,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  171. (1358,353,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimesstr,\nfreshweight,dryweight,thoweight,actweight,emp,ftname,trim(ftid) ftid,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n ftdry\nWHERE pastureid = ? \n AND (( operatetime >=? and operatetime<=?) OR ? = \'\')\n AND (barid=? OR ? = \'\' )\n AND (times=? OR ? = \'\' )\nORDER BY operatetime DESC,id DESC','pastureid,startTime,stopTime,startTime,barid,barid,times,times','getFtdryList','GetDataByName','配方干物质列表','tmrgo','{\"name\":\"getBarfeedremainList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3041025691337884674\",\"barname\":\"22\",\"emp\":\"1\",\"id\":\"3041025691337884673\",\"operatetime\":\"2020-09-07 10:50\",\"pastureid\":\"3025176271438480383\",\"pid\":1,\"remain\":\"33.00\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  172. (1359,353,'delete from ftdry where pastureid=? and id = ? ','pastureid,id','deleteFtdry','PostDataByName','删除配方干物质','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  173. (1360,353,'INSERT INTO ftdry(id,pastureid,barid,barname,times,freshweight,dryweight,thoweight,actweight,emp,operatetime) VALUES (?,?,?,?,?,?,?,?,?,?,?) ','snowid,pastureid,barid,barname,times,freshweight,dryweight,thoweight,actweight,emp,operatetime','insertFtdry','PostDataByName','新增配方干物质','tmrgo','{\"name\":\"insertBarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  174. (1361,353,'update ftdry set barid =?,barname =?,times =?,freshweight =?,dryweight =?,thoweight =?,actweight =?,emp =?,operatetime =?\nwhere pastureid=? and id=?','barid,barname,times,freshweight,dryweight,thoweight,actweight,emp,operatetime,pastureid,id','updateFtdry','PostDataByName','修改配方干物质','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  175. (1362,353,'INSERT INTO ftdry(id,pastureid,barid,barname,times,freshweight,dryweight,thoweight,actweight,emp,operatetime,ftname,ftid) \n\nSELECT\n ?,pastureid,barid,barname,times,freshweight,dryweight,thoweight,actweight,emp,now(),ftname,ftid\nFROM\n ftdry WHERE id=? AND pastureid=?','snowid,id,pastureid','copyFtdry','PostDataByName','复制配方干物质','tmrgo','{\"name\":\"copybarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  176. (1364,352,'SELECT\nemp\nFROM\n barfeedremain\nWHERE pastureid = ?\nGROUP BY emp\nORDER BY id DESC','pastureid','getBarfeedremainEmpHis','GetDataByName','剩料记录员工列表','tmrgo','{\"name\":\"getBarfeedremainEmpHis\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"emp\":\"1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  177. (1365,355,'SELECT\nemp\nFROM\n pennsieve\nWHERE pastureid = ?\nGROUP BY emp\nORDER BY id DESC','pastureid','getPennsieveEmpHis','GetDataByName','宾州筛员工列表','tmrgo','{\"name\":\"getFtdryEmpHis\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  178. (1366,355,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times timesstr,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND times,\nonerate,oneweight,tworate,twoweight,threerate,threeweight,fourrate,fourweight,remark,emp,ccname,planid,onerange,tworange,threerange,fourrange,\ntrim(ccid) ccid,\nTRIM(id) id,\nTRIM(pastureid) pastureid,\nCONCAT(onerange,tworange,threerange,fourrange) standard\nFROM\n pennsieve\nWHERE pastureid = ? \n AND (( operatetime >=? and operatetime<=?) OR ? = \'\')\n AND (barid=? OR ? = \'\' )\n AND (times=? OR ? = \'\' )\nORDER BY operatetime DESC,id DESC','pastureid,startTime,stopTime,startTime,barid,barid,times,times','getPennsieveList','GetDataByName','宾州筛列表','tmrgo','{\"name\":\"getPennsieveList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3028006959913108480\",\"barname\":\"15\",\"emp\":\"张三\",\"fourrange\":\"60-100\",\"fourrate\":\"40\",\"fourweight\":\"40\",\"ftid\":\"11\",\"ftname\":\"22\",\"id\":\"3025176271438480385\",\"onerange\":\"5-15\",\"onerate\":\"10\",\"oneweight\":\"10\",\"operatetime\":\"2020-09-08T00:00:00+08:00\",\"pastureid\":\"3025176271438480383\",\"planid\":33,\"remark\":\"111\",\"threerange\":\"35-60\",\"threerate\":\"30\",\"threeweight\":\"30\",\"times\":\"3\",\"tworange\":\"15-35\",\"tworate\":\"20\",\"twoweight\":\"20\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  179. (1367,355,'delete from pennsieve where pastureid=? and id = ? ','pastureid,id','deletePennsieve','PostDataByName','删除宾州筛','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  180. (1368,355,'INSERT INTO pennsieve(id,pastureid,barid,barname,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,fourrate,fourweight,remark,emp,operatetime,onerange,tworange,threerange,fourrange,ccid,ccname) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,if(?=\'\',-1,?),?) ','snowid,pastureid,barid,barname,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,fourrate,fourweight,remark,emp,operatetime,onerange,tworange,threerange,fourrange,ccid,ccid,ccname','insertPennsieve','PostDataByName','新增宾州筛','tmrgo','{\"name\":\"insertBarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  181. (1369,355,'update pennsieve set barid =?,barname =?,times =?,onerate =?,oneweight =?,tworate =?,twoweight =?,threerate =?,threeweight =?,fourrate =?,fourweight =?,remark =?,emp =?,operatetime =?,onerange =?,tworange =?,threerange =?,fourrange =?,ccid=if(?=\'\',-1,?),ccname=?\nwhere pastureid=? and id=?','barid,barname,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,fourrate,fourweight,remark,emp,operatetime,onerange,tworange,threerange,fourrange,ccid,ccid,ccname,pastureid,id','updatePennsieve','PostDataByName','修改宾州筛','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  182. (1370,355,'INSERT INTO pennsieve(id,pastureid,barid,barname,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,fourrate,fourweight,remark,emp,operatetime,ccid,ccname,planid,onerange,tworange,threerange,fourrange) \nSELECT\n?, pastureid,barid,barname,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,fourrate,fourweight,remark,emp,now(),ccid,ccname,planid,onerange,tworange,threerange,fourrange\nFROM\n pennsieve WHERE id=? AND pastureid=?','snowid,id,pastureid','copyPennsieve','PostDataByName','新增宾州筛','tmrgo','{\"name\":\"copybarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  183. (1371,355,'SELECT bm.`cowclass` ccname,TRIM(bm.`cowclassid`) ccid,b.id,CONCAT(\'(\',bzonemin,\'-\',bzonemax,\')\')oneRange, CONCAT(\'(\',bztwomin,\'-\',bztwomax,\')\')twoRange, \nCONCAT(\'(\',bzthreemin,\'-\',bzthreemax,\')\')threeRange, CONCAT(\'(\',bzfourmin,\'-\',bzfourmax,\')\')fourRange FROM bar b\nLEFT JOIN barmilk bm\nON bm.`barid` = b.`id` AND bm.`pastureid` = ?\nLEFT JOIN optrange op\nON op.`cowclassid` = bm.`cowclassid` AND op.`pastureid` = ?\nWHERE b.pastureid=? and b.`id` = ? and bm.productdate <= ?\n ORDER BY bm.`productdate` DESC','pastureid,pastureid,pastureid,barid,date','getPennsieveRange','GetDataByName','宾州筛范围','tmrgo','{\"name\":\"getPennsieveRange\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-01\",\"barid\":\"3028006959913108480\",\"enable\":1}}','{\"code\":0,\"list\":[{\"fourRange\":\"(30-40)\",\"id\":3028006959913108500,\"oneRange\":\"(10-20)\",\"productdate\":\"2020-09-01T00:00:00+08:00\",\"threeRange\":\"(10-20)\",\"twoRange\":\"(30-40)\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  184. (1372,356,'SELECT\nemp\nFROM\n dungsieve\nWHERE pastureid = ?\nGROUP BY emp\nORDER BY id DESC','pastureid','getDungsieveEmpHis','GetDataByName','粪便筛员工列表','tmrgo','{\"name\":\"getFtdryEmpHis\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  185. (1373,356,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nonerate,oneweight,tworate,twoweight,threerate,threeweight,remark,emp,planid,ccname,onerange,tworange,threerange,\ntrim(ccid) ccid,\nTRIM(id) id,\nTRIM(pastureid) pastureid,\n CONCAT(onerange,tworange,threerange) standard\nFROM\n dungsieve\nWHERE pastureid = ? \n AND (( operatetime >=? and operatetime<=?) OR ? = \'\')\n AND (barid=? OR ? = \'\' )\n AND (times=? OR ? = \'\' )\nORDER BY operatetime DESC,id DESC','pastureid,startTime,stopTime,startTime,barid,barid,times,times','getDungsieveList','GetDataByName','粪便筛列表','tmrgo','{\"name\":\"getDungsieveList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  186. (1374,356,'delete from dungsieve where pastureid=? and id = ? ','pastureid,id','deleteDungsieve','PostDataByName','删除粪便筛','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  187. (1375,356,'INSERT INTO dungsieve(id,pastureid,barname,barid,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,remark,emp,operatetime,onerange,tworange,threerange,ccid,ccname) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,if(?=\'\',-1,?),?) ','snowid,pastureid,barname,barid,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,remark,emp,operatetime,onerange,tworange,threerange,ccid,ccid,ccname','insertDungsieve','PostDataByName','新增粪便筛','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  188. (1376,356,'update dungsieve set barname =?,barid =?,times =?,onerate =?,oneweight =?,tworate =?,twoweight =?,threerate =?,threeweight =?,remark =?,emp =?,operatetime =?,onerange =?,tworange =?,threerange =?,ccid =if(?=\'\',-1,?),ccname=?\nwhere pastureid=? and id=?','barname,barid,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,remark,emp,operatetime,onerange,tworange,threerange,ccid,ccid,ccname,pastureid,id','updateDungsieve','PostDataByName','修改粪便筛','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  189. (1377,356,'INSERT INTO dungsieve(id,pastureid,barname,barid,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,remark,emp,operatetime,planid,ccname,ccid,onerange,tworange,threerange) \nSELECT\n?,pastureid,barname,barid,times,onerate,oneweight,tworate,twoweight,threerate,threeweight,remark,emp,now(),planid,ccname,ccid,onerange,tworange,threerange\nFROM\n dungsieve WHERE id=? AND pastureid=?','snowid,id,pastureid','copyDungsieve','PostDataByName','新增粪便筛','tmrgo','{\"name\":\"copyDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  190. (1378,356,'SELECT bm.`cowclass` ccname,TRIM(bm.`cowclassid`) ccid,b.id,CONCAT(\'(\',fbonemin,\'-\',fbonemax,\')\')oneRange, CONCAT(\'(\',fbtwomin,\'-\',fbtwomax,\')\')twoRange, \nCONCAT(\'(\',fbthreemin,\'-\',fbthreemax,\')\')threeRange FROM bar b\nLEFT JOIN barmilk bm\nON bm.`barid` = b.`id` AND bm.`pastureid` = ?\nLEFT JOIN optrange op\nON op.`cowclassid` = bm.`cowclassid` AND op.`pastureid` = ?\nWHERE b.pastureid=? and b.`id` = ? and bm.productdate <= ?\n ORDER BY bm.`productdate` DESC','pastureid,pastureid,pastureid,barid,date','getDungsieveRange','GetDataByName','粪便筛范围','tmrgo','{\"name\":\"getDungsieveRange\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-01\",\"barid\":\"3028006959913108480\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":3028006959913108500,\"oneRange\":\"(0-10)\",\"threeRange\":\"(30-40)\",\"twoRange\":\"(20-30)\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  191. (1379,357,'SELECT\nemp\nFROM\n dungscore\nWHERE pastureid = ?\nGROUP BY emp\nORDER BY id DESC','pastureid','getDungscoreEmpHis','GetDataByName','粪便评分员工列表','tmrgo','{\"name\":\"getFtdryEmpHis\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  192. (1380,357,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nstandardscore,cowsum,1score score1,2score score2,3score score3,4score score4,5score score5,remark,emp,ftname,\ntrim(ftid) ftid,\nTRIM(id) id,\n (SELECT bm.product FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)product,\n (SELECT bm.avgdim FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)avgdim,\n SUM(p.1score+p.2score+p.3score+p.4score+p.5score) sumcowcount,\nROUND(IFNULL((SELECT SUM(d2.`actualweightminus`)/d2.`cowcount` FROM `downloadplandtl2` d2 where d2.`fbarid` = p.barid AND d2.`pastureid` = p.pastureid),0),2) cowneed,\nTRIM(pastureid) pastureid\nFROM\n dungscore p\nWHERE pastureid = ? \n AND (( operatetime >=? and operatetime<=?) OR ? = \'\')\n AND (barid=? OR ? = \'\' )\n AND (times=? OR ? = \'\' )\nORDER BY operatetime DESC,id DESC','pastureid,startTime,stopTime,startTime,barid,barid,times,times','getDungscoreList','GetDataByName','粪便评分列表','tmrgo','{\"name\":\"getDungscoreList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"1score\":5,\"2score\":10,\"3score\":45,\"4score\":20,\"5score\":25,\"barid\":\"3028006959913108480\",\"barname\":\"15\",\"cowsum\":105,\"emp\":\"老八\",\"ftid\":\"1\",\"ftname\":\"1\",\"id\":\"3025176271438480384\",\"operatetime\":\"2020-09-08\",\"pastureid\":\"3025176271438480383\",\"remark\":\"单\",\"standardscore\":\"3\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  193. (1381,357,'delete from dungscore where pastureid=? and id = ? ','pastureid,id','deleteDungscore','PostDataByName','删除粪便评分','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  194. (1382,357,'INSERT INTO dungscore(id,pastureid,barname,barid,times,standardscore,cowsum,1score,2score,3score,4score,5score,remark,emp,operatetime,ftid,ftname) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ','snowid,pastureid,barname,barid,times,standardscore,cowsum,score1,score2,score3,score4,score5,remark,emp,operatetime,ftid,ftname','insertDungscore','PostDataByName','新增粪便评分','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  195. (1383,357,'update dungscore set barname =?,barid =?,times =?,standardscore =?,cowsum =?,1score =?,2score =?,3score =?,4score =?,5score =?,remark =?,emp =?,operatetime =?,ftid =?,ftname =?\nwhere pastureid=? and id=?','barname,barid,times,standardscore,cowsum,score1,score2,score3,score4,score5,remark,emp,operatetime,ftid,ftname,pastureid,id','updateDungscore','PostDataByName','修改粪便评分','tmrgo','{\"name\":\"updateDungscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  196. (1384,357,'INSERT INTO dungscore(id,pastureid,barname,barid,times,standardscore,cowsum,1score,2score,3score,4score,5score,remark,emp,operatetime,ftid,ftname) \nSELECT\n?,pastureid,barname,barid,times,standardscore,cowsum,1score,2score,3score,4score,5score,remark,emp,now(),ftid,ftname\nFROM\n dungscore WHERE id=? AND pastureid=?','snowid,id,pastureid','copyDungscore','PostDataByName','复制粪便评分','tmrgo','{\"name\":\"copyDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  197. (1385,357,'SELECT trim(b.id) id,op.`dungstandard`,op.`bodystandard`,trim(fp.ftid)ftid ,fp.`ftname` FROM bar b\nLEFT JOIN feedpdate fp\nON fp.`barid` = b.`id` AND fp.`pastureid` = ?\nLEFT JOIN `optscore` op\nON op.`ftid` =fp.`ftid` AND op.`pastureid` = ?\nWHERE b.pastureid=? and b.`id` = ? and fp.date<= ?\n ORDER BY fp.`date` DESC','pastureid,pastureid,pastureid,barid,date','getDungAndBodyScore','GetDataByName','粪便评分标准参数','tmrgo','{\"name\":\"getDungscoreScore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-09\",\"barid\":\"3028006959913108480\",\"enable\":1}}','null',0,1,0,0,0),
  198. (1386,358,'SELECT\nemp\nFROM\n bodyscore\nWHERE pastureid = ?\nGROUP BY emp\nORDER BY id DESC','pastureid','getBodyscoreEmpHis','GetDataByName','体况评分员工列表','tmrgo','{\"name\":\"getFtdryEmpHis\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  199. (1387,358,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nstandardscore,cowsum,remark,emp,ftname,\nscore25,score275,score3,score325,score35,score375,`score4`,\ntrim(ftid) ftid,\nTRIM(id) id,\n (SELECT bm.product FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)product,\n (SELECT bm.avgdim FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)avgdim,\n SUM(p.score25+p.score275+p.score3+p.score325+p.score35+p.score375+p.score4) sumcowcount,\nROUND(IFNULL((SELECT SUM(d2.`actualweightminus`)/d2.`cowcount` FROM `downloadplandtl2` d2 where d2.`fbarid` = p.barid AND d2.`pastureid` = p.pastureid),0),2) cowneed,\nTRIM(pastureid) pastureid\nFROM\n bodyscore p\nWHERE pastureid = ? \n AND (( operatetime >=? and operatetime<=?) OR ? = \'\')\n AND (barid=? OR ? = \'\' )\n AND (times=? OR ? = \'\' )\nORDER BY operatetime DESC,id DESC','pastureid,startTime,stopTime,startTime,barid,barid,times,times','getBodyscoreList','GetDataByName','体况评分列表','tmrgo','{\"name\":\"getBodyscoreList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"2\",\"barname\":\"1\",\"cowsum\":100,\"emp\":\"朱一\",\"ftid\":\"1\",\"ftname\":\"2\",\"id\":\"3025176271438480387\",\"operatetime\":\"2020-09-08\",\"pastureid\":\"3025176271438480383\",\"remark\":\"0\",\"score25\":10,\"score275\":20,\"score3\":30,\"score325\":40,\"score35\":0,\"score375\":0,\"score4\":0,\"standardscore\":\"4\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  200. (1388,358,'delete from bodyscore where pastureid=? and id = ? ','pastureid,id','deleteBodyscore','PostDataByName','删除体况评分','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  201. (1389,358,'INSERT INTO bodyscore(id,pastureid,barname,barid,times,standardscore,cowsum,score25,score275,score3,score325,score35,score375,score4,remark,emp,operatetime,ftname,ftid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,if(?=\'\',null,?)) ','snowid,pastureid,barname,barid,times,standardscore,cowsum,score25,score275,score3,score325,score35,score375,score4,remark,emp,operatetime,ftname,ftid,ftid','insertBodyscore','PostDataByName','新增体况评分','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  202. (1390,358,'update bodyscore set barname =?,barid =?,times =?,standardscore =?,cowsum =?,score25 =?,score275 =?,score3 =?,score325 =?,score35 =?,score375 =?,score4 =?,remark =?,emp =?,operatetime =?\nwhere pastureid=? and id=?','barname,barid,times,standardscore,cowsum,score25,score275,score3,score325,score35,score375,score4,remark,emp,operatetime,pastureid,id','updateBodyscore','PostDataByName','修改体况评分','tmrgo','{\"name\":\"updateBodyscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  203. (1391,358,'INSERT INTO bodyscore(id,pastureid,barname,barid,times,standardscore,cowsum,score25,score275,score3,score325,score35,score375,score4,remark,emp,operatetime,ftname,ftid) \nSELECT\n?,pastureid,barname,barid,times,standardscore,cowsum,score25,score275,score3,score325,score35,score375,score4,remark,emp,NOW(),ftname,ftid\nFROM\n bodyscore WHERE id=? AND pastureid=?','snowid,id,pastureid','copyBodyscore','PostDataByName','复制体况评分','tmrgo','{\"name\":\"copyDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  204. (1393,354,'SELECT\nTRIM(eqid) eqid,eqclass,eqcode,driver,TRIM(driverid) driverid,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,\nTRIM(id) id,\nTRIM(pastureid) pastureid,emp\nFROM\n dutyrecord\nWHERE pastureid = ? \n AND (( operatetime >=? and operatetime<=?) OR ? = \'\')\n AND (eqclass=? OR ? = \'\' )\n AND (times=? OR ? = \'\' )\n AND (eqcode like concat(\'%\',?,\'%\') OR ? = \'\' )\n AND (driver like concat(\'%\',?,\'%\') OR ? = \'\' )\n\n\nunion \n\nSELECT\nTRIM(eqid) eqid,eqclass,eqcode,driver,TRIM(driverid) driverid,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,\nTRIM(dutyrecord.id) id,\nTRIM(dutyrecord.pastureid) pastureid,emp\nFROM\n dutyrecord JOIN \n\n (SELECT\nTRIM(MAX(id)) id,\nTRIM(pastureid) pastureid\nFROM\n dutyrecord\nWHERE pastureid = ?\nAND ( operatetime<=? and ?<>\'\')\nGROUP BY eqid,times) ww ON ww.pastureid = dutyrecord.`pastureid` AND ww.id = dutyrecord.`id`\n WHERE dutyrecord.pastureid = ? \n AND (eqclass=? OR ? = \'\' )\n AND (times=? OR ? = \'\' )\n AND (eqcode LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\' )\n AND (driver LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\' )\n\nORDER BY operatetime DESC,id DESC','pastureid,startTime,stopTime,startTime,eqclass,eqclass,times,times,eqcode,eqcode,driver,driver,pastureid,startTime,startTime,pastureid,eqclass,eqclass,times,times,eqcode,eqcode,driver,driver ','getDutyrecordList','GetDataByName','值班记录列表','tmrgo','{\"name\":\"getDutyrecordList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,\\nTRIM(id) id,\\nTRIM(pastureid) pa\' at line 14\"',0,1,0,0,0),
  205. (1394,354,'delete from dutyrecord where pastureid=? and id = ? ','pastureid,id','deleteDutyrecord','PostDataByName','删除值班记录','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  206. (1395,354,'INSERT INTO dutyrecord(id,pastureid,eqid,eqclass,eqcode,driver,driverid,times,operatetime,emp) VALUES (?,?,?,?,?,?,?,?,?,?) \nON DUPLICATE KEY UPDATE operatetime = ?','snowid,pastureid,eqid,eqclass,eqcode,driver,driverid,times,operatetime,emp,operatetime','insertDutyrecord','PostDataByName','新增值班记录','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  207. (1396,354,'update dutyrecord set eqid =?,eqclass =?,eqcode =?,driver =?,driverid =?,times =?,operatetime =?\nwhere pastureid=? and id=?','eqid,eqclass,eqcode,driver,driverid,times,operatetime,pastureid,id','updateDutyrecord','PostDataByName','修改值班记录','tmrgo','{\"name\":\"updateDutyrecord\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  208. (1397,342,'SELECT\nd.`drivercode`,\nd.`drivername`,\nTRIM(d.`id`) id\n\nFROM\n `driver` d\nWHERE d.pastureid = ? and d.`enable`=1\nand (d.drivername like concat(\'%\',?,\'%\') or ?= \'\')\n\nORDER BY d.id DESC','pastureid,drivername,drivername ','getDriverListEnable','GetDataByName','驾驶员列表','tmrgo','{\"name\":\"getDriverListEnable\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"drivername\":\"周\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"drivercode\":\"hn005\",\"drivername\":\"周师傅\",\"id\":\"3360023110929089536\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  209. (1398,354,'\nSELECT tmr.`eqcode`,TRIM(lpplan.tmrid) eqid,IF(tmr.tclassid=0,\'铲车\',\'TMR设备\')eqclass,lpplan .times,TRIM(lpplan.pastureid) pastureid,driver.`drivername` driver ,TRIM(driver.`id`)driverid,\nDATE_FORMAT(dr.operatetime,\'%Y-%m-%d\')operatetime,\nCASE lpplan.times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimesstr\nFROM lpplan \nINNER JOIN tmr\nON tmr.id = lpplan.tmrid AND tmr.`pastureid` = lpplan.pastureid\nLEFT JOIN dutyrecord dr\nON dr.pastureid = lpplan.pastureid AND dr.eqid =lpplan.tmrid AND dr.times = lpplan.`times` AND dr.operatetime = (SELECT MAX(operatetime) FROM dutyrecord WHERE pastureid=lpplan.pastureid AND eqid = lpplan.tmrid AND times = lpplan.`times`)\nLEFT JOIN driver \nON driver.`pastureid` = dr.pastureid AND driver.`id` = dr.driverid and driver.enable= 1\nWHERE lpplan.pastureid = ?\nGROUP BY lpplan.tmrid,lpplan.times\n\nUNION\n\nSELECT tmr.`eqcode`,TRIM(lpplandtl1.tmrid) eqid,IF(tmr.tclassid=0,\'铲车\',\'TMR设备\') eqclass,lpplan.times,TRIM(lpplan.pastureid) pastureid,driver.`drivername` driver ,TRIM(driver.`id`)driverid,\nDATE_FORMAT(dr.operatetime,\'%Y-%m-%d\')operatetime,\nCASE lpplan.times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimesstr\n\nFROM lpplandtl1 \nINNER JOIN tmr\nON tmr.id = lpplandtl1.tmrid AND tmr.`pastureid` = lpplandtl1.`pastureid`\nINNER JOIN lpplan\nON lpplan.id = lpplandtl1.lppid AND lpplan.`pastureid` = lpplandtl1.`pastureid`\nLEFT JOIN dutyrecord dr\nON dr.pastureid = lpplandtl1.pastureid AND dr.eqid =lpplandtl1.tmrid AND dr.times = lpplan.`times` AND dr.operatetime = (SELECT MAX(operatetime) FROM dutyrecord WHERE pastureid=lpplandtl1.pastureid AND eqid = lpplandtl1.tmrid AND times = lpplan.`times`)\nLEFT JOIN driver \nON driver.`pastureid` = dr.pastureid AND driver.`id` = dr.driverid and driver.enable= 1\nWHERE lpplandtl1.pastureid = ?\nGROUP BY lpplandtl1.tmrid,lpplan.times\n\nUNION\n\nSELECT tmr.`eqcode`,TRIM(remainplan.tmrid) eqid,IF(tmr.tclassid=0,\'铲车\',\'TMR设备\') eqclass,remainplan.times,TRIM(remainplan.pastureid) pastureid,driver.`drivername` driver ,TRIM(driver.`id`)driverid,\nDATE_FORMAT(dr.operatetime,\'%Y-%m-%d\')operatetime,\nCASE remainplan.times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimesstr\n\nFROM `remainplan` \nINNER JOIN tmr\nON tmr.id = remainplan.tmrid AND tmr.`pastureid` = remainplan.`pastureid`\nLEFT JOIN dutyrecord dr\nON dr.pastureid = remainplan.pastureid AND dr.eqid =remainplan.tmrid AND dr.times = remainplan.`times` AND dr.operatetime = (SELECT MAX(operatetime) FROM dutyrecord WHERE pastureid=remainplan.pastureid AND eqid = remainplan.tmrid AND times = remainplan.`times`)\nLEFT JOIN driver \nON driver.`pastureid` = dr.pastureid AND driver.`id` = dr.driverid and driver.enable= 1\nWHERE remainplan.pastureid = ?\nGROUP BY remainplan.tmrid,remainplan.times\n\nUNION\n\nSELECT tmr.`eqcode`,TRIM(remainplan.tmrid) eqid,IF(tmr.tclassid=0,\'铲车\',\'TMR设备\') eqclass,remainplan.times,TRIM(remainplan.pastureid) pastureid,driver.`drivername` driver ,TRIM(driver.`id`)driverid,\nDATE_FORMAT(dr.operatetime,\'%Y-%m-%d\')operatetime,\nCASE remainplan.times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimesstr\n\nFROM `premixplan` remainplan\nINNER JOIN tmr\nON tmr.id = remainplan.tmrid AND tmr.`pastureid` = remainplan.`pastureid`\nLEFT JOIN dutyrecord dr\nON dr.pastureid = remainplan.pastureid AND dr.eqid =remainplan.tmrid AND dr.times = remainplan.`times` AND dr.operatetime = (SELECT MAX(operatetime) FROM dutyrecord WHERE pastureid=remainplan.pastureid AND eqid = remainplan.tmrid AND times = remainplan.`times`)\nLEFT JOIN driver \nON driver.`pastureid` = dr.pastureid AND driver.`id` = dr.driverid and driver.enable= 1\nWHERE remainplan.pastureid = ?\nGROUP BY remainplan.tmrid,remainplan.times\nORDER BY times,eqcode','pastureid,pastureid,pastureid,pastureid','geEqListByDplan','GetDataByName','值班记录列表','tmrgo','{\"name\":\"geEqListByDplan\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"eqclass\":\"测试类别1\",\"eqcode\":\"测试编号1\",\"eqid\":1243,\"pastureid\":\"3025176271438480383\",\"times\":3},{\"eqclass\":\"测试类别2\",\"eqcode\":\"测试编号2\",\"eqid\":1244,\"pastureid\":\"3025176271438480383\",\"times\":2},{\"eqclass\":\"测试类别3\",\"eqcode\":\"测试编号3\",\"eqid\":1245,\"pastureid\":\"3025176271438480383\",\"times\":1}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  210. (1399,365,'SELECT trim(feedp.pastureid) pastureid,barname,trim(barid) barid,trim(ftid) arrid,1 as type,? as times,ft.tname ftname,ft.tcolor background FROM feedp \ninner join feedtemplet ft\non ft.id = feedp .ftid and ft.pastureid=?\nWHERE feedp.pastureid = ?\nGROUP BY feedp.ftid\nUNION\nSELECT trim(feedp.pastureid) pastureid,barname,barid,trim(ptsfid) arrid,0 as type,? as times,ft.tname ptsfname ,ft.tcolor background FROM feedp\ninner join feedtemplet ft\non ft.id = feedp .ptsfid and ft.pastureid=?\nWHERE feedp.pastureid = ? and (SELECT inforvalue FROM sysopt WHERE sysopt.`pastureid`=feedp.pastureid AND sysopt.`inforname`= \'isEnableSupplyFeed\') = 1\nGROUP BY feedp.`ptsfid`\n','times,pastureid,pastureid,times ,pastureid,pastureid','geFTListByFP','GetArrList','配方列表','tmrgo','{\"name\":\"geFTListByFP\",\"name1\":\"geFTListByFPDetail\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'ft.pastureid=?\\nWHERE feedp.pastureid = ? \\nGROUP BY feedp.`ptsfid`\' at line 9\"',0,1,0,0,0),
  211. (1400,365,'SELECT TRIM(id) id,times,tratio,ROUND(ptsrate*weight,2)-ptsuse weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM(ptid) ptid,TRIM(ptsid ) ptsid ,\n(select bname from bar where pastureid =fpdetail.pastureid and id = fpdetail.barid ) barname,\n ? AS background,? AS fttype,cowcount,ccountradio FROM fpdetail\nWHERE fpdetail.pastureid = ? AND ( fpdetail.`ptsid`=?) AND times=? AND ptsuse< ROUND(ptsrate*weight,2) \n\nUNION\nSELECT TRIM(id) id,times,tratio,ROUND((1-ptsrate)*weight,2)-ptuse weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM(ptid) ptid,TRIM(ptsid ) ptsid ,\n(select bname from bar where pastureid =fpdetail.pastureid and id = fpdetail.barid ) barname, \n? AS background,? AS fttype,cowcount,ccountradio FROM fpdetail\nWHERE fpdetail.pastureid = ? AND (fpdetail.`ptid`=? ) AND times=? AND ptuse<ROUND((1-ptsrate)*weight,2)\nORDER BY barid','background,type,pastureid,arrid,times,background,type,pastureid,arrid,times','geFTListByFPDetail','GetDataByName','配方栏舍列表','tmrgo','{\"name\":\"geFTListByFPDetail\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"arrid\":\"3045510162053334000\",\"times\":\"1\",\"enable\":1}}','\"sql: expected 10 arguments, got 12\"',0,1,0,0,0),
  212. (1401,335,'INSERT INTO feedp(id,pastureid,barname,barid,softccount,ccount,ratio,ccountratio,ftid,ftname,ptsfid,ptsfname,feedweight,ftweight,supplyweight) \nVALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) \nON DUPLICATE KEY UPDATE barname=?,barid=?,softccount=?,ccount=?,ratio=?,ccountratio=?,ftid=?,ftname=?,ptsfid=?,ptsfname=?,feedweight=?,ftweight=?,supplyweight=?','snowid,pastureid,barname,barid,softccount,ccount,ratio,ccountratio,ftid,ftname,ptsfid,ptsfname,feedweight,ftweight,supplyweight,barname,barid,softccount,ccount,ratio,ccountratio,ftid,ftname,ptsfid,ptsfname,feedweight,ftweight,supplyweight','updateBigFP','PostDataByName','新增栏舍配方主','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  213. (1402,335,'INSERT INTO fpdetail(id,pastureid,barid,barname,times,tratio,weight,cowcount,ccountradio,ptid,ptsid,ptsrate) \nVALUES (?,?,?,?,?,?,?,?,?,?,?,?/?) \nON DUPLICATE KEY UPDATE barid=?,barname=?,times =?,tratio =?,weight =?,cowcount =?,ccountradio =?,ptid =?,ptsid =?,ptsrate=?/?','snowid,pastureid,barid,barname,times,tratio,weight,cowcount,ratio,ptid,ptsid,supplyweight,feedweight,barid,barname,times,tratio,weight,cowcount,ratio,ptid,ptsid,supplyweight,feedweight','updateBigFPDetail','PostDataByName','新增栏舍配方子','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  214. (1403,334,'call applyFPdate(?,?)','date,pastureid','applyFPdate','PostDataByName','应用配方模板','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  215. (1404,334,'select if(DATE_FORMAT(max(date), \'%Y-%m-%d\')>DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(max(date), \'%Y-%m-%d\'))\n maxdate from feedpdate where pastureid=?','pastureid','getFPMaxDate','GetDataByName','配方模板列表历史最近日全球','tmrgo','{\"name\":\"getFTMaxDate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"maxdate\":\"2020-08-31\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  216. (1405,365,'SELECT\nifnull((select eqcode from tmr where pastureid =lpplan.pastureid and id = lpplan.tmrid ),lpplan.tmrname) tmrname,trim(tmrid) tmrid,sort,sel,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND timesstr,issplit,\ntimes,display,begintime,\n(select tname from feedtemplet where pastureid =lpplan.pastureid and id = lpplan.ftid ) ftname,sumcowcount,\nIFNULL(round((SELECT SUM(lpplandtl1.lweight) FROM `lpplandtl1` WHERE lpplandtl1.`lppid`=lpplan.id),2),0) sumweight ,\nifnull((select maxstirfeed from tmr where pastureid =lpplan.pastureid and id = lpplan.tmrid ),100000) maxweight,\nTRIM(ftid) ftid,\nTRIM(id) id,\nTRIM(id) lppid,\nTRIM(pastureid) pastureid\n\nFROM\n lpplan\nWHERE pastureid = ? and times <= (SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= lpplan.pastureid AND sysopt.`inforname`=\'times\')\nORDER BY lpplan.sort','pastureid ','getLppList','GetArrList','发料计划列表','tmrgo','{\"name\":\"getLppList\",\"name1\":\"getLppdList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'2),0),2) sumcowcount,maxweight,\\nTRIM(ftid) ftid,\\nTRIM(id) id,\\nTRIM(id) lppid,\\nTR\' at line 2\"',0,1,0,0,0),
  217. (1406,365,'delete from lpplan where pastureid=? and id = ? ','pastureid,id','deleteLpp','PostDataByName','删除发料计划','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  218. (1407,365,'INSERT INTO lpplan(id,pastureid,tmrname,tmrid,sort,sel,times,display,begintime,ftname,ftid,sumweight,maxweight,issplit) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?) ','snowid,pastureid,tmrname,tmrid,sort,sel,times,display,begintime,ftname,ftid,sumweight,maxweight,issplit','insertLpp','PostDataByName','新增发料计划','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  219. (1408,365,'update lpplan set tmrname =?,tmrid =?,sort =?,sel =?,times =?,display =?,begintime =?,ftname =?,ftid =?,sumweight =?,sumcowcount =?,maxweight =?,issplit= ?\nwhere pastureid=? and id=?','tmrname,tmrid,sort,sel,times,display,begintime,ftname,ftid,sumweight,sumcowcount,maxweight,issplit,pastureid,id','updateLpp','PostDataByName','修改发料计划','tmrgo','{\"name\":\"updateDutyrecord\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  220. (1409,365,'SELECT\ntrim(lpplandtl1.lppid) lppid,lweight,\nlpplandtl1.lweight weight,lpplandtl1.sort,\n(select bname from bar where pastureid =lpplandtl1.pastureid and id = lpplandtl1.barid ) barname,\nTRIM(lpplandtl1.fpdid) fpdid,\nTRIM(lpplandtl1.barid) barid,\nTRIM(lpplandtl1.id) id,\nTRIM(lpplandtl1.pastureid) pastureid,\n(SELECT tcolor FROM `feedtemplet` WHERE pastureid =lpplandtl1.`pastureid` AND id = IF(lpplandtl1.`fttype`=1,fpdetail.ptid,fpdetail.ptsid) ) background,\nlpplandtl1.fttype,\ntrim(lpplandtl1.tmrid) tmrid,\nifnull((select eqcode from tmr where pastureid =lpplandtl1.pastureid and id = lpplandtl1.tmrid ),lpplandtl1.tmrname) tmrname,\nifnull((select tcolor from tmr where pastureid =lpplandtl1.pastureid and id = lpplandtl1.tmrid ),\'#ccc\') tbackground,\nfpdetail.ptid,\nfpdetail.ptsid,\nfpdetail.times,\nfpdetail.cowcount,\nfpdetail.ccountradio\nFROM\n lpplandtl1\ninner join fpdetail\non lpplandtl1.fpdid= fpdetail.id and lpplandtl1.pastureid = fpdetail.pastureid \nWHERE lpplandtl1.pastureid = ? and lpplandtl1.lppid= ? and lpplandtl1.lweight>0\nORDER BY lpplandtl1.sort','pastureid,lppid','getLppdList','GetDataByName','发料计划列表-子','tmrgo','{\"name\":\"getLppdList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"lppid\":\"3025176271438480384\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'.weight,lpplandtl1.sort,lpplandtl1.barname,\\nTRIM(lpplandtl1.fpdid) fpdid,\\nTRIM(l\' at line 3\"',0,1,0,0,0),
  221. (1410,365,'delete from lpplandtl1 where pastureid=? and id = ? ','pastureid,id','deleteLppd','PostDataByName','删除发料计划-子','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  222. (1411,365,'INSERT INTO lpplandtl1(id,pastureid,lppid,barid,barname,fpdid,lweight,sort,tmrid,tmrname,fttype,background,cowcount,ccountradio) \nVALUES (?,?,?,?,?,?,?,?,\nIFNULL((SELECT * FROM ((SELECT lpplandtl1.tmrid FROM lpplandtl1 WHERE pastureid = ? AND lppid = ? ORDER BY sort LIMIT 1 )) ww),?),\nIFNULL((SELECT * FROM ((SELECT lpplandtl1.tmrname FROM lpplandtl1 WHERE pastureid = ? AND lppid = ? ORDER BY sort LIMIT 1 )) ww),?),\n?,?,IF(?=\'\',0,?),IF(?=\'\',0,?)) ON DUPLICATE KEY UPDATE lweight=lweight+?\n\n','snowid,pastureid,lppid,barid,barname,fpdid,lweight,sort,pastureid,lppid,tmrid,pastureid,lppid,tmrname,fttype,background,cowcount,cowcount,ccountradio,ccountradio,lweight','insertLppd','PostDataByName','新增发料计划-子','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  223. (1412,365,'update lpplandtl1 set lppid =?,barid =?,barname =?,fpdid =?,lweight =?,sort =?,tmrid =?,tmrname =?,background=?\nwhere pastureid=? and id=?','lppid,barid,barname,fpdid,lweight,sort,tmrid,tmrname,background,pastureid,id','updateLppd','PostDataByName','修改发料计划-子','tmrgo','{\"name\":\"updateDutyrecord\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  224. (1413,383,'SELECT GROUP_CONCAT(r.`name`) rolenames,GROUP_CONCAT(r.`id`) roleids,\ndname,display,statue,reportenable,emp,DATE_FORMAT(opratetime, \'%Y-%m-%d\')opratetime,\nTRIM(dashboard.id) id,\nTRIM(dashboard.pastureid) pastureid,\ntrim(dashboard.empid) empid\nFROM\n dashboard\n LEFT JOIN dashboard_role dr\n ON dr.`did`= dashboard.`id` AND dr.`pastureid` = dashboard.pastureid\n LEFT JOIN role r\n ON dr.`roleid`= r.`id` AND r.`pastureid` = dashboard.pastureid\nWHERE dashboard.pastureid = ? and (dashboard.empid=? or dashboard.statue=1)\n AND (dname like concat(\'%\',?,\'%\') OR ? = \'\' ) \n AND (statue=? OR ? = \'\' )\n GROUP BY dashboard.`id`\nORDER BY id DESC','pastureid,empid,dname,dname,statue,statue','getDashboardList','GetDataByName','仪表盘列表','tmrgo','{\"name\":\"getDashboardList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"display\":\"dd\",\"dname\":\"仪表3\",\"emp\":\"王二\",\"id\":\"3025176271438480380\",\"oprateTime\":\"2020-09-10\",\"pastureid\":\"3025176271438480383\",\"reportenable\":1,\"statue\":0},{\"display\":\"搭嘎好\",\"dname\":\"仪表2\",\"emp\":\"李四\",\"id\":\"3025176271438480379\",\"oprateTime\":\"2020-09-10\",\"pastureid\":\"3025176271438480383\",\"reportenable\":1,\"statue\":0},{\"display\":\"广大\",\"dname\":\"仪表1\",\"emp\":\"张三\",\"id\":\"3025176271438480378\",\"oprateTime\":\"2020-09-10\",\"pastureid\":\"3025176271438480383\",\"reportenable\":1,\"rolenames\":\"超级管理员,新\",\"statue\":0}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  225. (1414,383,'delete from dashboard where pastureid=? and id = ? ','pastureid,id','deleteDashboard','PostDataByName','删除仪表盘','tmrgo','{\"name\":\"deleteDashboard\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":\"0\",\"LastInsertIdStr\":0,\"RowsAffected\":0,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  226. (1415,383,'INSERT INTO dashboard(id,pastureid,dname,display,emp,empid) VALUES (?,?,?,?,?,?) ','snowid,pastureid,dname,display,emp,empid','insertDashboard','PostDataByName','新增仪表盘','tmrgo','{\"name\":\"insertDashboard\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"dname\":\"李五\",\"display\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  227. (1416,383,'update dashboard set dname =?,display =?,statue =?,reportenable =?,emp =?,opratetime=?\nwhere pastureid=? and id=?','dname,display,statue,reportenable,emp,opratetime,pastureid,id','updateDashboard','PostDataByName','修改仪表盘','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  228. (1417,353,'delete from dashboard_role where pastureid=? and did= ? ','pastureid,id','deleteDrole','PostDataByName','删除仪表盘_角色','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  229. (1418,353,'INSERT INTO dashboard_role(id,pastureid,roleid,did) VALUES (?,?,?,?) ','snowid,pastureid,roleid,id','insertDrole','PostDataByName','新增仪表盘-角色','tmrgo','{\"name\":\"insertBarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  230. (1419,365,'SELECT \ntname,usedsum,\nifnull(MAX(CASE\n WHEN times = 1 THEN\n usesum\n END\n) ,0)AS onetime,\nifnull(MAX(CASE\n WHEN times = 2 THEN\n usesum\n END\n) ,0)AS twotime\n,\nifnull(MAX(CASE\n WHEN times = 3 THEN\n usesum\n END\n),0) AS threetime,\nifnull(MAX(CASE\n WHEN times = 4 THEN\n usesum\n END\n) ,0)AS fourtime\nFROM \n\n(SELECT IFNULL(tem.tname,qq.tname) tname,IFNULL(tem.ptid,qq.ptid) ptid,tem.times times,\n IFNULL(tem.barsum,0) usesum , IFNULL(qq.barsum,0) usedsum \nFROM \n(SELECT ft.`tname` ,COUNT(fpdetail.`barid`)barsum,fpdetail.ptid,times\nFROM `fpdetail`\nINNER JOIN feedtemplet ft\nON ft.id = fpdetail .ptid AND ft.pastureid=?\nWHERE fpdetail.`pastureid` = ? AND ptuse < ROUND((1-ptsrate)*fpdetail.weight,2)\nAND times <= (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= fpdetail.`pastureid` AND sysopt.`inforname`= \'times\')\nGROUP BY ptid,times\nUNION \nSELECT ft.`tname` ,COUNT(fpdetail.`barid`) barsum,fpdetail.ptsid,times\nFROM `fpdetail` \nINNER JOIN feedtemplet ft\nON ft.id = fpdetail .ptsid AND ft.pastureid=?\nWHERE fpdetail.`pastureid` = ? AND ptsuse < ROUND(ptsrate*fpdetail.weight,2) \nAND times <= (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= fpdetail.`pastureid` AND sysopt.`inforname`= \'times\')\nGROUP BY ptsid,times) tem\n#####\n\nLEFT JOIN \n#####\n(SELECT ft.`tname` ,COUNT(fpdetail.`barid`)barsum,fpdetail.ptid\nFROM `fpdetail`\nINNER JOIN feedtemplet ft\nON ft.id = fpdetail .ptid AND ft.pastureid=?\nWHERE fpdetail.`pastureid` = ? \nAND times <= (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= fpdetail.`pastureid` AND sysopt.`inforname`= \'times\')\nGROUP BY ptid\n\nUNION \nSELECT ft.`tname` ,COUNT(fpdetail.`barid`) barsum,fpdetail.ptsid\nFROM `fpdetail` \nINNER JOIN feedtemplet ft\nON ft.id = fpdetail .ptsid AND ft.pastureid=?\nWHERE fpdetail.`pastureid` = ? \nAND times <= (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= fpdetail.`pastureid` AND sysopt.`inforname`= \'times\')\nGROUP BY ptsid)qq\n#####\nON qq.ptid= tem.ptid )ww\n\n GROUP BY ww.tname','pastureid,pastureid,pastureid,pastureid,pastureid,pastureid,pastureid,pastureid','getLppUseSUMList','GetDataByName','发料计划列表-子','tmrgo','{\"name\":\"getLppUseSUMList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"lppid\":\"3025176271438480384\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"onetime\":4,\"threetime\":3,\"tname\":\"test\",\"twotime\":4,\"usedsum\":12},{\"threetime\":2,\"tname\":\"补料1\",\"twotime\":2,\"usedsum\":6},{\"onetime\":1,\"threetime\":2,\"tname\":\"补料2\",\"twotime\":2,\"usedsum\":6},{\"onetime\":1,\"tname\":\"补料3\",\"usedsum\":3},{\"threetime\":2,\"tname\":\"配方1\",\"twotime\":2,\"usedsum\":6},{\"threetime\":2,\"tname\":\"配方2\",\"twotime\":2,\"usedsum\":6}],\"message\":\"ok\",\"pageSize\":0,\"total\":6}',0,1,0,0,0),
  231. (1420,383,'SELECT\nDATE_FORMAT(opratetime, \'%Y-%m-%d\')opratetime,display `desc`,cname,display,\ncname chart_name,statue,emp,\ntrim(empid)empid,\nTRIM(chart.id) id,\nTRIM(chart.id) chart_id,\nTRIM(chart.pastureid) pastureid,\ncontent\nFROM\n chart\nWHERE chart.pastureid = ? and (chart.empid=? or chart.statue=1)\n AND (cname like concat(\'%\',?,\'%\') OR ? = \'\' )\n AND (statue=? OR ? = \'\' )\nORDER BY id DESC','pastureid,empid,dname,dname,statue,statue','getChartList','GetDataByName','图表列表','tmrgo','{\"name\":\"getChartList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"chart_id\":\"2\",\"chart_name\":\"图表212\",\"desc\":\"daa\",\"emp\":\"test\",\"id\":\"2\",\"opratetime\":\"2020-09-11\",\"pastureid\":\"3025176271438480383\",\"statue\":\"1\"},{\"chart_id\":\"1\",\"chart_name\":\"图表1\",\"emp\":\"李四\",\"id\":\"1\",\"opratetime\":\"2020-09-11\",\"pastureid\":\"3025176271438480383\",\"statue\":\"1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  232. (1421,383,'delete from chart where pastureid=? and id = ? ','pastureid,id','deleteChart','PostDataByName','删除图表','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  233. (1422,383,'INSERT INTO chart(id,pastureid,cname,emp,empid,display,content) VALUES (?,?,?,?,?,?,?) ','snowid,pastureid,cname,emp,empid,display,content','insertChart','PostDataByName','新增图表','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  234. (1423,383,'update chart set cname =?,statue =?,emp =?,opratetime =?,display=?\nwhere pastureid=? and id=?','cname ,statue ,emp ,opratetime ,display,pastureid,id','updateChart','PostDataByName','修改图表','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  235. (1424,365,'SELECT\ntrim(lppid) lppid,\nlweight weight,sort,barname,\nTRIM(fpdid) fpdid,\nTRIM(tmrid) id,\nTRIM(barid) barid,\nTRIM(id) id,\nTRIM(pastureid) pastureid,\nfttype\nFROM\n lpplandtl1date\nWHERE pastureid = ? and lppid= ?\nORDER BY lpplandtl1date.sort','pastureid,lppid','getLppdListDatev1','GetDataByName','发料计划列表-子历史','tmrgo','{\"name\":\"getLppdListDate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"lppid\":\"3025176271438480384\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"22\",\"barname\":\"15\",\"fpdid\":\"2555\",\"id\":\"3025176271438480384\",\"lppid\":\"3025176271438480384\",\"lweight\":\"100.00\",\"pastureid\":\"3025176271438480383\",\"sort\":0}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  236. (1425,365,'SELECT\ntmrname,trim(tmrid) tmrid,sort,sel,\ntimes,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND timesstr,\ndisplay,begintime,ftname,sumweight,sumcowcount,maxweight,\nTRIM(ftid) ftid,\nTRIM(id) id,\nTRIM(id) lppid,\nTRIM(pastureid) pastureid\nFROM\n lpplandate\nWHERE pastureid = ? \nORDER BY lpplandate.sort','pastureid','getLppListDatev1','GetArrList','发料计划列表历史','tmrgo','{\"name\":\"getLppListHis\",\"name1\":\"getLppdListHis\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  237. (1426,343,'SELECT\neqcode,\ntname,\ndatacaptureno,\ntrim(tclassid) tclassid,\nconcat(tname,\' / \',eqcode) tmrmix,\ntclassname,\nmaxstirfeed,\nremark,\n`enable`,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n tmr\nWHERE pastureid = ? and enable=1 and if(?=0,tclassid=0,if(?=1,tclassid<>0,\'\'=\'\'))\nORDER BY tmr.id DESC','pastureid,eqtype,eqtype','getTMRListEnable','GetDataByName','tmr列表','tmrgo','{\"name\":\"getTMRListEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"eqtype\":\"2\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":2,\"enable\":1,\"eqcode\":\"05841\",\"id\":\"3029300176059106304\",\"maxstirfeed\":0,\"pastureid\":\"3025176271438480383\",\"remark\":\"维修中\",\"tclassid\":\"0\",\"tclassname\":\"\",\"tname\":\"东区铲车\"},{\"datacaptureno\":7,\"enable\":1,\"eqcode\":\"017288\",\"id\":\"3029299420144862208\",\"maxstirfeed\":2000,\"pastureid\":\"3025176271438480383\",\"remark\":\"在用\",\"tclassid\":\"2\",\"tclassname\":\"固定式\",\"tname\":\"拖拉机\"},{\"datacaptureno\":8,\"enable\":1,\"eqcode\":\"0000158\",\"id\":\"3027989712817619968\",\"maxstirfeed\":1000,\"pastureid\":\"3025176271438480383\",\"remark\":\"\",\"tclassid\":\"1\",\"tclassname\":\"自走式\",\"tname\":\"装载机\"},{\"datacaptureno\":4,\"enable\":1,\"eqcode\":\"09874\",\"id\":\"3026792763464614912\",\"maxstirfeed\":0,\"pastureid\":\"3025176271438480383\",\"remark\":\"保养中\",\"tclassid\":\"0\",\"tclassname\":\"\",\"tname\":\"西区铲车\"},{\"datacaptureno\":12,\"enable\":1,\"eqcode\":\"11\",\"id\":\"3026731597124076544\",\"maxstirfeed\":1,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"1\",\"tclassname\":\"自走式\",\"tname\":\"11\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":5}',0,1,0,0,0),
  238. (1427,365,'UPDATE fpdetail SET ptuse=IF(?=1,IF(ptuse+? <0,0,ptuse+?),ptuse),ptsuse=IF(?=0,IF(ptsuse+?<0,0,ptsuse+?),ptsuse)\nWHERE pastureid=? AND id=?','fttype,lweight,lweight,fttype,lweight,lweight,pastureid,id','updateFpdetailUse','PostDataByName','修改栏舍配方子','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  239. (1428,365,'call applyLPPdate(?,?)','date,pastureid','applyLPPdate','PostDataByName','应用配方模板','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  240. (1429,334,'select if(DATE_FORMAT(max(date), \'%Y-%m-%d\')>DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(max(date), \'%Y-%m-%d\'))\n maxdate from lpplandate where pastureid=?','pastureid','getLPPMaxDate','GetDataByName','配方模板列表历史最近日全球','tmrgo','{\"name\":\"getFTMaxDate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"maxdate\":\"2020-08-31\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  241. (1430,365,'UPDATE `lpplandtl1` SET sort=sort+1 WHERE pastureid=? AND sort>=? AND lppid =?','pastureid,sort,lppid','updateLpplandtlSorts','PostDataByName','修改栏舍配方子sort','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  242. (1431,365,'UPDATE `lpplandtl1` SET sort=? WHERE pastureid=? AND id =?','pastureid,id','updateLpplandtlSortone','PostDataByName','修改栏舍配方子','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  243. (1432,383,'SELECT IFNULL(\n(\nSELECT CASE \nWHEN IF(?=0,ROUND(ptsrate*weight,2)-ptsuse<?,ROUND((1-ptsrate)*weight,2)-ptuse<?)\nTHEN CONCAT(\'输入重量不可大于未分配重量,当前剩余量:\',\nIF(?=0,ROUND(ptsrate*weight,2)-ptsuse,ROUND((1-ptsrate)*weight,2)-ptuse))\nELSE \'\' END AS vmsg \nFROM `fpdetail` \nWHERE id = ? AND pastureid=?\n),\n\n\'栏舍不存在\') vmsg','fttype,lweight,lweight,fttype,fpdid,pastureid','checkFPdLeftW','GetDataByName','图表列表','tmrgo','{\"name\":\"checkFPdLeftW\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"fttype\":\"1\",\"lweight\":\"-0.17\",\"fpdid\":\"3061170366514201600\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"不可输入负数\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  244. (1433,338,'SELECT \n(SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = dlp.`pastureid` AND dr.`eqid` = dlp.`tmrid` and dr.times= dlp.times AND dr.`operatetime` <=dlp.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1)driver,\nGROUP_CONCAT(d2.fname ORDER BY d2.`sort` ) barnames,plantime,\nDATE_FORMAT(mydate, \'%Y-%m-%d\') mydate,projname,datacaptureno,tmrid,tmrtname,havebutton,inbuttontype,dlp.intime,dlp.completedtime,dlp.processtime,iscompleted, lpplantype,\nenable,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes,dlp.sort,dlp.remark,itemnum,outitems,feedpname,feedpcount,dlp.remark display,\ndlp.templetname ftname,\nIFNULL(IF(dlp.lpplantype =3,\n(SELECT TRIM(lppid) FROM `remainplandate` rm WHERE rm.pastureid = dlp.pastureid AND rm.id = dlp.pid AND rm.date = dlp.mydate)\n ,\n IF(dlp.lpplantype =4,\n (SELECT TRIM(lppid) FROM `premixplandate` rm WHERE rm.pastureid = dlp.pastureid AND rm.id = dlp.pid AND rm.date = dlp.mydate)\n ,\n TRIM(dlp.pid)\n )\n ),TRIM(dlp.pid))pid,\ntempid,templetname,thoweight,fpweight,dlp.lweight,iweight,oweight,\nTRIM(dlp.id) id,\nTRIM(dlp.pastureid) pastureid,\nIF(dlp.lpplantype IN(0,1,2),ROUND(dlp.lweight/(SELECT SUM(fweight) FROM `ftdetaildate` WHERE `date` = dlp.mydate AND pastureid = dlp.pastureid AND ftid = dlp.tempid),0),NULL)cowcount\nFROM\n downloadedplan dlp\n left JOIN downloadplandtl2 d2\n ON d2.pastureid=dlp.pastureid AND d2.`pid` = dlp.`id` AND d2.date = dlp.`mydate` \nWHERE dlp.pastureid = ? \n AND ( mydate =? ) \n AND (dlp.times=? OR ? = \'\' )\n AND (dlp.lpplantype=? OR ? = \'\' )\nGROUP BY dlp.`id`\nORDER BY dlp.sort','pastureid,mydate,times,times,lpplantype,lpplantype','getDownloadedplanList','GetDataByName','日执行计划主列表','tmrgo','{\"name\":\"getDownloadedplanList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barnames\":\"西区#6,东区#1\",\"datacaptureno\":5,\"driver\":\"2号驾驶员\",\"feedpcount\":0,\"havebutton\":0,\"id\":\"141\",\"inbuttontype\":0,\"iscompleted\":0,\"itemnum\":3,\"lpplantype\":2,\"lweight\":100,\"mydate\":\"2020-09-15T00:00:00+08:00\",\"outitems\":2,\"pastureid\":\"3025176271438480383\",\"pid\":\"3025176271438480384\",\"projname\":\"1.001\",\"sort\":1,\"tempid\":3025176272438480400,\"templetname\":\"配方1\",\"times\":1,\"tmrid\":3052766172849636400,\"tmrtname\":\"TMR004\"},{\"barnames\":\"西区#2,西区#6\",\"datacaptureno\":6,\"driver\":\"1号驾驶员\",\"feedpcount\":0,\"havebutton\":0,\"id\":\"142\",\"inbuttontype\":0,\"iscompleted\":0,\"itemnum\":3,\"lpplantype\":2,\"lweight\":100,\"mydate\":\"2020-09-15T00:00:00+08:00\",\"outitems\":2,\"pastureid\":\"3025176271438480383\",\"pid\":\"3025176271438480385\",\"projname\":\"3.002\",\"sort\":2,\"tempid\":3051208869281268700,\"templetname\":\"配方2\",\"times\":3,\"tmrid\":3052769584060302300,\"tmrtname\":\"TMR005\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  245. (1434,338,'SELECT \nsort,fname,lweight weight\nFROM \n downloadplandtl1\nWHERE pastureid = ? \n AND flpid=? \n AND date=?\nORDER BY downloadplandtl1.sort ','pastureid,flpid,date','getDownloadplandtl1List','GetDataByName','计划内容操作详情列表\n','tmrgo','{\"name\":\"getDownloadplandtl1List\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"flpid\":\"3025176271438480384\",\"date\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"fname\":\"饲料名称3\",\"sort\":1,\"weight\":\"0.26\"},{\"fname\":\"饲料名称2\",\"sort\":6,\"weight\":\"0.26\"},{\"fname\":\"饲料名称1\",\"sort\":7,\"weight\":\"0.26\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  246. (1435,338,'SELECT \nsort,fname,lweight weight,useinbartype\nFROM \n downloadplandtl2\nWHERE pastureid = ? \n AND flpid=? \n AND date=?\nORDER BY downloadplandtl2.sort ','pastureid,flpid,date','getDownloadplandt2List','GetDataByName','计划内容栏舍详情列表','tmrgo','{\"name\":\"getDownloadplandtl1List\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"flpid\":\"3025176271438480384\",\"date\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"fname\":\"饲料名称3\",\"sort\":1,\"weight\":\"0.26\"},{\"fname\":\"饲料名称2\",\"sort\":6,\"weight\":\"0.26\"},{\"fname\":\"饲料名称1\",\"sort\":7,\"weight\":\"0.26\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  247. (1436,338,'SELECT IFNULL(\n(\nSELECT CASE \nWHEN (SELECT COUNT(*) FROM `fpdetail`\nWHERE fpdetail.`pastureid` = ?\nAND (ptuse < ROUND((1-ptsrate)*fpdetail.weight,2)OR ptsuse < ROUND(ptsrate*fpdetail.weight,2) ))>0\nTHEN CONCAT(\'存在未分配\')\nELSE \'\' END AS vmsg \n),\n\'\') vmsg','pastureid','checkLLPIsDistribution','GetDataByName','新生成--撒料计划是否分配完毕\n','tmrgo','{\"name\":\"checkLLPIsDistribution\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"flpid\":\"3025176271438480384\",\"date\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"vmsg\":\"存在未分配\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  248. (1437,338,'SELECT IFNULL(\n(\nSELECT CASE \nWHEN (SELECT COUNT(*) FROM `downloadedplan`\nWHERE downloadedplan.`pastureid` = ? AND mydate = ?\nAND havebutton=1)>0\nTHEN CONCAT(\'\')\n# THEN CONCAT(\'当前日期已开始执行,不可重新生成\')\nELSE \'\' END AS vmsg \n),\n\'\') vmsg','pastureid,startTime','checkDLPIsStart','GetDataByName','新生成--日执行计划是否执行','tmrgo','{\"name\":\"checkDLPIsStart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"vmsg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  249. (1438,338,'call createdownloadedplan(?,?,?)','startTime,stopTime,pastureid','createdownloadedplan','PostDataByName','新生成日执行计划','tmrgo','{\"name\":\"checkDLPIsStart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"date\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"vmsg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  250. (1442,365,'UPDATE `lpplan` SET sumweight = ifnull((SELECT SUM(lpplandtl1.lweight) FROM `lpplandtl1` WHERE lpplandtl1.`lppid`=lpplan.id),0)\nwhere lpplan.pastureid=? and lpplan.id = ?','pastureid,lppid','updateLppWeight','PostDataByName','修改发料总重','tmrgo','{\"name\":\"updateLpp\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  251. (1443,365,'SELECT \n(\nSELECT CASE \nWHEN (SELECT ftid FROM `lpplan`\nWHERE lpplan.`pastureid` = ?\nAND id= ?)<>IF (1 =?, ?,?)\nAND (SELECT COUNT(lppd1.`id`) FROM `lpplandtl1` lppd1\nINNER JOIN `lpplan`\nON lppd1.`lppid` = lpplan.`id` AND lppd1.`pastureid` = lpplan.`pastureid`\nWHERE lpplan.`pastureid` = ? AND lpplan.id= ? AND lppd1.`barid`= ? )=0\nTHEN CONCAT(\'该栏舍配方与计划配方不匹配,无法分配\')\nWHEN ?<>?\nTHEN CONCAT(\'该栏舍配方与计划配方班次不匹配,无法分配\')\nELSE \'\' END AS vmsg \n\n) vmsg','pastureid,lppid,fttype,ptid,ptsid,pastureid,lppid,barid,times,timesTem','checkLLPDetailInsert','GetDataByName','新生成--撒料计划是否可插入','tmrgo','{\"name\":\"checkLLPDetailInsert\",\"parammaps\": {\n \"pastureid\": \"3025176271438480383\",\n \"barid\": \"3050941006599422976\",\n \"lppid\": \"3025176271438480384\",\n \"times\": 1,\n \"ptsid\": \"-1\",\n \"ptid\": \"3025176272438480393\",\n \"fttype\": \"1\"\n }}','{\"code\":0,\"list\":[{\"vmsg\":\"该栏舍配方与计划配方不匹配,无法分配\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  252. (1444,350,'SELECT \n(\nSELECT CASE \nWHEN \n(SELECT COUNT(*) FROM `barmilk` WHERE `pastureid` = ? AND barid=?)>0\nTHEN CONCAT(\'该栏舍已经使用,不可删除\')\nWHEN \n(SELECT COUNT(*) FROM `feedp` WHERE `pastureid` = ? AND barid=?)>0\nTHEN CONCAT(\'该栏舍已经使用,不可删除\')\n\nELSE \'\' END AS vmsg \n) vmsg','pastureid,barid,pastureid,barid','checkBarDelete','GetDataByName','栏舍删除-校验','tmrgo','{\"name\":\"checkBarDelete\",\"parammaps\": {\n \"pastureid\": \"3025176271438480383\",\n \"barid\": \"3055340423423198208\",\n \"lppid\": \"3025176271438480384\",\n \"times\": 1,\n \"ptsid\": \"-1\",\n \"ptid\": \"3025176272438480393\",\n \"fttype\": \"1\"\n }}','{\"code\":0,\"list\":[{\"vmsg\":\"该栏舍已经使用,不可删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  253. (1445,335,'SELECT\ntname,\nTRIM(id) id,\n(SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid) Sfweight\nFROM\nfeedtemplet\nWHERE pastureid=? AND ENABLE=1 AND fttypeid=1\nORDER BY id DESC','pastureid','getFTSWeight','GetDataByName','配方模板列表','tmrgo','{\"name\":\"getFTSWeight\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"Sfweight\":\"56.00\",\"SfweightLock\":\"0.00\",\"id\":\"3058200140793250816\",\"tname\":\"高产泌乳饲喂\"},{\"Sfweight\":\"75.00\",\"SfweightLock\":\"0.00\",\"id\":\"3057188086795994112\",\"tname\":\"干奶后期饲喂\"},{\"SfweightLock\":\"0.00\",\"id\":\"3057187938351186944\",\"tname\":\"干奶前期饲喂\"},{\"Sfweight\":\"50.00\",\"SfweightLock\":\"0.00\",\"id\":\"3055715213241746432\",\"tname\":\"中产泌乳饲料\"},{\"Sfweight\":\"10.75\",\"SfweightLock\":\"0.00\",\"id\":\"3051208869281268742\",\"tname\":\"育成后备配方\"},{\"Sfweight\":\"5.75\",\"SfweightLock\":\"0.00\",\"id\":\"3051208869281268739\",\"tname\":\"犊牛后备饲料\"},{\"Sfweight\":\"28.25\",\"SfweightLock\":\"0.00\",\"id\":\"3025176272438480393\",\"tname\":\"青年后备\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":7}',0,1,0,0,0),
  254. (1446,382,'SELECT table_name as \'table\' FROM information_schema.tables WHERE table_schema=\'tmrgo\' order by table_name ','','getTABLES','GetDataByName','获取表','tmrgo','{\"name\":\"getTABLES\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'table FROM information_schema.tables WHERE table_schema=\'tmrgo\' order by table\' at line 1\"',0,1,0,0,0),
  255. (1447,382,'SELECT \nCOLUMN_COMMENT Comment,\nCOLUMN_NAME `Field`,DATA_TYPE `Type`, IS_NULLABLE `Null`,COLUMN_KEY `Key`,COLUMN_DEFAULT `Default`,EXTRA `Extra`\n FROM information_schema.COLUMNS \nWHERE table_name = ? AND table_schema = \'tmrwatch\'','table_name ','getColumnName','GetDataByName','获取表字段','tmrgo','{\"name\":\"getColumnName\",\"parammaps\":{\"table_name\":\"chart\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"Extra\":\"auto_increment\",\"Field\":\"id\",\"Key\":\"PRI\",\"Null\":\"NO\",\"Type\":\"bigint\"},{\"Extra\":\"\",\"Field\":\"pastureid\",\"Key\":\"PRI\",\"Null\":\"NO\",\"Type\":\"bigint\"},{\"Default\":\"NULL\",\"Extra\":\"\",\"Field\":\"cname\",\"Key\":\"\",\"Null\":\"YES\",\"Type\":\"varchar\"},{\"Default\":\"NULL\",\"Extra\":\"\",\"Field\":\"statue\",\"Key\":\"\",\"Null\":\"YES\",\"Type\":\"varchar\"},{\"Default\":\"NULL\",\"Extra\":\"\",\"Field\":\"emp\",\"Key\":\"\",\"Null\":\"YES\",\"Type\":\"varchar\"},{\"Default\":\"current_timestamp()\",\"Extra\":\"\",\"Field\":\"opratetime\",\"Key\":\"\",\"Null\":\"YES\",\"Type\":\"datetime\"},{\"Default\":\"NULL\",\"Extra\":\"\",\"Field\":\"display\",\"Key\":\"\",\"Null\":\"YES\",\"Type\":\"varchar\"},{\"Default\":\"NULL\",\"Extra\":\"\",\"Field\":\"content\",\"Key\":\"\",\"Null\":\"YES\",\"Type\":\"longtext\"},{\"Default\":\"NULL\",\"Extra\":\"\",\"Field\":\"sourceid\",\"Key\":\"\",\"Null\":\"YES\",\"Type\":\"bigint\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":9}',0,1,0,0,0),
  256. (1448,382,'SELECT\nDATE_FORMAT(opratetime, \'%Y-%m-%d\')opratetime,display `desc`,\ncname chart_name,statue,emp,\nTRIM(chart.id) source_id,\nTRIM(chart.pastureid) pastureid,\ncontent \nFROM\n chart\nWHERE chart.pastureid = ? \n AND id = ?','pastureid,id','getChartDetail','GetDataByName','获取表字段','tmrgo','{\"name\":\"getChartDetail\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3061379167456592896\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"chart_name\":\"啊啊啊\",\"content\":\"{\\\"chartType\\\":\\\"bar\\\",\\\"dataSrc\\\":\\\"bar\\\",\\\"filters\\\":[],\\\"limit\\\":200,\\\"orderByStrs\\\":[],\\\"selectedCalcul\\\":[{\\\"Column\\\":\\\"autozone\\\",\\\"Type\\\":\\\"int\\\",\\\"availableFunc\\\":[{\\\"func\\\":\\\"sum\\\",\\\"name\\\":\\\"合计\\\"},{\\\"func\\\":\\\"avg\\\",\\\"name\\\":\\\"平均\\\"},{\\\"func\\\":\\\"max\\\",\\\"name\\\":\\\"最大值\\\"},{\\\"func\\\":\\\"min\\\",\\\"name\\\":\\\"最小值\\\"},{\\\"func\\\":\\\"count\\\",\\\"name\\\":\\\"计数\\\"},{\\\"func\\\":\\\"none\\\",\\\"name\\\":\\\"-\\\"}],\\\"calculFunc\\\":\\\"sum\\\",\\\"lable\\\":\\\"autozone(合计)\\\",\\\"name\\\":\\\"autozone\\\"}],\\\"selectedDimension\\\":[{\\\"Column\\\":\\\"bname\\\",\\\"Type\\\":\\\"varchar\\\",\\\"asxAxis\\\":true,\\\"id\\\":3,\\\"isDimension\\\":true,\\\"lable\\\":\\\"bname\\\",\\\"name\\\":\\\"bname\\\"}],\\\"source_id\\\":\\\"\\\"}\",\"desc\":\"123\",\"emp\":\"test\",\"opratetime\":\"2020-09-18\",\"pastureid\":\"3025176271438480383\",\"source_id\":\"3061379167456592896\",\"statue\":\"0\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  257. (1449,382,'update chart set cname =?,emp =?,display=?,content=?\nwhere pastureid=? and id=?','cname ,emp ,display,content,pastureid,id','updateChartV2','PostDataByName','修改图表','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  258. (1450,381,'SELECT \nTRIM(c.id) source_id,\nTRIM(c.id) chart_id,\ncname chart_name,c.display `desc`,reportenable,\nTRIM(dashboard.id) dashboard_id,\nTRIM(dashboard.pastureid) pastureid,\nc.content\nFROM\n dashboard\n LEFT JOIN dashboard_chart dc\n ON dc.`did`= dashboard.`id` AND dc.`pastureid` = dashboard.`pastureid`\n LEFT JOIN chart c\n ON dc.chartid= c.`id` AND c.`pastureid` = dc.`pastureid`\nWHERE dashboard.pastureid = ? AND dashboard.id=?','pastureid,did','getdashboard_chart','GetDataByName','获取表','tmrgo','{\"name\":\"getdashboard_chart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  259. (1451,382,'INSERT INTO dashboard_chart(id,pastureid,chartid,did) VALUES (?,?,?,?) ','snowid,pastureid,cid,did','insertdashboard_chart','PostDataByName','添加到看板','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  260. (1452,381,'select trim(dashboard.id) dashboard_id,dashboard.dname name,dashboard.display `desc`,dashboard.statue,content ,\nGROUP_CONCAT(dc.chartid) chartids \nfrom dashboard \nLEFT JOIN dashboard_chart dc\nON dc.did = dashboard.`id`\nwhere dashboard.pastureid=? and (dashboard.id=? or ?=\'\') and (dashboard.empid=?)\nGROUP BY dashboard.id','pastureid,did,did,empid','getdashboards','Dashboards','获取表','tmrgo','{\"name\":\"getdashboards\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"3046724737046152192\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"dashboards\":null,\"list\":null,\"message\":\"ok\",\"order\":[],\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  261. (1453,381,'update dashboard set dname =?,display =?\nwhere pastureid=? and id=?','dname,display,pastureid,id','updateDashboardV2','PostDataByName','修改仪表盘','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  262. (1454,382,'delete from dashboard_chart where pastureid = ? and chartid=? and did=?','pastureid,cid,did','deletedashboard_chart','PostDataByName','从看板删除','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  263. (1455,382,'SELECT \'车次\' AS \'tablename\' , \'trainnumber\' AS \'table\'\nUNION\nSELECT \'栏舍\' AS \'tablename\' , \'barroport\' AS \'table\'','','getTABLESV2','GetDataByName','获取表','tmrgo','{\"name\":\"getTABLES\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'table FROM information_schema.tables WHERE table_schema=\'tmrgo\' order by table\' at line 1\"',0,1,0,0,0),
  264. (1457,383,'SELECT TRIM(role.id) id,role.name rolename,enable,remark FROM role \nINNER JOIN `dashboard_role` dr\nON dr.`roleid` = role.`id`\nWHERE role.pastureid=? AND dr.`did` = ?\nORDER BY role.id DESC','pastureid,did','getRoleByDid','GetDataByName','角色首页列表','tmrgo','{\"name\":\"getRoleByDid\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"did\":\"3025176271438480378\",\"drivername\":\"李五\",\"enable\":1}}','{\"code\":0,\"list\":[{\"enable\":1,\"id\":\"3046723478587180032\",\"remark\":\"123\",\"rolename\":\"test\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  265. (1458,334,'call updateFPbyFTChange(?,?,?)','ftid,pastureid,type','updateFPbyFTChange','PostDataByName','配方修改更新栏舍配方','tmrgo','{\"name\":\"updateFPbyFTChange\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"ftid \":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  266. (1459,334,'call updateLPPbyFPChange(?,?)','fpid,pastureid','updateLPPbyFPChange','PostDataByName','配方修改更新栏舍配方','tmrgo','{\"name\":\"updateFPbyFTChange\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"ftid \":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  267. (1460,347,'INSERT INTO feednur(id,pastureid,fid,fname,feedcode,price,remark,dry,starch,cp,ca,p,n,fat,adf,ndf,ndip,ash,fpercent,iscu,sources,feednurid) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,1,?) ON DUPLICATE KEY UPDATE dry=?,starch=?,cp=?,ca=?,p=?,n=?,fat=?,adf=?,ndf=?,ndip=?,ash=?,fpercent=?,iscu=?,feednurid=?','snowid,pastureid,fid,fname,feedcode,price,remark,dry,starch,cp,ca,p,n,fat,adf,ndf,ndip,ash,fpercent,iscu,feednurid,dry,starch,cp,ca,p,n,fat,adf,ndf,ndip,ash,fpercent,iscu,feednurid','insertFeednurV2','PostDataByName','新增饲料库(营养价值)','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  268. (1461,21,'update user set password=\'e10adc3949ba59abbe56e057f20f883e\' where pastureid = ? and id = ?','pastureid,id','initPassword','GetDataByName','用户管理-初始化密码','tmrgo','{\"name\":\"initPassword\",\"parammaps\":{\"jwt_username\":\"00028\"}}','',0,1,0,0,0),
  269. (1462,383,'SELECT\nDATE_FORMAT(opratetime, \'%Y-%m-%d\')opratetime,display `desc`,cname,display,\ncname chart_name,statue,emp,\ntrim(empid)empid,\nTRIM(chart.id) id,\nTRIM(chart.id) chart_id,\nTRIM(chart.pastureid) pastureid,\ncontent\nFROM\n chart\nWHERE chart.pastureid = ? and (chart.empid=?)\nORDER BY id DESC','pastureid,empid','getChartListV2','GetDataByName','图表列表仅自己','tmrgo','{\"name\":\"getChartList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"chart_id\":\"2\",\"chart_name\":\"图表212\",\"desc\":\"daa\",\"emp\":\"test\",\"id\":\"2\",\"opratetime\":\"2020-09-11\",\"pastureid\":\"3025176271438480383\",\"statue\":\"1\"},{\"chart_id\":\"1\",\"chart_name\":\"图表1\",\"emp\":\"李四\",\"id\":\"1\",\"opratetime\":\"2020-09-11\",\"pastureid\":\"3025176271438480383\",\"statue\":\"1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  270. (1463,365,'SELECT \n(\nSELECT CASE \nWHEN (SELECT ftid FROM `lpplan`\nWHERE lpplan.`pastureid` = ?\nAND id= ?)<>IF (1 =?, ?,?)\nAND (SELECT COUNT(lppd1.`id`) FROM `lpplandtl1` lppd1\nINNER JOIN `lpplan`\nON lppd1.`lppid` = lpplan.`id` AND lppd1.`pastureid` = lpplan.`pastureid`\nWHERE lpplan.`pastureid` = ? AND lpplan.id= ? AND lppd1.`barid`= ? )=0\nTHEN CONCAT(\'该栏舍配方与计划配方不匹配,无法分配\')\nWHEN ?<>?\nTHEN CONCAT(\'该栏舍配方与计划配方班次不匹配,无法分配\')\nELSE \'\' END AS vmsg \n\n) vmsg','pastureid,lppid,fttype,ptid,ptsid,pastureid,lppid,barid,times,timesTem','checkLLPDetailInsertV2','GetDataByName','新生成--撒料计划是否可插入','tmrgo','{\"name\":\"checkLLPDetailInsert\",\"parammaps\": {\n \"pastureid\": \"3025176271438480383\",\n \"barid\": \"3050941006599422976\",\n \"lppid\": \"3025176271438480384\",\n \"times\": 1,\n \"ptsid\": \"-1\",\n \"ptid\": \"3025176272438480393\",\n \"fttype\": \"1\"\n }}','{\"code\":0,\"list\":[{\"vmsg\":\"该栏舍配方与计划配方不匹配,无法分配\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  271. (1464,383,'SELECT IF(?=0,ifnull((SELECT IF(empid = ?,\'editOk\',\'editNo\') statue FROM `chart` WHERE pastureid = ? AND id = ? ),\'editNo\'),\nifnull((SELECT IF(empid = ?,\'editOk\',\'editNo\') statue FROM `dashboard` WHERE pastureid = ? AND id = ?),\'editNo\')) statue','type,empid,pastureid,id,empid,pastureid,id','getChartRole','GetDataByName','权限','tmrgo','{\"name\":\"getChartRole\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"statue\":\"0\",\"empid\":\"3046724737046152192\",\"id\":\"3072750847005295616\"}}','{\"code\":0,\"list\":[{\"statue\":\"editOk\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  272. (1465,334,'update ftdetail set feedgroup=?\nwhere pastureid=? and ftid=? and sort = ?','feedgroup,pastureid,ftid,sort','updateFTdetailbySort','PostDataByName','修改配方模板详情组别','tmrgo','{\"name\":\"updateFTdetailSort\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3040887789920453632\",\"feedgroup\":\"饲料名称2\",\"id\":\"3026386153072231424\",\"sort\":\"7\"}}','{\"LastInsertId\":0,\"RowsAffected\":0,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  273. (1466,334,'SELECT \n(\nSELECT CASE \nWHEN \n(SELECT COUNT(*) FROM `premixplan` WHERE `pastureid` = ? AND ftid=? )>0\nTHEN CONCAT(\'该配方已分配预混计划,无法删除\')\nWHEN \n(SELECT COUNT(*) FROM `ftdetail` WHERE `pastureid` = ? AND fid=?)>0\nTHEN CONCAT(\'该预混配方被其他配方使用,无法删除\')\nWHEN \n(SELECT COUNT(*) FROM `feedp` WHERE `pastureid` = ? AND (ftid=? OR ptsfid=?))>0\nTHEN CONCAT(\'该配方已分配栏舍,无法删除\')\nWHEN \n(SELECT COUNT(*) FROM `lpplan` WHERE `pastureid` = ? AND ftid=? )>0\nTHEN CONCAT(\'该配方已分配撒料计划,无法删除\')\nELSE \'\' END AS vmsg \n) vmsg','pastureid,id,pastureid,id,pastureid,id,id,pastureid,id','checkdeleteFT','GetDataByName','删除校验','tmrgo','{\"name\":\"checkdeleteFT\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3073106826209264640\",\"lweight\":\"0.17\",\"fpdid\":\"3048556331721556992\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"该预混配方被其他配方使用,无法删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  274. (1467,334,'delete from ftdetail where pastureid=? and ftid= ? ','pastureid,id','deleteFTdetailByFtid','PostDataByName','删除配方模板详情','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  275. (1468,381,'select trim(dashboard.id) dashboard_id,dashboard.dname name,dashboard.display `desc`,dashboard.statue,content ,\nGROUP_CONCAT(dc.chartid) chartids \nfrom dashboard \nLEFT JOIN dashboard_chart dc\nON dc.did = dashboard.`id`\nwhere dashboard.pastureid=? and (dashboard.id=? or ?=\'\') and (dashboard.empid=? or statue = 1)\nGROUP BY dashboard.id','pastureid,did,did,empid','getdashboardsV2','Dashboards','获取表','tmrgo','{\"name\":\"getdashboards\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"3046724737046152192\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"dashboards\":null,\"list\":null,\"message\":\"ok\",\"order\":[],\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  276. (1469,335,'SELECT TRIM(pastureid)pastureid,\ntrim(barid) barid,barname,productdate,product,avgmonthage,bw,dayw,fetal,avgdim,dayspre,fat,pro,lactose,source,tem,cowsum,cowclass,\ntrim(cowclassid) cowclassid,bigcowclass,emp \nFROM barmilk\nWHERE pastureid=? AND barid = ? AND productdate = (SELECT MAX(bk.productdate) FROM barmilk bk WHERE bk.pastureid=barmilk.pastureid AND bk.barid=barmilk.barid )\n','pastureid,barid ','getnurj','GetDataByName','栏舍配方列表','tmrgo','{\"name\":\"getnurj\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3027996177498375168\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"avgdim\":11,\"avgmonthage\":\"15.00\",\"barid\":3027996177498375000,\"barname\":\"西区#1\",\"bigcowclass\":\"泌乳牛\",\"bw\":100,\"cowclass\":\"高产牛\",\"cowclassid\":3052868183976838000,\"cowsum\":\"200\",\"dayspre\":100,\"dayw\":\"4.00\",\"emp\":\"test专员\",\"fat\":\"15.60\",\"fetal\":2,\"lactose\":\"9.80\",\"pastureid\":\"3025176271438480383\",\"pro\":\"12.50\",\"product\":\"40.00\",\"productdate\":\"2020-09-15T00:00:00+08:00\",\"source\":\"\",\"tem\":\"37\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  277. (1470,335,'SELECT \'干物质(kg)\' standard,11.071 cowneed,18.97 feedprov,7.899 diff,16.224 cprov,2.746 jprov\n\nUNION\nSELECT \'产奶净能(MJ)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'奶牛能量单位(NND)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'粗蛋白(g)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'钙(g)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'磷(g)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'产奶净能(Mcal/DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'粗蛋白(%DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'脂肪(%DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\nUNION\nSELECT \'淀粉(%DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'NDF(%DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'粗料中的NDF(%DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'ADF(%DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\nUNION\nSELECT \'钙(%DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'磷(%DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'(4.0)饲料转化效率(kg/DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'(3.0)饲料转化效率(kg/DM)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\n\nUNION\nSELECT \'精粗比(%)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\nUNION\nSELECT \'日粮成本(元)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'干物质成本(元/公斤))\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\nUNION\nSELECT \'公斤奶成本(元)\' ,72.526 ,100.86 ,7.899 ,28.71 ,3.415\n\n','pastureid,barid ','judgenur','GetDataByName','配方评估','tmrgo','{\"name\":\"getnurj\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3027996177498375168\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"avgdim\":11,\"avgmonthage\":\"15.00\",\"barid\":3027996177498375000,\"barname\":\"西区#1\",\"bigcowclass\":\"泌乳牛\",\"bw\":100,\"cowclass\":\"高产牛\",\"cowclassid\":3052868183976838000,\"cowsum\":\"200\",\"dayspre\":100,\"dayw\":\"4.00\",\"emp\":\"test专员\",\"fat\":\"15.60\",\"fetal\":2,\"lactose\":\"9.80\",\"pastureid\":\"3025176271438480383\",\"pro\":\"12.50\",\"product\":\"40.00\",\"productdate\":\"2020-09-15T00:00:00+08:00\",\"source\":\"\",\"tem\":\"37\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  278. (1471,335,'SELECT trim(id) id,standard,cowneed,feedprov,diff,cprov,jprov\nFROM cowjudge where pastureid = ? and if((select count(*) from cowjudge cj where cj.pastureid=cowjudge.pastureid and cj.cowclassid = ? )>0,cowclassid= ?,cowclassid= -1)\n','pastureid,cowclassid,cowclassid','judgenurV2','GetDataByName','配方评估','tmrgo','{\"name\":\"getnurj\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3027996177498375168\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"avgdim\":11,\"avgmonthage\":\"15.00\",\"barid\":3027996177498375000,\"barname\":\"西区#1\",\"bigcowclass\":\"泌乳牛\",\"bw\":100,\"cowclass\":\"高产牛\",\"cowclassid\":3052868183976838000,\"cowsum\":\"200\",\"dayspre\":100,\"dayw\":\"4.00\",\"emp\":\"test专员\",\"fat\":\"15.60\",\"fetal\":2,\"lactose\":\"9.80\",\"pastureid\":\"3025176271438480383\",\"pro\":\"12.50\",\"product\":\"40.00\",\"productdate\":\"2020-09-15T00:00:00+08:00\",\"source\":\"\",\"tem\":\"37\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  279. (1472,324,'SELECT lp1.id,lp1.pastureid,lpplan.tmrname,lpplan.tmrid,lpplan.sort,lpplan.sel,lpplan.times,lpplan.display,\n\nlpplan.begintime,lpplan.ftname,lpplan.ftid,lpplan.sumweight,lpplan.sumcowcount,lpplan.remark,lp1.barname,\nGROUP_CONCAT(ftd.fname) feednames,lpplan.sumweight*0.88 doneweight,lp1.lweight\n FROM `lpplan`\n INNER JOIN `lpplandtl1` lp1\n ON lp1.pastureid = lpplan.pastureid AND lp1.lppid=lpplan.id \n INNER JOIN `ftdetail` ftd\n ON ftd.pastureid = lpplan.pastureid AND ftd.ftid=lpplan.ftid\n WHERE lpplan.pastureid = \'3025176271438480384\' \nGROUP BY lp1.id','','getmonitoring','','首页','tmrgo','','',0,1,0,0,0),
  280. (1473,334,'call updateFPbyFTChangeALL(?)','pastureid','updateFPbyFTChangeALL','PostDataByName','配方修改更新栏舍配方','tmrgo','{\"name\":\"updateFPbyFTChange\",\"parammaps\":{\"pastureid\":\"302517627,1438480383\",\"ftid \":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  281. (1474,358,'SELECT\nemp\nFROM\n ftdry\nWHERE pastureid = ?\nGROUP BY emp\nORDER BY id DESC','pastureid','getFtdryEmpHis','GetDataByName','体况评分员工列表','tmrgo','{\"name\":\"getFtdryEmpHis\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  282. (1475,353,'SELECT \nround(ROUND(SUM(\nIF(ftd.preftid<>0,\n ftd.`fweight`*IFNULL((SELECT SUM(ftd1.`fweight`*f1.dry/100)/SUM(ftd1.`fweight`) FROM `ftdetail` ftd1\nJOIN feednur f1 ON f1.fid= ftd1.fid AND f1.pastureid = ftd1.pastureid\nWHERE ftd1.pastureid = ftd.`pastureid` AND ftd1.ftid = ftd.`preftid`),0),\nftd.`fweight`*f.dry/100)) ,2)/SUM(ftd.fweight),2)\nthoweight \n FROM `ftdetail` ftd\nLEFT JOIN feednur f ON f.fid= ftd.fid AND f.pastureid = ftd.pastureid\nWHERE ftd.pastureid = ? AND ftd.ftid = (SELECT fp.`ftid` FROM `feedp` fp WHERE fp.`barid` = ?)','pastureid,barid','getFtdrytweight','GetDataByName','配方干物质列表','tmrgo','{\"name\":\"getFtdrytweight\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3028006959913108480\",\"sort\":\"0\",\"date\":\"2020-09-06\"}}','{\"code\":0,\"list\":[{\"thoweight\":\"0.36\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  283. (1476,336,'SELECT \ntrim(id) id,trim(pastureid) pastureid,trim(ftid) ftid,ftname,sort,\ntrim(tmrid) tmrid,\nif (tmrid=-1,\'任意车\',(select eqcode from tmr where pastureid =pp.pastureid and id = pp.tmrid )) tmrcode,trim(lppid) lppid,\n(select CONCAT(lpplan .sort,\' \',lpplan .display) from lpplan where pastureid =pp.pastureid and id = pp.lppid ) lppcode,\nenable,ptime,(select maxstirfeed from tmr where pastureid =pp.pastureid and id = pp.tmrid ) maxweight,operateweight,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes \nFROM\n premixplan pp\n\nWHERE pp.pastureid = ? \norder by sort\n','pastureid','getPremixplanList','GetDataByName','预混计划列表','tmrgo','{\"name\":\"getPremixplanList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"enable\":1,\"ftid\":\"1\",\"ftname\":\"1\",\"id\":\"3025176271438480385\",\"lppcode\":6,\"lppid\":\"5\",\"maxweight\":\"5000.00\",\"operateweight\":\"2000.00\",\"pastureid\":\"3025176271438480383\",\"ptime\":\"08:00\",\"times\":\"4\",\"timesstr\":\"第四班\",\"tmrcode\":\"3\",\"tmrid\":\"2\"},{\"enable\":1,\"ftid\":\"1\",\"ftname\":\"1\",\"id\":\"3025176271438480386\",\"lppcode\":6,\"lppid\":\"5\",\"maxweight\":\"5000.00\",\"operateweight\":\"2000.00\",\"pastureid\":\"3025176271438480383\",\"ptime\":\"08:00\",\"times\":\"4\",\"timesstr\":\"第四班\",\"tmrcode\":\"任意车\",\"tmrid\":\"-1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  284. (1477,334,'SELECT\ntname,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n feedtemplet\nWHERE pastureid = ? and fttypeid = 2 AND enable = 1\n\nORDER BY id DESC','pastureid','getFTYHList','GetDataByName','配方模板列表','tmrgo','{\"name\":\"getFTList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"预混配方\",\"id\":\"8874176271438480590\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方2\"},{\"ccid\":1,\"enable\":1,\"fttype\":\"饲喂配方\",\"id\":\"8874176271438480589\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  285. (1478,343,'SELECT\ntname,\nmaxstirfeed,\nTRIM(id) id\nFROM\n tmr\nWHERE pastureid = ? AND ENABLE=1 AND tclassid<>0 and tclassid<>4\n\n\nUNION ALL \nSELECT \'任意车\',(SELECT MAX(maxstirfeed) FROM tmr WHERE pastureid = ? AND ENABLE=1 AND tclassid<>0),-1\n\n\nORDER BY id DESC\n','pastureid,pastureid','getTMRYHList','GetDataByName','tmr列表','tmrgo','{\"name\":\"getTMRYHList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"eqtype\":\"2\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'(sekect max(maxstirfeed) FROM tmr WHERE pastureid = ? and enable=1 and tclassi\' at line 10\"',0,1,0,0,0),
  286. (1479,365,'SELECT\nconcat(sort,\' \',display) lppcode,\nTRIM(id) id\nFROM\n lpplan\nWHERE pastureid = ? AND sel=1 AND times=?\n\nORDER BY sort \n','pastureid,times','getLPPCodeList','GetDataByName','撒料车次','tmrgo','{\"name\":\"getLPPCodeList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"2\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":\"3052796725653144576\",\"lppcode\":4},{\"id\":\"3051413601262240768\",\"lppcode\":3}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  287. (1480,336,'delete from premixplan where pastureid=? and id = ? ','pastureid,id','deletePremixplan','PostDataByName','删除预混计划','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  288. (1481,336,'INSERT INTO premixplan(id,pastureid,ftid,ftname,tmrid,tmrcode,times,lppid,lppcode,enable,ptime,maxweight,operateweight,sort) VALUES (?,?,?,?,?,?,?,if(?=\'\',null,?),if(?=\'\',null,?),?,?,?,?,?) ','snowid,pastureid,ftid,ftname,tmrid,tmrcode,times,lppid,lppid,lppcode,lppcode,enable,ptime,maxweight,operateweight,sort','insertPremixplan','PostDataByName','新增预混计划','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  289. (1482,336,'update premixplan set ftid =?,ftname =?,tmrid =?,tmrcode =?,times =?,lppid =if(?=\'\',null,?),lppcode =if(?=\'\',null,?),enable =?,ptime =?,maxweight =?,operateweight =?,sort=?\nwhere pastureid=? and id=?','ftid,ftname,tmrid,tmrcode,times,lppid,lppid,lppcode,lppcode,enable,ptime,maxweight,operateweight,sort,pastureid,id','updatePremixplan','PostDataByName','修改预混计划','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  290. (1483,337,'delete rp,rpd from remainplan rp\nleft join rpdetail rpd\non rp.pastureid =rpd.pastureid and rpd.bigid = rp.id\nwhere rp.pastureid=? and rp.id = ? ','pastureid,id','deleteRemainplan','PostDataByName','删除剩料计划','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  291. (1484,337,'INSERT INTO remainplan(id,pastureid,tmrid,tmrcode,enable,times,lppid,lppcode,rtime,treatmethod,sort) VALUES (?,?,?,?,?,?,if(?=\'\',null,?),if(?=\'\',null,?),?,?,?) ','snowid,pastureid,tmrid,tmrcode,enable,times,lppid,lppid,lppcode,lppcode,rtime,treatmethod,sort','insertRemainplan','PostDataByName','新增剩料计划','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  292. (1485,337,'update remainplan set tmrid =?,tmrcode =?,enable =?,times =?,lppid =if(?=\'\',null,?),lppcode =if(?=\'\',null,?),rtime =?,treatmethod =?,sort =?\nwhere pastureid=? and id=?','tmrid,tmrcode,enable,times,lppid,lppid,lppcode,lppcode,rtime,treatmethod,sort,pastureid,id','updateRemainplan','PostDataByName','修改剩料计划','tmrgo','{\"name\":\"updateRemainplan\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  293. (1486,337,'SELECT \nTRIM(id) id,TRIM(pastureid) pastureid,TRIM(barid) barid,\n(SELECT bname FROM bar WHERE pastureid =rp.pastureid AND id = rp.barid ) bar,\nsort,TRIM(tmrid) tmrid,\nIF (tmrid=-1,\'任意车\',(SELECT eqcode FROM tmr WHERE pastureid =rp.pastureid AND id = rp.tmrid )) tmrcode,TRIM(lppid) lppid,\n(SELECT CONCAT(lpplan .sort,\' \',lpplan .display) FROM lpplan WHERE pastureid =rp.pastureid AND id = rp.lppid ) lppcode,\n`enable`,rtime,treatmethod,useinbar,TRIM(useinbarid) useinbarid,\ntimes times1,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes ,\n(SELECT GROUP_CONCAT((SELECT bname FROM bar WHERE pastureid = rpd.pastureid AND id = rpd.barid)) FROM rpdetail rpd WHERE rpd.pastureid = rp.pastureid AND rpd.bigid = rp.id AND rpd.type=0) qstr,\n(SELECT GROUP_CONCAT((SELECT bname FROM bar WHERE pastureid = rpd.pastureid AND id = rpd.barid)) FROM rpdetail rpd WHERE rpd.pastureid = rp.pastureid AND rpd.bigid = rp.id AND rpd.type=1) hstr,\n(SELECT GROUP_CONCAT(barid) FROM rpdetail rpd WHERE rpd.pastureid = rp.pastureid AND rpd.bigid = rp.id AND rpd.type=0 ) qstrids,\n(SELECT GROUP_CONCAT(barid) FROM rpdetail rpd WHERE rpd.pastureid = rp.pastureid AND rpd.bigid = rp.id AND rpd.type=1) hstrids\nFROM\n remainplan rp\n\nWHERE rp.pastureid = ? \nORDER BY sort','pastureid','getRemainplanList','GetDataByName','剩料计划列表','tmrgo','{\"name\":\"getRemainplanList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"sort\":\"0\",\"enable\":1}}','\"Error 1146: Table \'tmrgo.rpdetailrpd\' doesn\'t exist\"',0,1,0,0,0),
  294. (1487,334,'select if(DATE_FORMAT(max(date), \'%Y-%m-%d\')>DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(max(date), \'%Y-%m-%d\'))\n maxdate from premixplandate where pastureid=?','pastureid','getPPMaxDate','GetDataByName','配方模板列表历史最近日全球','tmrgo','{\"name\":\"getPPMaxDate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"maxdate\":\"2020-10-13\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  295. (1488,334,'select if(DATE_FORMAT(max(date), \'%Y-%m-%d\')>DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(now(), \'%Y-%m-%d\'),DATE_FORMAT(max(date), \'%Y-%m-%d\'))\n maxdate from remainplandate where pastureid=?','pastureid','getRPMaxDate','GetDataByName','配方模板列表历史最近日全球','tmrgo','{\"name\":\"remainplandate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"maxdate\":\"2020-10-13\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  296. (1490,337,'SELECT \ntrim(id) id,trim(pastureid) pastureid,trim(barid) barid,bar,sort,\ntrim(tmrid) tmrid,\nif (tmrid=-1,\'任意车\',tmrcode) tmrcode,times ,trim(lppid) lppid,lppcode,enable,rtime,treatmethod,useinbar,trim(useinbarid) useinbarid,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimesstr,\n(select group_concat(bar) from rpdetaildate rpd where rpd.pastureid = rp.pastureid and rpd.bigid = rp.id and rpd.type=0 and rpd.date = rp.date) qstr,\n(select group_concat(bar) from rpdetaildate rpd where rpd.pastureid = rp.pastureid and rpd.bigid = rp.id and rpd.type=1 and rpd.date = rp.date) hstr,\n(select group_concat(barid) from rpdetaildate rpd where rpd.pastureid = rp.pastureid and rpd.bigid = rp.id and rpd.type=0 and rpd.date = rp.date) qstrids,\n(select group_concat(barid) from rpdetaildate rpd where rpd.pastureid = rp.pastureid and rpd.bigid = rp.id and rpd.type=1 and rpd.date = rp.date) hstrids\nFROM\n remainplandate rp\n\nWHERE rp.pastureid = ? and date =?\norder by sort','pastureid,date','getRemainplanListDate','GetDataByName','剩料计划列表','tmrgo','{\"name\":\"getRemainplanList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  297. (1491,389,'SELECT\n(select fname from feed where pastureid =c.pastureid and id = c.feedid ) feedname,price,\ntrim(bigid)bigid,\ntrim(feedid)feedid,\nTRIM(c.id) id,\nTRIM(c.pastureid) pastureid\nFROM\n contract c\nWHERE c.pastureid = ? and c.bigid = ?\nORDER BY id ','pastureid,id','getContractList','GetDataByName','合同列表','tmrgo','{\"name\":\"getContractList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bigid\":\"1\",\"feedid\":\"1\",\"feedname\":\"2\",\"id\":\"1\",\"pastureid\":\"3025176271438480383\",\"price\":\"3.1\"},{\"bigid\":\"1\",\"feedid\":\"2\",\"feedname\":\"3\",\"id\":\"2\",\"pastureid\":\"3025176271438480383\",\"price\":\"1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  298. (1492,389,'delete from contract where pastureid=? and bigid = ? ','pastureid,id','deleteContract','PostDataByName','删除合同','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  299. (1493,389,'INSERT INTO contract(id,pastureid,bigid,feedid,feedname,price) VALUES (?,?,?,?,?,?) ','snowid,pastureid,bigid,feedid,feedname,price','insertContract','PostDataByName','新增合同','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  300. (1494,389,'update bigcontract set enable=if(?=\'\',enable,?),operatetime=if(?=\'\',operatetime,?)\nwhere pastureid=? and id=?','enable,enable,operatetime,operatetime,pastureid,id','updateBigContract','PostDataByName','修改合同','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  301. (1495,389,'INSERT INTO bigcontract(id,pastureid,contractcode,providerid,providername,emp,enable,operatetime) VALUES (?,?,?,?,?,?,?,?) ','snowid,pastureid,contractcode,providerid,providername,emp,enable,operatetime','insertBigContract','PostDataByName','新增主合同','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  302. (1496,389,'delete from bigcontract where pastureid=? and id = ? ','pastureid,id','deleteBigContract','PostDataByName','删除合同','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  303. (1497,389,'SELECT\nDATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,contractcode,trim(providerid) providerid,\n(select providername from provider where pastureid = bc.pastureid and id = bc.providerid )providername,emp,enable,\nTRIM(bc.id) id,\nTRIM(bc.pastureid) pastureid\nFROM\n bigcontract bc\nWHERE bc.pastureid = ? \n AND ((bc.operatetime>= ? and bc.operatetime<= ?) or ? = \'\')\n AND (providerid =? OR ? = \'\' )\nORDER BY bc.id DESC','pastureid,startTime,stopTime,startTime,providerid,providerid ','getBigContractList','GetDataByName','合同列表','tmrgo','{\"name\":\"getBigContractList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"contractcode\":\"1250\",\"emp\":\"2\",\"id\":\"1\",\"operatetime\":\"2020-10-13\",\"pastureid\":\"3025176271438480383\",\"providerid\":\"1\",\"providername\":\"1.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  304. (1498,370,'update user set password=\'e10adc3949ba59abbe56e057f20f883e\' where pastureid = ? and id = ?','pastureid,id','initPassword','GetDataByName','用户','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  305. (1499,376,'SELECT\nproviderName,providerNumber,linkman,telphone,remark,enable,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n provider\nWHERE pastureid = ? \n AND enable =1\nORDER BY id DESC','pastureid','getProviderListEnable','GetDataByName','供应商列表','tmrgo','{\"name\":\"getProviderListEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"enable\":1,\"id\":\"3062658294063039488\",\"linkman\":\"13242\",\"pastureid\":\"3025176271438480383\",\"providerName\":\"测试供应商\",\"providerNumber\":\"000211\",\"remark\":\"121\",\"telphone\":\"12345678910\"},{\"enable\":1,\"id\":\"3055707559324812288\",\"linkman\":\"李四\",\"pastureid\":\"3025176271438480383\",\"providerName\":\"汉高饲料\",\"providerNumber\":\"00003\",\"remark\":\"\",\"telphone\":\"15540741342\"},{\"enable\":1,\"id\":\"3055706217617294336\",\"linkman\":\"张先生\",\"pastureid\":\"3025176271438480383\",\"providerName\":\"英美尔\",\"providerNumber\":\"00002\",\"remark\":\"\",\"telphone\":\"\"},{\"enable\":1,\"id\":\"3025176271438487452\",\"linkman\":\"京东小哥\",\"pastureid\":\"3025176271438480383\",\"providerName\":\"京东\",\"providerNumber\":\"00001\",\"remark\":\"在用\",\"telphone\":\"18546954726\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":4}',0,1,0,0,0),
  306. (1500,347,'SELECT\nfn.feedcode,fn.fname,\nTRIM(fn.id) id,\nTRIM(fn.pastureid)pastureid\nFROM\n feed fn\nWHERE fn.pastureid = ? \n AND fn.enable =1\nORDER BY fn.id DESC','pastureid','getFeedListEnable','GetDataByName','饲料列表','tmrgo','{\"name\":\"getFeedListEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bigfeedclassid\":1,\"bigfeedclassname\":\"精料\",\"enable\":1,\"fccode\":\"0851\",\"fcname\":\"饲料1\",\"id\":\"3025176271438480543\",\"pastureid\":\"3025176271438480383\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  307. (1501,362,'SELECT\nremark,DATE_FORMAT(inventorydate, \'%Y-%m-%d\') inventorydate,createuser,\nTRIM(f.id) id,\nTRIM(f.pastureid) pastureid,\nround((select sum(theoryweight-factweight) from feedinventorydetail fd where fd.pastureid and fd.invid = f.id and fd.theoryweight>fd.factweight) ,2) lessWeight,\nround((select sum(factweight-theoryweight) from feedinventorydetail fd where fd.pastureid and fd.invid = f.id and fd.theoryweight<fd.factweight),2) moreWeight ,\nround((select sum(factweight-theoryweight) from feedinventorydetail fd where fd.pastureid and fd.invid = f.id and fd.theoryweight<>fd.factweight) ,2) differWeight\nFROM\n feedinventory f\nWHERE f.pastureid = ? and ((f.inventorydate>=? and f.inventorydate<=?)or ?=\'\')\nORDER BY inventorydate desc,id desc','pastureid,startTime,stopTime,startTime','getBigInventoryList','GetDataByName','盘点列表','tmrgo','{\"name\":\"getBigInventoryList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"createuser\":\"张三\",\"differWeight\":\"-1.00\",\"id\":\"3\",\"inventorydate\":\"2020-11-03\",\"lessWeight\":\"1.00\",\"pastureid\":\"3025176271438480383\",\"remark\":\"问问1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  308. (1502,362,'DELETE fd,f\n FROM feedinventory f\n left JOIN feedinventorydetail fd\n ON fd.`invid` = f.`id` AND fd.`pastureid` = f.`pastureid`\n WHERE f.pastureid=? AND f.inventorydate = (SELECT* FROM((SELECT MAX(inventorydate) FROM feedinventory WHERE pastureid=?))qq)','pastureid,pastureid','deleteBigInventory','PostDataByName','删除盘点','tmrgo','{\"name\":\"deleteBigInventory\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":\"0\",\"LastInsertIdStr\":0,\"RowsAffected\":0,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  309. (1503,362,'INSERT INTO feedinventory(id,pastureid,remark,inventorydate,createuser) VALUES (?,?,?,?,?) ','snowid,pastureid,remark,inventorydate,createuser','insertBigInventory','PostDataByName','新增盘点主','tmrgo','{\"name\":\"insertBigInventory\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  310. (1505,362,'INSERT INTO feedinventorydetail(id,pastureid,invid,feedid,feedname,theoryweight,factweight) VALUES (?,?,?,?,?,?,?) ','snowid,pastureid,invid,feedid,feedname,stockweight,factweight','insertInventory','PostDataByName','新增盘点子','tmrgo','{\"name\":\"insertBigInventory\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  311. (1506,362,'SELECT\nfeed.fname feedname,\nifnull(f.stockweight,0) stockweight,\ntrim(feedid)feedid,DATE_FORMAT(now(), \'%Y-%m-%d\') nowdate,? emp,\nTRIM(f.id) id,\nTRIM(feed.id) feedid,\nTRIM(feed.pastureid) pastureid\nFROM\n feed \nleft join feedstorage f\non feed.pastureid= f.pastureid and feed.id = f.feedid\nWHERE feed.pastureid = ? and feed.enable = 1\nORDER BY feed.id desc','emp,pastureid','getFeedstorageWeightList','GetDataByName','盘点列表','tmrgo','{\"name\":\"getFeedstorageWeightList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"emp\":\"\",\"feedid\":\"3\",\"feedname\":\"4\",\"id\":\"2\",\"nowdate\":\"2020-11-05\",\"pastureid\":\"3025176271438480383\",\"stockweight\":\"6.000\"},{\"emp\":\"\",\"feedid\":\"6\",\"feedname\":\"7\",\"id\":\"3\",\"nowdate\":\"2020-11-05\",\"pastureid\":\"3025176271438480383\",\"stockweight\":\"9.000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  312. (1507,362,'SELECT\nfeedname,trim(feedid)feedid,f.theoryweight stockweight,factweight,\n(f.factweight-f.theoryweight) differ,\nTRIM(f.id) id,\nTRIM(f.pastureid) pastureid\nFROM\n feedinventorydetail f\nWHERE f.pastureid = ? and f.invid = ?\nORDER BY f.id ','pastureid,id','getInventoryList','GetDataByName','盘点列表','tmrgo','{\"name\":\"getBigInventoryList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"createuser\":\"张三\",\"id\":\"2\",\"inventorydate\":\"2020-11-04\",\"pastureid\":\"3025176271438480383\",\"remark\":\"问问\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  313. (1508,359,'SELECT\nfeed.`fname`,IFNULL(f.stockweight,0) stockweight,TRIM(feed.id)feedid,feed.uprice price,\nTRIM(feed.pastureid) pastureid\nFROM\n feedstorage f\nRIGHT JOIN feed \nON feed.`id` = f.`feedid` AND f.`pastureid` = feed.`pastureid`\n\n\nWHERE feed.pastureid =?\nORDER BY feed.id ','pastureid','getinitFeed','GetDataByName','初始化列表','tmrgo','{\"name\":\"getFeedstorageWeightList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"emp\":\"\",\"feedid\":\"3\",\"feedname\":\"4\",\"id\":\"2\",\"nowdate\":\"2020-11-05\",\"pastureid\":\"3025176271438480383\",\"stockweight\":\"6.000\"},{\"emp\":\"\",\"feedid\":\"6\",\"feedname\":\"7\",\"id\":\"3\",\"nowdate\":\"2020-11-05\",\"pastureid\":\"3025176271438480383\",\"stockweight\":\"9.000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  314. (1509,359,'DELETE f FROM feedstorage f\n WHERE f.pastureid=? ','pastureid','clearFS','PostDataByName','清空库存','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  315. (1510,359,'INSERT INTO feedstorage(id,pastureid,feedid,feedname,pcpde,stockweight,price) VALUES (?,?,?,?,?,?,?) ','snowid,pastureid,feedid,fname,pcpde,stockweight,price','insertFeedstorage','PostDataByName','新增库存','tmrgo','{\"name\":\"insertBigInventory\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  316. (1511,364,'SELECT\nfeed.fname feedname,ifnull(f.stockweight,0) stockweight,trim(feed.id)feedid,pcpde,ifnull(round(price*stockweight,2),0) sumprice,ifnull(f.price,feed.uprice) price,\nTRIM(f.id) id,\nTRIM(f.pastureid) pastureid\nFROM\n feed \nleft join feedstorage f\non feed.pastureid= f.pastureid and feed.id = f.feedid\nWHERE feed.pastureid = ? and (feed.id =? or ?= \'\')\nORDER BY feed.id desc','pastureid,feedid,feedid','getFeedstorageList','GetDataByName','库存统计列表','tmrgo','{\"name\":\"getFeedstorageWeightList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"emp\":\"\",\"feedid\":\"3\",\"feedname\":\"4\",\"id\":\"2\",\"nowdate\":\"2020-11-05\",\"pastureid\":\"3025176271438480383\",\"stockweight\":\"6.000\"},{\"emp\":\"\",\"feedid\":\"6\",\"feedname\":\"7\",\"id\":\"3\",\"nowdate\":\"2020-11-05\",\"pastureid\":\"3025176271438480383\",\"stockweight\":\"9.000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  317. (1512,359,'SELECT\nDATE_FORMAT(laiddate, \'%Y-%m-%d\')laiddate,\ntrim(feedid) feedid,feedname,providerid,providername,contractcode,\nif(operateweight=0,\'\',operateweight) operateweight,\nif(grossweight=0,\'\',grossweight) grossweight,\nif(tareweight=0,\'\',tareweight) tareweight,\nif(operateweight >0,\'是\',\'否\') islaid,\nround(pricenew*operateweight,2) sumprice,licence,pcpde,remark,DATE_FORMAT(createdate, \'%Y-%m-%d %H:%i\') createdate,createemp,startweight,wagonnumber,pricenew,\nif(operateweight >0,f.priceold,(select price from feedstorage where pastureid=f.pastureid and feedid=f.feedid limit 1 ) ) priceold,\nTRIM(f.id) id,\nTRIM(f.pastureid) pastureid\nFROM\n feedlaid f\nWHERE f.pastureid = ? \nand ( (f.laiddate>= ? and f.laiddate<= ? ) or ?=\'\')\nand(feedid = ? or ?=\'\')\nand (if(?=\'是\',operateweight >0,if(?=\'否\',operateweight =0,\'\'=\'\')))\nand (providerid=? or ?=\'\')\nORDER BY laiddate desc,id desc','pastureid,startTime,stopTime,startTime,feedid,feedid,islaid,islaid,providerid,providerid','getFeedlaidList','GetDataByName','入库列表','tmrgo','{\"name\":\"getFeedlaidList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  318. (1513,359,'update feedlaid set laiddate =?,feedid =?,feedname =?,providerid =if(?=\'\',-1,?),providername =?,contractcode =?,licence =?,pcpde =?,remark =?,createemp =?,startweight =?,priceold =?,pricenew =?,operateweight =if(?=\'\',0,?),grossweight =if(?=\'\',0,?),tareweight =if(?=\'\',0,?),wagonnumber=?\nwhere pastureid=? and id=?','laiddate,feedid,feedname,providerid,providerid,providername,contractcode,licence,pcpde,remark,createemp,startweight,priceold,pricenew,operateweight,operateweight,grossweight,grossweight,tareweight,tareweight,wagonnumber,pastureid,id','updateFeedlaid','PostDataByName','修改入库','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}} ','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  319. (1514,359,'INSERT INTO feedlaid(id,pastureid,laiddate,feedid,feedname,providerid,providername,contractcode,licence,pcpde,remark,createemp,startweight,priceold,pricenew,grossweight,tareweight,operateweight,wagonnumber) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,if(?=\'\',0,?),if(?=\'\',0,?),if(?=\'\',0,?),?) ','snowid,pastureid,laiddate,feedid,feedname,providerid,providername,contractcode,licence,pcpde,remark,createemp,startweight,priceold,pricenew,grossweight,grossweight,tareweight,tareweight,operateweight,operateweight,wagonnumber','insertFeedlaid','PostDataByName','新增入库','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  320. (1515,347,'SELECT\nfn.feedcode,fn.fname,\nifnull(fs.price,fn.uprice) price,\nifnull(fs.stockweight,0) stockweight,\nTRIM(fn.id) id,\nTRIM(fn.pastureid)pastureid\nFROM\n feed fn\n LEFT JOIN feedstorage fs\n ON fs.feedid= fn.id and fs.pastureid = fn.pastureid \n\nWHERE fn.pastureid = ? \nand (fn.fname like concat(\'%\',?,\'%\') or ?=\'\')\n AND fn.enable =1\nORDER BY fn.id DESC','pastureid,fname,fname ','getFeedListEnableV2','GetDataByName','饲料列表','tmrgo','{\"name\":\"getFeedListEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bigfeedclassid\":1,\"bigfeedclassname\":\"精料\",\"enable\":1,\"fccode\":\"0851\",\"fcname\":\"饲料1\",\"id\":\"3025176271438480543\",\"pastureid\":\"3025176271438480383\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  321. (1517,359,'SELECT\nDATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,contractcode,TRIM(bc.providerid) providerid,providername,bc.emp,\nc.price,concat(contractcode,\' 价格 : \',c.price) contractcodeCat,\nTRIM(bc.id) id,\nTRIM(bc.pastureid) pastureid\nFROM\n bigcontract bc\n INNER JOIN contract c\n ON c.`bigid` = bc.`id`\nWHERE bc.pastureid = ? AND c.`feedid` = ? and bc.providerid =? \nAND bc.enable = 1\nORDER BY bc.id DESC','pastureid,feedid,providerid','getBigContractListEnable','GetDataByName','合同列表','tmrgo','{\"name\":\"getBigContractListEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  322. (1518,359,'INSERT INTO feedstorage(id,pastureid,feedid,feedname,pcpde,stockweight,price) VALUES (?,?,?,?,?,?,?) \nON DUPLICATE KEY UPDATE price=(stockweight*price+?*?)/(stockweight+?),stockweight=stockweight+?,pcpde=?','snowid,pastureid,feedid,fname,pcpde,operateweight,price,operateweight,price,operateweight,operateweight,pcpde','insertFeedstorageLaid','PostDataByName','入库新增库存','tmrgo','{\"name\":\"insertFeedstorageLaid\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  323. (1519,361,'SELECT\nDATE_FORMAT(usedate, \'%Y-%m-%d\')usedate,\ntrim(feedid) feedid,feedname,trim(cowclassid)cowclassid,cowclass,\ntrim(barid) barid,barname,usetype,planweight,actweight,operateweight,createdate,createemp,remark,ischarge,ifnull(price,(select uprice from feed where feed.pastureid = f.pastureid and feed.id = f.feedid)) price,\nif(ischarge=0 and usetype=\'系统用量\',(select stockweight from feedstorage where pastureid =f.pastureid and feedid=f.feedid),f.repertoryweight) repertoryweight,\nTRIM(f.id) id,\nTRIM(f.pastureid) pastureid\nFROM\n feeduse f\nWHERE f.pastureid = ? \nand ( (f.usedate>= ? and f.usedate<= ? ) or ?=\'\')\nand if(?=\'系统用量\',usetype=\'系统用量\',if(?=\'\', usetype<>\'系统用量\',usetype=?))\nand(feedid= ? or ?=\'\')\nand (cowclassid=? or ?=\'\')\nand (ischarge=? or ?=\'\')\nORDER BY usedate desc, id desc','pastureid,startTime,stopTime,startTime,usetype,usetype,usetype,feedid,feedid,cowclassid,cowclassid,ischarge,ischarge','getFeeduseList','GetDataByName','用量列表','tmrgo','{\"name\":\"getFeeduseList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  324. (1520,361,'INSERT INTO feeduse(id,pastureid,usedate,feedid,feedname,cowclassid,cowclass,usetype,operateweight,repertoryweight,createemp,remark,price) VALUES (?,?,?,?,?,if(?=\'\',-1,?),?,?,?,?,?,?,?) ','snowid,pastureid,usedate,feedid,feedname,cowclassid,cowclassid,cowclass,usetype,operateweight,repertoryweight,createemp,remark,price','insertFeeduse','PostDataByName','新增出库','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  325. (1521,361,'update feedstorage\nset stockweight=stockweight-?\nwhere pastureid = ? and feedid = ?','operateweight,pastureid,feedid','updateFeedstorageuse','PostDataByName','出库新增库存','tmrgo','{\"name\":\"updateFeedstorageuse\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  326. (1522,360,'UPDATE feeduse fu\nleft JOIN feedstorage fs\nON fs.`pastureid` =fu.`pastureid` AND fs.`feedid` = fu.`feedid` \nSET \nfu.`ischarge` = 1,\nfu.price = fs.price,\nfu.repertoryweight = ifnull(fs.stockweight,0)\nWHERE fu.pastureid= ? and fu.`id` = ? ','pastureid,id','chargeFeedstorageuse','PostDataByName','审核','tmrgo','{\"name\":\"updateFeedstorageuse\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  327. (1523,360,'UPDATE feeduse fu\nSET \nfu.`operateweight` = ? ,\nfu.`remark`=?\nWHERE fu.pastureid= ? and fu.`id` = ? ','operateweight,remark,pastureid,id','updateFeeduse','PostDataByName','系统用量编辑','tmrgo','{\"name\":\"updateFeedstorageuse\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  328. (1524,361,'SELECT\nfeed.fname feedname,ifnull(f.stockweight,0) stockweight,trim(feed.id)feedid,pcpde,round(price*stockweight,2) sumprice,ifnull(f.price,feed.uprice) price,\nTRIM(f.id) id,\nTRIM(f.pastureid) pastureid\nFROM\n feed \nleft join feedstorage f\non feed.pastureid= f.pastureid and feed.id = f.feedid\nWHERE feed.pastureid = ? and feed.enable = 1 and (feed.fname like concat(\'%\',?,\'%\') or ?= \'\')\nORDER BY feed.id desc','pastureid,feedname,feedname','getFeedstorageuse','GetDataByName','库存列表','tmrgo','{\"name\":\"getFeedstorageuse\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"feedid\":\"3\",\"feedname\":\"青贮玉米\",\"id\":\"2\",\"pastureid\":\"3025176271438480383\",\"pcpde\":\"5\",\"price\":\"8.000\",\"stockweight\":\"6.000\",\"sumprice\":\"48.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  329. (1525,363,'SELECT \n(SELECT fname FROM feed WHERE pastureid =fs.pastureid AND id = fs.feedid ) feedname,\n(SELECT pasture_name FROM pasture WHERE pastureid = fs.`pastureid`)pasturename,\nfs.`stockweight`,ROUND(fs.lweight,2) avgweight, IF (fs.stockweight<=0,0, FLOOR(fs.stockweight/fs.lweight)) ldays,\nTRIM(fs.feedid) feedid,\nTRIM(fs.`pastureid`) pastureid,\nDATE_FORMAT((SELECT MAX(DATE) FROM fswarnhis WHERE pastureid = fs.pastureid AND feedid = fs.feedid ), \'%Y-%m-%d\') lastdate \nFROM (SELECT\nfs.`id`,\n fs.`feedname`,fs.`stockweight`,\nfs.feedid feedid,\nfs.`pastureid` pastureid,DATE_FORMAT(NOW(), \'%Y-%m-%d\') lastdate,\n(SELECT SUM(d.lweight)/7 lweight FROM `downloadplandtl1` d WHERE d.pastureid = fs.pastureid \nAND `date` >= DATE_FORMAT(DATE_ADD(NOW(),INTERVAL -7 DAY), \'%Y-%m-%d\') \nAND `date` <DATE_FORMAT(NOW(), \'%Y-%m-%d\') AND d.fid = fs.`feedid`) lweight\nFROM `feedstorage` fs) fs\n\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = fs.`pastureid`\n\nWHERE fs.stockweight< fs.lweight*(SELECT inforvalue FROM `sysopt` WHERE sysopt.pastureid = fs.pastureid AND inforname = \'repertoryWarn\')\nORDER BY fs.pastureid,fs.id\n ','pastureid,pastureid','getFsWarnListJT','GetDataByName','库存统计列表','tmrgo','{\"name\":\"getFsWarnListJT\",\"parammaps\":{\"pastureid\":\"1\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"avgweight\":\"11070.64\",\"feedid\":\"3151353343348573184\",\"feedname\":\"饲料价格002-1\",\"lastdate\":\"2021-02-04\",\"ldays\":\"0\",\"pastureid\":\"3025176271438480383\",\"pasturename\":\"宝鸡\",\"stockweight\":\"-111.11\"},{\"avgweight\":\"1764.66\",\"feedid\":\"3045605178557858816\",\"feedname\":\"羊草\",\"lastdate\":\"2021-02-04\",\"ldays\":\"0\",\"pastureid\":\"3025176271438480383\",\"pasturename\":\"宝鸡\",\"stockweight\":\"0.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  330. (1526,363,'SELECT\n fs.`feedname`,fs.`stockweight`,round(avgweight,2) avgweight,\nif (fs.ldays<=0,0, FLOOR(ldays)) ldays,\ntrim(feedid) feedid,\ntrim(fs.`pastureid`) pastureid,DATE_FORMAT(fs.date, \'%Y-%m-%d\') `date`\nFROM `fswarnhis` fs\nWHERE fs.`pastureid`=? and fs.feedid =?\nORDER BY fs.date desc','pastureid,feedid ','getFsWarnListdate','GetDataByName','库存统计列表','tmrgo','{\"name\":\"getFsWarnListdate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  331. (1527,364,'SELECT\nfeedname,operateweight,trim(feedid)feedid,pcpde,round(pricenew*operateweight,2) sumprice, pricenew price,\nDATE_FORMAT(laiddate, \'%Y-%m-%d\') laiddate,remark,\nTRIM(f.id) id,\nTRIM(f.pastureid) pastureid\nFROM\n feedlaid f\nWHERE f.pastureid = ? and feedid =?\n AND (( laiddate>=? and laiddate<=?) OR ? = \'\')\nORDER BY laiddate desc,id desc','pastureid,feedid,startTime,stopTime,startTime','getFsLaidList','GetDataByName','库存统计查看-入库记录列表','tmrgo','{\"name\":\"getFsLaidList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"feedid \":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  332. (1528,364,'SELECT\nfeedname,operateweight,trim(feedid)feedid,round(price*operateweight,2) sumprice,price,\nDATE_FORMAT(usedate, \'%Y-%m-%d\')usedate,remark,\nTRIM(f.id) id,usetype,cowclass,\nTRIM(f.pastureid) pastureid\nFROM\n feeduse f\nWHERE f.pastureid = ? and feedid =?\n AND (( usedate>=? and usedate<=?) OR ? = \'\')\nAND(usetype=? OR ? =\'\') and (f.usetype <> \'系统用量\' or ischarge=1)\nORDER BY usedate desc,id desc','pastureid,feedid,startTime,stopTime,startTime,usetype,usetype','getFsUseList','GetDataByName','库存统计查看-出库记录列表','tmrgo','{\"name\":\"getFsUseList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"feedid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  333. (1529,24,'\nSELECT\n dictlist.id,\n dictlist.label,\n dictlist.value,\n dictlist.orderby\nFROM\n dictlist\n JOIN `dict`\n ON `dict`.`id` = dictlist.`pid`\nWHERE `dict`.`name` = ?\n AND `dict`.ENABLE = 1\n AND dictlist.enable = 1\n \n UNION ALL\nSELECT -1,\'系统用量\',\'系统用量\',-1\n\nORDER BY orderby ','dictname','getDictByNameUse','query','字典','tmrgo','','',2,1,0,0,0),
  334. (1530,361,'INSERT INTO feedstorage(id,pastureid,feedid,feedname,pcpde,stockweight,price) VALUES (?,?,?,?,?,0-?,?) \nON DUPLICATE KEY UPDATE stockweight=stockweight-?','snowid,pastureid,feedid,fname,pcpde,operateweight,price,operateweight','insertFeedstorageUse','PostDataByName','出库新增库存','tmrgo','{\"name\":\"insertFeedstorageLaid\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  335. (1532,324,'SELECT \n(SELECT `pasture_name` FROM `pasture` WHERE pastureid = d.pastureid)pastureName,\nprojname,\nDATE_FORMAT(intime, \'%Y-%m-%d %H:%i:%s\') intime,\nlpplantype lpplantype1,\nCASE lpplantype\nWHEN 0 THEN\n\'撒料计划\'\nWHEN 1 THEN\n\'撒料计划-混料\'\nWHEN 2 THEN\n\'撒料计划-撒料\'\nWHEN 3 THEN\n\'剩料计划\'\nWHEN 4 THEN\n\'预混计划\'\nWHEN 5 THEN\n\'预称重计划\'\nEND \nlpplantype,\nconcat(remark,projname ) remark,\ntmrtname,\nTRIM(pastureid)pastureid,\nTRIM(pid)pid,\nTRIM(id)id\n FROM `downloadedplan` d\nWHERE pastureid= ? and `intime` IS NOT NULL\nAND mydate >= ? AND mydate <= ?\nAND (`iscompleted`=? or ?=\'\') \nAND (d.`tmrtname` = ? OR ? = \'\') \nAND (lpplantype = ? or ? = \'\')\nORDER BY d.intime','pastureid,startTime,stopTime,iscompleted,iscompleted,tmrtname,tmrtname,lpplantype,lpplantype','getprocessAnalysis','GetDataByName','过程分析','tmrgo','{\"name\":\"getprocessAnalysis\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  336. (1533,324,'SELECT \nproesstime,iscompleted,Hdif,HdifSUM,\nIF(HdifRate<0,0,HdifRate)HdifRate,Sdif,SdifSUM,\nIF(SdifRate<0,0,SdifRate)SdifRate\n\nFROM (\n\nSELECT pid,TIMEDIFF(IFNULL((SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d.`mydate`=d2.`date` AND d.pastureid = d2.pastureid AND d2.pid=d.id),\n(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d.`mydate`=d2.`date` AND d.pastureid = d2.pastureid AND d2.pid=d.id)\n\n),intime) proesstime,\nCASE iscompleted\nWHEN 0 THEN\n\'进行中\'\nWHEN 1 THEN\n\'已完成\'\nEND iscompleted,\n(SELECT SUM(ABS(lweight-actualweightminus)) FROM downloadplandtl1 WHERE pastureid =d.pastureid AND pid = d.id)Hdif,\n(SELECT SUM(lweight) FROM downloadplandtl1 WHERE pastureid =d.pastureid AND pid = d.id)HdifSUM,\nCONCAT(ROUND((1-(SELECT SUM(ABS(lweight-actualweightminus))/SUM(lweight) FROM downloadplandtl1 WHERE pastureid =d.pastureid AND pid = d.id)) *100,2),\'%\') HdifRate,\n\n\n (SELECT SUM(ABS(lweight-actualweightminus)) FROM downloadplandtl2 WHERE pastureid =d.pastureid AND pid = d.id)Sdif,\n(SELECT SUM(lweight) FROM downloadplandtl2 WHERE pastureid =d.pastureid AND pid = d.id)SdifSUM,\nCONCAT(ROUND((1-(SELECT SUM(ABS(lweight-actualweightminus))/SUM(lweight) FROM downloadplandtl2 WHERE pastureid =d.pastureid AND pid = d.id) )*100,2),\'%\') SdifRate\n \n \n FROM `downloadedplan` d \nWHERE pastureid= ?\nAND id = ?\nORDER BY `id` DESC\n) tem ','pastureid,id','getprocessAnalysisStr','GetDataByName','过程详情','tmrgo','{\"name\":\"getprocessAnalysis\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  337. (1534,324,'\nSELECT\n\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid))\n) proesstime, \n\n\nTIMEDIFF((SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid ),(SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid))\n sumproesstime, \n\nd1.sort,\nd1.`fname`,\nd1.`lweight`,\nd1.`actualweightminus`,\nABS(d1.`lweight`- d1.`actualweightminus`) diff,\nCONCAT(100-if(ROUND(ABS(d1.`lweight`- d1.`actualweightminus`)/d1.`lweight`*100,2)>100,100,ROUND(ABS(d1.`lweight`- d1.`actualweightminus`)/d1.`lweight`*100,2)),\'%\') diffRate,\nDATE_FORMAT(d1.intime, \'%H:%i:%s\') intime,\nd1.`begintime` stoptime,\nd1.`lastactualweight`,\nd1.`actualweight`,\ncase d1.buttontype\nwhen 1 then \'自动\'\nwhen 2 then \'手动\'\nwhen 3 then \'手动\'\nend buttontype\nFROM\n `downloadplandtl1_exec` d1\nWHERE d1.`pastureid` = ?\nAND d1.pid =?\nORDER BY sort','pastureid,pid','getprocessAnalysisHL','GetDataByName','混料详情','tmrgo','{\"name\":\"getprocessAnalysis\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  338. (1535,324,'\nSELECT\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`date`=d2.`date` AND d1.pastureid = d2.pastureid AND d2.pid=d1.pid))\n) proesstime, \n TIMEDIFF((SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid ),(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`date`=d2.`date` AND d1.pastureid = d2.pastureid AND d2.pid=d1.pid)) sumproesstime,\nd1.sort,\nd1.`fname`,\nd1.`lweight`,\nd1.`actualweightminus`,\nABS(d1.`lweight`- d1.`actualweightminus`) diff,\nCONCAT(100-if(ROUND(ABS(d1.`lweight`- d1.`actualweightminus`)/d1.`lweight`*100,2)>100,100,ROUND(ABS(d1.`lweight`- d1.`actualweightminus`)/d1.`lweight`*100,2)),\'%\') diffRate,\nDATE_FORMAT(d1.intime, \'%H:%i:%s\') intime,\nd1.`begintime` stoptime,\nd1.`lastactualweight`,\nd1.`actualweight`,\ncase d1.buttontype\nwhen 1 then \'自动\'\nwhen 2 then \'手动\'\nwhen 3 then \'手动\'\nend buttontype\nFROM\n `downloadplandtl2` d1\nWHERE d1.`pastureid` = ?\nAND pid =?\nORDER BY sort','pastureid,pid','getprocessAnalysisSL','GetDataByName','撒料详情','tmrgo','{\"name\":\"getprocessAnalysis\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  339. (1536,325,'SELECT * FROM (\nSELECT DATE(de.`date`) 计划时间1,\nIFNULL((SELECT d.`templetname` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid),de.`fname`) 配方名称,\nROUND(SUM(de.`lweight`),2) 理论重量,\nROUND(SUM(de.`actualweightminus`),2) 实际重量,\nSUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\nSUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , \nSUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , \nROUND(ABS(SUM(de.`lweight`)-SUM(de.`actualweightminus`)),2) 混料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0)),0) 混料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 混料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\nFROM `downloadplandtl1` de \n\nWHERE de.pastureid=? AND de.`date` BETWEEN ? AND ?\n AND de.`type` = 0 \nAND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) IN (0,1,2,5)\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY (SELECT d.`templetname` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid)\nORDER BY 混料准确率 DESC,配方名称\n) tem\nwhere tem.配方名称 = ? or ?=\'\'','pastureid,startTime,stopTime,fname,fname','getAccuracyHFT','GetDataByName',' 汇总-配方混料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  340. (1537,325,'SELECT * FROM (\nSELECT \n(SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = de.`pastureid` AND dr.`eqid` = de.`optdevice` AND dr.times= (SELECT d.times FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) AND dr.`operatetime` <=de.`date` \nORDER BY dr.`operatetime` DESC LIMIT 1)驾驶员,\nDATE(de.`date`) 计划时间1,\nIFNULL(TIMEDIFF (\n(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d2.`pid`=de.`pid` AND d2.pastureid = de.pastureid ),\n(SELECT d.intime FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid))\n,\'00:00:00\') 混料时间,\nIFNULL(TIMEDIFF (\n(SELECT MIN(intime) FROM downloadplandtl2 d2 \nWHERE d2.`pid`=de.`pid` AND d2.pastureid = de.pastureid ),\n(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d2.`pid`=de.`pid` AND d2.pastureid = de.pastureid ))\n,\'00:00:00\') 等待时间,\nIFNULL((SELECT d.`projname` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid)\n,\'无车次\') 车次,\nCASE (SELECT d.`times` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid)\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND 班次,\n(SELECT d.tmrtname FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) TMR名称,\nROUND(SUM(de.`lweight`),2) 理论重量,\nROUND(SUM(de.`actualweightminus`),2) 实际重量,\nSUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\nSUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , \nSUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , \nROUND(ABS(SUM(de.`lweight`)-SUM(de.`actualweightminus`)),2) 混料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\n\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0)),0) 混料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 混料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\nFROM `downloadplandtl1` de \n\nWHERE de.pastureid=? AND de.`date` BETWEEN ? AND ?\n-- AND de.`type` = 0 \n-- AND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) IN (0,1,2,5)\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY (SELECT d.projname FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid)\nORDER BY 混料准确率 DESC,TMR名称 ) tem\n\nWHERE (tem.车次 = ? OR ?=\'\') AND (tem.班次 = ? OR ?=\'\') AND (tem.TMR名称 = ? OR ?=\'\')\n','pastureid,startTime,stopTime,projname,projname,times,times,fname,fname','getAccuracyHCC','GetDataByName',' 汇总- 车次混料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  341. (1540,325,'SELECT DATE(d.`mydate`) 计划时间1, de.`fname` 原料名称,\nSUM(de.`lweight`) 理论重量,SUM(de.`actualweightminus`) 实际重量,SUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , ROUND(ABS(SUM(de.`lweight`)-SUM(de.`actualweightminus`)),2) 混料误差值,\nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\n\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差\nFROM `downloadplandtl1_exec` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.`pastureid` = de.`pastureid`\nWHERE d.pastureid = ? AND d.mydate BETWEEN ? AND ? AND d.lpplantype<3\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY de.`fname`\nORDER BY AVG(ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)','pastureid,startTime,stopTime','getAccuracyHYL','GetDataByName',' 汇总-原料混料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  342. (1542,325,'\nSELECT * FROM (\n\nSELECT DATE(de.`date`) 计划时间1,\nIFNULL((SELECT ft.`ccname` FROM `downloadedplan` d\nJOIN `feedtemplet` ft ON ft.`pastureid` = d.`pastureid` AND ft.id = d.`tempid`WHERE d.pastureid = de.pastureid AND d.id = de.pid)\n,\'无类别\') 牲畜类别,\nROUND(SUM(de.`lweight`),2) 理论重量,\nROUND(SUM(de.`actualweightminus`),2) 实际重量,\nSUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\nSUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , \nSUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , \nROUND(ABS(SUM(de.`lweight`)-SUM(de.`actualweightminus`)),2) 混料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0)),0) 混料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 混料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\nFROM `downloadplandtl1` de \n\nWHERE de.pastureid=? AND de.`date` BETWEEN ? AND ?\n AND de.`type` = 0 \nAND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) IN (0,1,2,5)\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY (SELECT ft.`ccname` FROM `downloadedplan` d\nJOIN `feedtemplet` ft ON ft.`pastureid` = d.`pastureid` AND ft.id = d.`tempid`WHERE d.pastureid = de.pastureid AND d.id = de.pid)\nORDER BY 混料准确率 DESC,牲畜类别\n\n) tem\n\nWHERE (tem.牲畜类别 = ? OR ?=\'\')','pastureid,startTime,stopTime,fname,fname','getAccuracyHSC','GetDataByName',' 汇总-牲畜类别混料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  343. (1543,325,'SELECT\n 计划时间1,\n 栏舍名称,\n ROUND(理论重量,2)理论重量,\n ROUND(实际重量,2)实际重量,\n 计划混料操作数,\n 已混料操作数, \n CONCAT(ROUND( 已混料操作数/ 计划混料操作数 *100 ,2),\'%\') 混料操作率,\n 混料自动跳转次数 , \n 混料手动跳转次数 , \n ROUND(ABS(理论重量-实际重量),2) 混料误差值, \nCONCAT( \nIF (实际重量>理论重量,\nROUND((理论重量/实际重量*100),2) ,\nROUND((实际重量/理论重量*100) ,2)),\'%\')混料准确率,\n 取消次数,\n 方差,混料正确数,\nCONCAT(ROUND(IFNULL(混料正确数/ 计划混料操作数,0)*100,2),\'%\') 混料正确率,\nCONCAT(ROUND(IFNULL(去除取消混料正确数/去除取消混料数,0)*100,2),\'%\') 去除取消正确率\nFROM \n(\nSELECT \nd2.`type`,\nDATE(d2.`date`) 计划时间1,\nIFNULL(d2.`fname`\n,\'无栏舍\') 栏舍名称,\nSUM(d2.lweight) 理论重量,\nSUM((SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.flpid = d2.flpid AND dt.type = 0 AND dt.date = d2.date)*\n(d2.lweight/(SELECT SUM(lweight) FROM `downloadplandtl2` dt WHERE dt.pastureid = d2.pastureid AND dt.flpid = d2.flpid AND dt.type = 0 AND dt.date = d2.date))) 实际重量,\nSUM((SELECT SUM(1) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 计划混料操作数,\nSUM((SELECT SUM(dt.`havebuttom`) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 已混料操作数,\nSUM((SELECT SUM(IF(dt.`buttontype` =1,1,0)) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 混料自动跳转次数,\nSUM((SELECT SUM(IF(dt.`buttontype` >1,1,0)) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 混料手动跳转次数,\nSUM((SELECT SUM(CASE WHEN (ABS(dt.`actualweightminus`-dt.`lweight`)/dt.`lweight`)>3 AND dt.`lweight` >30 AND dt.`actualweightminus` >30 THEN 1 ELSE 0 END) \nFROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 取消次数,\nROUND(STD(ABS((SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)*\n(d2.lweight/(SELECT SUM(lweight) FROM `downloadplandtl2` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid))- d2.lweight)) ,2)方差,\n IFNULL(\nSUM((SELECT SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0)) FROM `downloadplandtl1_exec` de WHERE de.pastureid = d2.pastureid AND de.pid = d2.pid))\n,0) 混料正确数,\n\n IFNULL(\nSUM((SELECT SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )) FROM `downloadplandtl1_exec` de WHERE de.pastureid = d2.pastureid AND de.pid = d2.pid))\n,0) 去除取消混料数,\n IFNULL(\nSUM((SELECT SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0),0\n)) FROM `downloadplandtl1_exec` de WHERE de.pastureid = d2.pastureid AND de.pid = d2.pid))\n,0) 去除取消混料正确数\n\n\n\nFROM \n `downloadplandtl2` d2\n WHERE d2.pastureid=? AND d2.`date` BETWEEN ? AND ?\nAND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = d2.pastureid AND d.id = d2.pid) IN (0,1,2,5)\nand d2.`type` = 0\nGROUP BY d2.`fbarid`\n\n) tem\nWHERE 栏舍名称= ? OR ?=\'\'\nORDER BY 混料准确率 DESC,栏舍名称\n','pastureid,startTime,stopTime,fname,fname','getAccuracyHNS','GetDataByName',' 汇总-牛舍混料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  344. (1546,325,'SELECT DATE(d.`mydate`) 计划时间1,ifnull(d.`templetname`,de.`feedtempletname`) 配方名称,\nSUM(de.`lweight`) 理论重量,round(SUM(de.`actualweightminus`)) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数 , \nABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0)),0) 撒料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 撒料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\n\n\n\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.`templetname`\nHAVING d.`templetname` = ? OR ?=\'\'\nORDER BY 撒料准确率 DESC,配方名称','pastureid,startTime,stopTime,fname,fname','getAccuracySFT','GetDataByName',' 汇总-配方撒料准确率','tmrgo','{\"name\":\"getAccuracySFT\",\"page\":1,\"offset\":1,\"pagecount\":\"\",\"returntype\":\"Map\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"startTime\":\"2021-03-15\",\"stopTime\":\"2021-03-15\",\"inputDatetime\":[\"2021-03-16T06:45:08.771Z\",\"2021-03-16T06:45:08.771Z\"],\"fname\":\"泌乳牛配方\",\"sort\":\"\",\"times\":\"\"}}','{\"code\":0,\"list\":[{\"取消次数\":\"0\",\"实际重量\":\"390\",\"已撒料操作数\":\"1\",\"撒料准确率\":\"32.10%\",\"撒料手动跳转次数\":\"0\",\"撒料操作率\":\"33.33%\",\"撒料自动跳转次数\":\"1\",\"撒料误差值\":\"960.00\",\"方差\":271.75,\"理论重量\":\"1350.00\",\"计划撒料操作数\":\"3\",\"计划时间\":\"2021-03-15T00:00:00+08:00\",\"配方名称\":\"泌乳牛配方\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  345. (1547,325,'SELECT \n(SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = de.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1)驾驶员,\n\nDATE(d.`mydate`) 计划时间,d.`projname` 车次,\nCASE d.times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND 班次,\nd.tmrtname TMR名称,\nIFNULL(TIMEDIFF (\n(SELECT max(intime) FROM downloadplandtl2 d2 \nWHERE d2.`pid`=de.`pid` AND d2.pastureid = de.pastureid ),\n(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d2.`pid`=de.`pid` AND d2.pastureid = de.pastureid ))\n,\'00:00:00\') 混料时间,\nIFNULL(TIMEDIFF (\n(SELECT MIN(intime) FROM downloadplandtl2 d2 \nWHERE d2.`pid`=de.`pid` AND d2.pastureid = de.pastureid ),\n(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d2.`pid`=de.`pid` AND d2.pastureid = de.pastureid ))\n,\'00:00:00\') 等待时间,\nSUM(de.`lweight`) 理论重量,round(SUM(de.`actualweightminus`)) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数 ,\nABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)),2) 方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0)),0) 撒料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 撒料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\n\n\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.pastureid = de.pastureid \nWHERE d.pastureid = ? AND DATE(d.`mydate`) BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n -- AND de.`type` = 0\nAND (d.`tmrtname` = ? OR ?=\'\')\nAND (d.`projname` = ? OR ?= \'\')\n\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.`projname`\nHAVING (班次 = ? OR ?= \'\')\nORDER BY 撒料准确率 DESC,车次\n','pastureid,startTime,stopTime,fname,fname,projname,projname,times,times','getAccuracySCC','GetDataByName',' 汇总- 车次撒料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  346. (1548,325,'SELECT DATE(d.`mydate`) 计划时间1, de.`fname` 原料名称,\nSUM(de.`lweight`) 理论重量,SUM(de.`actualweightminus`) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数 ,\n ABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.`pastureid` = de.`pastureid`\nWHERE d.pastureid = ? AND DATE(d.`mydate`) BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\nAND (de.`fname` = ? OR ?=\'\')\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY de.`fname`\nORDER BY 撒料准确率 DESC','pastureid,startTime,stopTime,fname,fname','getAccuracySYL','GetDataByName',' 汇总-原料撒料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  347. (1549,325,'SELECT DATE(d.`mydate`) 计划时间1,ifnull((SELECT concat(bm.bigcowclass,\'-\',bm.cowclass) FROM barmilk bm WHERE bm.`barid` = de.fbarid AND bm.pastureid=de.pastureid AND bm.productdate<=de.`date` ORDER BY bm.productdate DESC LIMIT 1) ,\'无类别\') 牲畜类别,\nSUM(de.`lweight`) 理论重量,SUM(de.`actualweightminus`) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数, \nABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0)),0) 撒料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 撒料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\n\n\nFROM `downloadedplan` d JOIN `downloadplandtl2` de\nON d.`id`=de.`pid` AND d.`pastureid` = de.`pastureid`\nWHERE d.pastureid = ? AND DATE(d.`mydate`) BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\nAND (de.`cowclassname` = ? OR ?=\'\')\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY (SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = de.fbarid AND bm.pastureid=de.pastureid AND bm.productdate<=de.`date` ORDER BY bm.productdate DESC LIMIT 1) \nORDER BY 撒料准确率 DESC,牲畜类别','pastureid,startTime,stopTime,fname,fname','getAccuracySSC','GetDataByName',' 汇总-牲畜类别撒料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  348. (1550,325,'SELECT DATE(d.`mydate`) 计划时间1,de.`fname` 栏舍名称,\nSUM(de.`lweight`) 理论重量,SUM(de.`actualweightminus`) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数, \nABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值,\n concat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0)),0) 撒料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 撒料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\n\n\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.`pastureid` = de.`pastureid`\nWHERE d.pastureid = ? AND DATE(d.`mydate`) BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\nAND (de.`fname` = ? OR ?=\'\')\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY de.`fname`\nORDER BY 撒料准确率 DESC,栏舍名称','pastureid,startTime,stopTime,fname,fname','getAccuracySNS','GetDataByName',' 汇总-牛舍撒料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  349. (1551,325,'SELECT \n(SELECT `pasture_name` FROM `pasture` WHERE pastureid = d.pastureid) 牧场,\nDATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 日期, d.`tmrtname` TMR名称,d.`projname` 车次,\nCASE d.`times` \nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND 班次,d.`templetname` 配方名称,d1.`fname` 饲料,d1.`lweight` 理论重量,d1.`actualweightminus` 实际重量,\nABS(d1.`lweight`-d1.`actualweightminus`) 误差值,\nCONCAT(ROUND(100-(ABS(d1.`lweight`-d1.`actualweightminus`)/d1.`lweight`)*100,2),\'%\') 准确率, \nd.`plantime` 计划时间,\nd1.`begintime` 开始时间1,\nDATE_FORMAT(d1.`intime`, \'%H:%i:%s\') 结束时间,\nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl1 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)\n, (SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid)\n), \'%H:%i:%s\') 开始时间,\ncase d1.buttontype\nwhen 1 then \'自动\'\nwhen 2 then \'手动\'\nwhen 3 then \'手动\'\nend 跳转方式,d1.`lastactualweight` 开始重量,d1.`actualweight` 结束重量\nFROM `downloadedplan` d JOIN `downloadplandtl1` d1 ON d.`id`=d1.`pid` AND d.`pastureid`=d1.`pastureid`\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype in (0,1,2,5) and d1.type = 0\nAND ( d.`tmrtname`=? or ? = \'\')\nAND ( d.`projname`=? or ? = \'\')\nAND ( d.`times`=? or ? = \'\')\nAND ( d1.`buttontype`=? or ? = \'\')\nAND ( d.`templetname`=? or ? = \'\')\nORDER BY d.`mydate`,d.`projname`,d1.`intime` ','pastureid,startTime,stopTime,tmrtname,tmrtname,projname,projname,times,times,buttontype,buttontype,templetname,templetname','getStatisticsHL','GetDataByName',' 混料统计明细','tmrgo','{\"name\":\"getStatisticsHL\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'SELECT MAX(intime) FROM downloadplandtl1 d2 \\nWHERE d1.`pid`=d2.`pid` AND d1.pas\' at line 4\"',0,1,0,0,0),
  350. (1552,325,'SELECT \n(SELECT `pasture_name` FROM `pasture` WHERE pastureid = d.pastureid) 牧场,\nDATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 日期, d.`tmrtname` TMR名称,d.`projname` 车次,\nCASE d.`times` \nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND 班次,\nd.`templetname` 配方名称,d2.`fname` 栏舍,d2.`lweight` 理论重量,d2.`actualweightminus` 实际重量,\nABS(d2.`lweight`-d2.`actualweightminus`) 误差值,\nCONCAT(ROUND(100-(ABS(d2.`lweight`-d2.`actualweightminus`)/d2.`lweight`)*100,2),\'%\') 准确率, \nDATE_FORMAT(d.`plantime`, \'%H:%i:%s\') 计划时间,d2.`begintime` 开始时间1,DATE_FORMAT(d2.`intime`, \'%H:%i:%s\') 结束时间,\nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl2 d1\nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d1.intime<d2.intime)\n, (SELECT MAX(intime) FROM downloadplandtl1_exec de\nWHERE de.`date`=d2.`date` AND de.pastureid = d2.pastureid AND de.pid=d2.pid)\n), \'%H:%i:%s\') 开始时间,\n\ncase d2.buttontype\nwhen 1 then \'自动\'\nwhen 2 then \'手动\'\nwhen 3 then \'手动\'\nend 跳转方式,d2.`lastactualweight` 开始重量,d2.`actualweight` 结束重量\nFROM `downloadedplan` d JOIN `downloadplandtl2` d2 ON d.`id`=d2.`pid` AND d.`pastureid`=d2.`pastureid`\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype in (0,1,2,5) and d2.type = 0\nAND ( d.`tmrtname`=? or ? = \'\')\nAND ( d.`projname`=? or ? = \'\')\nAND ( d.`times`=? or ? = \'\')\nAND ( d.`templetname`=? or ? = \'\')\nAND ( d2.`fname`=? or ? = \'\')\nAND ( d2.`buttontype`=? or ? = \'\')\nORDER BY d.`mydate`,d.`projname`,d2.`intime` ','pastureid,startTime,stopTime,tmrtname,tmrtname,projname,projname,times,times,templetname,templetname,fname,fname,buttontype,buttontype','getStatisticsSL','GetDataByName','撒料统计明细','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  351. (1553,325,'SELECT DATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 日期, d.`tmrtname` TMR名称,d.`projname` 车次,d.`times` 班次,d.`templetname` 配方名称,d2.`fname` 栏舍,d1.`fname` 饲料,d1.`lweight`*d2.`lweight`/d.`lweight` 理论重量,ROUND(d1.`actualweightminus`*d2.`lweight`/d.`lweight`) 实际重量,\nABS(d1.`lweight`*d2.`lweight`/d.`lweight`-ROUND(d1.`actualweightminus`*d2.`lweight`/d.`lweight`)) 误差值,\n1-(ABS(d1.`lweight`*d2.`lweight`/d.`lweight`-ROUND(d1.`actualweightminus`*d2.`lweight`/d.`lweight`))/(d1.`lweight`*d2.`lweight`/d.`lweight`)) 准确率,d.`plantime` 计划时间,d1.`begintime` 开始时间,d1.`intime` 结束时间,d1.`buttontype` 跳转方式,d1.`lastactualweight` 开始重量,d1.`actualweight` 结束重量\nFROM `downloadedplan` d JOIN `downloadplandtl1` d1 ON d.`id`=d1.`pid` AND d.`pastureid`=d1.`pastureid`\nJOIN `downloadplandtl2` d2 ON d.`id`=d2.`pid` AND d.`pastureid`=d2.`pastureid`\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype<3\nORDER BY d.`projname`,d1.`intime` ,d2.`fname`,d1.`fname` ','pastureid,startTime,stopTime,fname,fname','getStatisticsYL','GetDataByName','牛舍各原料统计明细','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  352. (1554,325,'SELECT DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \nd.`templetname` 名称,\nSUM(de.`lweight`) 理论量,\nIFNULL(SUM(de.`actualweightminus`),0) 实际量,\nROUND(IF(SUM(de.`lweight`)>SUM(de.`actualweightminus`),SUM(de.`actualweightminus`)/SUM(de.`lweight`),SUM(de.`lweight`)/SUM(de.`actualweightminus`))*100,2) 准确率,\nCOUNT(de.id) 添加饲料次数,\nSUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio`,1,0)) 添加正确数,\nIF(COUNT(de.id)>0,SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio`,1,0))/COUNT(de.id),0) 正确率\nFROM `downloadedplan` d JOIN `downloadplandtl1_exec` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid \nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND de.type = 0\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.`Mydate`,d.`templetname`\nORDER BY d.`templetname` ,d.`Mydate`','pastureid,startTime,stopTime ','getAccuracyAllFT','GetDataByName','汇总 -按配方统计 ','tmrgo','{\"name\":\"getAccuracyAllFT\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  353. (1555,325,'\nSELECT \n日期,\nSUM(计划取消重量) 计划取消重量,\nROUND((SUM(实际量)-SUM(计划取消重量))/SUM(理论量)*100,2) field3, -- 准确率(去除取消重量)\nIFNULL(ROUND(IF(SUM(实际量)>SUM(理论量),SUM(理论量)/SUM(实际量),SUM(实际量)/SUM(理论量))*100,2),0) field1, -- 准确率\nSUM(理论量) 理论量, \nSUM(实际量) 实际量, \nSUM(计划数) 计划数,\nSUM(正确数) 正确数,\nIFNULL(ROUND(SUM(正确数)/SUM(计划数)*100,2),0) field2 \n FROM \n(\nSELECT \nIFNULL((SELECT SUM(actualweightminus) FROM downloadplandtl1_exec de1 WHERE de1.pid = d.id AND d.pastureid = de1.pastureid\nAND ((ABS(de1.`actualweightminus`-de1.`lweight`)/de1.`lweight`)>=3 AND (de1.`lweight` >=30 OR de1.`actualweightminus` >=30 AND de1.type = 0))\n ),0) 计划取消重量,\n\nDATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \nd.`lweight` 理论量,\nIFNULL(d.`iweight`,0) 实际量,\n(SELECT COUNT(*) FROM downloadplandtl1 de1 WHERE de1.pid = d.id AND d.pastureid = de1.pastureid AND de1.type = 0) 计划数, -- 添加饲料次数, \n(SELECT SUM(IF(ABS(de1.`actualweightminus`-de1.`lweight`)<=de1.`feedallowratio` AND de1.`actualweightminus`<>0,1,0)) \nFROM downloadplandtl1 de1 WHERE de1.pid = d.id AND d.pastureid = de1.pastureid AND de1.type = 0) 正确数\n\nFROM `downloadedplan` d\n\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype in (0,1,2,5)\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \n) tem \nGROUP BY 日期','pastureid,startTime,stopTime','getAccuracyAllJH','GetDataByName','汇总 -按计划统计 ','tmrgo','{\"name\":\"getAccuracyAllJH\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'),2) field3 , -- 计划取消准确率\\n \\n \\nDATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') \' at line 8\"',0,1,0,0,0),
  354. (1556,325,'SELECT IFNULL((SELECT `cowclass` FROM `barmilk` WHERE pastureid = de.pastureid AND `barid` = de.fbarid AND `productdate` <= de.date ORDER BY productdate DESC LIMIT 1) ,\'无类别\')名称 ,\nDATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \nSUM(de.`lweight`) 理论量,SUM(de.`actualweightminus`) 实际量,\nROUND(IF(SUM(de.`lweight`)>SUM(de.`actualweightminus`),SUM(de.`actualweightminus`)/SUM(de.`lweight`),SUM(de.`lweight`)/SUM(de.`actualweightminus`))*100,2) 准确率\nFROM `downloadedplan` d JOIN `downloadplandtl2` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND de.type = 0\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.`Mydate`,(SELECT `cowclass` FROM `barmilk` WHERE pastureid = de.pastureid AND `barid` = de.fbarid AND `productdate` <= de.date ORDER BY productdate DESC LIMIT 1)\nORDER BY 名称 ,d.`Mydate`','pastureid,startTime,stopTime','getAccuracyAllNQ','GetDataByName','汇总 -按牛群统计 ','tmrgo','{\"name\":\"getAccuracyAllNQ\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'FROM `downloadedplan` d JOIN `downloadplandtl2` de ON d.`id`=de.`pid` AND d.past\' at line 5\"',0,1,0,0,0),
  355. (1557,325,'SELECT concat(de.`fname`,\'-\',d.times,\'班\') 名称,de.`fname`,DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \nIFNULL(DATE_FORMAT(de.intime,\'%H.%i\'),\'\') 准确率 -- 撒料时间\nFROM `downloadedplan` d right JOIN `downloadplandtl2` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND de.type = 0\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.times,d.`Mydate`,de.`fname`\nORDER BY concat(de.`fname`,d.times) ,d.`Mydate`','pastureid,startTime,stopTime','getAccuracyAllLS','GetDataByName','汇总 -按栏舍统计 ','tmrgo','{\"name\":\"getAccuracyAllLS\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"Error 1054: Unknown column \'d\' in \'field list\'\"',0,1,0,0,0),
  356. (1558,325,'SELECT d.`projname` 名称,DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \nSUM(de.`lweight`) 理论量,SUM(de.`actualweightminus`) 实际量,\nROUND(IF(SUM(de.`lweight`)>SUM(de.`actualweightminus`),SUM(de.`actualweightminus`)/SUM(de.`lweight`),SUM(de.`lweight`)/SUM(de.`actualweightminus`))*100,2) 准确率\nFROM `downloadedplan` d right JOIN `downloadplandtl1_exec` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND de.type = 0\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.projname,d.`Mydate`\norder by d.`projname` ,d.`Mydate`','pastureid,startTime,stopTime','getAccuracyAllCC','GetDataByName','汇总 -按车次统计 ','tmrgo','{\"name\":\"getAccuracyAllCC\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"Error 1054: Unknown column \'de.projname\' in \'field list\'\"',0,1,0,0,0),
  357. (1559,325,'SELECT de.`fname` 名称,DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \ncount(de.id) field1 -- 取消次数\nFROM `downloadedplan` d LEFT JOIN `downloadplandtl1_exec` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nAND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND (de.`lweight` >=30 OR de.`actualweightminus` >=30 )) \nAND de.type = 0\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) \n-- 加上就是不含取消操作\n\nGROUP BY d.`Mydate`','pastureid,startTime,stopTime','getAccuracyAllQX','GetDataByName','汇总 -混料计划取消次数','tmrgo','{\"name\":\"getAccuracyAllQX\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  358. (1560,325,'SELECT \n日期,\nSUM(自动次数) field1, -- 自动次数,\nifnull( SUM(实际自动),0) 实际自动,\nifnull(SUM(理论自动),0)理论自动,\nSUM(手动次数) field2, -- 手动次数, \nSUM(实际手动) 实际手动,SUM(理论手动) 理论手动,\nIFNULL(ROUND(IF(SUM(实际自动)>SUM(理论自动),SUM(理论自动)/SUM(实际自动),SUM(实际自动)/SUM(理论自动))*100,2),0) field3, -- 自动准确率,\nIFNULL(ROUND(IF(SUM(实际手动)>SUM(理论手动),SUM(理论手动)/SUM(实际手动),SUM(实际手动)/SUM(理论手动))*100,2),0) field4 -- 手动准确率 \nFROM (\nSELECT DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \n(SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype = 1 AND actualweightminus>0 AND de.type = 0) 实际自动,\n(SELECT SUM(lweight) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype = 1 AND de.type = 0) 理论自动,\n(SELECT COUNT(*) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype = 1 AND de.type = 0) 自动次数,\n\n(SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype IN (2,3) AND actualweightminus>0 AND de.type = 0) 实际手动,\n(SELECT SUM(lweight) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype IN (2,3) AND de.type = 0) 理论手动,\n(SELECT COUNT(*) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype IN (2,3) AND de.type = 0) 手动次数\nFROM `downloadedplan` d\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) \n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 and (de.`lweight` >=30 or de.`actualweightminus` >=30 )) \n)d\nGROUP BY d.`日期`\nORDER BY `日期`\n\n','pastureid,startTime,stopTime','getAccuracyAllHL','GetReportform','汇总 -混料统计','tmrgo','{\"name\":\"getAccuracyAllHL\",\"page\":1,\"offset\":1,\"pagecount\":\"\",\"returntype\":\"Map\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-03\",\"stopTime\":\"2020-11-03\",\"inputDatetime\":[\"2020-11-24T08:39:05.753Z\",\"Tue Nov 24 2020 16:39:05 GMT 0800 (中国标准时间)7\"],\"enable\":[]}}','{\"code\":0,\"data\":[{\"field1\":\"182\",\"field2\":\"26\",\"field3\":\"100.07\",\"field4\":\"31.90\",\"实际手动\":\"637.00\",\"实际自动\":\"95519.00\",\"日期\":\"2020-11-03\",\"理论手动\":\"1996.74\",\"理论自动\":\"95450.67\"}],\"list\":{\"data1\":[\"2020-11-03\"],\"data2\":[\"182\"],\"data3\":[\"26\"],\"data4\":[\"100.07\"],\"data5\":[\"31.90\"]},\"message\":\"ok\"}',0,1,0,0,0),
  359. (1561,324,'SELECT tem.id,tem.pastureid,tem.optdevice,tem.proesstime,DATE_FORMAT(startstime, \'%H:%i:%s\') startstime,\nDATE_FORMAT(intime, \'%H:%i:%s\') intime,tem.sort,tem.actualweightminus,\nDATE_FORMAT(r.`mtime`, \'%H:%i:%s\') mtime,r.`weight`, tem.`lastactualweight`,tem.lweight,\ntem.`actualweight`,\nDATE_FORMAT(r.`mtime`, \'%Y-%m-%d\') `date`\nFROM (SELECT\nTRIM(d1.`id`) id,\nd1.`pastureid`,\nd1.`optdevice`,\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid))\n) proesstime, \nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)\n, (SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid)\n),\'%Y-%m-%d %H:%i:%s\') startstime,\n\nd1.sort,\nd1.lastactualweight+ d1.`lweight` lweight ,\nd1.`actualweightminus`,\nDATE_FORMAT(d1.intime, \'%Y-%m-%d %H:%i:%s\') intime,\nd1.`lastactualweight`,\nd1.`actualweight`\n\nFROM\n `downloadplandtl1_exec` d1\nWHERE d1.`pastureid` = ?\nAND pid =?\n\nUNION ALL\n\nSELECT\nTRIM(d1.`id`) id,\nd1.`pastureid`,\nd1.`optdevice` ,\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`date`=d2.`date` AND d1.pastureid = d2.pastureid AND d2.pid=d1.pid))\n) proesstime, \nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)\n, (SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid)\n),\'%Y-%m-%d %H:%i:%s\') startstime,\n\nd1.sort,\nd1.lastactualweight - d1.`lweight` lweight ,\nd1.`actualweightminus`,\nDATE_FORMAT(d1.intime, \'%Y-%m-%d %H:%i:%s\') intime,\nd1.`lastactualweight`,\nd1.`actualweight`\n\nFROM\n `downloadplandtl2` d1\nWHERE d1.`pastureid` = ?\nAND pid =?\n\nORDER BY sort\n) tem \nINNER JOIN tmr \nON tmr.`pastureid` = tem.pastureid AND tmr.`id`= tem.optdevice\nINNER JOIN `recweight` r\nON r.`pastureid` = tem.pastureid AND r.`srcaddr` = tmr.`datacaptureno` \nWHERE r.`mtime` >=tem.startstime AND r.`mtime` <=tem.intime\n \nORDER BY sort , mtime\n\n','pastureid,pid,pastureid,pid','getprocessAnalysisTBv2','GetDataByName','监控图','tmrgo','{\"name\":\"getprocessAnalysisTB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  360. (1562,326,'SELECT \n-1 barid,\'平均值\' barname,tem.sumweight,\'\' standard,\nCONCAT(ROUND(AVG(oneweight),2)) oneweight, \nCONCAT(ROUND(AVG(twoweight),2))twoweight,\nCONCAT(ROUND(AVG(threeweight),2))threeweight,\nCONCAT(ROUND(AVG(fourweight),2)) fourweight,\n\nCONCAT(ROUND(AVG(onerate),2),\'%\') onerate, \nCONCAT(ROUND(AVG(tworate),2),\'%\')tworate,\nCONCAT(ROUND(AVG(threerate),2),\'%\')threerate,\nCONCAT(ROUND(AVG(fourrate),2),\'%\') fourrate\nFROM (\nSELECT tem.barid,tem.barname,tem.sumweight,tem.standard,\n tem.oneweight,\n tem.twoweight,\n tem.threeweight,\n tem.fourweight,\n ROUND(oneweight/sumweight*100,2) onerate,\n ROUND(twoweight/sumweight*100,2) tworate,\n ROUND(threeweight/sumweight*100,2) threerate,\n 100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)+ROUND(threeweight/sumweight*100,2)) fourrate\n\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,CONCAT(p.barname,\'/\',IFNULL((SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1),\'\'))barname,\n SUM(p.oneweight+p.twoweight+p.threeweight+p.fourweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight,\n ROUND(SUM(p.fourweight),2) fourweight,\n CONCAT(p.onerange,p.tworange,p.threerange,p.fourrange) standard\n FROM `pennsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =?\n\nGROUP BY p.barname) tem\nORDER BY barid)tem\n\nUNION ALL\n\nSELECT \n-2,\'变异系数\',tem.sumweight,\'\' standard,\nCONCAT(ROUND(STD(oneweight)/AVG(oneweight)*100,2),\'%\'),\nCONCAT(ROUND(STD(twoweight)/AVG(twoweight)*100,2),\'%\'),\nCONCAT(ROUND(STD(threeweight)/AVG(threeweight)*100,2),\'%\'),\nCONCAT(ROUND(STD(fourweight)/AVG(fourweight)*100,2),\'%\'),\n\nCONCAT(ROUND(STD(onerate)/AVG(onerate)*100,2),\'%\'),\nCONCAT(ROUND(STD(tworate)/AVG(tworate)*100,2),\'%\'),\nCONCAT(ROUND(STD(threerate)/AVG(threerate)*100,2),\'%\'),\nCONCAT(ROUND(STD(fourrate)/AVG(fourrate)*100,2),\'%\')\nFROM (\nSELECT tem.barid,tem.barname,tem.sumweight,tem.standard,\n tem.oneweight,\n tem.twoweight,\n tem.threeweight,\n tem.fourweight,\n CONCAT(ROUND(oneweight/sumweight*100,2),\'%\') onerate,\n CONCAT(ROUND(twoweight/sumweight*100,2),\'%\') tworate,\n CONCAT(ROUND(threeweight/sumweight*100,2),\'%\') threerate,\n CONCAT(100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)+ROUND(threeweight/sumweight*100,2)),\'%\') fourrate\n\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,CONCAT(p.barname,\'/\',IFNULL((SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1),\'\'))barname,\n SUM(p.oneweight+p.twoweight+p.threeweight+p.fourweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight,\n ROUND(SUM(p.fourweight),2) fourweight,\n CONCAT(p.onerange,p.tworange,p.threerange,p.fourrange) standard\n FROM `pennsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =?\n\nGROUP BY p.barname) tem\nORDER BY barid)tem\n\nUNION ALL\n\n\nSELECT tem.barid,tem.barname,tem.sumweight,tem.standard,\n tem.oneweight,\n tem.twoweight,\n tem.threeweight,\n tem.fourweight,\n CONCAT(ROUND(oneweight/sumweight*100,2),\'%\') onerate,\n CONCAT(ROUND(twoweight/sumweight*100,2),\'%\') tworate,\n CONCAT(ROUND(threeweight/sumweight*100,2),\'%\') threerate,\n CONCAT(100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)+ROUND(threeweight/sumweight*100,2)),\'%\') fourrate\n\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,CONCAT(p.barname,\'/\',IFNULL((SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1),\'\'))barname,\n SUM(p.oneweight+p.twoweight+p.threeweight+p.fourweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight,\n ROUND(SUM(p.fourweight),2) fourweight,\n CONCAT(p.onerange,p.tworange,p.threerange,p.fourrange) standard\n FROM `pennsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =?\n\nGROUP BY p.barname) tem\nORDER BY barid\n','pastureid,date,pastureid,date,pastureid,date','getAssessCowPenn','GetDataByName','牛群评估-宾州筛分析列表','tmrgo','{\"name\":\"getAssessCowPenn\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3027996177498375168\",\"barname\":\"西区#1/高产牛\",\"fourrate\":\"7.14%\",\"fourweight\":\"10.00\",\"onerate\":\"42.86%\",\"oneweight\":\"60.00\",\"pastureid\":3025176271438480400,\"standard\":\"(50-100)(30-50)(10-20)(0-10)\",\"sumweight\":\"140.00\",\"threerate\":\"14.29%\",\"threeweight\":\"20.00\",\"tworate\":\"35.71%\",\"twoweight\":\"50.00\"},{\"barid\":\"3028006959913108480\",\"barname\":\"西区#2/荷兰大奶牛\",\"fourrate\":\"4.83%\",\"fourweight\":\"5.00\",\"onerate\":\"48.29%\",\"oneweight\":\"50.00\",\"pastureid\":3025176271438480400,\"standard\":\"(10-20)(30-40)(10-20)(30-40)\",\"sumweight\":\"103.55\",\"threerate\":\"22.74%\",\"threeweight\":\"23.55\",\"tworate\":\"24.14%\",\"twoweight\":\"25.00\"},{\"barid\":\"3050941006599422976\",\"barname\":\"北区#1/水牛\",\"fourrate\":\"24.48%\",\"fourweight\":\"35.00\",\"onerate\":\"15.38%\",\"oneweight\":\"22.00\",\"pastureid\":3025176271438480400,\"standard\":\"(1-1)(3-4)(5-6)(7-8)\",\"sumweight\":\"143.00\",\"threerate\":\"37.06%\",\"threeweight\":\"53.00\",\"tworate\":\"23.08%\",\"twoweight\":\"33.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  361. (1563,326,'SELECT \n-1 barid,\'平均值\' barname,tem.sumweight,\'\' standard,\nCONCAT(ROUND(AVG(oneweight),2)) oneweight, \nCONCAT(ROUND(AVG(twoweight),2))twoweight,\nCONCAT(ROUND(AVG(threeweight),2))threeweight,\n\nCONCAT(ROUND(AVG(onerate),2),\'%\') onerate, \nCONCAT(ROUND(AVG(tworate),2),\'%\')tworate,\nCONCAT(ROUND(AVG(threerate),2),\'%\')threerate\n\nFROM (\nSELECT tem.barid,tem.barname,tem.sumweight,tem.standard,\n tem.oneweight,\n tem.twoweight,\n tem.threeweight,\n CONCAT(ROUND(oneweight/sumweight*100,2),\'%\') onerate,\n CONCAT(ROUND(twoweight/sumweight*100,2),\'%\') tworate,\n CONCAT(100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)),\'%\') threerate\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,CONCAT(p.barname,\'/\',IFNULL((SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1),\'\'))barname,\n SUM(p.oneweight+p.twoweight+p.threeweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight,\n CONCAT(p.onerange,p.tworange,p.threerange) standard\n FROM `dungsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =?\n\nGROUP BY p.barname) tem\nORDER BY barid)tem\n\nUNION ALL\n\nSELECT \n-2,\'变异系数\',tem.sumweight,\'\' standard,\nCONCAT(ROUND(STD(oneweight)/AVG(oneweight)*100,2),\'%\'),\nCONCAT(ROUND(STD(twoweight)/AVG(twoweight)*100,2),\'%\'),\nCONCAT(ROUND(STD(threeweight)/AVG(threeweight)*100,2),\'%\'),\n\nCONCAT(ROUND(STD(onerate)/AVG(onerate)*100,2),\'%\'),\nCONCAT(ROUND(STD(tworate)/AVG(tworate)*100,2),\'%\'),\nCONCAT(ROUND(STD(threerate)/AVG(threerate)*100,2),\'%\')\nFROM (\nSELECT tem.barid,tem.barname,tem.sumweight,tem.standard,\n tem.oneweight,\n tem.twoweight,\n tem.threeweight,\n CONCAT(ROUND(oneweight/sumweight*100,2),\'%\') onerate,\n CONCAT(ROUND(twoweight/sumweight*100,2),\'%\') tworate,\n CONCAT(100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)),\'%\') threerate\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,CONCAT(p.barname,\'/\',IFNULL((SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1),\'\'))barname,\n SUM(p.oneweight+p.twoweight+p.threeweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight,\n CONCAT(p.onerange,p.tworange,p.threerange) standard\n FROM `dungsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =?\n\nGROUP BY p.barname) tem\nORDER BY barid)tem\n\nUNION ALL\n\n\nSELECT tem.barid,tem.barname,tem.sumweight,tem.standard,\n tem.oneweight,\n tem.twoweight,\n tem.threeweight,\n CONCAT(ROUND(oneweight/sumweight*100,2),\'%\') onerate,\n CONCAT(ROUND(twoweight/sumweight*100,2),\'%\') tworate,\n CONCAT(100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)),\'%\') threerate\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,CONCAT(p.barname,\'/\',IFNULL((SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1),\'\'))barname,\n SUM(p.oneweight+p.twoweight+p.threeweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight,\n CONCAT(p.onerange,p.tworange,p.threerange) standard\n FROM `dungsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =?\n\nGROUP BY p.barname) tem\nORDER BY barid\n','pastureid,date,pastureid,date,pastureid,date','getAssessCowDung','GetDataByName','牛群评估-粪便筛分析列表','tmrgo','{\"name\":\"getAssessCowDung\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'CONCAT(ROUND(AVG(onerate)*100,2),\'%\') onerate, \\nCONCAT(ROUND(AVG(tworate)*100,2)\' at line 7\"',0,1,0,0,0),
  362. (1564,326,'SELECT tem.standardscore,tem.barname,tem.product,tem.avgdim,tem.sumcowcount,tem.dryweight,\n CONCAT(score25,\'(\',ROUND(score25/sumcowcount*100,2),\'%)\') score25,\n CONCAT(score275,\'(\',ROUND(score275/sumcowcount*100,2),\'%)\') score275,\n CONCAT(score3,\'(\',ROUND(score3/sumcowcount*100,2),\'%)\') score3,\n CONCAT(score325,\'(\',ROUND(score325/sumcowcount*100,2),\'%)\') score325,\n CONCAT(score35,\'(\',ROUND(score35/sumcowcount*100,2),\'%)\') score35,\n CONCAT(score375,\'(\',ROUND(score375/sumcowcount*100,2),\'%)\') score375,\n CONCAT((sumcowcount-score25-score275-score3-score325-score35-score375),\'(\',100-(ROUND(score25/sumcowcount*100,2)\n +ROUND(score275/sumcowcount*100,2)+ROUND(score3/sumcowcount*100,2)\n +ROUND(score325/sumcowcount*100,2)+ROUND(score35/sumcowcount*100,2)\n +ROUND(score375/sumcowcount*100,2)),\'%)\') score4\n\n\nFROM (\nSELECT\n p.pastureid,p.barid,p.standardscore,\n CONCAT(p.barname,\'/\',IFNULL((SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1),\'\'))barname,\n \n (SELECT bm.product FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)product,\n (SELECT bm.avgdim FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)avgdim,\n SUM(p.score25+p.score275+p.score3+p.score325+p.score35+p.score375+p.score4) sumcowcount,\nROUND(IFNULL((SELECT SUM(d2.`actualweightminus`)/d2.`cowcount` FROM `downloadplandtl2` d2 where d2.`fbarid` = p.barid AND d2.`pastureid` = p.pastureid),0),2) dryweight,\n ROUND(SUM(p.score25),2) score25,\n ROUND(SUM(p.score275),2)score275,\n ROUND(SUM(p.score3),2)score3,\n ROUND(SUM(p.score325),2) score325,\n ROUND(SUM(p.score35),2) score35,\n ROUND(SUM(p.score375),2) score375,\n ROUND(SUM(p.score4),2) score4\n FROM `bodyscore` p\n\n WHERE p.`pastureid` =? AND p.`operatetime` =?\nGROUP BY p.barid) tem\nORDER BY barid','pastureid,date','getAssessBodyscore','GetDataByName','牛群评估-BCS评分','tmrgo','{\"name\":\"getAssessBodyscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"CONCAT(p.onerange,p.tworange,p.threerange)\":\"(1-2)(3-4)(5-6)\",\"barid\":3050941006599423000,\"barname\":\"北区#1/水牛\",\"fourrate\":\"24.16%\",\"onerate\":\"62.92%\",\"oneweight\":\"112.00\",\"pastureid\":3025176271438480400,\"sumweight\":\"178.00\",\"threerate\":\"24.16%\",\"threeweight\":\"43.00\",\"tworate\":\"12.92%\",\"twoweight\":\"23.00\"},{\"CONCAT(p.onerange,p.tworange,p.threerange)\":\"(0-20)(0-20)(0-20)\",\"barid\":3055340423423198000,\"barname\":\"南区#1/干奶后期 产前-分娩\",\"fourrate\":\"25.78%\",\"onerate\":\"39.06%\",\"oneweight\":\"50.00\",\"pastureid\":3025176271438480400,\"sumweight\":\"128.00\",\"threerate\":\"25.78%\",\"threeweight\":\"33.00\",\"tworate\":\"35.16%\",\"twoweight\":\"45.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  363. (1565,326,'SELECT tem.standardscore,tem.barname,tem.product,tem.avgdim,tem.sumcowcount,tem.dryweight,\n CONCAT(1score,\'(\',ROUND(1score/sumcowcount*100,2),\'%)\') score1,\n CONCAT(2score,\'(\',ROUND(2score/sumcowcount*100,2),\'%)\') score2,\n CONCAT(3score,\'(\',ROUND(3score/sumcowcount*100,2),\'%)\') score3,\n CONCAT(4score,\'(\',ROUND(4score/sumcowcount*100,2),\'%)\') score4,\n CONCAT((sumcowcount-1score-2score-3score-4score),\'(\',100-(ROUND(1score/sumcowcount*100,2)\n +ROUND(2score/sumcowcount*100,2)+ROUND(3score/sumcowcount*100,2)\n +ROUND(4score/sumcowcount*100,2)),\'%)\') score5\n\nFROM (\nSELECT\nstandardscore,\n p.pastureid,p.barid,\n CONCAT(p.barname,\'/\',IFNULL((SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1),\'\'))barname,\n \n (SELECT bm.product FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)product,\n (SELECT bm.avgdim FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)avgdim,\n SUM(p.1score+p.2score+p.3score+p.4score+p.5score) sumcowcount,\nROUND(IFNULL((SELECT SUM(d2.`actualweightminus`)/d2.`cowcount` FROM `downloadplandtl2` d2 where d2.`fbarid` = p.barid AND d2.`pastureid` = p.pastureid),0),2) dryweight,\n\n ROUND(SUM(p.1score),2) 1score,\n ROUND(SUM(p.2score),2)2score,\n ROUND(SUM(p.3score),2)3score,\n ROUND(SUM(p.4score),2) 4score,\n ROUND(SUM(p.5score),2) 5score\n FROM `dungscore` p\n WHERE p.`pastureid` =? AND p.`operatetime` = ?\nGROUP BY p.barid) tem\nORDER BY barid','pastureid,date','getAssessDungscore','GetDataByName','牛群评估-粪便评分','tmrgo','{\"name\":\"getAssessDungscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"CONCAT(p.onerange,p.tworange,p.threerange)\":\"(1-2)(3-4)(5-6)\",\"barid\":3050941006599423000,\"barname\":\"北区#1/水牛\",\"fourrate\":\"24.16%\",\"onerate\":\"62.92%\",\"oneweight\":\"112.00\",\"pastureid\":3025176271438480400,\"sumweight\":\"178.00\",\"threerate\":\"24.16%\",\"threeweight\":\"43.00\",\"tworate\":\"12.92%\",\"twoweight\":\"23.00\"},{\"CONCAT(p.onerange,p.tworange,p.threerange)\":\"(0-20)(0-20)(0-20)\",\"barid\":3055340423423198000,\"barname\":\"南区#1/干奶后期 产前-分娩\",\"fourrate\":\"25.78%\",\"onerate\":\"39.06%\",\"oneweight\":\"50.00\",\"pastureid\":3025176271438480400,\"sumweight\":\"128.00\",\"threerate\":\"25.78%\",\"threeweight\":\"33.00\",\"tworate\":\"35.16%\",\"twoweight\":\"45.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  364. (1566,338,'SELECT \nsort,fname,lweight weight\nFROM \n downloadplandtl1\nWHERE pastureid = ? \n AND pid=? \nORDER BY downloadplandtl1.sort ','pastureid,id','getDownloadplandtl1ListV2','GetDataByName','计划内容操作详情列表\n','tmrgo','{\"name\":\"getDownloadplandtl1List\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"flpid\":\"3025176271438480384\",\"date\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"fname\":\"饲料名称3\",\"sort\":1,\"weight\":\"0.26\"},{\"fname\":\"饲料名称2\",\"sort\":6,\"weight\":\"0.26\"},{\"fname\":\"饲料名称1\",\"sort\":7,\"weight\":\"0.26\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  365. (1567,338,'SELECT \nsort,fname,lweight weight,\nif(useinbartype=0,\'转投剩料\',\nif(useinbartype=1,\'撒\',\'继续饲喂\')\n) useinbar\nFROM \n downloadplandtl2\nWHERE pastureid = ? \n AND pid=? \nand (if(?=0,useinbartype in(0,2),useinbartype = 1 ) or ?=\'\')\nORDER BY downloadplandtl2.sort ','pastureid,id,useinbartype,useinbartype ','getDownloadplandt2ListV2','GetDataByName','计划内容栏舍详情列表','tmrgo','{\"name\":\"getDownloadplandt2ListV2\",\"page\":1,\"offset\":1,\"returntype\":\"Map\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2021-03-12\",\"id\":\"579801\",\"useinbartype\":\"\"}}','{\"code\":0,\"list\":[{\"fname\":\"饲料名称3\",\"sort\":1,\"weight\":\"0.26\"},{\"fname\":\"饲料名称2\",\"sort\":6,\"weight\":\"0.26\"},{\"fname\":\"饲料名称1\",\"sort\":7,\"weight\":\"0.26\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  366. (1568,325,'SELECT DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, SUM(d.`lweight`) 理论量,SUM(d.`iweight`) 实际量,round(IF(SUM(d.`lweight`)>0,\nSUM(d.`iweight`)/SUM(d.`lweight`)*100,0),2) field1 , -- 准确率\nCOUNT(de.id) 添加饲料次数,SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio`,1,0)) 计划正确数,\nround(IF(COUNT(de.id)>0,SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio`,1,0))/COUNT(de.id),0)*100,2) 手动field2-- 正确率\nFROM `downloadedplan` d JOIN `downloadplandtl1_exec` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype<3\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.`Mydate`','pastureid,startTime,stopTime','getAccuracyAllJHV2','GetDataByName','汇总 -按计划统计 ','tmrgo','{\"name\":\"getAccuracyAllFT\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  367. (1569,326,'\nSELECT \n配方模板,实际牛头数,应混料量,实际混料量,撒料量,ifnull(混料时间,0)混料时间,转投剩料量,今日剩料量,配方单价,\nROUND(理论干物质,2) 理论干物质,\nifnull(ROUND(TMR干物质*100,2),0) TMR干物质,\nROUND(IFNULL(今日剩料量/撒料量*100,0),2)剩料率,\nROUND(应混料量*理论干物质/实际牛头数,2) 配方干物质采食量,\nifnull(ROUND((撒料量 - 今日剩料量)*TMR干物质/实际牛头数,2),0) 实际干物质采食量,\nIFNULL(ROUND(((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)/(应混料量*理论干物质/实际牛头数)*100,2) ,0) 采食率,\nIFNULL(ROUND(配方单价*应混料量/实际牛头数,2),0) 配方成本,\nIFNULL(ROUND(配方单价*实际混料量/实际牛头数,2),0) 实际成本,\nCONCAT(ROUND(IFNULL(产奶量/实际牛头数,0),2)) 产奶量,\nIFNULL(ROUND(IFNULL(产奶量/实际牛头数,0)/((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)*100,2),0) 饲料转化率,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) 公斤奶饲料成本\n FROM (\nSELECT \nd.`templetname` 配方模板,\n(SELECT SUM(ccount) FROM feedpdate fpt WHERE fpt.pastureid = d.pastureid AND fpt.date = d.mydate AND fpt.`ftid` = d.`tempid`)实际牛头数,\n(SELECT SUM(d1e.lweight) FROM `downloadplandtl1` d1e \n JOIN `downloadedplan` dv ON dv.pastureid= d1e.pastureid AND dv.id = d1e.pid\nWHERE d1e.pastureid = d.`pastureid` AND dv.mydate = d.`mydate` AND d1e.type = 0 AND dv.tempid= d.tempid)应混料量,\n(SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1` d1e \n JOIN `downloadedplan` dv ON dv.pastureid= d1e.pastureid AND dv.id = d1e.pid\nWHERE d1e.pastureid = d.`pastureid` AND dv.mydate = d.`mydate` AND d1e.type = 0 AND dv.tempid= d.tempid)实际混料量,\n\n@tid := d.tempid tempid,\n@da := d.mydate,\n\n\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d1.`tempid` FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` = @da and d1.pastureid = ? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\ngroup by d1.`tempid`) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nwhere ww.`tempid` = d.tempid\n) 产奶量,\n\n\n\nSUM(d2.`actualweightminus`) 撒料量,\nDATE_FORMAT(TIMEDIFF(FROM_UNIXTIME(SUM(UNIX_TIMESTAMP(d2.intime)-\nUNIX_TIMESTAMP(IFNULL((SELECT MAX(intime) FROM `downloadplandtl2` d2v\nWHERE d.`mydate`=d2v.`date` AND d.pastureid = d2v.pastureid AND d2v.pid=d.id AND d2v.sort<d2.sort),\n(SELECT MAX(intime) FROM `downloadplandtl1_exec` d1v\nWHERE d.`mydate`=d1v.`date` AND d.pastureid = d1v.pastureid AND d1v.pid=d.id )\n))\n)+1),\'1970-01-01 08:00:01\'),\'%H:%i:%s\') 混料时间,\n\n0 转投剩料量,\nSUM(IFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0)) 今日剩料量,\nSUM(IFNULL((SELECT AVG(actweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)*d2.`actualweightminus`)/SUM(d2.actualweightminus) TMR干物质,\nSUM(IFNULL((SELECT AVG(thoweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)*d2.`lweight`)/SUM(d2.`lweight`) 理论干物质,\n\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = fp.pastureid AND ftd.`date` = fp.date AND ftd.`ftid` = fp.`ftid` AND ftd.`version` = d.tversion\n\n) 配方单价 \n FROM \n\n `downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.`pastureid` = d.`pastureid` AND d2.`pid` = d.`id` \n\nJOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND d2.`fbarid` = fp.`barid`\n\n\nWHERE d.pastureid = ? AND d.`mydate` =? AND d.lpplantype IN (0,1,2,5) and d2.type = 0 \nGROUP BY d.`tempid`) tem\nwhere (tem.配方模板=? or ?=\'\') \n','pastureid,pastureid,date,ftname,ftname','getFeedEfficiencyFT','GetDataByName','饲喂效率-配方','tmrgo','{\"name\":\"getFeedEfficiencyFT\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  368. (1570,326,'\nSELECT \n配方模板,栏舍,实际牛头数,应混料量,实际混料量,撒料量,ifnull(混料时间,0)混料时间,转投剩料量,今日剩料量,\nROUND(理论干物质,2) 理论干物质,\nifnull(ROUND(TMR干物质*100,2),0) TMR干物质,\nROUND(IFNULL(今日剩料量/撒料量*100,0),2)剩料率,\nROUND(应混料量*理论干物质/实际牛头数,2) 配方干物质采食量,\nifnull(ROUND((撒料量 - 今日剩料量)*TMR干物质/实际牛头数,2),0) 实际干物质采食量,\nIFNULL(ROUND(((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)/(应混料量*理论干物质/实际牛头数)*100,2) ,0) 采食率,\nIFNULL(ROUND(配方单价*应混料量/实际牛头数,2) ,0) 配方成本,\nIFNULL(ROUND(配方单价*实际混料量/实际牛头数,2) ,0) 实际成本,\nCONCAT(ROUND(IFNULL(产奶量/实际牛头数,0),2)) 产奶量,\nIFNULL(ROUND(IFNULL(产奶量/实际牛头数,0)/((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)*100,2),0) 饲料转化率,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) 公斤奶饲料成本\n FROM (\nSELECT \nd.`templetname` 配方模板,\nd.`id`,\nd.`projname`,\nfp.`barname` 栏舍,\nfp.ccount 实际牛头数,\nSUM(d2.`lweight`) 应混料量,\nround(SUM((SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1_exec` d1e \nWHERE d1e.pastureid = d.`pastureid` AND d1e.date = d2.`date` AND d1e.flpid = d2.`flpid` AND d1e.type =0 )*d2.lweight/d.lweight),2)实际混料量,\nbm.product*bm.cowsum 产奶量,\nSUM(d2.`actualweightminus`) 撒料量,\nDATE_FORMAT(TIMEDIFF(FROM_UNIXTIME(SUM(UNIX_TIMESTAMP(d2.intime)-\nUNIX_TIMESTAMP(IFNULL((SELECT MAX(intime) FROM `downloadplandtl2` d2v\nWHERE d.`mydate`=d2v.`date` AND d.pastureid = d2v.pastureid AND d2v.pid=d.id AND d2v.sort<d2.sort),\n(SELECT MAX(intime) FROM `downloadplandtl1_exec` d1v\nWHERE d.`mydate`=d1v.`date` AND d.pastureid = d1v.pastureid AND d1v.pid=d.id )\n))\n)+1),\'1970-01-01 08:00:01\'),\'%H:%i:%s\') 混料时间,\n0 转投剩料量,\nIFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0) 今日剩料量,\nAVG(IFNULL((SELECT AVG(actweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)) TMR干物质,\nAVG(IFNULL((SELECT AVG(thoweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)) 理论干物质,\n\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = fp.pastureid AND ftd.`date` = fp.date AND ftd.`ftid` = fp.`ftid` AND ftd.`version` = d.tversion\n\n) 配方单价\n FROM \n\n `downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.`pastureid` = d.`pastureid` AND d2.`pid` = d.`id`\n\nJOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND d2.`fbarid` = fp.`barid`\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =fp.`pastureid` AND bm.`barid` = fp.`barid` AND bm.`productdate` = \n(SELECT MAX(`productdate`) FROM barmilk WHERE barmilk.productdate <=fp.`date` AND barmilk.`pastureid` = fp.`pastureid` and barmilk.barid = fp.`barid`)\n\n\n\nWHERE d.pastureid = ? AND d.`mydate` =? AND d.lpplantype IN (0,1,2,5) AND d2.`type` = 0\nGROUP BY d2.`fbarid`) tem\nwhere (配方模板=? or ? =\'\') \nand (栏舍=? or ? =\'\') \n','pastureid,date,ftname,ftname,barname,barname','getFeedEfficiencyLS','GetDataByName','饲喂效率-栏舍','tmrgo','{\"name\":\"getFeedEfficiencyLS\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"Error 1054: Unknown column \'?\' in \'where clause\'\"',0,1,0,0,0),
  369. (1571,326,'SELECT \nbarname,\n牲畜类别,IFNULL(实际牛头数,0) 实际牛头数,应混料量,实际混料量,撒料量,IFNULL(混料时间,0)混料时间,转投剩料量,今日剩料量,\nROUND(理论干物质,2) 理论干物质,\nIFNULL(ROUND(TMR干物质*100,2),0) TMR干物质,\nROUND(IFNULL(今日剩料量/撒料量*100,0),2)剩料率,\nIFNULL(ROUND(应混料量*理论干物质/实际牛头数,2),0) 配方干物质采食量,\nIFNULL(ROUND((撒料量 - 今日剩料量)*TMR干物质/实际牛头数,2),0) 实际干物质采食量,\nIFNULL(ROUND(((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)/(应混料量*理论干物质/实际牛头数)*100,2) ,0) 采食率,\nIFNULL(ROUND(配方单价*应混料量/实际牛头数,2),0) 配方成本,\nIFNULL(ROUND(配方单价*实际混料量/实际牛头数,2),0) 实际成本,\nCONCAT(ROUND(IFNULL(产奶量/实际牛头数,0),2)) 产奶量,\nIFNULL(ROUND(IFNULL(产奶量/实际牛头数,0)/((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)*100,2),0) 饲料转化率,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) 公斤奶饲料成本\n FROM (\nSELECT \n@tcowclass := IFNULL((SELECT `cowclass` FROM `barmilk` WHERE pastureid = d2.pastureid AND `barid` = d2.fbarid AND `productdate` <= d2.date ORDER BY productdate DESC LIMIT 1) ,\'无类别\')牲畜类别,\n(SELECT SUM(bm1.cowsum) FROM feedpdate fpt \nJOIN barmilk bm1\nON bm1.`pastureid` =fpt.`pastureid` AND bm1.`barid` = fpt.`barid` AND bm1.`productdate` = \n(SELECT MAX(barmilk.`productdate`) FROM barmilk WHERE barmilk.productdate <=fpt.`date` AND barmilk.`pastureid` = fpt.`pastureid` AND barmilk.`barid` = fpt.`barid`)\nWHERE fpt.pastureid = d.pastureid AND fpt.date = d2.date AND bm1.cowclass= @tcowclass)实际牛头数,\n\nSUM(d2.`lweight`) 应混料量,\n\nROUND(SUM((SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1` d1e \nWHERE d1e.pastureid = d.`pastureid` AND d1e.date = d2.`date` AND d1e.flpid = d2.`flpid` AND d1e.type =0 )*d2.lweight/d.lweight),2)实际混料量,\n\n@tid := IFNULL(d2.cowclassid,-1) cowclassid,\n@da := d.mydate,\n\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d21.`fname`,IFNULL(d21.`cowclassid`,-1)cowclassid FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` = @da AND d1.pastureid =? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\nGROUP BY d21.`cowclassid`) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nWHERE ww.cowclassid = @tid\n) 产奶量,\n\nSUM(d2.`actualweightminus`) 撒料量,\nDATE_FORMAT(TIMEDIFF(FROM_UNIXTIME(SUM(UNIX_TIMESTAMP(d2.intime)-\nUNIX_TIMESTAMP(IFNULL((SELECT MAX(intime) FROM `downloadplandtl2` d2v\nWHERE d.`mydate`=d2v.`date` AND d.pastureid = d2v.pastureid AND d2v.pid=d.id AND d2v.sort<d2.sort),\n(SELECT MAX(intime) FROM `downloadplandtl1_exec` d1v\nWHERE d.`mydate`=d1v.`date` AND d.pastureid = d1v.pastureid AND d1v.pid=d.id )\n))\n)+1),\'1970-01-01 08:00:01\'),\'%H:%i:%s\') 混料时间,\n0 转投剩料量,\nSUM(IFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0)) 今日剩料量,\nSUM(IFNULL((SELECT AVG(actweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)*d2.`actualweightminus`)/SUM(d2.actualweightminus) TMR干物质,\nSUM(IFNULL((SELECT AVG(thoweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)*d2.`lweight`)/SUM(d2.`lweight`) 理论干物质,\nGROUP_CONCAT( fp.barname)barname,\n\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = fp.pastureid AND ftd.`date` = fp.date AND ftd.`ftid` = fp.`ftid` AND ftd.`version` = d.tversion\n\n) 配方单价\n \n FROM \n\n `downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.`pastureid` = d.`pastureid` AND d2.`pid` = d.`id`\n\nJOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND d2.`fbarid` = fp.`barid`\n\n\nWHERE d.pastureid = ? AND d.`mydate`=? AND d.lpplantype IN (0,1,2,5) AND d2.type = 0 \nGROUP BY (SELECT `cowclass` FROM `barmilk` WHERE pastureid = d2.pastureid AND `barid` = d2.fbarid AND `productdate` <= d2.date ORDER BY productdate DESC LIMIT 1)) tem\nWHERE (牲畜类别=? OR ? =\'\') \n\n','pastureid,pastureid,date,cowclass,cowclass','getFeedEfficiencySC','GetDataByName','饲喂效率-牲畜','tmrgo','{\"name\":\"getAssessDungscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"avgdim\":10,\"barname\":\"西区#3/干奶前期 停奶-产前\",\"product\":\"20.00\",\"score1\":\"24.58%\",\"score2\":\"23.39%\",\"score3\":\"15.51%\",\"score4\":\"25.54%\",\"score5\":\"10.98%\",\"standardscore\":\"3\",\"sumcowcount\":\"419\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  370. (1572,326,'SELECT ROUND(IFNULL(SUM(d2.`actualweightminus`\n* (SELECT AVG(actweight) FROM ftdry fd WHERE fd.`pastureid` = d2.pastureid AND fd.`barid` = d2.`fbarid`\nAND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = d2.pastureid\nAND fd1.`barid` = d2.`fbarid` AND fd1.`operatetime` <=d2.date ))\n),0),2) field1,\n@da := d.mydate mydate,\nROUND(IFNULL(\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d21.`fname`,IFNULL(d21.`cowclassid`,-1)cowclassid FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` between ? and ? AND d1.pastureid =? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\n) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nWHERE ww.date = d.mydate and bm.`bigcowclass` = \'泌乳牛\'\n) \n,0),2) field2, -- 产奶量\nDATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 日期\nFROM \n `downloadedplan` d\nLEFT JOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =d.`pastureid` AND bm.`barid` = d2.`fbarid` AND bm.`productdate` =(SELECT MAX(`productdate`) FROM barmilk WHERE barmilk.productdate <=d.`mydate` AND barmilk.`pastureid` = d.`pastureid` AND barmilk.barid = d2.`fbarid`) \n\nWHERE d.pastureid = ? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.type = 0 \nAND bm.`bigcowclass` = \'泌乳牛\'\nGROUP BY d.`mydate`\nORDER BY d.`mydate`','startTime,stopTime,pastureid,pastureid,startTime,stopTime','getFeedEffMR','GetDataByName','饲喂效率图表-泌乳牛采食量','tmrgo','{\"name\":\"getFeedEffMR\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"Error 1054: Unknown column \'fp.date\' in \'field list\'\"',0,1,0,0,0),
  371. (1573,326,'\nSELECT \nfp.`barname` 名称,\nIFNULL(SUM(d2.`actualweightminus`),0) 撒料量,\nIFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0) 剩料量,\nifnull(ROUND(IFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0)/SUM(d2.`actualweightminus`),2) ,0)准确率, -- 剩料率\nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期\n\nFROM \n`downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND fp.`barid` = d2.`fbarid`\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =fp.`pastureid` AND bm.`barid` = fp.`barid` AND bm.`productdate` =(SELECT MAX(`productdate`) FROM barmilk WHERE barmilk.productdate <=fp.`date` AND barmilk.`pastureid` = fp.`pastureid` )\n\nWHERE fp.pastureid = ? AND fp.`date` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.`type` = 0\nGROUP BY fp.`barname` ,fp.`date`\nORDER BY fp.`barname` ,fp.`date`','pastureid,startTime,stopTime','getFeedEffSL','GetReportform','饲喂效率图表-剩料量','tmrgo','{\"name\":\"getFeedEffMR\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"data\":[{\"field1\":\"352719\",\"field2\":\"0.00\",\"日期\":\"2020-09-15\"}],\"list\":{\"data1\":[\"2020-09-15\"],\"data2\":[\"352719\"],\"data3\":[\"0.00\"],\"data4\":[null],\"data5\":[null]},\"message\":\"ok\"}',0,1,0,0,0),
  372. (1574,326,'SELECT \nDATE_FORMAT(d.`mydate` , \'%Y-%m-%d\') 日期,\nifnull(ROUND(SUM(UNIX_TIMESTAMP((SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d.`mydate`=d2.`date` AND d.pastureid = d2.pastureid AND d2.pid=d.id))-UNIX_TIMESTAMP(d.intime))/60,2),0) field1 -- 混料时间\n \n FROM \n`downloadedplan` d\nWHERE d.pastureid = ? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1) \n GROUP BY d.`mydate`\nORDER BY d.`mydate`','pastureid,startTime,stopTime ','getFeedEffHL','GetReportform','饲喂效率图表-混料时间','tmrgo','{\"name\":\"getFeedEffHL\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','{\"code\":0,\"data\":null,\"list\":{\"data1\":[],\"data2\":[],\"data3\":[],\"data4\":[],\"data5\":[]},\"message\":\"ok\"}',0,1,0,0,0),
  373. (1575,326,'\nSELECT \n日期,\n配方模板 名称,\nIFNULL(ROUND(IFNULL(产奶量/实际牛头数,0)/((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)*100,2),0) 准确率 -- 饲料转化率\n FROM (\nSELECT \nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期,\nd.templetname 配方模板,\n(SELECT SUM(ccount) FROM feedpdate fpt WHERE fpt.pastureid = d.pastureid AND fpt.date = d.mydate AND fpt.`ftid` = d.`tempid`)实际牛头数,\n\n@tid := d.tempid tempid,\n@da := d.mydate,\n\n\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d1.`tempid` FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` BETWEEN ? AND ? AND d1.pastureid = ? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\nGROUP BY d1.`tempid`,d1.mydate) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nWHERE ww.`tempid` = @tid AND ww.date = @da\n) 产奶量,\n\n\nSUM(d2.`actualweightminus`) 撒料量,\nSUM(IFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0)) 今日剩料量,\nSUM(IFNULL((SELECT AVG(actweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)*d2.`actualweightminus`)/SUM(d2.actualweightminus) TMR干物质\n\n FROM \n`downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND fp.`barid` = d2.`fbarid`\n\n\nWHERE d.pastureid = ? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.`type` = 0\nGROUP BY d.`tempid`,d.`mydate` ) tem\nORDER BY 名称,日期','startTime,stopTime,pastureid,pastureid,startTime,stopTime ','getFeedEffZH','GetDataByName','饲喂效率图表-转化率-配方','tmrgo','{\"name\":\"getFeedEffZH\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'FROM \\n`downloadedplan` d\\nJOIN `downloadplandtl2` d2\\nON d2.pastureid = d.pasturei\' at line 13\"',0,1,0,0,0),
  374. (1576,326,'\nSELECT \n日期,\n牲畜类别 名称,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) 准确率 -- 公斤奶饲料成本\n FROM (\nSELECT \nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期,\nIFNULL( (SELECT `cowclass` FROM `barmilk` WHERE pastureid = d2.pastureid AND `barid` = d2.fbarid AND `productdate` <= d2.date ORDER BY productdate DESC LIMIT 1) ,\'无类别\')牲畜类别,\n\nround(SUM((SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1_exec` d1e \nWHERE d1e.pastureid = d.`pastureid` AND d1e.date = d2.`date` AND d1e.flpid = d2.`flpid` AND d1e.type =0 )*d2.lweight/d.lweight),2)实际混料量,\n\n@tid := IFNULL( (SELECT `cowclassid` FROM `barmilk` WHERE pastureid = d2.pastureid AND `barid` = d2.fbarid AND `productdate` <= d2.date ORDER BY productdate DESC LIMIT 1),-1) cowclassid,\n@da := d.mydate,\n\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d21.`fname`,IFNULL(d21.`cowclassid`,-1)cowclassid FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` between ? and ? AND d1.pastureid =? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\nGROUP BY d21.`cowclassid`,d21.date) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nWHERE ww.cowclassid = @tid and ww.date = @da\n) 产奶量,\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = fp.pastureid AND ftd.`date` = fp.date AND ftd.`ftid` = fp.`ftid` AND ftd.`version` = d.tversion\n\n) 配方单价 \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND fp.`barid` = d2.`fbarid`\n\n\n\nWHERE fp.pastureid = ? AND fp.`date` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.`type` = 0\nGROUP BY (SELECT `cowclass` FROM `barmilk` WHERE pastureid = d2.pastureid AND `barid` = d2.fbarid AND `productdate` <= d2.date ORDER BY productdate DESC LIMIT 1),fp.`date`) tem\nORDER BY 名称,日期\n\n','startTime,stopTime,pastureid,pastureid,startTime,stopTime ','getFeedEffCB','GetReportform','饲喂效率图表-成本-牲畜类别','tmrgo','{\"name\":\"getFeedEffCB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','{\"code\":0,\"data\":[{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-01\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-02\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-03\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-04\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-05\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-06\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-07\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-08\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-09\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-10\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-11\"}],\"list\":{\"data1\":[\"无类别\"],\"data2\":[\"2020-11-01\",\"2020-11-02\",\"2020-11-03\",\"2020-11-04\",\"2020-11-05\",\"2020-11-06\",\"2020-11-07\",\"2020-11-08\",\"2020-11-09\",\"2020-11-10\",\"2020-11-11\"],\"data3\":[{\"data\":[\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\"]}]},\"message\":\"ok\"}',0,1,0,0,0),
  375. (1577,390,'SELECT \nifnull((SELECT CONCAT(ROUND(SUM(iweight)/SUM(lweight)*100,2),\'%\') yesRateHL\n FROM `downloadedplan` dt WHERE dt.`pastureid` = d.pastureid \n AND dt.`mydate`=DATE_FORMAT(DATE_SUB(d.`mydate`,INTERVAL 1 DAY),\'%Y-%m-%d\')),\'0.00%\')yesRateHL, -- 昨日混料准确率\n \n(SELECT CONCAT(ROUND(SUM(iweight)/SUM(lweight)*100,2),\'%\') yesRateHL\n FROM `downloadedplan` dt WHERE dt.`pastureid` = d.pastureid \n AND dt.`mydate` BETWEEN DATE_FORMAT(DATE_SUB(d.`mydate`,INTERVAL 31 DAY),\'%Y-%m-%d\') AND DATE_FORMAT(DATE_SUB(d.`mydate`,INTERVAL 1 DAY),\'%Y-%m-%d\'))monRateHL , -- 近30日混料准确率\n \nifnull((SELECT CONCAT(ROUND(SUM(oweight)/SUM(lweight)*100,2),\'%\') yesRateSL\n FROM `downloadedplan` dt WHERE dt.`pastureid` = d.pastureid \n AND dt.`mydate`=DATE_FORMAT(DATE_SUB(d.`mydate`,INTERVAL 1 DAY),\'%Y-%m-%d\')),\'0.00%\')yesRateSL, -- 昨日撒料准确率\n \n(SELECT CONCAT(ROUND(SUM(oweight)/SUM(lweight)*100,2),\'%\') yesRateSL\n FROM `downloadedplan` dt WHERE dt.`pastureid` = d.pastureid \n AND dt.`mydate` BETWEEN DATE_FORMAT(DATE_SUB(d.`mydate`,INTERVAL 31 DAY),\'%Y-%m-%d\') AND DATE_FORMAT(DATE_SUB(d.`mydate`,INTERVAL 1 DAY),\'%Y-%m-%d\'))monRateSL, -- 进30日撒料准确率\n\nifnull((SELECT CONCAT(ROUND(IF(COUNT(de.id)>0,SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio`,1,0))/COUNT(de.id),0)*100,2),\'%\') -- 正确率\nFROM `downloadedplan` dt JOIN `downloadplandtl2` de ON dt.`id`=de.`pid` AND dt.pastureid = de.pastureid\nWHERE dt.`pastureid` = d.pastureid AND dt.`mydate`=DATE_FORMAT(DATE_SUB(d.`mydate`,INTERVAL 1 DAY),\'%Y-%m-%d\')),\'0.00%\') yesRateSLR, -- 昨日正确率\n\n(SELECT CONCAT(ROUND(IF(COUNT(de.id)>0,SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio`,1,0))/COUNT(de.id),0)*100,2),\'%\') -- 正确率\nFROM `downloadedplan` dt JOIN `downloadplandtl2` de ON dt.`id`=de.`pid` AND dt.pastureid = de.pastureid\nWHERE dt.`pastureid` = d.pastureid \nAND dt.`mydate` BETWEEN DATE_FORMAT(DATE_SUB(d.`mydate`,INTERVAL 31 DAY),\'%Y-%m-%d\') AND DATE_FORMAT(DATE_SUB(d.`mydate`,INTERVAL 1 DAY),\'%Y-%m-%d\')) monRateSLR, -- 近30日正确率\n\n\n\n(SELECT COUNT(*)FROM downloadedplan dt WHERE dt.pastureid= d.pastureid AND dt.mydate = d.mydate and dt.iscompleted=1) doneTimes,\n(SELECT COUNT(*)FROM downloadedplan dt WHERE dt.pastureid= d.pastureid AND dt.mydate = d.mydate ) planTimes,\nifnull((SELECT SUM(dc.actualweightminus) FROM downloadplandtl1_exec dc WHERE dc.pastureid = ? AND dc.date = d.mydate),0) doneWeight,\nifnull((SELECT SUM(dc.lweight ) FROM downloadplandtl1_exec dc WHERE dc.pastureid = ? AND dc.date = d.mydate),0) planWeight,\nifnull(round(getSLtimeDiffSINGEL(d.pastureid,d.mydate),2),0.00) temtime,\nifnull(round(getSLtimeDiffMonth(d.pastureid) ,2),0.00)montime\n FROM \n(SELECT (SELECT ?) as pastureid,date_format(now(),\'%Y-%m-%d\') mydate) d\n\n# where d.`pastureid` = 3025176271438480386 and d.`mydate`=\'2020-11-20\' # date_format(now(),\'%Y-%m-%d\')\n\n\n','pastureid,pastureid,pastureid','getHomepageStr','GetDataByName','首页监控数据-牧场','tmrgo','{\"name\":\"getHomepageStr\",\"parammaps\":{\"pastureid\":\"3025176271438480387\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','{\"code\":0,\"list\":[{\"pastureid\":\"3025176271438480387\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  376. (1578,324,'SELECT \ntem.eqcode tname,tem.remark,tem.fname,tem.inorout,IFNULL(tem.lweight,0) lweight,tem.lastactualweight,TRIM(tem.`projid`) pid,tem.datacaptureno,tem.id,\nIFNULL(tem.doneweight,0) doneweight,\ntem.nowweight,\nround(IFNULL(tem.lweight- tem.doneweight,0),2) leftweight,\nCONCAT(ROUND(tem.doneweight/tem.lweight*100,2),\'%\') donerate\nFROM \n\n(\nSELECT tmr.`eqcode`,tmr.`tname`,d.`remark`,tmr.`projid`,tmr.`datacaptureno`,TRIM(tmr.id) id,\ntmr.`inorout`,\nIF(tmr.`nextsort`=-1,\'无\',IF(tmr.`inorout`=0,de.`fname`,d2.`fname`)) fname,\nIF(tmr.`inorout`=0,\n(SELECT SUM(lweight) FROM downloadplandtl1_exec d1e WHERE d1e.`pastureid` = tmr.`pastureid` AND d1e.`pid` = d.`id` AND d1e.sort = tmr.`nextsort` )\n, (SELECT SUM(lweight) FROM downloadplandtl2 d2e WHERE d2e.`pastureid` = tmr.`pastureid` AND d2e.`pid` = d.`id` AND d2e.sort = tmr.`nextsort` )) lweight,\nIF(tmr.`inorout`=0,de.lastactualweight,d2.lastactualweight) lastactualweight,\ntmr.`lastweight`,\nABS((SELECT weight FROM `recweight` r WHERE r.pastureid= tmr.`pastureid` AND r.srcaddr = tmr.`datacaptureno` ORDER BY mtime DESC LIMIT 1)-tmr.`lastweight`) doneweight,\n(SELECT weight FROM `recweight` r WHERE r.pastureid= tmr.`pastureid` AND r.srcaddr = tmr.`datacaptureno` ORDER BY mtime DESC LIMIT 1) nowweight\nFROM tmr\nINNER JOIN downloadedplan d\nON d.`pastureid` = tmr.`pastureid` AND d.`id` = tmr.`projid`\nLEFT JOIN `downloadplandtl1_exec` de\nON de.`pastureid` = tmr.`pastureid` AND de.`pid` = d.`id` AND tmr.`inorout` = 0 \nLEFT JOIN `downloadplandtl2` d2\nON d2.`pastureid` = tmr.`pastureid` AND d2.`pid` = d.`id` AND tmr.`inorout` = 1 AND (tmr.nextsort = d2.sort OR tmr.nextsort=-1 )\n\nWHERE tmr.`pastureid` =? AND d.`havebutton` = 1 AND d.`iscompleted` = 0 \nAND (( \nIF(tmr.nextsort=-1,de.sort = (SELECT MAX(sort) FROM downloadplandtl1_exec d1e WHERE d1e.`pastureid` = tmr.`pastureid` AND d1e.`pid` = d.`id` ),tmr.nextsort = de.sort)\n )\nOR (\nIF(tmr.nextsort=-1,d2.sort = (SELECT MAX(sort) FROM downloadplandtl2 d2e WHERE d2e.`pastureid` = tmr.`pastureid` AND d2e.`pid` = d.`id` ),tmr.nextsort = d2.sort)\n ))\n)tem','pastureid','getHomepageLBList','GetDataByName','过程分析轮播','tmrgo','{\"name\":\"getHomepageLBList\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  377. (1579,326,'\nSELECT \n日期,\n栏舍 名称,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) 准确率 -- 公斤奶饲料成本\n FROM (\nSELECT \nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期,\nfp.barname 栏舍 ,\n\nround(SUM((SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1_exec` d1e \nWHERE d1e.pastureid = d.`pastureid` AND d1e.date = d2.`date` AND d1e.flpid = d2.`flpid` AND d1e.type =0 )*d2.lweight/d.lweight),2)实际混料量,\n\nbm.product*bm.cowsum 产奶量,\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = fp.pastureid AND ftd.`date` = fp.date AND ftd.`ftid` = fp.`ftid` AND ftd.`version` = d.tversion\n\n) 配方单价 \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND fp.`barid` = d2.`fbarid`\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =fp.`pastureid` AND bm.`barid` = fp.`barid` AND bm.`productdate` = (SELECT MAX(`productdate`) FROM barmilk WHERE barmilk.productdate <=fp.`date` AND barmilk.`pastureid` = fp.`pastureid` AND barmilk.barid = fp.`barid`)\n\n\n\n\nWHERE fp.pastureid = ? AND fp.`date` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.`type` = 0\nGROUP BY d2.`fbarid`,d2.`date`) tem\nORDER BY 名称,日期','pastureid,startTime,stopTime ','getFeedEffCBLS','GetReportform','饲喂效率图表-成本-栏舍','tmrgo','{\"name\":\"getFeedEffCB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','{\"code\":0,\"data\":[{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-01\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-02\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-03\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-04\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-05\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-06\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-07\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-08\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-09\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-10\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-11\"}],\"list\":{\"data1\":[\"无类别\"],\"data2\":[\"2020-11-01\",\"2020-11-02\",\"2020-11-03\",\"2020-11-04\",\"2020-11-05\",\"2020-11-06\",\"2020-11-07\",\"2020-11-08\",\"2020-11-09\",\"2020-11-10\",\"2020-11-11\"],\"data3\":[{\"data\":[\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\"]}]},\"message\":\"ok\"}',0,1,0,0,0),
  378. (1580,326,'\nSELECT \n日期,\n配方 名称,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) 准确率 -- 公斤奶饲料成本\n FROM (\nSELECT \nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期,\nfp.ftname 配方,\n\n(SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1_exec` d1e \n JOIN `downloadedplan` dv ON dv.pastureid= d1e.pastureid AND dv.id = d1e.pid\nWHERE d1e.pastureid = d.`pastureid` AND dv.mydate = d.`mydate` AND d1e.type = 0 AND dv.tempid= d.tempid)实际混料量,\n\n@tid := d.tempid tempid,\n@da := d.mydate,\n\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d1.`tempid` FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` BETWEEN ? AND ? AND d1.pastureid = ? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\nGROUP BY d1.`tempid`,d1.mydate) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nWHERE ww.`tempid` = @tid AND ww.date = @da\n) 产奶量,\n\n\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = fp.pastureid AND ftd.`date` = fp.date AND ftd.`ftid` = fp.`ftid` AND ftd.`version` = d.tversion\n\n) 配方单价 \n \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND fp.`barid` = d2.`fbarid`\n\n\n\nWHERE fp.pastureid = ? AND fp.`date` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.`type` = 0\nGROUP BY d.`tempid`,fp.`date`) tem\nORDER BY 名称,日期','startTime,stopTime,pastureid,pastureid,startTime,stopTime ','getFeedEffCBFT','GetReportform','饲喂效率图表-成本-配方','tmrgo','{\"name\":\"getFeedEffCB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','{\"code\":0,\"data\":[{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-01\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-02\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-03\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-04\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-05\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-06\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-07\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-08\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-09\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-10\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-11\"}],\"list\":{\"data1\":[\"无类别\"],\"data2\":[\"2020-11-01\",\"2020-11-02\",\"2020-11-03\",\"2020-11-04\",\"2020-11-05\",\"2020-11-06\",\"2020-11-07\",\"2020-11-08\",\"2020-11-09\",\"2020-11-10\",\"2020-11-11\"],\"data3\":[{\"data\":[\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\"]}]},\"message\":\"ok\"}',0,1,0,0,0),
  379. (1581,390,'Select\n日期,\nIFNULL(ROUND(配方单价*实际混料量/实际牛头数,2),0)field2, -- 实际成本,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) field1 -- 公斤奶饲料成本\n from (SELECT\n@da := d.mydate mydate,\nROUND(IFNULL(\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d21.`fname`,IFNULL(d21.`cowclassid`,-1)cowclassid FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` between ? and ? AND d1.pastureid =? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\n) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nWHERE ww.date = d.mydate and bm.`bigcowclass` = \'泌乳牛\'\n) \n,0),2) 产奶量, -- 产奶量\n(SELECT SUM(ccount) FROM feedpdate fpt WHERE fpt.pastureid = d.pastureid AND fpt.date = d.mydate )实际牛头数,\n(SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1_exec` d1e \n JOIN `downloadedplan` dv ON dv.pastureid= d1e.pastureid AND dv.id = d1e.pid\nWHERE d1e.pastureid = d.`pastureid` AND dv.mydate = d.`mydate` AND d1e.type = 0 )实际混料量,\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = d.pastureid AND ftd.`date` = d.mydate AND ftd.`ftid` = d.`tempid` AND ftd.`version` = d.tversion\n\n) 配方单价 ,\n\nDATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 日期\nFROM \n `downloadedplan` d\nLEFT JOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =d.`pastureid` AND bm.`barid` = d2.`fbarid` AND bm.`productdate` =(SELECT MAX(`productdate`) FROM barmilk WHERE barmilk.productdate <=d.`mydate` AND barmilk.`pastureid` = d.`pastureid` AND barmilk.barid = d2.`fbarid`) \n\nWHERE d.pastureid = ? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.type = 0 \nAND bm.`bigcowclass` = \'泌乳牛\'\nGROUP BY d.`mydate`\nORDER BY d.`mydate`) ww','startTime,stopTime,pastureid,pastureid,startTime,stopTime','getHomepageCB','GetReportform','首页-成本图表','tmrgo','{\"name\":\"getFeedEffCB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','{\"code\":0,\"data\":[{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-01\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-02\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-03\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-04\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-05\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-06\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-07\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-08\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-09\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-10\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-11\"}],\"list\":{\"data1\":[\"无类别\"],\"data2\":[\"2020-11-01\",\"2020-11-02\",\"2020-11-03\",\"2020-11-04\",\"2020-11-05\",\"2020-11-06\",\"2020-11-07\",\"2020-11-08\",\"2020-11-09\",\"2020-11-10\",\"2020-11-11\"],\"data3\":[{\"data\":[\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\"]}]},\"message\":\"ok\"}',0,1,0,0,0),
  380. (1582,390,'SELECT tem.fname,tem.id,tem.pastureid,tem.optdevice,tem.proesstime,DATE_FORMAT(startstime, \'%H:%i:%s\') startstime,\nDATE_FORMAT(intime, \'%H:%i:%s\') intime,tem.sort,tem.actualweightminus,\nDATE_FORMAT(r.`mtime`, \'%H:%i:%s\') mtime,r.`weight`, tem.`lastactualweight`,tem.lweight,\ntem.`actualweight`,\nDATE_FORMAT(r.`mtime`, \'%Y-%m-%d\') `date`\nFROM \n(\nSELECT\nd1.fname,\nTRIM(d1.`id`) id,\nd1.`pastureid`,\nd1.`optdevice`,\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid))\n) proesstime, \nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)\n, (SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid)\n),\'%Y-%m-%d %H:%i:%s\') startstime,\n\nd1.sort,\nd1.lastactualweight+ d1.`lweight` lweight ,\nd1.`actualweightminus`,\nDATE_FORMAT(d1.intime, \'%Y-%m-%d %H:%i:%s\') intime,\nd1.`lastactualweight`,\nd1.`actualweight`\n\nFROM\n `downloadplandtl1_exec` d1\nWHERE d1.`pastureid` = ? AND d1.optdevice = ?\nAND pid =?\n\nUNION ALL\n\nSELECT\nd1.fname,\nTRIM(d1.`id`) id,\nd1.`pastureid`,\nd1.`optdevice` ,\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`date`=d2.`date` AND d1.pastureid = d2.pastureid AND d2.pid=d1.pid))\n) proesstime, \nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)\n, (SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`date`=d2.`date` AND d1.pastureid = d2.pastureid AND d2.pid=d1.pid)\n),\'%Y-%m-%d %H:%i:%s\') starttime, \nd1.sort,\nd1.lastactualweight - d1.`lweight` lweight ,\nd1.`actualweightminus`,\nDATE_FORMAT(d1.intime, \'%Y-%m-%d %H:%i:%s\') intime,\nd1.`lastactualweight`,\nd1.`actualweight`\n\nFROM\n `downloadplandtl2` d1\nWHERE d1.`pastureid` = ? AND d1.optdevice = ?\nAND pid =?\n\nORDER BY sort\n) tem \nINNER JOIN tmr \nON tmr.`pastureid` = tem.pastureid AND tmr.`id`= tem.optdevice\nINNER JOIN `recweight` r\nON r.`pastureid` = tem.pastureid AND r.`srcaddr` = tmr.`datacaptureno` \nWHERE r.`mtime` >=tem.startstime AND r.`mtime` <=tem.intime\n \nORDER BY sort,mtime\n\n','pastureid,id,pid,pastureid,id,pid','getHomeprocessAnalysis','GetDataByName','监控图','tmrgo','{\"name\":\"getprocessAnalysisTB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  381. (1583,324,'SELECT \ntem.tname,tem.remark,tem.fname,tem.inorout,tem.lweight,tem.lastactualweight,TRIM(tem.`projid`)pid,tem.datacaptureno,tem.id,\nABS(tem.lastactualweight - tem.nowweight) doneweight,\ntem.nowweight,\ntem.lweight- ABS(tem.lastactualweight - tem.nowweight) leftweight,\nCONCAT(ROUND(ABS(tem.lastactualweight - tem.nowweight)/tem.lweight*100,2),\'%\') donerate\nFROM \n\n(\nSELECT tmr.`eqcode`,tmr.`tname`,d.`remark`,tmr.`projid`,tmr.`datacaptureno`,trim(tmr.id) id,\ntmr.`inorout`,\nIF(tmr.`inorout`=0,de.`fname`,d2.`fname`) fname,\nIF(tmr.`inorout`=0,de.`lweight`,d2.`lweight`) lweight,\nIF(tmr.`inorout`=0,de.lastactualweight,d2.lastactualweight)lastactualweight,\nIF(tmr.`inorout`=0,de.lastactualweight,d2.lastactualweight)-\n(SELECT weight FROM `recweight` r WHERE r.pastureid= tmr.`pastureid` AND r.srcaddr = tmr.`datacaptureno` ORDER BY mtime DESC LIMIT 1) 完成重量,\n(SELECT weight FROM `recweight` r WHERE r.pastureid= tmr.`pastureid` AND r.srcaddr = tmr.`datacaptureno` ORDER BY mtime DESC LIMIT 1) nowweight\nFROM tmr\nINNER JOIN downloadedplan d\nON d.`pastureid` = tmr.`pastureid` AND d.`id` = tmr.`projid`\nLEFT JOIN `downloadplandtl1_exec` de\nON de.`pastureid` = tmr.`pastureid` and de.pid = d.id AND de.`optdevice` = tmr.`id` AND tmr.`inorout` = 0 and tmr.nextsort = sort\nLEFT JOIN `downloadplandtl2` d2\nON d2.`pastureid` = tmr.`pastureid` and d2.pid = d.id AND d2.`optdevice` = tmr.`id` AND tmr.`inorout` = 1 and tmr.nextsort = sort\n\nWHERE tmr.`pastureid` =?\nAND tmr.`nextsort` <> -1 AND tmr.`nextsort` <> 0\n)tem\n','pastureid','getHomepageLBListV2','GetDataByName','过程分析轮播','tmrgo','{\"name\":\"getHomepageLBList\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','{\"code\":0,\"list\":[{\"doneTimes\":21,\"doneWeight\":\"84420.00\",\"monRateHL\":\"99.66%\",\"monRateSL\":\"98.86%\",\"monRateSLR\":\"96.92%\",\"planTimes\":21,\"planWeight\":\"191264.03\",\"yesRateHL\":\"99.74%\",\"yesRateSL\":\"98.07%\",\"yesRateSLR\":\"97.87%\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  382. (1584,385,'SELECT \ntem.feedname,\nround(tem.sumprice-tem.laidsumstart+tem.usesumstart ,2)startprice,\nround(IF(?>=DATE_FORMAT(NOW(), \'%Y-%m-%d\'), tem.sumprice,tem.sumprice-tem.laidsumstop+tem.usesumstop) ,2) stopprice,\nround(tem.stockweight-tem.laidwstart+tem.usewstart ,2) startsum,\nround(IF(?>=DATE_FORMAT(NOW(), \'%Y-%m-%d\'),tem.stockweight,tem.stockweight-tem.laidwstop+tem.usewstop) ,2) stopsum,\nround(tem.laidsum ,2) laidsum ,\nround(系统用量,2) usesumXT,\nround(损耗,2) usesumXH,\nround(人工用料,2) usesumRG\n FROM\n(\n SELECT \n fs.pastureid,\n fs.feedid,\n f.fname feedname,\n fs.stockweight,\n fs.stockweight*fs.price sumprice,\n ifnull((SELECT SUM(fl.pricenew*fl.operateweight) FROM feedlaid fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND fl.laiddate BETWEEN ? AND NOW() \n ),0) laidsumstart,\n ifnull((SELECT SUM(fl.operateweight) FROM feedlaid fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND fl.laiddate BETWEEN ? AND NOW() \n ) ,0) laidwstart,\n ifnull((SELECT SUM(fl.price*fl.operateweight) FROM feeduse fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND (ischarge = 1 OR usetype<>\'系统用量\') \n AND fl.usedate BETWEEN ? AND NOW() \n ),0) usesumstart,\n ifnull((SELECT SUM(fl.operateweight) FROM feeduse fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND (ischarge = 1 OR usetype<>\'系统用量\')\n AND fl.usedate BETWEEN ? AND NOW() \n ),0) usewstart,\n\n ifnull((SELECT SUM(fl.pricenew*fl.operateweight) FROM feedlaid fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND fl.laiddate BETWEEN DATE_ADD(?,INTERVAL 1 DAY) AND NOW() \n ),0) laidsumstop,\n\n ifnull((SELECT SUM(fl.operateweight) FROM feedlaid fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND fl.laiddate BETWEEN DATE_ADD(?,INTERVAL 1 DAY) AND NOW() \n ),0) laidwstop,\n ifnull((SELECT SUM(fl.price*fl.operateweight) FROM feeduse fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND (ischarge = 1 OR usetype<>\'系统用量\') \n AND fl.usedate BETWEEN DATE_ADD(?,INTERVAL 1 DAY) AND NOW() \n ),0) usesumstop,\n ifnull((SELECT SUM(fl.operateweight) FROM feeduse fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND (ischarge = 1 OR usetype<>\'系统用量\')\n AND fl.usedate BETWEEN DATE_ADD(?,INTERVAL 1 DAY) AND NOW() \n ) ,0)usewstop,\n \n \n\n IFNULL((SELECT SUM(fl.operateweight) FROM feedlaid fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND fl.laiddate BETWEEN ? AND ? \n ),0) laidsum,\n\n ifnull((SELECT SUM(fl.operateweight) FROM feeduse fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND (ischarge = 1 OR usetype<>\'系统用量\')\n AND fl.usedate BETWEEN ? AND ?\n AND usetype = \'人工用料\'\n ) ,0)人工用料,\n \n ifnull((SELECT SUM(fl.operateweight) FROM feeduse fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND (ischarge = 1 OR usetype<>\'系统用量\')\n AND fl.usedate BETWEEN ? AND ?\n AND usetype = \'损耗\'\n ),0) 损耗,\n \n ifnull((SELECT SUM(fl.operateweight) FROM feeduse fl \n WHERE fl.pastureid = fs.pastureid AND fl.feedid = fs.feedid \n AND (ischarge = 1 OR usetype<>\'系统用量\')\n AND fl.usedate BETWEEN ? AND ?\n AND usetype = \'系统用量\'\n ),0) 系统用量\n\n\n FROM `feedstorage` fs\n join feed f\n on f.pastureid = fs.pastureid and f.id = fs.feedid\n WHERE fs.pastureid = ? AND (f.fname =? OR ? =\'\' )\n) tem\n\n\n','stopTime,stopTime,startTime,startTime,startTime,startTime,stopTime,stopTime,stopTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,pastureid,feedname,feedname','getfsStaticlist','GetDataByName','库存统计列表','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":[{\"feedname\":\"\",\"laidsum\":\"0.00\",\"startprice\":\"0.000000\",\"startsum\":\"0.000\",\"stopprice\":\"0.000000\",\"stopsum\":\"0.000\",\"usesumRG\":\"0.000\",\"usesumXH\":\"0.000\",\"usesumXT\":\"0.000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  383. (1585,385,'SELECT \n\'牲畜类别\' typestr,tem.times,\nIFNULL(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff,\nIFNULL(CONCAT(ROUND(ABS(tem.actualweightminus-tem.lweight)/tem.lweight*100,2),\'%\'),\'0.00%\') diffrate\n FROM (\n \n \n \nSELECT \nd2.`type`,\n IFNULL((SELECT cowclass FROM `barmilk` bm WHERE bm.`pastureid` = d2.`pastureid` AND bm.`barid` = d2.`fbarid` AND bm.`productdate` <= d2.`date` ORDER BY bm.`productdate` LIMIT 1),\'无类别\') fname,IFNULL(ftd.`fname`,d1.`fname` ) feedname,d.`times` ,\nSUM(\n d2.lweight/(SELECT SUM(lweight) FROM downloadplandtl2 d2t WHERE d2t.pastureid = d2.pastureid AND d2t.flpid = d2.flpid AND d2t.type = 0 AND d2t.date = d2.date)*\n d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )lweight,\n SUM(\n d2.lweight/(SELECT SUM(lweight) FROM downloadplandtl2 d2t WHERE d2t.pastureid = d2.pastureid AND d2t.flpid = d2.flpid AND d2t.type = 0 AND d2t.date = d2.date)*\n d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )actualweightminus\n \n FROM \n`downloadedplan` d\n\nJOIN `downloadplandtl2` d2\nON d.`pastureid` = d2.`pastureid` AND d2.`pid` = d.`id` \nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`flpid` = d2.`flpid` AND d1.type = 0 AND d2.`date` = d1.date\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\n\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nGROUP BY IFNULL((SELECT cowclass FROM `barmilk` bm WHERE bm.`pastureid` = d2.`pastureid` AND bm.`barid` = d2.`fbarid` AND bm.`productdate` <= d2.`date` ORDER BY bm.`productdate` LIMIT 1),\'无类别\'),IFNULL(ftd.`fname`,d1.`fname` )\nHAVING d2.`type` = 0\n\n\n) tem\nwhere tem.fname = ? or ? =\'\'\nORDER BY tem.fname,tem.feedname\n','pastureid,startTime,stopTime,fname,fname ','getMaterialAnalysisSC','GetDataByName','用料分析-牲畜','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  384. (1586,385,'SELECT \n\'栏舍\' typestr,tem.times,\nIFNULL(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff,\nIFNULL(CONCAT(ROUND(ABS(tem.actualweightminus-tem.lweight)/tem.lweight*100,2),\'%\'),\'0.00%\') diffrate\n FROM (\n \n \n \nSELECT \nd2.`type`,\n d2.fname,IFNULL(ftd.`fname`,d1.`fname` ) feedname,d.`times` ,\nSUM(\n d2.lweight/(SELECT SUM(lweight) FROM downloadplandtl2 d2t WHERE d2t.pastureid = d2.pastureid AND d2t.flpid = d2.flpid AND d2t.type = 0 AND d2t.date = d2.date)*\n d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )lweight,\n SUM(\n d2.lweight/(SELECT SUM(lweight) FROM downloadplandtl2 d2t WHERE d2t.pastureid = d2.pastureid AND d2t.flpid = d2.flpid AND d2t.type = 0 AND d2t.date = d2.date)*\n d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )actualweightminus\n \n FROM \n`downloadedplan` d\n\nJOIN `downloadplandtl2` d2\nON d.`pastureid` = d2.`pastureid` AND d2.`pid` = d.`id` \nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`flpid` = d2.`flpid` AND d1.type = 0 AND d2.`date` = d1.date\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\n\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nGROUP BY d2.`fbarid`,IFNULL(ftd.`fname`,d1.`fname` )\nHAVING d2.`type` = 0\n\n\n) tem\nwhere tem.fname = ? or ? =\'\'\nORDER BY tem.fname,tem.feedname\n','pastureid,startTime,stopTime,fname,fname ','getMaterialAnalysisLS','GetDataByName','用料分析-栏舍','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  385. (1587,385,'SELECT \n\'日期\' typestr,\nifnull(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff,\nIFNULL(CONCAT(ROUND(ABS(tem.actualweightminus-tem.lweight)/tem.lweight*100,2),\'%\'),\'0.00%\') diffrate\n\n FROM (\n\nSELECT DATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') fname,IFNULL(ftd.`fname`,d1.`fname` ) feedname,\n SUM(d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )lweight,\n SUM(d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )actualweightminus\n \n \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`pid` = d.`id`\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\n\n\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nAND d1.`type` = 0\n\nGROUP BY d.mydate,IFNULL(ftd.`fname`,d1.`fname` )\n \n) tem\nwhere tem.fname = ? or ? =\'\'\norder by tem.fname,tem.feedname','pastureid,startTime,stopTime,fname,fname ','getMaterialAnalysisRQ','GetDataByName','用料分析-日期','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  386. (1588,385,'SELECT \n\'TMR名称\' typestr,\nIFNULL(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff,\nIFNULL(CONCAT(ROUND(ABS(tem.actualweightminus-tem.lweight)/tem.lweight*100,2),\'%\'),\'0.00%\') diffrate\n\n FROM (\n\nSELECT d.`tmrtname` fname,IFNULL(ftd.`fname`,d1.`fname` ) feedname,d.`times` ,\n SUM(d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )lweight,\n SUM(d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )actualweightminus\n \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`pid` = d.`id`\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\n\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nAND d1.type = 0\nGROUP BY d.`tmrid`,IFNULL(ftd.`fname`,d1.`fname` )\n \n) tem\nwhere tem.fname = ? or ? =\'\'\norder by tem.fname,tem.feedname','pastureid,startTime,stopTime,fname,fname ','getMaterialAnalysisTMR','GetDataByName','用料分析-tmr','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  387. (1589,385,'SELECT \n\'班次\' typestr,tem.times,\nIFNULL(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff,\nIFNULL(CONCAT(ROUND(ABS(tem.actualweightminus-tem.lweight)/tem.lweight*100,2),\'%\'),\'0.00%\') diffrate\n FROM (\n\nSELECT \nCASE d.`times` \nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND fname,IFNULL(ftd.`fname`,d1.`fname` ) feedname,d.`times` ,\n SUM(d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )lweight,\n SUM(d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )actualweightminus\n \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`pid` = d.`id`\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\n\n\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nAND d1.`type` = 0\nGROUP BY d.times,IFNULL(ftd.`fname`,d1.`fname` )\n \n) tem\nWHERE tem.fname = ? OR ? =\'\'\nORDER BY tem.times,tem.feedname','pastureid,startTime,stopTime,fname,fname ','getMaterialAnalysisBC','GetDataByName','用料分析-班次','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  388. (1590,385,'\nSELECT \n\n\'车次\' typestr,\nIFNULL(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff,\nIFNULL(CONCAT(ROUND(ABS(tem.actualweightminus-tem.lweight)/tem.lweight*100,2),\'%\'),\'0.00%\') diffrate\n\n FROM (\n\nSELECT d.`times`,\nIFNULL(ftd.`fname`,d1.`fname` )feedname,\nCONCAT(d.`projname`,\'(\',DATE_FORMAT(d.`mydate`, \'%m-%d\'),\')\') fname,\n SUM(d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )lweight,\n \n SUM(d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )actualweightminus\n\n \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`pid` = d.`id`\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\n\n\n\n\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nAND d1.`type` = 0\nGROUP BY CONCAT(d.`projname`,\'(\',d.mydate,\')\'),IFNULL(ftd.`fname`,d1.`fname`)\n \n) tem\nWHERE tem.fname = ? OR ? =\'\'\n\nORDER BY fname,feedname','pastureid,startTime,stopTime,fname,fname ','getMaterialAnalysisCC','GetDataByName','用料分析-车次','tmrgo','{\"name\":\"getMaterialAnalysisCC\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  389. (1591,385,'SELECT \n\'牲畜类别\' typestr,tem.times,\nIFNULL(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff\n\n FROM (\n \n \n \nSELECT \nd2.`type`,\n IFNULL((SELECT cowclass FROM `barmilk` bm WHERE bm.`pastureid` = d2.`pastureid` AND bm.`barid` = d2.`fbarid` AND bm.`productdate` <= d2.`date` ORDER BY bm.`productdate` LIMIT 1),\'无类别\') fname,IFNULL(ftd.`fname`,d1.`fname` ) feedname,d.`times` ,\nSUM(\n d2.lweight/(SELECT SUM(lweight) FROM downloadplandtl2 d2t WHERE d2t.pastureid = d2.pastureid AND d2t.flpid = d2.flpid AND d2t.type = 0 AND d2t.date = d2.date)*\n d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )* f.uprice lweight,\n SUM(\n d2.lweight/(SELECT SUM(lweight) FROM downloadplandtl2 d2t WHERE d2t.pastureid = d2.pastureid AND d2t.flpid = d2.flpid AND d2t.type = 0 AND d2t.date = d2.date)*\n d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )* f.uprice actualweightminus\n\n \n FROM \n`downloadedplan` d\n\nJOIN `downloadplandtl2` d2\nON d.`pastureid` = d2.`pastureid` AND d2.`pid` = d.`id` \nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`flpid` = d2.`flpid` AND d1.type = 0 AND d2.`date` = d1.date\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\n\nLEFT JOIN `feed` f ON f.`pastureid` =d1.`pastureid` AND f.`id` = IFNULL(ftd.`fid`,d1.`fid`)\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nGROUP BY IFNULL((SELECT cowclass FROM `barmilk` bm WHERE bm.`pastureid` = d2.`pastureid` AND bm.`barid` = d2.`fbarid` AND bm.`productdate` <= d2.`date` ORDER BY bm.`productdate` LIMIT 1),\'无类别\'),IFNULL(ftd.`fname`,d1.`fname` )\nHAVING d2.`type` = 0\n\n\n) tem\nwhere tem.fname = ? or ? =\'\'\nORDER BY tem.fname,tem.feedname\n','pastureid,startTime,stopTime,fname,fname ','getPriceAnalysisSC','GetDataByName','价格分析-牲畜','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  390. (1592,385,'SELECT \n\'栏舍\' typestr,tem.times,\nIFNULL(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff\n\n FROM (\n \n \n \nSELECT \nd2.`type`,\n d2.fname,IFNULL(ftd.`fname`,d1.`fname` ) feedname,d.`times` ,\nSUM(\n d2.lweight/(SELECT SUM(lweight) FROM downloadplandtl2 d2t WHERE d2t.pastureid = d2.pastureid AND d2t.flpid = d2.flpid AND d2t.type = 0 AND d2t.date = d2.date)*\n d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )* f.uprice lweight,\n SUM(\n d2.lweight/(SELECT SUM(lweight) FROM downloadplandtl2 d2t WHERE d2t.pastureid = d2.pastureid AND d2t.flpid = d2.flpid AND d2t.type = 0 AND d2t.date = d2.date)*\n d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )* f.uprice actualweightminus\n\n \n FROM \n`downloadedplan` d\n\nJOIN `downloadplandtl2` d2\nON d.`pastureid` = d2.`pastureid` AND d2.`pid` = d.`id` \nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`flpid` = d2.`flpid` AND d1.type = 0 AND d2.`date` = d1.date\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\nLEFT JOIN `feed` f ON f.`pastureid` =d1.`pastureid` AND f.`id` = IFNULL(ftd.`fid`,d1.`fid`)\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nGROUP BY d2.`fbarid`,IFNULL(ftd.`fname`,d1.`fname` )\nHAVING d2.`type` = 0\n\n\n) tem\nwhere tem.fname = ? or ? =\'\'\nORDER BY tem.fname,tem.feedname\n','pastureid,startTime,stopTime,fname,fname ','getPriceAnalysisLS','GetDataByName','价格分析-栏舍','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  391. (1593,385,'SELECT \n\'日期\' typestr,\nIFNULL(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff,\nIFNULL(CONCAT(ROUND(ABS(tem.actualweightminus-tem.lweight)/tem.lweight*100,2),\'%\'),\'0.00%\') diffrate\n\n FROM (\n\nSELECT DATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') fname,IFNULL(ftd.`fname`,d1.`fname` ) feedname,\n SUM(d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )*f.uprice lweight,\n SUM(d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )*f.uprice actualweightminus\n \n \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`pid` = d.`id`\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\n\nLEFT JOIN `feed` f ON f.`pastureid` =d1.`pastureid` AND f.`id` = IFNULL(ftd.`fid`,d1.`fid`)\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nAND d1.`type` = 0\n\nGROUP BY d.mydate,IFNULL(ftd.`fname`,d1.`fname` )\n \n) tem\n\nwhere tem.fname = ? or ? =\'\'\norder by tem.fname,tem.feedname','pastureid,startTime,stopTime,fname,fname ','getPriceAnalysisRQ','GetDataByName','价格分析-日期','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  392. (1594,385,'SELECT \n\'TMR名称\' typestr,\nIFNULL(tem.fname,\'无类别\')fname ,tem.feedname,\nROUND(tem.lweight,2)lweight,\nROUND(tem.actualweightminus,2)actualweightminus,\nROUND(ABS(tem.actualweightminus-tem.lweight),2) diff,\nIFNULL(CONCAT(ROUND(ABS(tem.actualweightminus-tem.lweight)/tem.lweight*100,2),\'%\'),\'0.00%\') diffrate\n\n FROM (\n\nSELECT d.`tmrtname` fname,IFNULL(ftd.`fname`,d1.`fname` ) feedname,d.`times` ,\n SUM(d1.`lweight`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )*f.uprice lweight,\n SUM(d1.`actualweightminus`*IF(ftd.id IS NULL,1,ftd.`fweight`/(SELECT SUM(ftd2.fweight) FROM `ftdetail` ftd2 WHERE ftd2.`pastureid` =d1.`pastureid` AND ftd2.`ftid` = d1.`fid` ))\n )*f.uprice actualweightminus\n \n \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl1` d1\nON d.`pastureid` = d1.`pastureid` AND d1.`pid` = d.`id`\nLEFT JOIN `ftdetaildate` ftd ON ftd.`pastureid` =d1.`pastureid` AND ftd.`ftid` = d1.`fid` AND d1.`feedcode` = \'-1\' AND ftd.`date` = d.`mydate` AND ftd.`version` = d.`tversion`\n\nLEFT JOIN `feed` f ON f.`pastureid` =d1.`pastureid` AND f.`id` = IFNULL(ftd.`fid`,d1.`fid`)\n\nWHERE d.`pastureid` = ? AND d.`mydate` BETWEEN ? AND ?\nAND d1.type = 0\nGROUP BY d.`tmrid`,IFNULL(ftd.`fname`,d1.`fname` )\n \n) tem\nwhere tem.fname = ? or ? =\'\'\norder by tem.fname,tem.feedname','pastureid,startTime,stopTime,fname,fname ','getPriceAnalysisTMR','GetDataByName','用料分析-tmr','tmrgo','{\"name\":\"getfsStaticlist\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-01\",\"pid\":220849}} ','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  393. (1595,390,'SELECT DATE_FORMAT(DATE , \'%Y-%m-%d\') 日期,SUM(`actualweightminus`)field1 -- 混料重量\nFROM `downloadplandtl1` \nWHERE pastureid = ? AND DATE BETWEEN ? AND ? and type = 0\nGROUP BY DATE\norder by DATE ','pastureid,startTime,stopTime','getAccuraaActHL','GetDataByName','混料实际重量统计','tmrgo','{\"name\":\"getAccuraaActHL\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"field1\":\"95667.00\",\"日期\":\"2020-09-15T00:00:00+08:00\"},{\"field1\":\"95552.00\",\"日期\":\"2020-09-16T00:00:00+08:00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  394. (1596,324,'\nSELECT\nTRIM(d1.`pid`) pid,\nTRIM(d1.`id`) id,\nd1.`pastureid`,\nd1.`optdevice`,\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid))\n) proesstime, \nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)\n, (SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid)\n),\'%Y-%m-%d %H:%i:%s\') startstime,\n\nd1.sort,\nd1.lastactualweight+ d1.`lweight` lweight ,\nd1.`actualweightminus`,\nDATE_FORMAT(d1.intime, \'%Y-%m-%d %H:%i:%s\') intime,\nd1.`lastactualweight`,\nd1.`actualweight`\n\nFROM\n `downloadplandtl1_exec` d1\nWHERE d1.`pastureid` = ?\nAND pid =?\n\nUNION ALL\n\nSELECT\nTRIM(d1.`pid`) pid,\nTRIM(d1.`id`) id,\nd1.`pastureid`,\nd1.`optdevice` ,\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`date`=d2.`date` AND d1.pastureid = d2.pastureid AND d2.pid=d1.pid))\n) proesstime, \nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)\n, (SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`date`=d2.`date` AND d1.pastureid = d2.pastureid AND d2.pid=d1.pid)\n),\'%Y-%m-%d %H:%i:%s\') starttime, \nd1.sort,\nd1.lastactualweight - d1.`lweight` lweight ,\nd1.`actualweightminus`,\nDATE_FORMAT(d1.intime, \'%Y-%m-%d %H:%i:%s\') intime,\nd1.`lastactualweight`,\nd1.`actualweight`\n\nFROM\n `downloadplandtl2` d1\nWHERE d1.`pastureid` = ?\nAND pid =?\n\nORDER BY sort\n','pastureid,pid,pastureid,pid','getprocessAnalysisTBv3','GetDataByName','监控图1','tmrgo','{\"name\":\"getprocessAnalysisTB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  395. (1597,383,'SELECT COUNT(*) cou FROM `dashboard_chart`\nWHERE pastureid=? AND chartid = ?','pastureid,id','getChartuseCount','GetDataByName','图表删除-校验','tmrgo','{\"name\":\"checkBarDelete\",\"parammaps\": {\n \"pastureid\": \"3025176271438480383\",\n \"barid\": \"3055340423423198208\",\n \"lppid\": \"3025176271438480384\",\n \"times\": 1,\n \"ptsid\": \"-1\",\n \"ptid\": \"3025176272438480393\",\n \"fttype\": \"1\"\n }}','{\"code\":0,\"list\":[{\"vmsg\":\"该栏舍已经使用,不可删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  396. (1598,354,'SELECT tmr.`eqcode`,TRIM(d1e.optdevice) eqid,IF(tmr.tclassid=0,\'铲车\',\'TMR设备\')eqclass,d.times,TRIM(d1e.pastureid) pastureid,driver.`drivername` driver ,TRIM(driver.`id`)driverid,\nDATE_FORMAT(dr.operatetime,\'%Y-%m-%d\')operatetime,\nCASE d.times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimesstr\nFROM `downloadplandtl1_exec` d1e\nINNER JOIN `downloadedplan` d\nON d.pastureid = d1e.pastureid AND d.id = d1e.pid\nINNER JOIN tmr\nON tmr.id = d1e.optdevice AND tmr.`pastureid` = d1e.pastureid\nLEFT JOIN dutyrecord dr\nON dr.pastureid = d1e.pastureid AND dr.times =d.times AND dr.eqid =d1e.optdevice AND d.times = dr.times AND dr.operatetime = (SELECT MAX(operatetime) FROM dutyrecord WHERE pastureid=d1e.pastureid AND eqid = d1e.optdevice AND times =d.times)\nLEFT JOIN driver \nON driver.`pastureid` = dr.pastureid AND driver.`id` = dr.driverid\nWHERE d1e.pastureid = ? AND d.mydate = DATE_FORMAT(NOW(), \'%Y-%m-%d\') AND tmr.tclassid=0\nGROUP BY d1e.optdevice,d.times','pastureid','geEqListByDplanCC','GetDataByName','值班记录列表','tmrgo','{\"name\":\"geEqListByDplan\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"eqclass\":\"测试类别1\",\"eqcode\":\"测试编号1\",\"eqid\":1243,\"pastureid\":\"3025176271438480383\",\"times\":3},{\"eqclass\":\"测试类别2\",\"eqcode\":\"测试编号2\",\"eqid\":1244,\"pastureid\":\"3025176271438480383\",\"times\":2},{\"eqclass\":\"测试类别3\",\"eqcode\":\"测试编号3\",\"eqid\":1245,\"pastureid\":\"3025176271438480383\",\"times\":1}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  397. (1599,343,'SELECT IFNULL(\n(\nSELECT CASE \nWHEN (SELECT SUM(cou) FROM (\nSELECT COUNT(*) cou FROM remainplan WHERE pastureid = ? AND tmrid = ?\n\nUNION \n\nSELECT COUNT(*) FROM premixplan WHERE pastureid = ? AND tmrid = ?\n\nUNION \n\nSELECT COUNT(*) FROM lpplan WHERE pastureid = ? AND tmrid = ?\n\nUNION \n\nSELECT COUNT(*) FROM lpplandtl1 WHERE pastureid = ? AND tmrid = ?) tem)>0\nTHEN CONCAT(\'配方计划中已分配此车辆信息,不可进行删除\')\nELSE \'\' END AS vmsg \n),\n\'\') vmsg\n\n','pastureid,id,pastureid,id,pastureid,id,pastureid,id','checkDeleteTmr','GetDataByName','TMR删除校验','tmrgo','{\"name\":\"checkDLPIsStartV2\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"id\":\"3052754498524546048\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"配方计划中已分配此车辆信息,不可进行删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  398. (1600,345,'SELECT IFNULL(\n(\nSELECT CASE \nWHEN (SELECT SUM(cou) FROM (\nSELECT count(*) cou FROM `barmilk` WHERE pastureid= ? AND cowclassid = ?) tem)>0\nTHEN CONCAT(\'此牲畜类别已被栏舍绑定,不可进行删除\')\nELSE \'\' END AS vmsg \n),\n\'\') vmsg\n','pastureid,id','checkDeleteCC','GetDataByName','牲畜类别删除校验','tmrgo','{\"name\":\"checkDeleteCC\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"id\":\"3027853649461642240\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"此牲畜类别已被栏舍绑定,不可进行删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  399. (1601,350,'SELECT IFNULL(\n(\nSELECT CASE \n WHEN (SELECT COUNT(*) FROM `barmilk` WHERE pastureid= ? AND barid = ?)>0\n THEN CONCAT(\'栏舍配方中已分配此栏舍信息,不可进行删除\')\n WHEN (SELECT COUNT(*) FROM `lpplandtl1` WHERE pastureid= ? AND barid = ?)>0\n THEN CONCAT(\'撒料计划中已分配此栏舍信息,不可进行删除\')\n WHEN (SELECT COUNT(*) FROM `remainplan` WHERE pastureid= ? AND barid = ?)>0\n THEN CONCAT(\'剩料计划中已分配此栏舍信息,不可进行删除\')\n\nELSE \'\' END AS vmsg \n),\n\'\') vmsg\n\n','pastureid,id,pastureid,id,pastureid,id','checkDeleteBar','GetDataByName','栏舍删除校验','tmrgo','{\"name\":\"checkDeleteCC\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"id\":\"3027853649461642240\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"此牲畜类别已被栏舍绑定,不可进行删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  400. (1602,346,'SELECT IFNULL(\n(\nSELECT CASE \n WHEN (SELECT COUNT(*) FROM `feed` WHERE pastureid= ? AND fclassid = ?)>0\n THEN CONCAT(\'此饲料类别已关联饲料,不可进行删除\')\n\nELSE \'\' END AS vmsg \n),\n\'\') vmsg\n','pastureid,id','checkDeleteFC','GetDataByName','饲料类别删除校验','tmrgo','{\"name\":\"checkDeleteCC\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"id\":\"3027853649461642240\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"此牲畜类别已被栏舍绑定,不可进行删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  401. (1603,347,'SELECT IFNULL(\n(\nSELECT CASE \n WHEN (SELECT COUNT(*) FROM `ftdetail` WHERE pastureid= ? AND fid = ?)>0\n THEN CONCAT(\'此饲料已关联配方模板,不可进行删除\')\n WHEN (SELECT COUNT(*) FROM `contract` WHERE pastureid= ? AND feedid = ?)>0\n THEN CONCAT(\'此饲料已关联合同,不可进行删除\')\nELSE \'\' END AS vmsg \n),\n\'\') vmsg\n\n','pastureid,id,pastureid,id','checkDeleteFeed','GetDataByName','饲料表删除校验','tmrgo','{\"name\":\"checkDeleteCC\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"id\":\"3027853649461642240\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"此牲畜类别已被栏舍绑定,不可进行删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  402. (1604,376,'SELECT IFNULL(\n(\nSELECT CASE \n WHEN (SELECT COUNT(*) FROM `bigcontract` WHERE pastureid= ? AND providerid = ?)>0\n THEN CONCAT(\'此供应商已关联合同,不可进行删除\')\nELSE \'\' END AS vmsg \n),\n\'\') vmsg\n','pastureid,id','checkDeleteProv','GetDataByName','供应商删除校验','tmrgo','{\"name\":\"checkDeleteCC\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"id\":\"3027853649461642240\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"此牲畜类别已被栏舍绑定,不可进行删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  403. (1605,369,'SELECT IFNULL(\n(\nSELECT CASE \n WHEN (SELECT COUNT(*) FROM `user` WHERE pastureid= ? AND roleid = ?)>0\n THEN CONCAT(\'此角色已绑定用户,不可进行删除\')\nELSE \'\' END AS vmsg \n),\n\'\') vmsg','pastureid,id','checkDeleteRole','GetDataByName','角色删除校验','tmrgo','{\"name\":\"checkDeleteCC\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"id\":\"3027853649461642240\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"此牲畜类别已被栏舍绑定,不可进行删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  404. (1606,365,'CALL autoCreateLPP(?,?)','type,pastureid','autoCreateLPP','PostDataByName','修改栏舍配方子','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  405. (1607,343,'SELECT\neqcode,\ntname,\ndatacaptureno,\ntrim(tclassid) tclassid,\ntclassname,\nmaxstirfeed,\nremark,\n`enable`,\nTRIM(id) id,\nTRIM(pastureid)pastureid,\ntrim(projid)projid,\nlastsort,\nnextsort,inorout\n\nFROM\n tmr\nWHERE pastureid = ? \n AND (tmr.`eqcode` LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nORDER BY tmr.id DESC','pastureid,eqcode,eqcode','getTMRListTest','GetDataByName','tmr列表','tmrgo','{\"name\":\"getTMRList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":0,\"enable\":1,\"eqcode\":\"1\",\"id\":\"1\",\"maxstirfeed\":4,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"3\",\"tclassname\":\"3\",\"tname\":\"2\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  406. (1608,343,'call ProcNewButtonTest(?,?,?,?,?)','pastureid,InButtonType,startW,stopW,tmrid','ProcNewButtonTest','GetDataByName','取计划','tmrgo','{\"name\":\"ProcNewButtonTest\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"tmrid\":\"3052755377885545472\",\"InButtonType\":\"0\",\"startW\":1,\"stopW\":\"1\",\"nextsort\":\"0\",\"inorout\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'cc\' at line 1\"',0,1,0,0,0),
  407. (1609,343,'INSERT INTO recweight(pastureid,srcaddr,mtime,weight) \nSELECT ?,?,if(?=\'\',now(),?),?\n','pastureid,datacaptureno,dtime,dtime,SW','setRealWeighttest','GetDataByName','设置实际重量','tmrgo','{\"name\":\"getTMRList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":0,\"enable\":1,\"eqcode\":\"1\",\"id\":\"1\",\"maxstirfeed\":4,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"3\",\"tclassname\":\"3\",\"tname\":\"2\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  408. (1610,337,'INSERT INTO rpdetail(id,pastureid,bigid,barid,bar,type,sort) VALUES (?,?,?,?,?,?,(SELECT sort FROM (SELECT IFNULL((SELECT MAX(sort)+1 sort FROM rpdetail WHERE bigid=?),0)sort)tem) ) ','snowid,pastureid,bigid,barid,bar,type,bigid','insertRpdetail','PostDataByName','新增剩料计划','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  409. (1611,337,'delete from rpdetail where pastureid= ? and bigid = ?','pastureid,bigid ','deleteRpdetail','PostDataByName','删除剩料计划子','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  410. (1612,343,'SELECT ProcNewButton\n( ?, # 牧场id\n 1, # 设备地址\n tmr.datacaptureno, # tmr数据采集卡编号\n NOW(), # 当前时间\n ?, # 按键类型(1自动,2,3 手动 完成计划,4开始取计划,5继续取计划)\n 1255,# 本次id\n ?,# 开始重量\n ?, # 结束重量\n tmr.nextsort, #上一次顺序\n tmr.inorout#上次是否撒料、作料\n)res,ifnull((SELECT IFnull(\n(SELECT CONCAT(\'饲料名称:\',fname,\'\\n 理论重量:\',lweight) FROM `downloadplandtl1_exec` WHERE pastureid=d.pastureid AND pid = d.id AND sort = tmr.nextsort),\n(SELECT CONCAT(\'栏舍名称:\',fname,\'\\n 理论重量:\',lweight) FROM `downloadplandtl2` WHERE pastureid=d.pastureid AND pid = d.id AND sort = tmr.nextsort)\n)fname FROM `downloadedplan` d\nWHERE d.pastureid = tmr.pastureid AND id =tmr.projid) ,\'计划完\')feedstr\n\nFROM tmr\nWHERE tmr.pastureid = ? AND tmr.id = ?','pastureid,InButtonType,startW,stopW,pastureid,tmrid','ProcNewButtonTestV2','GetDataByName','取计划','tmrgo','{\"name\":\"ProcNewButtonTest\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"tmrid\":\"3052755377885545472\",\"InButtonType\":\"0\",\"startW\":1,\"stopW\":\"1\",\"nextsort\":\"0\",\"inorout\":1}}','{\"code\":0,\"list\":[{\"feedstr\":\"栏舍名称:测试栏舍0927-2\\n 理论重量:990.00\",\"res\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  411. (1613,337,'INSERT INTO remainplan(id,pastureid,barid,bar,tmrid,tmrcode,enable,times,lppid,lppcode,rtime,treatmethod,useinbar,useinbarid,sort) VALUES (?,?,?,?,?,?,?,?,if(?=\'\',null,?),if(?=\'\',null,?),?,?,?,?,?) ','snowid,pastureid,barid,bar,tmrid,tmrcode,enable,times,lppid,lppid,lppcode,lppcode,rtime,treatmethod,useinbar,useinbarid,sort','insertRemainplanV2','PostDataByName','新增剩料计划','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  412. (1614,353,'SELECT IFNULL(ROUND(tem.ftweight/tem.sumweight*thoweight+ tem.supplyweight/tem.sumweight*thoweightS,2),0) thoweight1,tem.thoweight FROM (SELECT fp.`ftid`,fpd.`id`,\nIFNULL(fpd.`ftweight`+fpd.supplyweight,0)sumweight,\nIFNULL(fpd.`ftweight`,0)ftweight,\nIFNULL(fpd.`supplyweight`,0)supplyweight,\nROUND(IFNULL((SELECT SUM(ftdetail.fweight/(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ftid` AND ftd.`pastureid`=?)*feednur.`dry`/100)/(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ftid` AND ftd.`pastureid`=fpd.pastureid)\n FROM `ftdetaildate` ftdetail\n left JOIN feednur \n ON feednur.`fid` =ftdetail.`fid` AND feednur.`pastureid`=?\n WHERE ftdetail.ftid =fpd.`ftid` AND ftdetail.`pastureid`=? AND ftdetail.date =?\n),\n######\nIFNULL((SELECT SUM(ftdetail.fweight/(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ftid` AND ftd.`pastureid`=?)*feednur.`dry`/100) /(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ftid` AND ftd.`pastureid`=fpd.pastureid)\n FROM `ftdetail`\n left JOIN feednur \n ON feednur.`fid` =ftdetail.`fid` AND feednur.`pastureid`=?\n WHERE ftdetail.ftid =fpd.`ftid` AND ftdetail.`pastureid`=?\n),0)\n\n),2) thoweight,\nROUND(IFNULL((SELECT SUM(ftdetail.fweight/(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ptsfid` AND ftd.`pastureid`=?)*feednur.`dry`/100)\n FROM `ftdetaildate` ftdetail\n left JOIN feednur \n ON feednur.`fid` =ftdetail.`fid` AND feednur.`pastureid`=?\n WHERE ftdetail.ftid =fpd.`ptsfid` AND ftdetail.`pastureid`=? AND ftdetail.date = ?\n),\n######\nIFNULL((SELECT SUM(ftdetail.fweight/(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ptsfid` AND ftd.`pastureid`=?)*feednur.`dry`/100) \n FROM `ftdetail`\n left JOIN feednur \n ON feednur.`fid` =ftdetail.`fid` AND feednur.`pastureid`=?\n WHERE ftdetail.ftid =fpd.`ptsfid` AND ftdetail.`pastureid`=?\n),0)\n\n),2) thoweightS\n\n FROM \n`feedpdate` fpd\nLEFT JOIN `feedp` fp\nON fp.`barid`= ? AND fp.`pastureid` = ?\n\nWHERE fpd.`pastureid` = ? AND fpd.`barid`=? AND fpd.`date`=(SELECT MAX(`date`) FROM feedpdate WHERE pastureid= fpd.`pastureid` AND barid=fpd.barid AND `date`<=? ) ) tem','pastureid,pastureid,pastureid,date,pastureid,pastureid,pastureid,pastureid,pastureid,pastureid,date,pastureid,pastureid,pastureid,barid,pastureid,pastureid,barid,date','getFtdrytweightV2','GetDataByName','配方干物质列表','tmrgo','{\"name\":\"getFtdrytweight\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3028006959913108480\",\"sort\":\"0\",\"date\":\"2020-09-06\"}}','{\"code\":0,\"list\":[{\"thoweight\":\"0.36\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  413. (1615,324,'SELECT pid,TIMEDIFF(IFNULL((SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d.`mydate`=d2.`date` AND d.pastureid = d2.pastureid AND d2.pid=d.id),\n(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d.`mydate`=d2.`date` AND d.pastureid = d2.pastureid AND d2.pid=d.id)\n\n),intime) proesstime,\nCASE iscompleted\nWHEN 0 THEN\n\'进行中\'\nWHEN 1 THEN\n\'已完成\'\nEND iscompleted,\n(SELECT SUM(ABS(lweight-actualweightminus)) FROM downloadplandtl1 WHERE pastureid =d.pastureid AND pid = d.id)Hdif,\n(SELECT SUM(lweight) FROM downloadplandtl1 WHERE pastureid =d.pastureid AND pid = d.id)HdifSUM,\nCONCAT(ROUND((1-(SELECT SUM(ABS(lweight-actualweightminus))/SUM(lweight) FROM downloadplandtl1 WHERE pastureid =d.pastureid AND pid = d.id)) *100,2),\'%\') HdifRate,\n\n\n (SELECT SUM(ABS(lweight-actualweightminus)) FROM downloadplandtl2 WHERE pastureid =d.pastureid AND pid = d.id)Sdif,\n(SELECT SUM(lweight) FROM downloadplandtl2 WHERE pastureid =d.pastureid AND pid = d.id)SdifSUM,\nCONCAT(ROUND((1-(SELECT SUM(ABS(lweight-actualweightminus))/SUM(lweight) FROM downloadplandtl2 WHERE pastureid =d.pastureid AND pid = d.id) )*100,2),\'%\') SdifRate\n \n \n FROM `downloadedplan` d \nWHERE pastureid= ?\nAND id = ?\nORDER BY `id` DESC\n','pastureid,id','getprocessAnalysisStrSH','GetDataByName','过程详情','tmrgo','{\"name\":\"getprocessAnalysis\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  414. (1616,324,'SELECT\nifnull((SELECT remain FROM barfeedremain\n WHERE pastureid = d1.pastureid AND barid =d1.fbarid\n AND times =d.times AND remaindate = d.mydate LIMIT 1) ,d1.`actualweightminus`)sweight,\nd1.sort,\nd1.`fname`,\nd1.`lweight`,\nd1.`actualweightminus`,\nABS(d1.`lweight`- d1.`actualweightminus`) diff,\nCONCAT(100-if(ROUND(ABS(d1.`lweight`- d1.`actualweightminus`)/d1.`lweight`*100,2)>100,100,ROUND(ABS(d1.`lweight`- d1.`actualweightminus`)/d1.`lweight`*100,2)),\'%\') diffRate,\nDATE_FORMAT(d1.intime, \'%H:%i:%s\') intime,\nd1.`begintime` stoptime,\nd1.`lastactualweight`,\nd1.`actualweight`,\ncase d1.buttontype\nwhen 1 then \'自动\'\nwhen 2 then \'手动\'\nwhen 3 then \'手动\'\nend buttontype\nFROM\n `downloadplandtl2` d1\njoin downloadedplan d\non d.pastureid =d1.`pastureid` and d1.pid = d.id\nWHERE d1.`pastureid` = ?\nAND d1.pid =? and useinbartype <> 1\nORDER BY sort','pastureid,pid','getprocessAnalysisHLSH','GetDataByName','混料详情','tmrgo','{\"name\":\"getprocessAnalysis\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  415. (1617,324,'\nSELECT\nd1.sort,\nd1.`fname`,\nd1.`lweight` lweight1,\nd1.allowrw lweight,\nd1.`actualweightminus`,\nABS(d1.`lweight`- d1.`actualweightminus`) diff,\nCONCAT(100-if(ROUND(ABS(d1.`lweight`- d1.`actualweightminus`)/d1.`lweight`*100,2)>100,100,ROUND(ABS(d1.`lweight`- d1.`actualweightminus`)/d1.`lweight`*100,2)),\'%\') diffRate,\nifnull((select min(remainleftw) from downloadplandtl2 d2 where d2.pastureid=d1.pastureid and d2.pid = d1.pid and d2.useinbartype=1),0) aweight,\nDATE_FORMAT(d1.intime, \'%H:%i:%s\') intime,\nd1.`begintime` stoptime,\nd1.`lastactualweight`,\nd1.`actualweight`,\ncase d1.buttontype\nwhen 1 then \'自动\'\nwhen 2 then \'手动\'\nwhen 3 then \'手动\'\nend buttontype\nFROM\n `downloadplandtl2` d1\nWHERE d1.`pastureid` = ?\nAND pid =? and useinbartype=1\nORDER BY sort','pastureid,pid','getprocessAnalysisSLSH','GetDataByName','撒料详情(剩料)','tmrgo','{\"name\":\"getprocessAnalysis\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  416. (1618,349,'select \'不处理\' fname, \'不处理\' id\nunion\nselect \'转为饲料\', \'转为饲料\'\nunion\nselect fname,id from feed where pastureid = ? and enable = 1\n','pastureid','getRemainFeedList','PostDataByName','剩料处理选项(加字段无需处理)','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  417. (1619,368,'SELECT qq.* FROM (SELECT \nTRIM(p.pastureid) id,\nTRIM(p.pastureid) pastureid,\n p.enable,p.user,p.note,p.groupsid,\n(select pasture_name from pasture where pastureid= p.groupsid) groupsname,\np.emp contact,p.address,p.phone,p.pasture_name pastureName,\nMAX(CASE\n WHEN infoname = \'牧场名称\' THEN\n info\n END\n) AS pastureName1,\n MAX(CASE\n WHEN infoname = \'联系人\' THEN\n info\n END\n) AS contact1,\n MAX(CASE\n WHEN infoname = \'地址\' THEN\n info\n END\n) AS address1,\n MAX(CASE\n WHEN infoname = \'联系电话\' THEN\n info\n END\n) AS phone1\n \n FROM\npasture p\nleft join `pastureinfo` pi\non pi.pastureid = p.pastureid \n WHERE p.pastureid= ? \n GROUP BY p.pastureid) qq\n WHERE (qq.pastureName LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\') \n AND (qq.enable = ? OR ?=\'\') \n AND (qq.address LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\')\n AND (qq.contact LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\')\n AND (qq.phone LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\')','pastureid,pastureName,pastureName,enable ,enable ,address ,address ,contact ,contact ,phone ,phone ','getPastureList','GetDataByName','牧场列表','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  418. (1620,399,'SELECT trim(pastureid) id, pasture_name groupsname, pasture_code groupscode,emp,phone,enable,user,user userold,note\n FROM\npasture g\n WHERE (g.pasture_name LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\') \nand (g.enable =? OR ?=\'\') and g.isgroups = 1','groupsname,groupsname,enable,enable ','getGroupsAllList','GetDataByName','集团列表','tmrgo','{\"name\":\"getGroupsList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"code\":0,\"list\":[{\"emp\":\"李四\",\"groupscode\":\"001\",\"groupsname\":\"现代牧业\",\"id\":\"1\",\"phone\":\"1235\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  419. (1621,399,'DELETE FROM \n','pastureid,id','deleteGroups','PostDataByName','删除集团','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  420. (1622,399,'update pasture set pasture_name=?,pasture_code=?,emp =?,phone =?,enable =?,note =?,user =if(?=\'\',null,?)\nwhere pastureid=?','groupsname,groupscode,emp,phone,enable,note,user,user,id','updateGroups','PostDataByName','修改集团','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  421. (1623,399,'INSERT INTO pasture(pastureid,pasture_name,pasture_code,emp,phone,enable,note,user,isgroups)\nVALUES (?,?,?,?,?,?,?,if(?=\'\',null,?),1 )','snowid,groupsname,groupscode,emp,phone,enable,note,user,user','insertGroups','PostDataByName','新增集团','tmrgo','{\"name\":\"insertGroups\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  422. (1624,367,'SELECT trim(g.pastureid) id,pasture_name groupsname, pasture_code groupscode,emp,phone,enable\n FROM\npasture g\njoin groups_pasture gp\non gp.pastureid= g.pastureid\n WHERE gp.groupsid= ? and gp.type = 1','id','groupsrelationlistJT','GetDataByName','集团信息-关联集团列表','tmrgo','{\"name\":\"groupsrelationlistJT\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3237984984531207168\",\"drivername\":\"李五\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  423. (1625,367,'\nSELECT tem.* FROM (SELECT \nTRIM(p.pastureid) id,\nTRIM(p.pastureid) pastureid,\n p.enable,p.user,p.note,p.groupsid,\n(select pasture_name from pasture where pastureid = p.groupsid) groupsname,\np.emp contact,p.address,p.phone,p.pasture_name pasturename,pasture_code pasturecode,\nMAX(CASE\n WHEN infoname = \'牧场名称\' THEN\n info\n END\n) AS pastureName1,\n MAX(CASE\n WHEN infoname = \'联系人\' THEN\n info\n END\n) AS contact1,\n MAX(CASE\n WHEN infoname = \'地址\' THEN\n info\n END\n) AS address1,\n\n MAX(CASE\n WHEN infoname = \'联系电话\' THEN\n info\n END\n) AS phone1\n \n FROM\npasture p\nleft join `pastureinfo` pi\non pi.pastureid = p.pastureid\n GROUP BY p.pastureid) tem\nleft join groups_pasture gp\non gp.pastureid= tem.pastureid\n WHERE gp.groupsid= ? and gp.type = 0\n\nunion\n\n\nSELECT tem.* FROM (SELECT \nTRIM(p.pastureid) id,\nTRIM(p.pastureid) pastureid,\n p.enable,p.user,p.note,p.groupsid,\n(select pasture_name from pasture where pastureid = p.groupsid) groupsname,\np.emp contact,p.address,p.phone,p.pasture_name pasturename,pasture_code pasturecode,\nMAX(CASE\n WHEN infoname = \'牧场名称\' THEN\n info\n END\n) AS pastureName1,\n MAX(CASE\n WHEN infoname = \'联系人\' THEN\n info\n END\n) AS contact1,\n MAX(CASE\n WHEN infoname = \'地址\' THEN\n info\n END\n) AS address1,\n\n MAX(CASE\n WHEN infoname = \'联系电话\' THEN\n info\n END\n) AS phone1\n \n FROM\npasture p\nleft join `pastureinfo` pi\non pi.pastureid = p.pastureid\n GROUP BY p.pastureid) tem\n WHERE tem.groupsid= ?\n','id,id','groupsrelationlistMC','GetDataByName','集团信息-关联牧场列表','tmrgo','{\"name\":\"groupsrelationlistMC\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3237984984531207168\",\"drivername\":\"李五\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  424. (1626,367,'\nSELECT tem.* FROM (SELECT \nTRIM(p.pastureid) id,\nTRIM(p.pastureid) pastureid,\n p.enable,p.user,p.note,p.groupsid,p.user userold,\np.pasture_code pasturecode,\n(select pasture_name from pasture where pastureid = p.groupsid) groupsname,\np.emp contact,p.address,p.phone,p.pasture_name pasturename,\nMAX(CASE\n WHEN infoname = \'牧场名称\' THEN\n info\n END\n) AS pastureName1,\n MAX(CASE\n WHEN infoname = \'联系人\' THEN\n info\n END\n) AS contact1,\n MAX(CASE\n WHEN infoname = \'地址\' THEN\n info\n END\n) AS address1,\n\n MAX(CASE\n WHEN infoname = \'联系电话\' THEN\n info\n END\n) AS phone1\n \n FROM\npasture p\nleft join `pastureinfo` pi\non pi.pastureid = p.pastureid\nwhere p.isgroups = 0\n GROUP BY p.pastureid) tem\n WHERE (tem.pastureName LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\') \nand (tem.enable=? OR ?=\'\') \nand (if (? =0, tem.groupsid is null,tem.groupsid is not null) or ? = \'\' ) ','pastureName ,pastureName,enable,enable,statue,statue','groupsrelationlistMCAll','GetDataByName','集团信息-关联-下拉牧场列表','tmrgo','{\"name\":\"groupsrelationlistMCAll\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','\"sql: expected 6 arguments, got 7\"',0,1,0,0,0),
  425. (1627,399,'INSERT INTO pasture(pastureid,pasture_code,pasture_name,groupsid,user,note,enable,emp,address,phone) \nVALUES (?,?,?,if(?=\'\',null,?),?,?,?,?,?,?) ','snowid,pasturecode,pasturename,groupsid,groupsid,user,note,enable,emp,address,phone','insertPasture','PostDataByName','新增牧场','tmrgo','{\"name\":\"insertGroups\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  426. (1628,399,'update pasture set pasture_code =?,pasture_name =?,groupsid =?,user =?,note =?,enable =?,emp =?,address =?,phone =?\nwhere pastureid=?','pasturecode,pasturename,groupsid,user,note,enable,emp,address,phone,id','updatePasture','PostDataByName','修改牧场','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  427. (1629,367,'SELECT trim(g.pastureid) id,pasture_name groupsname, pasture_code groupscode,emp,phone\n FROM\npasture g\njoin groups_pasture gp\non gp.pastureid = g.pastureid\n WHERE gp.groupsid=? and g.isgroups = 1\nand (g.pasture_name LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\') \n\nUNION\n SELECT TRIM(g.pastureid) id,pasture_name groupsname, pasture_code groupscode,emp,phone\n FROM\npasture g\nWHERE g.pastureid=? and g.isgroups = 1\n','pastureid,groupsname,groupsname,pastureid','getGroupsList','GetDataByName','集团列表','tmrgo','{\"name\":\"getGroupsList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  428. (1630,368,'UPDATE `pastureinfo` \nSET info = CASE infoname \nWHEN \'联系电话\' THEN ? \nWHEN \'是否启用\' THEN ? \nWHEN \'联系人\' THEN ? \nWHEN \'地址\' THEN ? \nWHEN \'牧场名称\' THEN ? \nEND \nWHERE pastureid= ? ','phone,enable,contact,address,pastureName,pastureid','updatepastureinfoV2','PostDataByName','更新牧场信息','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  429. (1631,399,'SELECT TRIM(m.id)id,m.id menu_id,m.`name`,IFNULL(mp.`id`,0) seebutton,(SELECT COUNT(id) childrens FROM menu WHERE parentId=m.id) childrens,m.parentId pid\nFROM menu m\nLEFT JOIN menu_pasture mp\nON m.id = mp.id AND mp.pastureid=? AND mp.isgroups=1\nWHERE m.isg >= 1\n','id','getMenuandButtonlistJT','GetDataByName','集团菜单配置','tmrgo','{\"name\":\"getMenuandButtonlistJT\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\"}}','',0,1,0,0,0),
  430. (1632,399,'SELECT trim(m.id)id,m.id menu_id,m.`name`,ifnull(mp.`id`,0) seebutton,(SELECT COUNT(id) childrens FROM menu where parentId=m.id) childrens,m.parentId pid\nFROM menu_pasture mp\nright join menu m\non m.id = mp.id AND mp.pastureid=? and m.`menutype` = \'menu\' \nwhere m.isg between 0 and 3\n','pastureid','getMenuandButtonlistMC','GetDataByName','牧场菜单配置','tmrgo','{\"name\":\"getMenuandButtonlistMC\",\"parammaps\":{\"pastureid\":\"3025176271438480383\"}}','',0,1,0,0,0),
  431. (1633,399,'INSERT INTO menu_pasture(id, pastureid, isgroups) VALUES (?,?,1) ','menuid,id','insertRolepastureJT','PostDataByName','配置菜单','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  432. (1634,399,'INSERT INTO menu_pasture(id, pastureid, isgroups) VALUES (?,?,0) ','menuid,id','insertRolepastureMC','PostDataByName','配置菜单','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  433. (1635,399,'delete from menu_pasture where pastureid=? and isgroups = 1','id','deletemenuPastureJT','PostDataByName','删除集团菜单','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  434. (1636,399,'delete from menu_pasture where pastureid=? and isgroups = 0','id','deletemenuPastureMC','PostDataByName','删除集团菜单','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  435. (1638,399,'DELETE FROM groups_pasture\nWHERE groupsid =? ','id','deletegroupsPasture','PostDataByName','删除集团-牧场关联','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  436. (1639,399,'INSERT INTO menu_pasture(id, pastureid, isgroups) VALUES (?,?,0) ','menuid,id','insertRolepastureMCV2','PostDataByName','配置菜单','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  437. (1640,335,'SELECT trim(id) id,standard,cowneed,feedprov,diff,cprov,jprov\nFROM cowjudge where pastureid = ? and if((select count(*) from cowjudge cj where cj.pastureid=cowjudge.pastureid and cj.cowclassid = ? )>0,cowclassid= ?,cowclassid= -1)\n','pastureid,cowclassid,cowclassid','judgenurV3','GetDataByName','栏舍配方列表','tmrgo','{\"name\":\"getnurj\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3027996177498375168\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"avgdim\":11,\"avgmonthage\":\"15.00\",\"barid\":3027996177498375000,\"barname\":\"西区#1\",\"bigcowclass\":\"泌乳牛\",\"bw\":100,\"cowclass\":\"高产牛\",\"cowclassid\":3052868183976838000,\"cowsum\":\"200\",\"dayspre\":100,\"dayw\":\"4.00\",\"emp\":\"test专员\",\"fat\":\"15.60\",\"fetal\":2,\"lactose\":\"9.80\",\"pastureid\":\"3025176271438480383\",\"pro\":\"12.50\",\"product\":\"40.00\",\"productdate\":\"2020-09-15T00:00:00+08:00\",\"source\":\"\",\"tem\":\"37\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  438. (1641,399,'INSERT INTO groups_pasture(id, pastureid, groupsid,type) VALUES (?,?,?,?) ','snowid,rid,id,type','insertgroupsPasture','PostDataByName','配置菜单','tmrgo','{\"name\":\"insertDriver\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','',0,1,0,0,0),
  439. (1642,31,'select * from menu_pasture where pastureid=? and isgroups = 0','id','testGETNurJudge','GETNurJudge','营养评估测试','tmrgo','{\n \"name\": \"judgenurBarBm\",\n \"parammaps\": {\n \"name\":\"judgenurBarBm\",\n \"name1\":\"judgenurBarHSL\",\n \"avgmonthage\": 42,\n \"bw\": 640.00,\n \"dayw\": 0,\n \"fetal\": 2,\n \"avgdim\": 140,\n \"dayspre\": 60,\n \"product\": 30,\n \"fat\": 3.90,\n \"pro\": 3.10,\n \"lactose\": 4.80,\n \"tem\": 25.00,\n \"cowsum\": 15,\n \"cowclass\": \"11\",\n \"source\": \"\",\n \"bigcowclass\": \"泌乳牛\",\n \"pastureid\": \"3025176271438480383\",\n \"barid\": \"3028015595213292544\",\n \"date\": \"2021-01-20\",\n \"startTime\": \"2021-01-18\",\n \"stopTime\": \"2021-01-20\"\n }\n}','{\"adf\":564.286,\"ca\":1331.429,\"cad\":3698.413,\"cdry\":0.219,\"cndf\":471.4289999999999,\"cp\":828.571,\"dry\":0.36000000000000004,\"fat\":540.476,\"kprice\":0.32,\"n\":186,\"ndf\":667.46,\"nm\":123.432,\"nuint\":59.245,\"p\":1488.571,\"pd\":4134.921,\"starch\":219.841,\"trans35f\":30.355666666666664,\"trans4f\":26.389,\"uprice\":28.803,\"upriced\":6.614}',0,1,0,0,0),
  440. (1643,31,'select count(*) from feed where id = ?','id','gettestlist','GetDataByName','用户修改密码','tmrgo','{\"name\":\"gettestlist\",\"page\":1,\"offset\":1,\"pagecount\":5,\"parammaps\":{\"empId\":\"3051078779687921000\",\"pastureId\":\"3025176271438480383\",\"deptId\":\"12\"}}','{\"code\":0,\"list\":[{\"count(*)\":\"3\"}],\"message\":\"ok\",\"pageNum\":1,\"pageSize\":5,\"pages\":1,\"total\":1}',0,1,0,0,0),
  441. (1644,335,'\nSELECT \nbm.cowsum,\nbm.cowsum ccount,\nIFNULL(CAST(SUM(dry)AS DECIMAL(20,3)),0)dry, -- 干物质(kg)\nIFNULL(CAST(SUM(dry)/SUM(cdry) AS DECIMAL(20,3)),0) jcrate, -- 精粗比\nIFNULL(CAST(SUM(cdry)AS DECIMAL(20,3)),0)cdry, -- 粗料中的干物质\nIFNULL(CAST(SUM(n)/200 AS DECIMAL(20,3)),0)nm, -- 产奶净能(MJ)\nIFNULL(CAST(SUM(n)/3.138/100 AS DECIMAL(20,3)),0) nuint, -- 奶牛能量单位(NND)\nIFNULL(CAST(SUM(cp)/100 AS DECIMAL(20,3)),0)cp, -- 粗蛋白(g)\nIFNULL(CAST(SUM(cp)/sum(dry)/1000 AS DECIMAL(20,3)),0)cpd, -- 粗蛋白(%DM)\nIFNULL(CAST(SUM(ca)/100 AS DECIMAL(20,3)),0) ca, -- 钙(g)\nIFNULL(CAST(SUM(p)/100 AS DECIMAL(20,3)),0) p,-- 磷(g)\n\nIFNULL(CAST(SUM(nm)/SUM(dry)/100 AS DECIMAL(20,3)),0) nmd,-- 产奶净能(Mcal/DM)\nIFNULL(CAST(SUM(rr.fat)/SUM(dry)/100 AS DECIMAL(20,3)),0) fat, -- 脂肪\nIFNULL(CAST(SUM(starch)/SUM(dry)/100 AS DECIMAL(20,3)),0) starch,-- 淀粉\nIFNULL(CAST(SUM(ndf)/SUM(dry)/100 AS DECIMAL(20,3)),0) ndf, -- NDF(%DM)\n\nIFNULL(CAST(SUM(cndf)/SUM(dry)/100 AS DECIMAL(20,3)),0) cndf,-- 粗料中的NDF(%DM)\nIFNULL(CAST(SUM(adf)/SUM(dry)/100 AS DECIMAL(20,3)),0) adf, -- ADF(%DM)\nIFNULL(CAST(SUM(ca)/SUM(dry)/1000 AS DECIMAL(20,3)),0) cad, -- 钙(%DM)\nIFNULL(CAST(SUM(p)/SUM(dry)/1000 AS DECIMAL(20,3)),0) pd,-- 磷(%DM)\nIFNULL(CAST((0.35*IFNULL(bm.`product`,0)+15*IFNULL(bm.`fat`,0)/100*IFNULL(bm.`product`,0))/SUM(dry) AS DECIMAL(20,3)),0) trans4f, -- 4.0转化效率\nIFNULL(CAST((0.35*IFNULL(bm.`product`,0)+18.57*IFNULL(bm.`fat`,0)/100*IFNULL(bm.`product`,0))/SUM(dry) AS DECIMAL(20,3)),0) trans35f,-- 3.5转化效率\nIFNULL(CAST(SUM(uprice)AS DECIMAL(20,3)),0) uprice, -- 日粮成本\nIFNULL(CAST(SUM(uprice)/SUM(dry) AS DECIMAL(20,3)),0) upriced, -- 干物质成本(元/公斤)\nIFNULL(CAST(SUM(uprice)/IFNULL(bm.`product`,0)AS DECIMAL(20,3)),0) kprice -- 公斤奶成本\n FROM (\nSELECT \ntem.barid,\ntem.ftid,\ntem.pastureid,\ntem.fweight*fu.`dry`/100 dry,-- 干物质(kg)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`/100,IF(fc.bigfeedclassname=\'精粗各半\', tem.fweight*fu.`dry`*0.5/100,0)) cdry,-- 粗料中的干物质\ntem.fweight*fu.`dry`*fu.`n` n, -- 产奶净能(MJ)\ntem.fweight*fu.`dry`*fu.`cp`*10 cp, -- 粗蛋白(g)\ntem.fweight*fu.`dry`*fu.`ca`*10 ca, -- 钙(g)\ntem.fweight*fu.`dry`*fu.`p`*10 p, -- 磷(g)\ntem.fweight*fu.`dry`*fu.`n`*0.2389 nm, -- 产奶净能(Mcal/DM)\ntem.fweight*fu.`dry`*fu.`fat` fat, -- 脂肪\ntem.fweight*fu.`dry`*fu.`starch` starch, -- 淀粉\n\n\ntem.fweight*fu.`dry`*fu.`ndf` ndf, -- NDF(%DM)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`*fu.`ndf`,0) cndf,-- 粗料中的NDF(%DM)\ntem.fweight*fu.`dry`*fu.`adf` adf, -- ADF(%DM)\ntem.fweight*feed.`uprice` uprice, -- 日粮成本\ntem.fweight*feed.`uprice`/(tem.fweight*fu.`dry`) upriced-- 干物质成本(元/公斤)\n\nFROM \n (SELECT fp.barid,ft.id ftid,ft.`pastureid`,IFNULL(ftd1.`fweight`*ftd.`fweight`/\n (SELECT SUM(fweight) FROM `ftdetail` WHERE ftdetail.`pastureid` = ftd1.`pastureid` AND ftdetail.`ftid` = ftd1.`ftid`),\n ftd.`fweight`)fweight,\n IFNULL(ftd1.`fname`,ftd.fname) fname,\n IFNULL(ftd1.`fid`,ftd.`fid`) fid\n FROM `feedtemplet` ft\n INNER JOIN `feedpdate` fp\n ON ft.`pastureid` = fp.`pastureid` AND ft.`id` = fp.`ftid` and fp.date = ?\n INNER JOIN `ftdetail` ftd\n ON ft.`pastureid` = ftd.`pastureid` AND ft.`id` = ftd.`ftid`\n LEFT JOIN `ftdetail` ftd1\n ON ft.`pastureid` = ftd1.`pastureid` AND ftd1.`ftid` = ftd.`preftid`\n WHERE ft.`pastureid` = ? \n AND fp.barid = ?) tem\nJOIN feed ON feed.`pastureid` = tem.pastureid AND feed.`id` = tem.fid\nJOIN `feednur` fu ON feed.`pastureid` = fu.`pastureid` AND feed.`id`= fu.`fid`\nJOIN `feedclass` fc ON fc.pastureid = feed.`pastureid` AND fc.id = feed.`fclassid`\n) rr\nLEFT JOIN `barmilk` bm\nON bm.`pastureid` = rr.pastureid AND bm.`barid` = rr.barid\n AND bm.`productdate` = (SELECT MAX(productdate) FROM barmilk WHERE `pastureid` = rr.pastureid AND bm.`barid` = rr.barid AND productdate<=?)\n','date,pastureid,barid,date','judgenurFT','GetDataByName','配方评估','tmrgo','{\"name\":\"judgenurFT\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3028015595213292544\",\"product\":\"30\",\"fat\":4}}','{\"code\":0,\"list\":[{\"adf\":\"0.000\",\"ca\":\"0.000\",\"cad\":\"0.000\",\"cdry\":\"0.000\",\"cndf\":\"0.000\",\"cp\":\"0.000\",\"cpd\":\"0.000\",\"dry\":\"0.000\",\"fat\":\"0.000\",\"jcrate\":\"0.000\",\"kprice\":\"0.000\",\"ndf\":\"0.000\",\"nm\":\"0.000\",\"nmd\":\"0.000\",\"nuint\":\"0.000\",\"p\":\"0.000\",\"pd\":\"0.000\",\"starch\":\"0.000\",\"trans35f\":\"0.000\",\"trans4f\":\"0.000\",\"uprice\":\"0.000\",\"upriced\":\"0.000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  442. (1645,335,'\nSELECT \nIFNULL(CAST(SUM(dry)AS DECIMAL(20,3)),0)dry, -- 干物质(kg)\nIFNULL(CAST(SUM(dry)/SUM(cdry) AS DECIMAL(20,3)),0) jcrate, -- 精粗比\nIFNULL(CAST(SUM(cdry)AS DECIMAL(20,3)),0)cdry, -- 粗料中的干物质\nIFNULL(CAST(SUM(n)AS DECIMAL(20,3)),0)nm, -- 产奶净能(MJ)\nIFNULL(CAST(SUM(n)/3.138 AS DECIMAL(20,3)),0) nuint, -- 奶牛能量单位(NND)\nIFNULL(CAST(SUM(cp)AS DECIMAL(20,3)),0)cp, -- 粗蛋白(g)\nIFNULL(CAST(SUM(cp)/sum(dry) AS DECIMAL(20,3)),0)cpd, -- 粗蛋白(%DM)\nIFNULL(CAST(SUM(ca)AS DECIMAL(20,3)),0) ca, -- 钙(g)\nIFNULL(CAST(SUM(p)AS DECIMAL(20,3)),0) p,-- 磷(g)\n\nIFNULL(CAST(SUM(nm)/SUM(dry)AS DECIMAL(20,3)),0) nmd,-- 产奶净能(Mcal/DM)\nIFNULL(CAST(SUM(rr.fat)/SUM(dry)AS DECIMAL(20,3)),0) fat, -- 脂肪\nIFNULL(CAST(SUM(starch)/SUM(dry)AS DECIMAL(20,3)),0) starch,-- 淀粉\nIFNULL(CAST(SUM(ndf)/SUM(dry)AS DECIMAL(20,3)),0) ndf, -- NDF(%DM)\n\nIFNULL(CAST(SUM(cndf)/SUM(dry)AS DECIMAL(20,3)),0) cndf,-- 粗料中的NDF(%DM)\nIFNULL(CAST(SUM(adf)/SUM(dry)AS DECIMAL(20,3)),0) adf, -- ADF(%DM)\nIFNULL(CAST(SUM(ca)/SUM(dry)AS DECIMAL(20,3)),0) cad, -- 钙(%DM)\nIFNULL(CAST(SUM(p)/SUM(dry)AS DECIMAL(20,3)),0) pd,-- 磷(%DM)\nIFNULL(CAST((0.35*IFNULL(bm.`product`,0)+15*IFNULL(bm.`fat`,0)/100*IFNULL(bm.`product`,0))/SUM(dry)AS DECIMAL(20,3)),0) trans4f, -- 4.0转化效率\nIFNULL(CAST((0.35*IFNULL(bm.`product`,0)+18.57*IFNULL(bm.`fat`,0)/100*IFNULL(bm.`product`,0))/SUM(dry)AS DECIMAL(20,3)),0) trans35f,-- 3.5转化效率\nIFNULL(CAST(SUM(uprice)AS DECIMAL(20,3)),0) uprice, -- 日粮成本\nIFNULL(CAST(SUM(upriced)AS DECIMAL(20,3)),0) upriced, -- 干物质成本(元/公斤)\nIFNULL(CAST(SUM(uprice)/IFNULL(bm.`product`,0)AS DECIMAL(20,3)),0) kprice -- 公斤奶成本\n FROM (\nSELECT \ntem.barid,\ntem.ftid,\ntem.pastureid,\ntem.fweight*fu.`dry`/100 dry,-- 干物质(kg)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`/100,IF(fc.bigfeedclassname=\'精粗各半\', tem.fweight*fu.`dry`*0.5/100,0)) cdry,-- 粗料中的干物质\ntem.fweight*fu.`dry`*fu.`n` n, -- 产奶净能(MJ)\ntem.fweight*fu.`dry`*fu.`cp`*10 cp, -- 粗蛋白(g)\ntem.fweight*fu.`dry`*fu.`ca`*10 ca, -- 钙(g)\ntem.fweight*fu.`dry`*fu.`p`*10 p, -- 磷(g)\ntem.fweight*fu.`dry`*fu.`n`*0.2389 nm, -- 产奶净能(Mcal/DM)\n\ntem.fweight*fu.`dry`*fu.`fat` fat, -- 脂肪\ntem.fweight*fu.`dry`*fu.`starch` starch, -- 淀粉\n\n\ntem.fweight*fu.`dry`*fu.`ndf` ndf, -- NDF(%DM)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`*fu.`ndf`,0) cndf,-- 粗料中的NDF(%DM)\ntem.fweight*fu.`dry`*fu.`adf` adf, -- ADF(%DM)\ntem.fweight*feed.`uprice` uprice, -- 日粮成本\ntem.fweight*feed.`uprice`/(tem.fweight*fu.`dry`) upriced-- 干物质成本(元/公斤)\n\nFROM \n (SELECT fp.barid,ft.id ftid,ft.`pastureid`,IFNULL(ftd1.`fweight`*ftd.`fweight`/\n (SELECT SUM(fweight) FROM `ftdetail` WHERE ftdetail.`pastureid` = ftd1.`pastureid` AND ftdetail.`ftid` = ftd1.`ftid`),\n ftd.`fweight`)fweight,\n IFNULL(ftd1.`fname`,ftd.fname) fname,\n IFNULL(ftd1.`fid`,ftd.`fid`) fid\n FROM `feedtemplet` ft\n INNER JOIN `feedpdate` fp\n ON ft.`pastureid` = fp.`pastureid` AND ft.`id` = fp.`ftid` and fp.date = ?\n INNER JOIN `ftdetail` ftd\n ON ft.`pastureid` = ftd.`pastureid` AND ft.`id` = ftd.`ftid`\n LEFT JOIN `ftdetail` ftd1\n ON ft.`pastureid` = ftd1.`pastureid` AND ftd1.`ftid` = ftd.`preftid`\n WHERE ft.`pastureid` = ? \n AND fp.barid = ?) tem\nJOIN feed ON feed.`pastureid` = tem.pastureid AND feed.`id` = tem.fid\nJOIN `feednur` fu ON feed.`pastureid` = fu.`pastureid` AND feed.`id`= fu.`fid`\nJOIN `feedclass` fc ON fc.pastureid = feed.`pastureid` AND fc.id = feed.`fclassid`\n) rr\nLEFT JOIN `barmilk` bm\nON bm.`pastureid` = rr.pastureid AND bm.`barid` = rr.barid\n AND bm.`productdate` = (SELECT MAX(productdate) FROM barmilk WHERE `pastureid` = rr.pastureid AND bm.`barid` = rr.barid AND productdate<?)\n','date,pastureid,barid,date','judgenurBarBm','GetDataByName','配方评估','tmrgo','{\"name\":\"judgenurBarBm\",\"parammaps\":{\"pastureid\":\"1\",\"barid\":\"1\",\"date\":\"2021-01-20\",\"enable\":1}}','{\"code\":0,\"list\":[{\"adf\":\"0.000\",\"ca\":\"0.000\",\"cad\":\"0.000\",\"cdry\":\"0.000\",\"cndf\":\"0.000\",\"cp\":\"0.000\",\"cpd\":\"0.000\",\"dry\":\"0.000\",\"fat\":\"0.000\",\"jcrate\":\"0.000\",\"kprice\":\"0.000\",\"ndf\":\"0.000\",\"nm\":\"0.000\",\"nmd\":\"0.000\",\"nuint\":\"0.000\",\"p\":\"0.000\",\"pd\":\"0.000\",\"starch\":\"0.000\",\"trans35f\":\"0.000\",\"trans4f\":\"0.000\",\"uprice\":\"0.000\",\"upriced\":\"0.000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  443. (1646,335,'SELECT SUM(d1e.`actualweightminus`)*(\nSELECT IFNULL(SUM(d2v.lweight)/SUM(dv.lweight),0) rate\n FROM `downloadplandtl2` d2v\nJOIN `downloadedplan` dv\nON dv.`pastureid` = d2v.`pastureid` AND dv.id = d2v.`pid`\nWHERE dv.mydate = d.mydate AND dv.pastureid = d.pastureid AND d2v.`fbarid`=?\n)/(\nSELECT ccount FROM `feedpdate` WHERE pastureid= d.pastureid AND `date` = d.mydate AND `barid` = ?\n) actualweightminus FROM `downloadplandtl1_exec` d1e\nJOIN `downloadedplan` d\nON d.`pastureid` = d1e.`pastureid` AND d.id = d1e.`pid`\n\nWHERE d.mydate =? AND d.pastureid = ?\nAND d.id IN(\nSELECT dv.id FROM `downloadplandtl2` d2v\nJOIN `downloadedplan` dv\nON dv.`pastureid` = d2v.`pastureid` AND dv.id = d2v.`pid`\nWHERE dv.mydate = d.mydate AND dv.pastureid = d.pastureid AND d2v.`fbarid`=?\n) \n','barid,barid,date,pastureid,barid','judgenurBarHL','GetDataByName','配方评估','tmrgo','{\"name\":\"judgenurBarHL\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3050941006599422976\",\"date\":\"2021-01-20\",\"enable\":1}}','{\"code\":0,\"list\":[{\"actualweightminus\":\"0.000000000000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  444. (1647,335,'SELECT IFNULL(SUM(d2.`actualweightminus`)/(\nSELECT ccount FROM `feedpdate` WHERE pastureid= d.pastureid AND `date` = d.mydate AND `barid` = d2.fbarid\n),0) ac FROM `downloadplandtl2` d2\nJOIN `downloadedplan` d\nON d.`pastureid` = d2.`pastureid` AND d.id = d2.`pid`\nWHERE d.mydate =? AND d.pastureid = ? AND d2.`fbarid`=?','date,pastureid,barid','judgenurBarSL','GetDataByName','配方评估','tmrgo','{\"name\":\"judgenurBarSL\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3050941006599422976\",\"date\":\"2021-01-20\",\"enable\":1}}','{\"code\":0,\"list\":[{\"actualweightminus\":\"0.000000000000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  445. (1648,335,'SELECT tem.ac/tem.ww actualweightminus FROM \n(\nSELECT \n\nIFNULL(SUM((SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` de WHERE de.pastureid = d2.`pastureid` AND de.flpid = d2.`flpid` AND de.type = 0 ))\n* SUM(d2.`actualweightminus`)/SUM((SELECT SUM(actualweightminus) FROM `downloadplandtl2` de WHERE de.pastureid = d2.`pastureid` AND de.flpid = d2.`flpid` AND de.type = 0))\n/(\nSELECT ccountratio FROM `feedpdate` WHERE pastureid= d2.pastureid AND `date` = d2.date AND `barid` = d2.fbarid\n),0) ac ,\n\n(SELECT SUM(fweight) FROM `ftdetaildate` WHERE pastureid = d2.pastureid AND ftid =\n(SELECT tempid FROM `downloadedplan` WHERE pastureid = d2.pastureid AND id = d2.pid) AND `date` =d2.date) ww\n\nFROM `downloadplandtl2` d2\n\nWHERE d2.date =? AND d2.pastureid = ? AND d2.`fbarid`=?) tem\n\n\nUNION ALL\n\nSELECT tem.ac/tem.ww actualweightminus FROM \n(\nSELECT \nIFNULL(SUM(d2.`actualweightminus`)/(\nSELECT ccountratio FROM `feedpdate` WHERE pastureid= d2.pastureid AND `date` = d2.date AND `barid` = d2.fbarid\n),0) ac ,\n(SELECT SUM(fweight) FROM `ftdetaildate` WHERE pastureid = d2.pastureid AND ftid =\n(SELECT tempid FROM `downloadedplan` WHERE pastureid = d2.pastureid AND id = d2.pid) AND `date` =d2.date) ww\n\nFROM `downloadplandtl2` d2\n\nWHERE d2.date =? AND d2.pastureid = ? AND d2.`fbarid`=? AND d2.`type` = 0\n) tem\n\n','date,pastureid,barid,date,pastureid,barid','judgenurBarHSL','GetDataByName','配方评估混料撒料','tmrgo','{\"name\":\"judgenurBarHSL\",\"parammaps\":{\"pastureid\":\"1\",\"barid\":\"1\",\"date\":\"2021-01-20\",\"enable\":1}}','{\"code\":0,\"list\":[{},{}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  446. (1649,31,'select count(*) from feed where id = ?','id','gettestlistV2','GetRJSBData','用户修改密码','tmrgo','{\n \"name\":\"getRLSB\",\n \"name1\":\"getRLSBdetail\",\n \"plancount\":1,\n \"parammaps\":{\n \"imei\":\"122\"\n }\n}\n','{\"code\":0,\"list\":[{\"count(*)\":\"3\"}],\"message\":\"ok\",\"pageNum\":1,\"pageSize\":5,\"pages\":1,\"total\":1}',0,1,0,0,0),
  447. (1650,31,'SELECT 0.95 actualweightminus\nUNION ALL \nSELECT 0.96','','gettestlistV2V2','PostRJSBData','用户修改密码','tmrgo','{\n \"name\":\"updatePlan\",\n \"parammaps\":{\n \"pastureid\":\"3264108097970897920\",\n \"completed\":\"0\",\n \"started\":\"1\",\n \"projuctid\":\"584488\",\n \"weight\":\"100\",\n \"begintime\":\"2020-04-26 08:09:19\",\n \"endtime\":\"2020-04-26 08:09:19\",\n \"beginweight\":\"233\",\n \"endweight\":\"333\",\n \"empcode\":\"00021\",\n \"empname\":\"张三\",\n \"ID\":\"4943340\",\n \"Inorout\":\"0\",\n \"begintimeD\":\"2020-04-26 08:10:19\",\n \"endtimeD\":\"2020-04-26 08:11:19\"\n }\n}\n\n','\"ok\"',0,1,0,0,0),
  448. (1651,404,'\nSELECT \n@product:=(SELECT SUM(product) product FROM \n`feedpdate` fp \nLEFT JOIN `barmilk` bm\nON bm.`pastureid` = fp.pastureid AND bm.`barid` = fp.barid\n AND bm.`productdate` = (SELECT MAX(productdate) FROM barmilk WHERE `pastureid` = fp.pastureid AND bm.`barid` = fp.barid AND productdate<?)\n WHERE fp.`pastureid` = rr.pastureid AND fp.`ftid` = rr.ftid AND fp.`date` = ?) pp,\n @fat:=(SELECT AVG(fat) product FROM \n`feedpdate` fp \nLEFT JOIN `barmilk` bm\nON bm.`pastureid` = fp.pastureid AND bm.`barid` = fp.barid\n AND bm.`productdate` = (SELECT MAX(productdate) FROM barmilk WHERE `pastureid` = fp.pastureid AND bm.`barid` = fp.barid AND productdate<?)\n WHERE fp.`pastureid` = rr.pastureid AND fp.`ftid` = rr.ftid AND fp.`date` = ?) ff,\nTRIM(rr.ftid) ftid,\nrr.tname,\nTRIM(rr.pastureid) pastureid,\nIFNULL((\nSELECT SUM(ccount) FROM`feedpdate` WHERE DATE BETWEEN ? AND ? AND pastureid = rr.pastureid AND ftid = rr.`ftid`\n),0)ccount,\n\nIFNULL((\n\nSELECT \nIFNULL(SUM((SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` de WHERE de.pastureid = d2.`pastureid` AND de.flpid = d2.`flpid` AND de.type = 0 ))\n* SUM(d2.`actualweightminus`)/SUM((SELECT SUM(actualweightminus) FROM `downloadplandtl2` de WHERE de.pastureid = d2.`pastureid` AND de.flpid = d2.`flpid` AND de.type = 0))\n/(\nSELECT SUM(ccountratio) FROM`feedpdate` WHERE DATE BETWEEN ? AND ? AND pastureid = rr.pastureid AND ftid = rr.`ftid`\n),0) ac \nFROM `downloadplandtl2` d2\n\nWHERE d2.date BETWEEN ? AND ? AND d2.pastureid =rr.pastureid AND (SELECT tempid FROM `downloadedplan` WHERE pastureid = d2.pastureid AND id = d2.pid) =rr.ftid AND d2.type = 0\n\n)/(SELECT SUM(fweight) FROM `ftdetail` WHERE pastureid = rr.pastureid AND ftid =rr.ftid)\n,0)Hrate,\n\nIFNULL((\nSELECT \nIFNULL(SUM(d2.`actualweightminus`)/(\nSELECT SUM(ccountratio) FROM`feedpdate` WHERE DATE BETWEEN ? AND ? AND pastureid = rr.pastureid AND ftid = rr.`ftid`\n),0) ac \nFROM `downloadplandtl2` d2\n\nWHERE d2.date BETWEEN ? AND ? AND d2.pastureid =rr.pastureid AND (SELECT tempid FROM `downloadedplan` WHERE pastureid = d2.pastureid AND id = d2.pid) = rr.ftid AND d2.`type` = 0\n)/(SELECT SUM(fweight) FROM `ftdetail` WHERE pastureid = rr.pastureid AND ftid =rr.ftid ),0)Srate,\n\nIFNULL(CAST(SUM(dry)AS DECIMAL(20,3)),0)dry, -- 干物质(kg)\nIFNULL(CAST(SUM(dry)/SUM(cdry) AS DECIMAL(20,3)),0) jcrate, -- 精粗比\nIFNULL(CAST(SUM(cdry)AS DECIMAL(20,3)),0)cdry, -- 粗料中的干物质\nIFNULL(CAST(SUM(n)/100 AS DECIMAL(20,3)),0)nm, -- 产奶净能(MJ)\nIFNULL(CAST(SUM(n)/3.138/100 AS DECIMAL(20,3)),0) nuint, -- 奶牛能量单位(NND)\nIFNULL(CAST(SUM(cp)/100 AS DECIMAL(20,3)),0)cp, -- 粗蛋白(g)\nIFNULL(CAST(SUM(cp)/SUM(dry)/1000 AS DECIMAL(20,3)),0)cpd, -- 粗蛋白(%DM)\nIFNULL(CAST(SUM(ca)/100 AS DECIMAL(20,3)),0) ca, -- 钙(g)\nIFNULL(CAST(SUM(p)/100 AS DECIMAL(20,3)),0) p,-- 磷(g)\n\nIFNULL(CAST(SUM(nm)/SUM(dry)/100 AS DECIMAL(20,3)),0) nmd,-- 产奶净能(Mcal/DM)\nIFNULL(CAST(SUM(rr.fat)/SUM(dry)/100 AS DECIMAL(20,3)),0) fat, -- 脂肪\nIFNULL(CAST(SUM(starch)/SUM(dry)/100 AS DECIMAL(20,3)),0) starch,-- 淀粉\nIFNULL(CAST(SUM(ndf)/SUM(dry)/100 AS DECIMAL(20,3)),0) ndf, -- NDF(%DM)\n\nIFNULL(CAST(SUM(cndf)/SUM(dry)/100 AS DECIMAL(20,3)),0) cndf,-- 粗料中的NDF(%DM)\nIFNULL(CAST(SUM(adf)/SUM(dry)/100 AS DECIMAL(20,3)),0) adf, -- ADF(%DM)\nIFNULL(CAST(SUM(ca)/SUM(dry)/1000 AS DECIMAL(20,3)),0) cad, -- 钙(%DM)\nIFNULL(CAST(SUM(p)/SUM(dry)/1000 AS DECIMAL(20,3)),0) pd,-- 磷(%DM)\nIFNULL(CAST(SUM(uprice)AS DECIMAL(20,3)),0) uprice, -- 日粮成本\n\n\n\n\nIFNULL(CAST((0.35*IFNULL(@product,0)+15*IFNULL(@fat,0)/100*IFNULL(@product,0))/SUM(dry) AS DECIMAL(20,3)),0) trans4f, -- 4.0转化效率\nIFNULL(CAST((0.35*IFNULL(@product,0)+18.57*IFNULL(@fat,0)/100*IFNULL(@product,0))/SUM(dry) AS DECIMAL(20,3)),0) trans35f,-- 3.5转化效率\nIFNULL(CAST(SUM(uprice)/IFNULL(@product,0)AS DECIMAL(20,3)),0) kprice -- 公斤奶成本\n\n FROM (\nSELECT \ntem.tname,\ntem.ftid,\ntem.pastureid,\ntem.fweight*fu.`dry`/100 dry,-- 干物质(kg)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`/100,IF(fc.bigfeedclassname=\'精粗各半\', tem.fweight*fu.`dry`*0.5/100,0)) cdry,-- 粗料中的干物质\ntem.fweight*fu.`dry`*fu.`n` n, -- 产奶净能(MJ)\ntem.fweight*fu.`dry`*fu.`cp`*10 cp, -- 粗蛋白(g)\ntem.fweight*fu.`dry`*fu.`ca`*10 ca, -- 钙(g)\ntem.fweight*fu.`dry`*fu.`p`*10 p, -- 磷(g)\ntem.fweight*fu.`dry`*fu.`n`*0.2389 nm, -- 产奶净能(Mcal/DM)\ntem.fweight*fu.`dry`*fu.`fat` fat, -- 脂肪\ntem.fweight*fu.`dry`*fu.`starch` starch, -- 淀粉\n\n\ntem.fweight*fu.`dry`*fu.`ndf` ndf, -- NDF(%DM)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`*fu.`ndf`,0) cndf,-- 粗料中的NDF(%DM)\ntem.fweight*fu.`dry`*fu.`adf` adf, -- ADF(%DM)\ntem.fweight*feed.`uprice` uprice, -- 日粮成本\ntem.fweight*feed.`uprice`/(tem.fweight*fu.`dry`) upriced-- 干物质成本(元/公斤)\nFROM \n (SELECT ft.id ftid,ft.`pastureid`,ft.tname,\n IFNULL(ftd1.`fweight`*ftd.`fweight`/\n (SELECT SUM(fweight) FROM `ftdetail` WHERE ftdetail.`pastureid` = ftd1.`pastureid` AND ftdetail.`ftid` = ftd1.`ftid`),\n ftd.`fweight`)fweight,\n IFNULL(ftd1.`fname`,ftd.fname) fname,\n IFNULL(ftd1.`fid`,ftd.`fid`) fid\n FROM `feedtemplet` ft\n INNER JOIN `downloadedplan` d\n ON ft.`pastureid` = d.`pastureid` AND ft.`id` = d.`tempid` AND d.`mydate` BETWEEN ? AND ?\n INNER JOIN `ftdetail` ftd\n ON ft.`pastureid` = ftd.`pastureid` AND ft.`id` = ftd.`ftid`\n LEFT JOIN `ftdetail` ftd1\n ON ft.`pastureid` = ftd1.`pastureid` AND ftd1.`ftid` = ftd.`preftid`\n WHERE ft.`pastureid` = ?\n GROUP BY d.`tempid`,ftd1.id,ftd.id\n ) tem\nJOIN feed ON feed.`pastureid` = tem.pastureid AND feed.`id` = tem.fid\nJOIN `feednur` fu ON feed.`pastureid` = fu.`pastureid` AND feed.`id`= fu.`fid`\nJOIN `feedclass` fc ON fc.pastureid = feed.`pastureid` AND fc.id = feed.`fclassid`\n) rr\n\nGROUP BY rr.ftid\n','stopTime,stopTime,stopTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,pastureid','judgenurFTReport','GetReportform','配方评估列表','tmrgo','{\"name\":\"judgenurFT\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"startTime\":\"2021-04-16\",\"stopTime\":\"2021-04-16\",\"fat\":4}}','{\"code\":0,\"list\":[{\"adf\":\"0.000\",\"ca\":\"0.000\",\"cad\":\"0.000\",\"cdry\":\"0.000\",\"cndf\":\"0.000\",\"cp\":\"0.000\",\"cpd\":\"0.000\",\"dry\":\"0.000\",\"fat\":\"0.000\",\"jcrate\":\"0.000\",\"kprice\":\"0.000\",\"ndf\":\"0.000\",\"nm\":\"0.000\",\"nmd\":\"0.000\",\"nuint\":\"0.000\",\"p\":\"0.000\",\"pd\":\"0.000\",\"starch\":\"0.000\",\"trans35f\":\"0.000\",\"trans4f\":\"0.000\",\"uprice\":\"0.000\",\"upriced\":\"0.000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  449. (1652,404,'\nSELECT \nbm.cowsum,\nbm.cowsum ccount,\nIFNULL(CAST(SUM(dry)AS DECIMAL(20,3)),0)dry, -- 干物质(kg)\nIFNULL(CAST(SUM(dry)/SUM(cdry) AS DECIMAL(20,3)),0) jcrate, -- 精粗比\nIFNULL(CAST(SUM(cdry)AS DECIMAL(20,3)),0)cdry, -- 粗料中的干物质\nIFNULL(CAST(SUM(n)/200 AS DECIMAL(20,3)),0)nm, -- 产奶净能(MJ)\nIFNULL(CAST(SUM(n)/3.138/100 AS DECIMAL(20,3)),0) nuint, -- 奶牛能量单位(NND)\nIFNULL(CAST(SUM(cp)/100 AS DECIMAL(20,3)),0)cp, -- 粗蛋白(g)\nIFNULL(CAST(SUM(cp)/sum(dry)/1000 AS DECIMAL(20,3)),0)cpd, -- 粗蛋白(%DM)\nIFNULL(CAST(SUM(ca)/100 AS DECIMAL(20,3)),0) ca, -- 钙(g)\nIFNULL(CAST(SUM(p)/100 AS DECIMAL(20,3)),0) p,-- 磷(g)\n\nIFNULL(CAST(SUM(nm)/SUM(dry)/100 AS DECIMAL(20,3)),0) nmd,-- 产奶净能(Mcal/DM)\nIFNULL(CAST(SUM(rr.fat)/SUM(dry)/100 AS DECIMAL(20,3)),0) fat, -- 脂肪\nIFNULL(CAST(SUM(starch)/SUM(dry)/100 AS DECIMAL(20,3)),0) starch,-- 淀粉\nIFNULL(CAST(SUM(ndf)/SUM(dry)/100 AS DECIMAL(20,3)),0) ndf, -- NDF(%DM)\n\nIFNULL(CAST(SUM(cndf)/SUM(dry)/100 AS DECIMAL(20,3)),0) cndf,-- 粗料中的NDF(%DM)\nIFNULL(CAST(SUM(adf)/SUM(dry)/100 AS DECIMAL(20,3)),0) adf, -- ADF(%DM)\nIFNULL(CAST(SUM(ca)/SUM(dry)/1000 AS DECIMAL(20,3)),0) cad, -- 钙(%DM)\nIFNULL(CAST(SUM(p)/SUM(dry)/1000 AS DECIMAL(20,3)),0) pd,-- 磷(%DM)\nIFNULL(CAST((0.35*IFNULL(bm.`product`,0)+15*IFNULL(bm.`fat`,0)/100*IFNULL(bm.`product`,0))/SUM(dry) AS DECIMAL(20,3)),0) trans4f, -- 4.0转化效率\nIFNULL(CAST((0.35*IFNULL(bm.`product`,0)+18.57*IFNULL(bm.`fat`,0)/100*IFNULL(bm.`product`,0))/SUM(dry) AS DECIMAL(20,3)),0) trans35f,-- 3.5转化效率\nIFNULL(CAST(SUM(uprice)AS DECIMAL(20,3)),0) uprice, -- 日粮成本\nIFNULL(CAST(SUM(uprice)/SUM(dry) AS DECIMAL(20,3)),0) upriced, -- 干物质成本(元/公斤)\nIFNULL(CAST(SUM(uprice)/IFNULL(bm.`product`,0)AS DECIMAL(20,3)),0) kprice -- 公斤奶成本\n FROM (\nSELECT \ntem.barid,\ntem.ftid,\ntem.pastureid,\ntem.fweight*fu.`dry`/100 dry,-- 干物质(kg)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`/100,IF(fc.bigfeedclassname=\'精粗各半\', tem.fweight*fu.`dry`*0.5/100,0)) cdry,-- 粗料中的干物质\ntem.fweight*fu.`dry`*fu.`n` n, -- 产奶净能(MJ)\ntem.fweight*fu.`dry`*fu.`cp`*10 cp, -- 粗蛋白(g)\ntem.fweight*fu.`dry`*fu.`ca`*10 ca, -- 钙(g)\ntem.fweight*fu.`dry`*fu.`p`*10 p, -- 磷(g)\ntem.fweight*fu.`dry`*fu.`n`*0.2389 nm, -- 产奶净能(Mcal/DM)\ntem.fweight*fu.`dry`*fu.`fat` fat, -- 脂肪\ntem.fweight*fu.`dry`*fu.`starch` starch, -- 淀粉\n\n\ntem.fweight*fu.`dry`*fu.`ndf` ndf, -- NDF(%DM)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`*fu.`ndf`,0) cndf,-- 粗料中的NDF(%DM)\ntem.fweight*fu.`dry`*fu.`adf` adf, -- ADF(%DM)\ntem.fweight*feed.`uprice` uprice, -- 日粮成本\ntem.fweight*feed.`uprice`/(tem.fweight*fu.`dry`) upriced-- 干物质成本(元/公斤)\n\nFROM \n (SELECT fp.barid,ft.id ftid,ft.`pastureid`,IFNULL(ftd1.`fweight`*ftd.`fweight`/\n (SELECT SUM(fweight) FROM `ftdetail` WHERE ftdetail.`pastureid` = ftd1.`pastureid` AND ftdetail.`ftid` = ftd1.`ftid`),\n ftd.`fweight`)fweight,\n IFNULL(ftd1.`fname`,ftd.fname) fname,\n IFNULL(ftd1.`fid`,ftd.`fid`) fid\n FROM `feedtemplet` ft\n INNER JOIN `feedpdate` fp\n ON ft.`pastureid` = fp.`pastureid` AND ft.`id` = fp.`ftid` and fp.date = ?\n INNER JOIN `ftdetail` ftd\n ON ft.`pastureid` = ftd.`pastureid` AND ft.`id` = ftd.`ftid`\n LEFT JOIN `ftdetail` ftd1\n ON ft.`pastureid` = ftd1.`pastureid` AND ftd1.`ftid` = ftd.`preftid`\n WHERE ft.`pastureid` = ? \n AND fp.barid = ?) tem\nJOIN feed ON feed.`pastureid` = tem.pastureid AND feed.`id` = tem.fid\nJOIN `feednur` fu ON feed.`pastureid` = fu.`pastureid` AND feed.`id`= fu.`fid`\nJOIN `feedclass` fc ON fc.pastureid = feed.`pastureid` AND fc.id = feed.`fclassid`\n) rr\nLEFT JOIN `barmilk` bm\nON bm.`pastureid` = rr.pastureid AND bm.`barid` = rr.barid\n AND bm.`productdate` = (SELECT MAX(productdate) FROM barmilk WHERE `pastureid` = rr.pastureid AND bm.`barid` = rr.barid AND productdate<?)\n','date,pastureid,barid,date','judgenurBarBmReport','GetDataByName','配方评估','tmrgo','{\"name\":\"judgenurBarBm\",\"parammaps\":{\"pastureid\":\"1\",\"barid\":\"1\",\"date\":\"2021-01-20\",\"enable\":1}}','{\"code\":0,\"list\":[{\"adf\":\"0.000\",\"ca\":\"0.000\",\"cad\":\"0.000\",\"cdry\":\"0.000\",\"cndf\":\"0.000\",\"cp\":\"0.000\",\"cpd\":\"0.000\",\"dry\":\"0.000\",\"fat\":\"0.000\",\"jcrate\":\"0.000\",\"kprice\":\"0.000\",\"n\":\"0.000\",\"ndf\":\"0.000\",\"nm\":\"0.000\",\"nuint\":\"0.000\",\"p\":\"0.000\",\"pd\":\"0.000\",\"starch\":\"0.000\",\"trans35f\":\"0.000\",\"trans4f\":\"0.000\",\"uprice\":\"0.000\",\"upriced\":\"0.000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  450. (1654,404,'select * from (SELECT\n(SELECT cc.`parentname` FROM `cowclass` cc WHERE cc.pastureid = bm.`pastureid` AND cc.id = bm.`cowclassid`) `bigcowclass`,\n TRIM(pastureid)pastureid,\nTRIM(barid) barid,barname,productdate,product,avgmonthage,bw,dayw,fetal,avgdim,dayspre,fat,pro,lactose,source,tem,cowsum,cowclass,\nTRIM(cowclassid) cowclassid,emp \n\n FROM `barmilk` bm WHERE pastureid = ? AND barid = ? AND `productdate` <= ? ORDER BY productdate LIMIT 1) ww','pastureid,barid,date','getbmdetaillist','GETNurJudgeRport','获取栏舍生产性能','tmrgo','{\"name\":\"judgenurFT\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2021-01-21\",\"startTime\":\"2021-01-21\",\"stopTime\":\"2021-01-21\",\"barid\":\"3027996177498375166\"}}','null',0,1,0,0,0),
  451. (1655,404,'SELECT\ntname,tcolor,ccid,ccname,fttype, remark,`enable`,\nTRIM(id) id,DATE_FORMAT(savetime,\'%H:%i:%s\') versiontime,\nTRIM(pastureid)pastureid,date,concat(\'V\',version) version,source\nFROM\n feedtempletdate\nWHERE pastureid = ? and id =? AND ( if(?=\'\',date= (select max(date) from feedtempletdate where pastureid=?),date= ?))\n\nORDER BY id DESC','pastureid,id,date,pastureid,date','getFTListDateHis','GetDataByName','配方模板列表历史记录','tmrgo','{\"name\":\"getFTList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"预混配方\",\"id\":\"8874176271438480590\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方2\"},{\"ccid\":1,\"enable\":1,\"fttype\":\"饲喂配方\",\"id\":\"8874176271438480589\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  452. (1656,399,'SELECT \n(\nSELECT CASE \nWHEN \n(SELECT COUNT(*) FROM `user` WHERE `username` = ? )>0\nTHEN CONCAT(\'该用户已存在\')\n\nELSE \'\' END AS vmsg \n) vmsg','user','checkuser','GetDataByName','用户新增校验','tmrgo','{\"name\":\"checkuser\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3073106826209264640\",\"lweight\":\"0.17\",\"fpdid\":\"3048556331721556992\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"该预混配方被其他配方使用,无法删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  453. (1657,399,'CALL createNewPasture(?,?,?)','pastureid,user,type','createNewPasture','createNewPasture','用户新增校验','tmrgo','{\"name\":\"checkdeleteFT\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3073106826209264640\",\"lweight\":\"0.17\",\"fpdid\":\"3048556331721556992\"}}','{\"code\":0,\"list\":[{\"vmsg\":\"该预混配方被其他配方使用,无法删除\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  454. (1658,405,'SELECT\ntname,tcolor,ccid,ccname,fttype, remark,`enable`,source,fttypeid,\nTRIM(id) id,\nTRIM(pastureid)pastureid,\nisissue,\n(SELECT GROUP_CONCAT( DISTINCT fp.`pastureName`) FROM feedtemplet_pasture fp\n WHERE fp.ftid=ft.`id` AND fp.pastureid =ft.pastureid ) grouppastures\nFROM\n feedtemplet ft\nWHERE pastureid = ? \nORDER BY id DESC','pastureid','getFTListXF','GetDataByName','配方下发列表','tmrgo','{\"name\":\"getFTListXF\",\"parammaps\":{\"pastureid\":\"1\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1054: Unknown column \'fp.groupsid\' in \'where clause\'\"',0,1,0,0,0),
  455. (1659,405,'SELECT pasturename,DATE_FORMAT(DATE,\'%Y-%m-%d %H:%i:%s\') date FROM feedtemplet_pasture fp\n WHERE fp.ftid=? AND fp.pastureid=?\n AND ( pasturename LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nORDER BY date DESC','ftid,pastureid,pasturename,pasturename ','getFTListXFhis','GetDataByName','下发记录列表','tmrgo','{\"name\":\"getFTListXF\",\"parammaps\":{\"pastureid\":\"1\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"饲喂配方\",\"fttypeid\":1,\"id\":\"3248345863642678272\",\"isissue\":0,\"pastureid\":\"1\",\"remark\":\"22\",\"source\":\"自定义\",\"tcolor\":\"#2C2424\",\"tname\":\"下发测试2\"},{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"饲喂配方\",\"fttypeid\":1,\"id\":\"3248326220693636096\",\"isissue\":0,\"pastureid\":\"1\",\"remark\":\"\",\"source\":\"自定义\",\"tcolor\":\"#ccc\",\"tname\":\"下发测试\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  456. (1660,405,' SELECT\ntrim(p.pastureid) id,\npasture_name pasturename\n\n FROM pasture p\n WHERE p.`groupsid` = ? and enable = 1','pastureid','getgroupsPasture','GetDataByName','牧场列表','tmrgo','{\"name\":\"getgroupsPasture\",\"parammaps\":{\"pastureid\":\"1\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":\"3025176271438480383\",\"pasturename\":\"宝鸡\"},{\"id\":\"3239457662261789696\",\"pasturename\":\"22\"},{\"id\":\"3239458563449947136\",\"pasturename\":\"33\"},{\"id\":\"3239460123043169280\",\"pasturename\":\"222\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":4}',0,1,0,0,0),
  457. (1661,405,'INSERT INTO `feedtemplet_issue`(id,pastureid,tcode,tname,tcolor,ccid,ccname,fttype,fttypeid,source,remark,sort,OWNER,weight,dryweight,date,version)\nSELECT id,pastureid,tcode,tname,tcolor,ccid,ccname,fttype,fttypeid,source,remark,sort,OWNER,weight,dryweight,now(),version\nFROM feedtemplet WHERE pastureid = ? AND id = ?','pastureid,ftid','insertfeedtemplet_issue','GetDataByName','插入配方下发记录主表','tmrgo','{\"name\":\"getgroupsPasture\",\"parammaps\":{\"pastureid\":\"1\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":\"3025176271438480383\",\"pasturename\":\"宝鸡\"},{\"id\":\"3239457662261789696\",\"pasturename\":\"22\"},{\"id\":\"3239458563449947136\",\"pasturename\":\"33\"},{\"id\":\"3239460123043169280\",\"pasturename\":\"222\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":4}',0,1,0,0,0),
  458. (1662,405,'INSERT INTO `ftdetail_issue`(id,pastureid,ftid,fid,fname,lweight,fweight,islockcount,isfg,sort,feedgroup,preftid,autosecond,autosecondname,splitftpreid,DATE)\nSELECT id,pastureid,ftid,fid,fname,lweight,fweight,islockcount,isfg,sort,feedgroup,preftid,autosecond,autosecondname,splitftpreid,\n(SELECT MAX(DATE) FROM feedtemplet_issue WHERE pastureid = ftdetail .`pastureid`)\nFROM `ftdetail` WHERE pastureid = ? AND ftid = ?','pastureid,ftid','insertftdetail_issue','GetDataByName','插入配方下发记录子表','tmrgo','{\"name\":\"getgroupsPasture\",\"parammaps\":{\"pastureid\":\"1\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":\"3025176271438480383\",\"pasturename\":\"宝鸡\"},{\"id\":\"3239457662261789696\",\"pasturename\":\"22\"},{\"id\":\"3239458563449947136\",\"pasturename\":\"33\"},{\"id\":\"3239460123043169280\",\"pasturename\":\"222\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":4}',0,1,0,0,0),
  459. (1663,405,'DELETE ft,ftd FROM `feedtemplet` ft \nINNER JOIN `ftdetail` ftd\nON ft.`pastureid` = ftd.`pastureid` AND ft.id = ftd.`ftid`\n\nWHERE ft.pastureid=? AND ft.id in (SELECT id FROM `feedtemplet_issue` fi WHERE fi.pastureid = ?\nAND DATE = (SELECT MAX(DATE) FROM feedtemplet_issue WHERE pastureid = fi.`pastureid`))','pastureid,groupsid','deleteFTissue','PostDataByName','删除配方模板-下发','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  460. (1664,405,'INSERT INTO `feedtemplet`(id,pastureid,tcode,tname,tcolor,ccid,ccname,fttype,fttypeid,source,remark,sort,OWNER,weight,dryweight,version)\nSELECT id,?,tcode,tname,tcolor,ccid,ccname,fttype,fttypeid,\'集团下发\',remark,sort,OWNER,weight,dryweight,version\nFROM feedtemplet WHERE pastureid = ? AND id IN (SELECT id FROM `feedtemplet_issue` fi WHERE fi.pastureid = ?\nAND DATE = (SELECT MAX(DATE) FROM feedtemplet_issue WHERE pastureid = fi.`pastureid`)\n)\n','pastureid,groupsid,groupsid','insertfeedtempletISS','GetDataByName','插入牧场配方主表','tmrgo','{\"name\":\"getgroupsPasture\",\"parammaps\":{\"pastureid\":\"1\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":\"3025176271438480383\",\"pasturename\":\"宝鸡\"},{\"id\":\"3239457662261789696\",\"pasturename\":\"22\"},{\"id\":\"3239458563449947136\",\"pasturename\":\"33\"},{\"id\":\"3239460123043169280\",\"pasturename\":\"222\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":4}',0,1,0,0,0),
  461. (1665,405,'INSERT INTO `ftdetail`(id,pastureid,ftid,fid,fname,lweight,fweight,islockcount,isfg,sort,feedgroup,preftid,autosecond,autosecondname,splitftpreid)\nSELECT id,?,ftid,fid,fname,lweight,fweight,islockcount,isfg,sort,feedgroup,preftid,autosecond,autosecondname,splitftpreid\nFROM ftdetail WHERE pastureid = ? AND ftid IN (SELECT id FROM `feedtemplet_issue` fi WHERE fi.pastureid = ?\nAND DATE = (SELECT MAX(DATE) FROM feedtemplet_issue WHERE pastureid = fi.`pastureid`)\n)\n','pastureid,groupsid,groupsid','insertftdetailISS','GetDataByName','插入牧场配方子表','tmrgo','{\"name\":\"getgroupsPasture\",\"parammaps\":{\"pastureid\":\"1\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":\"3025176271438480383\",\"pasturename\":\"宝鸡\"},{\"id\":\"3239457662261789696\",\"pasturename\":\"22\"},{\"id\":\"3239458563449947136\",\"pasturename\":\"33\"},{\"id\":\"3239460123043169280\",\"pasturename\":\"222\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":4}',0,1,0,0,0),
  462. (1666,405,'INSERT INTO feedtemplet_pasture(`ftid`,`pastureid`,`pasturename`,`issuepid`,date)\nSELECT id,?,?,?,(SELECT MAX(DATE) FROM feedtemplet_issue WHERE pastureid = fi.`pastureid`) \nFROM `feedtemplet_issue` fi WHERE fi.pastureid = ? \nAND DATE = (SELECT MAX(DATE) FROM feedtemplet_issue WHERE pastureid = fi.`pastureid`)','groupsid,pasturename,pastureid,groupsid','insertfeedtemplet_pastureISS','GetDataByName','插入下发记录','tmrgo','{\"name\":\"getgroupsPasture\",\"parammaps\":{\"pastureid\":\"1\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":\"3025176271438480383\",\"pasturename\":\"宝鸡\"},{\"id\":\"3239457662261789696\",\"pasturename\":\"22\"},{\"id\":\"3239458563449947136\",\"pasturename\":\"33\"},{\"id\":\"3239460123043169280\",\"pasturename\":\"222\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":4}',0,1,0,0,0),
  463. (1667,405,'SELECT ft.`tname`,DATE_FORMAT(ft.date,\'%Y-%m-%d %H:%i\')datestr,ft.date,TRIM(fp.`issuepid`)pastureid,fp.pasturename,TRIM(IFNULL(f.id,fp.ftid))ftid,ft.`version`, fp.`issuepid` p,TRIM(ft.`pastureid` ) groupid\nFROM `feedtemplet_issue` ft\nJOIN `feedtemplet_pasture` fp\nON fp.`pastureid`= ft.`pastureid` AND ft.`id` = fp.`ftid` AND ft.`date` =fp.`date` \nLEFT JOIN `feedtemplet` f\nON f.pastureid = fp.`issuepid` AND f.issueid = fp.ftid AND f.issueversion = ft.version\nWHERE ft.`pastureid` =?\nAND ft.date = ? and ft.id= ?\n\nUNION ALL \n\nSELECT ft.`tname`,DATE_FORMAT(ft.date,\'%Y-%m-%d %H:%i\')datestr,ft.date,ft.`pastureid`,p.`pasture_name`,ft.id,ft.`version`,0,TRIM(ft.`pastureid` ) groupid\nFROM `feedtemplet_issue` ft\nJOIN pasture p ON p.pastureid= ft.`pastureid`\nWHERE ft.`pastureid` =?\nAND ft.date = ? and ft.id= ?\n\nORDER BY DATE DESC,p\n','pastureid,date,ftid,pastureid,date,ftid ','getFTusageList','GetArrList','使用情况主表','tmrgo','{\"name\":\"getFTusageList\",\"name1\":\"getFTdusageList\",\"parammaps\":{\"pastureid\":\"1\",\"date\":\"2021-01-26 11:52:51\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"arrList\":[{\"concatname\":\"玉米(20.00)\",\"fname\":\"玉米\",\"fweight\":\"20.00\",\"id\":\"3248329252185572352\",\"sort\":\"2\"}],\"date\":\"2021-01-26T11:52:51+08:00\",\"ftid\":\"3248326220693636096\",\"p\":0,\"pastureid\":\"1\",\"pasturename\":\"现代牧业\",\"tname\":\"下发测试\",\"version\":0},{\"arrList\":[{\"concatname\":\"玉米(20.00)\",\"fname\":\"玉米\",\"fweight\":\"20.00\",\"id\":\"3248329252185572352\",\"sort\":\"2\"}],\"date\":\"2021-01-26T11:52:51+08:00\",\"ftid\":\"3248326220693636096\",\"p\":1,\"pastureid\":\"1\",\"pasturename\":\"问问\",\"tname\":\"下发测试\",\"version\":0}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  464. (1668,405,'SELECT `id`,`fname`,`fweight`,`sort`, CONCAT(\'(\',fweight,\')\',fname) concatname,sort sort1 , fweight nowweight FROM ftdetail_issue fi\nWHERE fi.pastureid = ? AND fi.ftid = ? AND fi.date = ?\nAND ?=0\nUNION ALL \n# nowweight 与fweight 相等为未修改,-1是删除\nSELECT `id`,`fname`,`fweight`,`sort`, CONCAT(\'(\',fweight,\')\',fname) concatname,sort,\nIFNULL((SELECT `fweight` FROM ftdetail_issue fi WHERE fi.pastureid = ? AND fi.ftid = ftd.ftid AND fi.date = ? AND fi.`fid` = ftd.fid ),-1) nowweight\nFROM `ftdetail` ftd\nWHERE ftd.pastureid = ? AND ftd.ftid = ? \nAND ?<>0\nORDER BY sort1','pastureid,ftid,date,p,groupid,date,pastureid,ftid,p','getFTdusageList','GetDataByName','使用情况子表','tmrgo','{\"name\":\"getFTdusageList\",\"parammaps\":{\"pastureid\":\"1\",\"date\":\"2021-01-26 11:52:51\",\"ftid\":\"3248326220693636096\",\"p\":\"0\"}} ','{\"code\":0,\"list\":[{\"concatname\":\"(20.00)玉米\",\"fname\":\"玉米\",\"fweight\":\"20.00\",\"id\":3248329252185572400,\"nowweight\":\"20.00\",\"sort\":2,\"sort1\":2}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  465. (1669,405,'DELETE f,fn FROM feed f\nLEFT JOIN feednur fn\nON fn.`pastureid` = f.`pastureid` AND fn.`fid` = f.`id`\nWHERE f.`pastureid` =? AND f.`id` IN(SELECT id FROM (SELECT id FROM feed WHERE pastureid =?) tem)','pastureid,groupsid','deleteFeedissue','PostDataByName','删除饲料-下发','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  466. (1670,405,'INSERT INTO feed(id,pastureid,feedcode,fname,fclass,fclassid,allowratio,printgroupid,printgroup,unitweight,uprice,dry,autozone,autosecond,autosecondname,confirmstart,trgaddress,sort,ENABLE,source,backup1,backup2,backup3)\nSELECT id,?,feedcode,fname,fclass,\n(SELECT id FROM `feedclass` WHERE fcname =(SELECT fcname FROM feedclass WHERE id =f.fclassid AND pastureid = f.pastureid) AND pastureid = ?) fclassid,allowratio,\nprintgroupid,printgroup,unitweight,uprice,dry,autozone,autosecond,autosecondname,confirmstart,trgaddress,sort,ENABLE,source,backup1,backup2,backup3\nFROM feed f\n WHERE pastureid =?\n ON DUPLICATE KEY UPDATE ENABLE= 1,fclass = f.`fclass`,fclassid = (SELECT id FROM `feedclass` WHERE fcname =(SELECT fcname FROM feedclass WHERE id =f.fclassid AND pastureid = f.pastureid) AND pastureid = ?)','pastureid,pastureid,groupsid,pastureid','insertFeedissue','PostDataByName','插入饲料-下发','tmrgo','{\"name\":\"insertFeedissue\",\"parammaps\":{\"pastureid\":\"3\",\"groupsid\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":\"0\",\"LastInsertIdStr\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  467. (1671,405,' INSERT INTO feednur(pastureid,fid,fname,feedcode,price,remark,dry,starch,cp,ca,p,n,fat,adf,ndf,ndip,ash,fpercent,iscu,sources,fndate,sort,ENABLE,feednurid)\nSELECT ?,fid,fname,feedcode,price,remark,dry,starch,cp,ca,p,n,fat,adf,ndf,ndip,ash,fpercent,iscu,sources,fndate,sort,ENABLE,feednurid\nFROM feednur\n WHERE pastureid = ?+10\nON DUPLICATE KEY UPDATE ENABLE=1','pastureid,groupsid','insertFeednurissue','PostDataByName','插入饲料nur-下发','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  468. (1672,399,'UPDATE USER SET username = ?\nWHERE username = ? AND pastureid = ?','user,userold,id','updateUserName','PostDataByName','更改管理员用户名','tmrgo','{\"name\":\"updateUserName\",\"parammaps\": {\n \"id\": \"1\",\n \"userold\": \"000000\",\n \"user\": \"000001\"\n }}','{\"LastInsertId\":\"0\",\"LastInsertIdStr\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  469. (1673,31,'INSERT INTO eq_pic(pastureid,projuctid,pfid,optid,catchtime,picclass,picpath, picname, username, newpicname) VALUES (?,?,?,?,?,?,?,?,?,?) ','pastureid,projuctid,pfid,optid,catchtime,picclass,picpath, picname, username, newpicname','insertcustompic','api/getCowCategory','图片上传','tmrgo','{}','null',0,1,0,0,0),
  470. (1674,405,'SELECT DISTINCT DATE_FORMAT(DATE,\'%Y-%m-%d %H:%i:%s\') date FROM`feedtemplet_pasture`\nWHERE pastureid = ? AND `date` LIKE CONCAT(?,\'%\') and ftid = ?\nORDER BY DATE DESC','pastureid,date,ftid ','getFTListXFhisTime','GetDataByName','使用情况时间列表','tmrgo','{\"name\":\"getFTListXF\",\"parammaps\":{\"pastureid\":\"1\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"饲喂配方\",\"fttypeid\":1,\"id\":\"3248345863642678272\",\"isissue\":0,\"pastureid\":\"1\",\"remark\":\"22\",\"source\":\"自定义\",\"tcolor\":\"#2C2424\",\"tname\":\"下发测试2\"},{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"饲喂配方\",\"fttypeid\":1,\"id\":\"3248326220693636096\",\"isissue\":0,\"pastureid\":\"1\",\"remark\":\"\",\"source\":\"自定义\",\"tcolor\":\"#ccc\",\"tname\":\"下发测试\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  471. (1675,390,'\nSELECT concat(IFNULL(round(SUM(HLrate)/COUNT(*)*100,2),0),\'%\') rateAvg, concat(IFNULL(round(MAX(HLrate),2)*100,0) ,\'%\') rateMAX, concat(IFNULL(round(MIN(HLrate)*100,0),0),\'%\') rateMIN \nFROM (\nSELECT SUM(IFNULL(d1.actualweightminus/d1.lweight,0))/COUNT(*) HLrate FROM `downloadplandtl1_exec` d1\nJOIN `downloadedplan` d ON d.`id` =d1.`pid` AND d.`pastureid` =d1.`pastureid` \nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d1.`pastureid`\n\nWHERE d1.`date` BETWEEN ? AND ? \nGROUP BY d1.`pastureid`\n) ww\n\nUNION ALL\n\n\nSELECT concat(IFNULL(round(SUM(HLrate)/COUNT(*)*100,2),0),\'%\') rateAvg, concat(IFNULL(round(MAX(HLrate),2)*100,0) ,\'%\') rateMAX, concat(IFNULL(round(MIN(HLrate)*100,0),0),\'%\') rateMIN \nFROM (\nSELECT SUM(IFNULL(d1.actualweightminus/d1.lweight,0))/COUNT(*) HLrate FROM `downloadplandtl2` d1\nJOIN `downloadedplan` d ON d.`id` =d1.`pid` AND d.`pastureid` =d1.`pastureid` \nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d1.`pastureid`\n\nWHERE d1.`date` BETWEEN ? AND ? \nGROUP BY d1.`pastureid`) ww\nUNION ALL\n\n\n\nSELECT concat(IFNULL(round(SUM(HLrate)/COUNT(*)*100,2),0),\'%\') rateAvg, concat(IFNULL(round(MAX(HLrate),2)*100,0) ,\'%\') rateMAX, concat(IFNULL(round(MIN(HLrate)*100,0),0),\'%\') rateMIN\nFROM (\nSELECT SUM(IF(ABS(d1.`actualweightminus`-d1.`lweight`)<=d1.`allowratio`,1,0)) /COUNT(*) HLrate FROM `downloadplandtl2` d1\nJOIN `downloadedplan` d ON d.`id` =d1.`pid` AND d.`pastureid` =d1.`pastureid` \nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d1.`pastureid`\nWHERE d1.`date` BETWEEN ? AND ? \nGROUP BY d1.`pastureid`\n) ww\n\nUNION ALL\nSELECT 0 a,0 b,0 c\n','pastureid,pastureid,startTime,stopTime,pastureid,pastureid,startTime,stopTime,pastureid,pastureid,startTime,stopTime','getHomepageStrJT','GetDataByName','首页监控数据-集团','tmrgo','{\"name\":\"getHomepageStrJT\",\"parammaps\":{\"pastureid\":\"3025176271438480387\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','{\"code\":0,\"list\":[{\"doneTimes\":0,\"doneWeight\":\"884.00\",\"monRateHL\":\"90.73%\",\"monRateSL\":\"89.81%\",\"monRateSLR\":\"64.54%\",\"montime\":5.46,\"planTimes\":0,\"planWeight\":\"15908.86\",\"yesRateHL\":\"41.39%\",\"yesRateSL\":\"38.17%\",\"yesRateSLR\":\"34.92%\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  472. (1676,399,'SELECT trim(pastureid) id, pasture_name groupsname, pasture_code groupscode,emp,phone,enable,user,user userold,note\n FROM\npasture g\n WHERE (g.pasture_name LIKE CONCAT(\'%\',?,\'%\') OR ?=\'\') \nand (g.enable =? OR ?=\'\') and g.isgroups = 1 and g.pastureid <> ?','groupsname,groupsname,enable,enable,id','getGroupsAllListV2','GetDataByName','集团列表','tmrgo','{\"name\":\"getGroupsList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"code\":0,\"list\":[{\"emp\":\"李四\",\"groupscode\":\"001\",\"groupsname\":\"现代牧业\",\"id\":\"1\",\"phone\":\"1235\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  473. (1677,325,'SELECT -1 pastureid,\n(SELECT pasture_name FROM pasture WHERE pastureid = ?) pasturename,\nDATE(d.`mydate`) 计划时间,\nIFNULL((SELECT d.`templetname` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid),de.`fname`) 配方名称,\nROUND(SUM(de.`lweight`)) 理论重量,\nROUND(SUM(de.`actualweightminus`)) 实际重量,\nSUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , \nROUND(SUM(ABS(de.`actualweightminus`-de.`lweight`)),2) 混料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差\nFROM `downloadplandtl1_exec` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\nWHERE d.`mydate` BETWEEN ? AND ? \nAND de.`type` = 0 \nAND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) IN (0,1,2,5)\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \n\nUNION ALL\n\nSELECT TRIM(d.`pastureid`) pastureid,\n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) pasturename,\nDATE(d.`mydate`) 计划时间,\nIFNULL((SELECT d.`templetname` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid),de.`fname`) 配方名称,\nROUND(SUM(de.`lweight`)) 理论重量,\nROUND(SUM(de.`actualweightminus`)) 实际重量,\nSUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , \nROUND(SUM(ABS(de.`actualweightminus`-de.`lweight`)),2) 混料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差\nFROM `downloadplandtl1_exec` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nRIGHT JOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\nWHERE d.`mydate` BETWEEN ? AND ? \nAND de.`type` = 0 \nAND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) IN (0,1,2,5)\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.pastureid\n','pastureid, pastureid,pastureid,startTime,stopTime,pastureid,pastureid,startTime,stopTime','getAccuracyJTHALL','GetDataByName','集团 - 汇总-混料准确率','tmrgo','{\"name\":\"getAccuracyJTHALL\",\"parammaps\":{\"pastureid\":\"1\",\"startTime\":\"2021-02-01\",\"stopTime\":\"2021-02-03\",\"enable\":1}} ','{\"code\":0,\"list\":[{\"pastureid\":\"-1\",\"pasturename\":\"现代牧业\",\"取消次数\":\"0\",\"实际重量\":\"0\",\"已混料操作数\":\"2\",\"方差\":286.68,\"混料准确率\":\"99.00%\",\"混料手动跳转次数\":\"1\",\"混料操作率\":\"4.76%\",\"混料自动跳转次数\":\"1\",\"混料误差值\":\"15731.58\",\"理论重量\":\"15732\",\"计划时间\":\"2021-02-01T00:00:00+08:00\",\"计划混料操作数\":\"42\",\"配方名称\":\"高产泌乳饲喂\"},{\"pastureid\":\"3025176271438480383\",\"pasturename\":\"宝鸡\",\"取消次数\":\"0\",\"实际重量\":\"0\",\"已混料操作数\":\"2\",\"方差\":286.68,\"混料准确率\":\"99.00%\",\"混料手动跳转次数\":\"1\",\"混料操作率\":\"4.76%\",\"混料自动跳转次数\":\"1\",\"混料误差值\":\"15731.58\",\"理论重量\":\"15732\",\"计划时间\":\"2021-02-01T00:00:00+08:00\",\"计划混料操作数\":\"42\",\"配方名称\":\"高产泌乳饲喂\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  474. (1678,325,'SELECT -1 pastureid,\n(SELECT pasture_name FROM pasture WHERE pastureid = ?) pasturename,\nDATE(d.`mydate`) 计划时间,\nifnull(d.`templetname`,de.`feedtempletname`) 配方名称,\nROUND(SUM(de.`lweight`)) 理论重量,\nROUND(SUM(de.`actualweightminus`)) 实际重量,\nSUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数 , \nROUND(SUM(ABS(de.`actualweightminus`-de.`lweight`)),2) 撒料误差值, \nCONCAT(ROUND( 100-AVG(ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`) ,2),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\nWHERE d.`mydate` BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \n\nUNION ALL\n\nSELECT TRIM(d.`pastureid`) pastureid,\n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) pasturename,\nDATE(d.`mydate`) 计划时间,\nifnull(d.`templetname`,de.`feedtempletname`) 配方名称,\nROUND(SUM(de.`lweight`)) 理论重量,\nROUND(SUM(de.`actualweightminus`)) 实际重量,\nSUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数 , \nROUND(SUM(ABS(de.`actualweightminus`-de.`lweight`)),2) 撒料误差值, \nCONCAT(ROUND( 100-AVG(ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`) ,2),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nRIGHT JOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\nWHERE d.`mydate` BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.pastureid\n','pastureid, pastureid,pastureid,startTime,stopTime,pastureid,pastureid,startTime,stopTime','getAccuracyJTSALL','GetDataByName','集团 - 汇总-撒料准确率','tmrgo','{\"name\":\"getAccuracyHJT\",\"parammaps\":{\"pastureid\":\"1\",\"startTime\":\"2021-02-01\",\"stopTime\":\"2021-02-03\",\"enable\":1}} ','{\"code\":0,\"list\":[{\"pastureid\":\"-1\",\"pasturename\":\"现代牧业\",\"取消次数\":\"0\",\"实际重量\":\"0\",\"已混料操作数\":\"2\",\"方差\":286.68,\"混料准确率\":\"99.00%\",\"混料手动跳转次数\":\"1\",\"混料操作率\":\"4.76%\",\"混料自动跳转次数\":\"1\",\"混料误差值\":\"15731.58\",\"理论重量\":\"15732\",\"计划时间\":\"2021-02-01T00:00:00+08:00\",\"计划混料操作数\":\"42\",\"配方名称\":\"高产泌乳饲喂\"},{\"pastureid\":\"3025176271438480383\",\"pasturename\":\"宝鸡\",\"取消次数\":\"0\",\"实际重量\":\"0\",\"已混料操作数\":\"2\",\"方差\":286.68,\"混料准确率\":\"99.00%\",\"混料手动跳转次数\":\"1\",\"混料操作率\":\"4.76%\",\"混料自动跳转次数\":\"1\",\"混料误差值\":\"15731.58\",\"理论重量\":\"15732\",\"计划时间\":\"2021-02-01T00:00:00+08:00\",\"计划混料操作数\":\"42\",\"配方名称\":\"高产泌乳饲喂\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  475. (1679,326,'\nSELECT \n(SELECT pasture_name FROM pasture WHERE pastureid = tem.pastureid) pasturename,\ntrim(tem.pastureid) pastureid,\n配方模板,实际牛头数,应混料量,实际混料量,撒料量,ifnull(混料时间,0)混料时间,转投剩料量,今日剩料量,配方单价,\nROUND(理论干物质,2) 理论干物质,\nifnull(ROUND(TMR干物质*100,2),0) TMR干物质,\nROUND(IFNULL(今日剩料量/撒料量*100,0),2)剩料率,\nROUND(应混料量*理论干物质/实际牛头数,2) 配方干物质采食量,\nifnull(ROUND((撒料量 - 今日剩料量)*TMR干物质/实际牛头数,2),0) 实际干物质采食量,\nIFNULL(ROUND(((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)/(应混料量*理论干物质/实际牛头数)*100,2) ,0) 采食率,\nIFNULL(ROUND(配方单价*应混料量/实际牛头数,2),0) 配方成本,\nIFNULL(ROUND(配方单价*实际混料量/实际牛头数,2),0) 实际成本,\nCONCAT(ROUND(IFNULL(产奶量/实际牛头数,0),2)) 产奶量,\nIFNULL(ROUND(IFNULL(产奶量/实际牛头数,0)/((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)*100,2),0) 饲料转化率,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) 公斤奶饲料成本\n FROM (\nSELECT \nd.pastureid ,\nd.`templetname` 配方模板,\n(SELECT SUM(ccount) FROM feedpdate fpt WHERE fpt.pastureid = d.pastureid AND fpt.date = d.mydate )实际牛头数,\n(SELECT SUM(d1e.lweight) FROM `downloadplandtl1` d1e \n JOIN `downloadedplan` dv ON dv.pastureid= d1e.pastureid AND dv.id = d1e.pid\nWHERE d1e.pastureid = d.`pastureid` AND dv.mydate = d.`mydate` AND d1e.type = 0 )应混料量,\n(SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1` d1e \n JOIN `downloadedplan` dv ON dv.pastureid= d1e.pastureid AND dv.id = d1e.pid\nWHERE d1e.pastureid = d.`pastureid` AND dv.mydate = d.`mydate` AND d1e.type = 0 )实际混料量,\n\n@tid := d.tempid tempid,\n@da := d.mydate,\n\n\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d1.`tempid` FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` = @da and d1.pastureid = ? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\ngroup by d1.`tempid`) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nwhere ww.`tempid` = @tid \n) 产奶量,\n\n\n\nSUM(d2.`actualweightminus`) 撒料量,\nDATE_FORMAT(TIMEDIFF(FROM_UNIXTIME(SUM(UNIX_TIMESTAMP(d2.intime)-\nUNIX_TIMESTAMP(IFNULL((SELECT MAX(intime) FROM `downloadplandtl2` d2v\nWHERE d.`mydate`=d2v.`date` AND d.pastureid = d2v.pastureid AND d2v.pid=d.id AND d2v.sort<d2.sort),\n(SELECT MAX(intime) FROM `downloadplandtl1_exec` d1v\nWHERE d.`mydate`=d1v.`date` AND d.pastureid = d1v.pastureid AND d1v.pid=d.id )\n))\n)+1),\'1970-01-01 08:00:01\'),\'%H:%i:%s\') 混料时间,\n\n0 转投剩料量,\nSUM(IFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0)) 今日剩料量,\nSUM(IFNULL((SELECT AVG(actweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)*d2.`actualweightminus`)/SUM(d2.actualweightminus) TMR干物质,\nSUM(IFNULL((SELECT AVG(thoweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)*d2.`lweight`)/SUM(d2.`lweight`) 理论干物质,\n\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = fp.pastureid AND ftd.`date` = fp.date AND ftd.`ftid` = fp.`ftid` AND ftd.`version` = d.tversion\n\n) 配方单价 \n FROM \n\n `downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.`pastureid` = d.`pastureid` AND d2.`pid` = d.`id` \n\nJOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND d2.`fbarid` = fp.`barid`\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\nWHERE d.`mydate` =? AND d.lpplantype IN (0,1,2,5) and d2.type = 0 \nGROUP BY d.`pastureid`) tem\n','pastureid,pastureid,pastureid,date','getFeedEfficiencyJT','GetDataByName','集团-饲喂效率','tmrgo','{\"name\":\"getFeedEfficiencyJT\",\"parammaps\":{\"pastureid\":\"1\",\"date\":\"2021-02-03\",\"stopTime\":\"2020-02-03\",\"enable\":1}}','{\"code\":0,\"list\":[{\"TMR干物质\":\"0.00%\",\"pastureid\":\"-1\",\"pasturename\":\"现代牧业\",\"产奶量\":\"0.00%\",\"今日剩料量\":\"0.00\",\"公斤奶饲料成本\":0,\"实际成本\":\"0.00\",\"实际牛头数\":\"380\",\"应混料量\":\"5775.44\",\"理论干物质\":\"0.000000\",\"转投剩料量\":0,\"配方干物质采食量\":\"0.00\",\"配方成本\":\"0.00\",\"配方模板\":\"高产泌乳饲喂\",\"采食率\":\"0.00\"},{\"TMR干物质\":\"0.00%\",\"pastureid\":\"-1\",\"pasturename\":\"现代牧业\",\"产奶量\":\"0.00%\",\"今日剩料量\":\"0.00\",\"公斤奶饲料成本\":0,\"实际成本\":\"0.00\",\"实际牛头数\":\"1330\",\"应混料量\":\"12900.00\",\"理论干物质\":\"0.000000\",\"转投剩料量\":0,\"配方干物质采食量\":\"0.00\",\"配方成本\":\"0.00\",\"配方模板\":\"测试配方1126\",\"采食率\":\"0.00\"},{\"TMR干物质\":\"0.00%\",\"pastureid\":\"3025176271438480383\",\"pasturename\":\"宝鸡\",\"产奶量\":\"0.00%\",\"今日剩料量\":\"0.00\",\"公斤奶饲料成本\":0,\"实际成本\":\"0.00\",\"实际牛头数\":\"1710\",\"应混料量\":\"18675.44\",\"理论干物质\":\"0.000000\",\"转投剩料量\":0,\"配方干物质采食量\":\"0.00\",\"配方成本\":\"0.00\",\"配方模板\":\"测试配方1126\",\"采食率\":\"0.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  476. (1680,325,'SELECT \nIFNULL((SELECT SUM(actualweightminus) FROM downloadplandtl1_exec de1 WHERE de1.pid = d.id AND d.pastureid = de1.pastureid\nAND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>=3 AND (de.`lweight` >=30 OR de.`actualweightminus` >=30 ))\n ),0) 计划取消重量,\n\n ROUND(IF(SUM(d.`lweight`)>0,\n(SUM(d.`iweight`)-(IFNULL((SELECT SUM(actualweightminus) FROM downloadplandtl1_exec de1 WHERE de1.pid = d.id AND d.pastureid = de1.pastureid\nAND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>=3 AND (de.`lweight` >=30 OR de.`actualweightminus` >=30 ))\n ),0)))/SUM(d.`lweight`)*100,0),2) field3 , -- 去除取消重量 准确率\nTRIM(d.`pastureid` ) pastureid,\n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) 牧场,\nSUM(d.`lweight`) 理论量,\nSUM(d.`iweight`) 实际量,\nROUND(IF(SUM(d.`lweight`)>0,\nSUM(d.`iweight`)/SUM(d.`lweight`)*100,0),2) field1 , -- 准确率\nCOUNT(de.id) 计划数, -- 添加饲料次数, \nSUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0)) 正确数,\nROUND(IF(COUNT(de.id)>0,SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0))/COUNT(de.id),0)*100,2) field2 -- 正确率\nFROM `downloadedplan` d JOIN `downloadplandtl1_exec` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\nWHERE d.`mydate` BETWEEN ? AND ? AND d.lpplantype<3\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.`pastureid`','pastureid,pastureid,startTime,stopTime','getJT1AccuracyAllJH','GetReportform','集团-汇总 -按计划统计 ','tmrgo','{\"name\":\"getJT1AccuracyAllJH\",\"parammaps\":{\"pastureid\":\"1\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','null',0,1,0,0,0),
  477. (1681,325,'SELECT \n牧场,\nTRIM(`pastureid` ) pastureid,\n日期,\nSUM(自动次数) field1, -- 自动次数,\n SUM(实际自动) 实际自动,\nSUM(理论自动)理论自动,\nSUM(手动次数) field2, -- 手动次数, \nSUM(实际手动) 实际手动,SUM(理论手动) 理论手动,\n ROUND(SUM(实际自动)/SUM(理论自动)*100,2) field3, -- 自动准确率,\n ROUND(SUM(实际手动)/SUM(理论手动)*100,2) field4 -- 手动准确率 \nFROM (\nSELECT DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \n d.`pastureid`, \n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) 牧场,\n(SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype = 1 AND actualweightminus>0 ) 实际自动,\n(SELECT SUM(lweight) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype = 1 ) 理论自动,\n(SELECT COUNT(*) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype = 1 ) 自动次数,\n\n(SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype IN (2,3) AND actualweightminus>0 ) 实际手动,\n(SELECT SUM(lweight) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype IN (2,3) ) 理论手动,\n(SELECT COUNT(*) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype IN (2,3) ) 手动次数\nFROM `downloadedplan` d\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\nWHERE d.`mydate` BETWEEN ? AND ? AND d.lpplantype<3\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 and (de.`lweight` >=30 or de.`actualweightminus` >=30 )) \n)d\nGROUP BY d.`pastureid`\nORDER BY `pastureid`','pastureid,pastureid,startTime,stopTime','getJT1AccuracyAllHL','GetReportform','集团-汇总 -混料统计','tmrgo','{\"name\":\"getJT1AccuracyAllHL\",\"page\":1,\"offset\":1,\"pagecount\":\"\",\"returntype\":\"Map\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-03\",\"stopTime\":\"2020-11-03\",\"inputDatetime\":[\"2020-11-24T08:39:05.753Z\",\"Tue Nov 24 2020 16:39:05 GMT 0800 (中国标准时间)7\"],\"enable\":[]}}','{\"code\":0,\"data\":[{\"field1\":\"182\",\"field2\":\"26\",\"field3\":\"100.07\",\"field4\":\"31.90\",\"实际手动\":\"637.00\",\"实际自动\":\"95519.00\",\"日期\":\"2020-11-03\",\"理论手动\":\"1996.74\",\"理论自动\":\"95450.67\"}],\"list\":{\"data1\":[\"2020-11-03\"],\"data2\":[\"182\"],\"data3\":[\"26\"],\"data4\":[\"100.07\"],\"data5\":[\"31.90\"]},\"message\":\"ok\"}',0,1,0,0,0),
  478. (1682,325,'SELECT de.`fname` 名称,DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \nTRIM(d.`pastureid` ) pastureid,\n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) 牧场,\nCOUNT(de.id) field1 -- 取消次数\nFROM `downloadedplan` d LEFT JOIN `downloadplandtl1_exec` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nAND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND (de.`lweight` >=30 OR de.`actualweightminus` >=30 )) \n\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\n\nWHERE d.`mydate` BETWEEN ? AND ? AND d.lpplantype<3\n-- 加上就是不含取消操作\n\nGROUP BY d.`pastureid`','pastureid,pastureid,startTime,stopTime','getJT1AccuracyAllQX','GetReportform','集团-汇总 -混料统计','tmrgo','{\"name\":\"getJT1AccuracyAllQX\",\"page\":1,\"offset\":1,\"pagecount\":\"\",\"returntype\":\"Map\",\"parammaps\":{\"pastureid\":\"1\",\"startTime\":\"2020-11-03\",\"stopTime\":\"2020-11-03\",\"inputDatetime\":[\"2020-11-24T08:39:05.753Z\",\"Tue Nov 24 2020 16:39:05 GMT 0800 (中国标准时间)7\"],\"enable\":[]}}','{\"code\":0,\"data\":[{\"field1\":0,\"pastureid\":3025176271438480400,\"日期\":\"2020-11-03\",\"牧场\":\"巴盟圣牧8牧\"},{\"field1\":0,\"pastureid\":3025176271438480400,\"日期\":\"2020-11-03\",\"牧场\":\"巴盟圣牧20牧\"},{\"field1\":0,\"pastureid\":3025176271438480400,\"日期\":\"2020-11-03\",\"牧场\":\"兰陵富源\"}],\"list\":{\"data1\":[\"巴盟圣牧8牧\",\"巴盟圣牧20牧\",\"兰陵富源\"],\"data2\":[0,0,0],\"data3\":[null,null,null],\"data4\":[null,null,null],\"data5\":[null,null,null]},\"message\":\"ok\"}',0,1,0,0,0),
  479. (1683,325,'SELECT \n牧场,\nTRIM(`pastureid` ) pastureid,\n日期,\nSUM(自动次数) field3, -- 自动次数,\n SUM(实际自动) 实际自动,\nSUM(理论自动)理论自动,\nSUM(手动次数) field4, -- 手动次数, \nSUM(实际手动) 实际手动,SUM(理论手动) 理论手动,\n ROUND(SUM(实际自动)/SUM(理论自动)*100,2) field1, -- 自动准确率,\n ROUND(SUM(实际手动)/SUM(理论手动)*100,2) field2 -- 手动准确率 \nFROM (\nSELECT DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \n d.`pastureid`, \n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) 牧场,\n(SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype = 1 AND actualweightminus>0 ) 实际自动,\n(SELECT SUM(lweight) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype = 1 ) 理论自动,\n(SELECT COUNT(*) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype = 1 ) 自动次数,\n\n(SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype IN (2,3) AND actualweightminus>0 ) 实际手动,\n(SELECT SUM(lweight) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype IN (2,3) ) 理论手动,\n(SELECT COUNT(*) FROM `downloadplandtl1_exec` de WHERE d.`id`=de.`pid` AND d.pastureid = de.pastureid AND de.buttontype IN (2,3) ) 手动次数\nFROM `downloadedplan` d\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\nWHERE d.`mydate` BETWEEN ? AND ? AND d.lpplantype<3\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 and (de.`lweight` >=30 or de.`actualweightminus` >=30 )) \n)d\nGROUP BY d.`pastureid`\nORDER BY `pastureid`','pastureid,pastureid,startTime,stopTime','getJT1AccuracyAllHLRate','GetReportform','集团-汇总 -混料统计','tmrgo','{\"name\":\"getJT1AccuracyAllHL\",\"page\":1,\"offset\":1,\"pagecount\":\"\",\"returntype\":\"Map\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-03\",\"stopTime\":\"2020-11-03\",\"inputDatetime\":[\"2020-11-24T08:39:05.753Z\",\"Tue Nov 24 2020 16:39:05 GMT 0800 (中国标准时间)7\"],\"enable\":[]}}','{\"code\":0,\"data\":[{\"field1\":\"182\",\"field2\":\"26\",\"field3\":\"100.07\",\"field4\":\"31.90\",\"实际手动\":\"637.00\",\"实际自动\":\"95519.00\",\"日期\":\"2020-11-03\",\"理论手动\":\"1996.74\",\"理论自动\":\"95450.67\"}],\"list\":{\"data1\":[\"2020-11-03\"],\"data2\":[\"182\"],\"data3\":[\"26\"],\"data4\":[\"100.07\"],\"data5\":[\"31.90\"]},\"message\":\"ok\"}',0,1,0,0,0),
  480. (1684,325,'SELECT MAX(CASE\n WHEN 名称 = \'泌乳牛\' THEN\n 准确率\n END\n) AS field1,\nMAX(CASE\n WHEN 名称 = \'后备牛\' THEN\n 准确率\n END\n) AS field2,\nMAX(CASE\n WHEN 名称 = \'干奶牛\' THEN\n 准确率\n END\n) AS field3,\nMAX(CASE\n WHEN 名称 = \'泌乳牛\' THEN\n 准确率\n END\n) AS field4,\n牧场,\nTRIM(pastureid) pastureid,\n理论量,\n实际量\n\n FROM (SELECT cc.`parentname` 名称 ,\n d.`pastureid`, \n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) 牧场,\nDATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, SUM(d.`lweight`) 理论量,\nSUM(d.`iweight`) 实际量,\nROUND(IF(SUM(d.`lweight`)>0,SUM(d.`iweight`)/SUM(d.`lweight`)*100,0),2) 准确率\nFROM `downloadedplan` d JOIN `downloadplandtl2` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nJOIN `feedtemplet` ft ON ft.`pastureid` = d.`pastureid` AND ft.`id` = d.`tempid`\nJOIN cowclass cc ON cc.`id` =ft.`ccid` AND cc.`pastureid` = d.`pastureid`\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\nWHERE d.`mydate` BETWEEN ? AND ? AND d.lpplantype<3\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.`pastureid`,cc.`parentid` \nORDER BY de.`cowclassname` ,d.`Mydate`) tem','pastureid,pastureid,startTime,stopTime','getJT1AccuracyAllNQ','GetDataByName','集团-汇总 -按牛群统计 ','tmrgo','{\"name\":\"getJT1AccuracyAllNQ\",\"parammaps\":{\"pastureid\":\"1\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"field1\":\"99.96\",\"field2\":\"99.29\",\"field3\":\"99.67\",\"field4\":\"99.96\",\"pastureid\":3025176271438480400,\"实际量\":\"28858\",\"牧场\":\"测试牧场\",\"理论量\":\"28978.34\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  481. (1685,325,'SELECT CONCAT(\n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`)\n,d.times) 名称,DATE_FORMAT(d.`Mydate`, \'%Y-%m-%d\') 日期, \nIFNULL(DATE_FORMAT(de.intime,\'%H.%i\'),\'\') 准确率 -- 撒料时间\nFROM `downloadedplan` d RIGHT JOIN `downloadplandtl2` de ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\n\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\nWHERE d.`mydate` BETWEEN ? AND ? AND d.lpplantype<3\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.times,d.`pastureid`,d.`mydate`\nORDER BY 名称,d.`Mydate`','pastureid,pastureid,startTime,stopTime','getAccuracyAllLSJT','GetDataByName','集团-汇总 -按栏舍统计 ','tmrgo','{\"name\":\"getAccuracyAllLSJT\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"Error 1054: Unknown column \'d\' in \'field list\'\"',0,1,0,0,0),
  482. (1686,326,'SELECT \n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) 名称,\nIFNULL(SUM(d.`oweight`),0) 撒料量,\nIFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0) 剩料量,\nifnull(ROUND(IFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0)/SUM(d.`oweight`),2),0)准确率, -- 剩料率\nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期\n\nFROM \n`feedpdate` fp\n\nRIGHT JOIN `downloadedplan` d\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND d.`templetname` = fp.`ftname`\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =fp.`pastureid` AND bm.`barid` = fp.`barid` AND bm.`productdate` = fp.`date`\n\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\n\nWHERE fp.`date` BETWEEN ? AND ? AND d.lpplantype<3\nGROUP BY d.`pastureid` ,d.`mydate`\nORDER BY 名称 ,d.`mydate`','pastureid,pastureid,startTime,stopTime','getFeedEffSLJT','GetReportform','集团-饲喂效率图表-剩料量','tmrgo','{\"name\":\"getFeedEffSLJT\",\"parammaps\":{\"pastureid\":\"1\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"data\":[{\"准确率\":\"0.00\",\"剩料量\":\"0.00\",\"名称\":\"兰陵富源\",\"撒料量\":\"2049810\",\"日期\":\"2020-09-15\"},{\"准确率\":\"0.00\",\"剩料量\":\"0.00\",\"名称\":\"兰陵富源\",\"撒料量\":\"2021608\",\"日期\":\"2020-09-16\"},{\"剩料量\":\"0.00\",\"名称\":\"宝鸡\",\"撒料量\":\"0\",\"日期\":\"2020-09-16\"},{\"准确率\":\"0.00\",\"剩料量\":\"0.00\",\"名称\":\"巴盟圣牧20牧\",\"撒料量\":\"710744\",\"日期\":\"2020-09-15\"},{\"准确率\":\"0.00\",\"剩料量\":\"0.00\",\"名称\":\"巴盟圣牧20牧\",\"撒料量\":\"824312\",\"日期\":\"2020-09-16\"}],\"list\":{\"data1\":[\"兰陵富源\",\"宝鸡\",\"巴盟圣牧20牧\"],\"data2\":[\"2020-09-15\",\"2020-09-16\"],\"data3\":[{\"data\":[\"0.00\",\"0.00\"]},{\"data\":[null]},{\"data\":[\"0.00\",\"0.00\"]}]},\"message\":\"ok\"}',0,1,0,0,0),
  483. (1687,326,'SELECT \n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) 名称,\nDATE_FORMAT(d.`mydate` , \'%Y-%m-%d\') 日期,\nIFNULL(ROUND(SUM(UNIX_TIMESTAMP((SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d.`mydate`=d2.`date` AND d.pastureid = d2.pastureid AND d2.pid=d.id))-UNIX_TIMESTAMP(d.intime))/60,2),0) 准确率-- 混料时间\n \n FROM \n`downloadedplan` d\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\nWHERE d.`mydate` BETWEEN ? AND ? AND d.lpplantype<3\n GROUP BY d.`pastureid`,d.`mydate`\nORDER BY 名称,d.`mydate`','pastureid,pastureid,startTime,stopTime ','getFeedEffHLJT','GetReportform','集团-饲喂效率图表-混料时间','tmrgo','{\"name\":\"getFeedEffHLJT\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','{\"code\":0,\"data\":null,\"list\":{\"data1\":[],\"data2\":[],\"data3\":[],\"data4\":[],\"data5\":[]},\"message\":\"ok\"}',0,1,0,0,0),
  484. (1688,326,'\nSELECT \n日期,\n(SELECT pasture_name FROM pasture WHERE pastureid = tem.`pastureid`) 名称,\nIFNULL(ROUND((产奶量)/((撒料量 - 今日剩料量)*TMR干物质)*100,2),\'0.00\') 准确率 -- 饲料转化率\n FROM (\nSELECT \nd.pastureid,\nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期,\nfp.`ftname` 配方模板,SUM(bm.product)产奶量,\nSUM(d.`oweight`) 撒料量,\nIFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0) 今日剩料量,\nIFNULL((SELECT AVG(actweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = fp.`date`),0) TMR干物质\n\n FROM \n`feedpdate` fp\n\nINNER JOIN `downloadedplan` d\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND d.`templetname` = fp.`ftname`\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =fp.`pastureid` AND bm.`barid` = fp.`barid` AND bm.`productdate` = (SELECT MAX(`productdate`) FROM barmilk WHERE barmilk.productdate <=fp.`date` AND barmilk.`pastureid` = fp.`pastureid` and barmilk.barid = fp.`barid`)\n\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\nWHERE fp.`date` BETWEEN ? AND ? AND d.lpplantype<3\nGROUP BY d.`pastureid`,d.`mydate` ) tem\nORDER BY 名称,日期','pastureid,pastureid,startTime,stopTime ','getFeedEffZHJT','GetReportform','集团-饲喂效率图表-转化率','tmrgo','{\"name\":\"getFeedEffZHJT\",\"parammaps\":{\"pastureid\":\"1\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','\"sql: expected 4 arguments, got 3\"',0,1,0,0,0),
  485. (1689,326,'\nSELECT \n日期,\n(SELECT pasture_name FROM pasture WHERE pastureid = tem.`pastureid`) 名称,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) 准确率 -- 公斤奶饲料成本\n FROM (\nSELECT \nd.pastureid,\nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期,\nIFNULL( (SELECT `cowclass` FROM `barmilk` WHERE pastureid = d2.pastureid AND `barid` = d2.fbarid AND `productdate` <= d2.date ORDER BY productdate DESC LIMIT 1) ,\'无类别\')牲畜类别,\n\nround(SUM((SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1_exec` d1e \nWHERE d1e.pastureid = d.`pastureid` AND d1e.date = d2.`date` AND d1e.flpid = d2.`flpid` AND d1e.type =0 )*d2.lweight/d.lweight),2)实际混料量,\n\n@tid := IFNULL( (SELECT `cowclassid` FROM `barmilk` WHERE pastureid = d2.pastureid AND `barid` = d2.fbarid AND `productdate` <= d2.date ORDER BY productdate DESC LIMIT 1),-1) cowclassid,\n@da := d.mydate,\n\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d21.`fname`,IFNULL(d21.`cowclassid`,-1)cowclassid FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` between ? and ? AND d1.pastureid =? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\nGROUP BY d21.`cowclassid`,d21.date) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nWHERE ww.cowclassid = @tid and ww.date = @da\n) 产奶量,\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = fp.pastureid AND ftd.`date` = fp.date AND ftd.`ftid` = fp.`ftid` AND ftd.`version` = d.tversion\n\n) 配方单价 \n FROM \n`downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND fp.`barid` = d2.`fbarid`\n\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d.`pastureid`\n\nWHERE fp.`date` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.`type` = 0\nGROUP BY d.`pastureid`,d.`mydate`) tem\nORDER BY 名称,日期\n\n','startTime,stopTime,pastureid,pastureid,pastureid,startTime,stopTime ','getFeedEffCBAllJT','GetReportform','集团-饲喂效率图表-成本-牧场','tmrgo','{\"name\":\"getFeedEffCB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','{\"code\":0,\"data\":[{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-01\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-02\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-03\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-04\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-05\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-06\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-07\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-08\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-09\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-10\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-11\"}],\"list\":{\"data1\":[\"无类别\"],\"data2\":[\"2020-11-01\",\"2020-11-02\",\"2020-11-03\",\"2020-11-04\",\"2020-11-05\",\"2020-11-06\",\"2020-11-07\",\"2020-11-08\",\"2020-11-09\",\"2020-11-10\",\"2020-11-11\"],\"data3\":[{\"data\":[\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\"]}]},\"message\":\"ok\"}',0,1,0,0,0),
  486. (1690,326,'SELECT IFNULL(SUM(d2.`actualweightminus`),0) 准确率, -- 采食量\n(SELECT pasture_name FROM pasture WHERE pastureid = d.`pastureid`) 名称,\nDATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 日期\nFROM \n `downloadedplan` d\nLEFT JOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =d.`pastureid` AND bm.`barid` = d2.`fbarid` AND bm.`productdate` = d.`mydate`\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem ON tem.`pastureid` = d.`pastureid`\n\nWHERE d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.type = 0 \nAND IF(bm.`id`IS NOT NULL,bm.`bigcowclass` = \'泌乳牛\',1=1)\nGROUP BY d.`pastureid`,d.`mydate`\nORDER BY 名称, d.`mydate`','pastureid,pastureid,startTime,stopTime','getFeedEffMRJT','GetReportform','集团-饲喂效率图表-泌乳牛采食量','tmrgo','{\"name\":\"getFeedEffMRJT\",\"parammaps\":{\"pastureid\":\"1\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"data\":[{\"准确率\":\"787944.00\",\"名称\":\"兰陵富源\",\"日期\":\"2020-09-15\"},{\"准确率\":\"790132.00\",\"名称\":\"兰陵富源\",\"日期\":\"2020-09-16\"},{\"准确率\":\"0.00\",\"名称\":\"宝鸡\",\"日期\":\"2020-09-15\"},{\"准确率\":\"0.00\",\"名称\":\"宝鸡\",\"日期\":\"2020-09-16\"},{\"准确率\":\"382876.00\",\"名称\":\"巴盟圣牧20牧\",\"日期\":\"2020-09-15\"},{\"准确率\":\"377800.00\",\"名称\":\"巴盟圣牧20牧\",\"日期\":\"2020-09-16\"},{\"准确率\":\"329408.00\",\"名称\":\"巴盟圣牧8牧\",\"日期\":\"2020-09-15\"},{\"准确率\":\"335612.00\",\"名称\":\"巴盟圣牧8牧\",\"日期\":\"2020-09-16\"},{\"准确率\":\"353596.00\",\"名称\":\"测试牧场\",\"日期\":\"2020-09-15\"},{\"准确率\":\"340736.00\",\"名称\":\"测试牧场\",\"日期\":\"2020-09-16\"}],\"list\":{\"data1\":[\"兰陵富源\",\"宝鸡\",\"巴盟圣牧20牧\",\"巴盟圣牧8牧\",\"测试牧场\"],\"data2\":[\"2020-09-15\",\"2020-09-16\"],\"data3\":[{\"data\":[\"787944.00\",\"790132.00\"]},{\"data\":[\"0.00\",\"0.00\"]},{\"data\":[\"382876.00\",\"377800.00\"]},{\"data\":[\"329408.00\",\"335612.00\"]},{\"data\":[\"353596.00\",\"340736.00\"]}]},\"message\":\"ok\"}',0,1,0,0,0),
  487. (1691,363,'\nSELECT \n(select fname from feed where pastureid =fs.pastureid and id = fs.feedid ) feedname,\nfs.`stockweight`,round(fs.lweight,2) avgweight, if (fs.stockweight<=0,0, FLOOR(fs.stockweight/fs.lweight)) ldays,\nTRIM(fs.feedid) feedid,\nTRIM(fs.`pastureid`) pastureid,\nDATE_FORMAT((select max(date) from fswarnhis where pastureid = fs.pastureid and feedid = fs.feedid ), \'%Y-%m-%d\') lastdate \nFROM (SELECT\nfs.`id`,\n fs.`feedname`,fs.`stockweight`,\nfs.feedid feedid,\nfs.`pastureid` pastureid,DATE_FORMAT(NOW(), \'%Y-%m-%d\') lastdate,\n(SELECT SUM(d.lweight)/7 lweight FROM `downloadplandtl1` d WHERE d.pastureid = fs.pastureid \nAND `date` >= DATE_FORMAT(DATE_ADD(NOW(),INTERVAL -7 DAY), \'%Y-%m-%d\') \nAND `date` <DATE_FORMAT(NOW(), \'%Y-%m-%d\') AND d.fid = fs.`feedid`) lweight\nFROM `feedstorage` fs) fs\n\n\nWHERE fs.`pastureid`=? AND fs.stockweight< fs.lweight*(SELECT inforvalue FROM `sysopt` WHERE sysopt.pastureid = fs.pastureid AND inforname = \'repertoryWarn\')\nORDER BY ldays ,stockweight \n ','pastureid','getFsWarnList','GetDataByName','库存统计列表','tmrgo','{\"name\":\"getFsWarnList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1054: Unknown column \'days\' in \'order clause\'\"',0,1,0,0,0),
  488. (1692,390,'SELECT DATE_FORMAT(DATE , \'%Y-%m-%d\') 日期,\n(SELECT pasture_name FROM pasture WHERE pastureid = d1.`pastureid`) 名称,\nSUM(`actualweightminus`)准确率 -- 混料重量\nFROM `downloadplandtl1_exec` d1\nJOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem \nON tem.`pastureid` = d1.`pastureid`\n\nWHERE d1.date BETWEEN ? AND ?\nGROUP BY d1.`pastureid`,d1.date\nORDER BY d1.`pastureid`,d1.date ','pastureid,pastureid,startTime,stopTime','getAccuracActHLJT','GetDataByName','集团-混料实际重量统计','tmrgo','{\"name\":\"getAccuracActHLJT\",\"parammaps\":{\"pastureid\":\"1\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"准确率\":\"177384.00\",\"名称\":\"测试牧场\",\"日期\":\"2020-09-15\"},{\"准确率\":\"176492.00\",\"名称\":\"测试牧场\",\"日期\":\"2020-09-16\"},{\"准确率\":\"165462.00\",\"名称\":\"巴盟圣牧8牧\",\"日期\":\"2020-09-15\"},{\"准确率\":\"167950.00\",\"名称\":\"巴盟圣牧8牧\",\"日期\":\"2020-09-16\"},{\"准确率\":\"191334.00\",\"名称\":\"巴盟圣牧20牧\",\"日期\":\"2020-09-15\"},{\"准确率\":\"191104.00\",\"名称\":\"巴盟圣牧20牧\",\"日期\":\"2020-09-16\"},{\"准确率\":\"396274.00\",\"名称\":\"兰陵富源\",\"日期\":\"2020-09-15\"},{\"准确率\":\"399358.00\",\"名称\":\"兰陵富源\",\"日期\":\"2020-09-16\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":8}',0,1,0,0,0),
  489. (1693,362,'SELECT\nIFNULL(MAX(DATE(inventorydate)),\'2000-01-01\') maxdate\nFROM\n feedinventory f\nWHERE f.pastureid = ? \nORDER BY f.id ','pastureid','getInventoryMaxdate','GetDataByName','获取盘点最大日期','tmrgo','{\"name\":\"getInventoryMaxdate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"maxdate\":\"2021-01-23T00:00:00+08:00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  490. (1694,338,'SELECT \nIFNULL(GROUP_CONCAT(tem.`fname`, \' 剩余量不足 需要:\',ROUND(tem.fweight,2),\' 剩余:\',IFNULL(ps.`stockweight`,0)+IFNULL(( SELECT SUM(`operateweight`) FROM `premixplan` pm WHERE pm.`pastureid` = tem.pastureid AND pm.`ftid` = tem.ftid AND pm.`enable` = 1),0)),\'\') vmsg\n \n FROM(\n\nSELECT ftd.`fname`,ftd.preftid ftid,lpp1.`pastureid`,\nSUM(lpp1.`lweight`*(ftd.`fweight`/\n (SELECT SUM(fweight) FROM ftdetail \n WHERE pastureid = lpp1.pastureid AND ftid = ftd.`ftid`)))*? fweight\nFROM `lpplandtl1` lpp1\nJOIN `lpplan` lpp ON lpp.`pastureid` = lpp1.`pastureid` AND lpp.`id` = lpp1.`lppid`\nJOIN `fpdetail` fpd ON fpd.`pastureid` = lpp1.`pastureid` AND fpd.`id` = lpp1.`fpdid`\nJOIN `ftdetail` ftd ON ftd.`pastureid` = fpd.`pastureid` AND ftd.`ftid` = fpd.`ptid`\nWHERE lpp1.`pastureid` = ?\nAND lpp.times <= (SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= lpp1.`pastureid` AND sysopt.`inforname`=\'times\')\n AND lpp.sel = 1 AND lpp1.`fttype` = 1\n AND ftd.`preftid`>0\n GROUP BY ftd.`ftid`\n \n \n UNION ALL\n \n SELECT ftd.`fname`,ftd.`preftid`,lpp1.`pastureid`,\n SUM(lpp1.`lweight`*(ftd.`fweight`/\n (SELECT SUM(fweight) FROM ftdetail \n WHERE pastureid = lpp1.pastureid AND ftid = ftd.`ftid`)))*? fweight \nFROM `lpplandtl1` lpp1\nJOIN `lpplan` lpp ON lpp.`pastureid` = lpp1.`pastureid` AND lpp.`id` = lpp1.`lppid`\nJOIN `fpdetail` fpd ON fpd.`pastureid` = lpp1.`pastureid` AND fpd.`id` = lpp1.`fpdid`\nJOIN `ftdetail` ftd ON ftd.`pastureid` = fpd.`pastureid` AND ftd.`ftid` = fpd.`ptsid`\nWHERE lpp1.`pastureid` = ?\nAND lpp.times <= (SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= lpp1.`pastureid` AND sysopt.`inforname`=\'times\')\n AND lpp.sel = 1 AND lpp1.`fttype` = 0\n AND ftd.`preftid`>0 AND (SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= lpp1.`pastureid` AND sysopt.`inforname`=\'isEnableSupplyFeed\') = 1\n GROUP BY ftd.`ftid`) tem\n LEFT JOIN `premixstorage` ps ON ps.`pastureid` = tem.pastureid AND ps.`pftid` = tem.ftid\n WHERE tem.fweight > IFNULL(ps.`stockweight`,0)+\n IFNULL(( SELECT SUM(`operateweight`) FROM `premixplan` pm WHERE pm.`pastureid` = tem.pastureid AND pm.`ftid` = tem.ftid AND pm.`enable` = 1),0)\n \n','days,pastureid,days,pastureid','checkPreMixStorage','GetDataByName','新生成--混料重量判断','tmrgo','{\"name\":\"checkPreMixStorage\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"days\":2}}','{\"code\":0,\"list\":[{\"vmsg\":\"犊牛预混 剩余量不足 需要:780.46 剩余:402.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  491. (1695,363,'SELECT \nTRIM(ps.`pastureid`) pastureid,TRIM(ps.`id`) id,\nTRIM(ps.`pftid`) pftid,ps.`pftname`,ps.`stockweight`,IFNULL(ROUND(ps.`stockweight`/tem.fweight),\'计划暂未使用\') days\n FROM\n `premixstorage` ps\n LEFT JOIN\n (\n\nSELECT ftd.`fname`,ftd.preftid ftid,lpp1.`pastureid`,\nSUM(lpp1.`lweight`*(ftd.`fweight`/\n (SELECT SUM(fweight) FROM ftdetail \n WHERE pastureid = lpp1.pastureid AND ftid = ftd.`ftid`))) fweight\nFROM `lpplandtl1` lpp1\nJOIN `lpplan` lpp ON lpp.`pastureid` = lpp1.`pastureid` AND lpp.`id` = lpp1.`lppid`\nJOIN `fpdetail` fpd ON fpd.`pastureid` = lpp1.`pastureid` AND fpd.`id` = lpp1.`fpdid`\nJOIN `ftdetail` ftd ON ftd.`pastureid` = fpd.`pastureid` AND ftd.`ftid` = fpd.`ptid`\nWHERE lpp1.`pastureid` = ?\nAND lpp.times <= (SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= lpp1.`pastureid` AND sysopt.`inforname`=\'times\')\n AND lpp.sel = 1 AND lpp1.`fttype` = 1\n AND ftd.`preftid`>0\n GROUP BY ftd.`ftid`\n \n \n UNION ALL\n \n SELECT ftd.`fname`,ftd.preftid,lpp1.`pastureid`,\n SUM(lpp1.`lweight`*(ftd.`fweight`/\n (SELECT SUM(fweight) FROM ftdetail \n WHERE pastureid = lpp1.pastureid AND ftid = ftd.`ftid`))) fweight \nFROM `lpplandtl1` lpp1\nJOIN `lpplan` lpp ON lpp.`pastureid` = lpp1.`pastureid` AND lpp.`id` = lpp1.`lppid`\nJOIN `fpdetail` fpd ON fpd.`pastureid` = lpp1.`pastureid` AND fpd.`id` = lpp1.`fpdid`\nJOIN `ftdetail` ftd ON ftd.`pastureid` = fpd.`pastureid` AND ftd.`ftid` = fpd.`ptsid`\nWHERE lpp1.`pastureid` = ?\nAND lpp.times <= (SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= lpp1.`pastureid` AND sysopt.`inforname`=\'times\')\n AND lpp.sel = 1 AND lpp1.`fttype` = 0\n AND ftd.`preftid`>0 AND (SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= lpp1.`pastureid` AND sysopt.`inforname`=\'isEnableSupplyFeed\') = 1\n GROUP BY ftd.`ftid`) tem\n ON ps.`pastureid` = tem.pastureid AND ps.`pftid` = tem.ftid\n \n \n\n','pastureid,pastureid','getPreMixStorageLsit','GetDataByName','预混剩料列表','tmrgo','{\"name\":\"getPreMixStorageLsit\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"days\":2}}','{\"code\":0,\"list\":[{\"vmsg\":\"犊牛预混 剩余量不足 需要:780.46 剩余:402.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  492. (1696,363,'update premixstorage set stockweight = ? where pastureid = ? and id =?','stockweight ,pastureid,id ','updatePreMixStorage','GetDataByName','预混剩料校正','tmrgo','{\"name\":\"updatePreMixStorage\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"startTime\":\"2020-09-14\",\"days\":2}}','{\"code\":0,\"list\":[{\"vmsg\":\"犊牛预混 剩余量不足 需要:780.46 剩余:402.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  493. (1697,31,'SELECT IFNULL(IF((SELECT PASSWORD FROM USER\nWHERE id=? )=MD5(?),\'\',\'密码错误\'),\'密码错误\') vmsg','id,password','checkPassword','GetDataByName','核对密码','tmrgo','{\"name\":\"checkPassword\",\"parammaps\":{\"id\":\"1\",\"password\":\"123456\",\"deptId\":\"12\"}}','',0,1,0,0,0),
  494. (1698,351,'SELECT\nTRIM(barid) barid,(select bname from bar where pastureid =barmilk. pastureid and id = barmilk.barid)barname,DATE_FORMAT(productdate, \'%Y-%m-%d\')productdate,product,avgmonthage,bw,dayw,fetal,avgdim,dayspre,fat,pro,lactose,source,tem,cowsum,cowclass,TRIM(cowclassid) cowclassid,bigcowclass,emp,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n barmilk\nWHERE pastureid = ? \n AND id =?\n','pastureid,id','getBarmilkListDetailAPP','GetDataByName','栏舍生产性能列表APP-查看','tmrgo','{\"name\":\"getBarmilkList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'TRIM(id) id,\\nTRIM(pastureid) pastureid\\nFROM\\n barmilk\\nWHERE pastureid = ? \\n AN\' at line 3\"',0,1,0,0,0),
  495. (1699,350,'SELECT\nbname,\nTRIM(id) id\nFROM\n bar\nWHERE pastureid = ? and enable=1\nand (bname like concat(\'%\',?,\'%\') or ? = \'\')\nORDER BY id DESC','pastureid,bname,bname ','getBarListEnableVague','GetDataByName','栏舍列表','tmrgo','{\"name\":\"getBarListEnableVague\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"bname\":\"西区\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"bname\":\"西区#3\",\"id\":\"3028015437557793792\"},{\"bname\":\"西区#2\",\"id\":\"3028006959913108480\"},{\"bname\":\"西区#1改\",\"id\":\"3027996177498375168\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  496. (1700,352,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d %H:%i\')operatetime,emp,remain,pid,times,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND timesstr,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n barfeedremain\nWHERE pastureid = ? \n AND id =?\n\nORDER BY id DESC','pastureid,id','getBarfeedremainListDetailAPP','GetDataByName','剩料记录列表APP','tmrgo','{\"name\":\"getBarfeedremainList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3041025691337884674\",\"barname\":\"22\",\"emp\":\"1\",\"id\":\"3041025691337884673\",\"operatetime\":\"2020-09-07 10:50\",\"pastureid\":\"3025176271438480383\",\"pid\":1,\"remain\":\"33.00\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  497. (1701,353,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimesstr,\nfreshweight,dryweight,thoweight,actweight,emp,ftname,trim(ftid) ftid,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n ftdry\nWHERE pastureid = ? and \nid = ?','pastureid,id','getFtdryListDetailAPP','GetDataByName','配方干物质列表','tmrgo','{\"name\":\"getBarfeedremainList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3041025691337884674\",\"barname\":\"22\",\"emp\":\"1\",\"id\":\"3041025691337884673\",\"operatetime\":\"2020-09-07 10:50\",\"pastureid\":\"3025176271438480383\",\"pid\":1,\"remain\":\"33.00\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  498. (1702,355,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND timesstr,\nonerate,oneweight,tworate,twoweight,threerate,threeweight,fourrate,fourweight,remark,emp,ccname,planid,onerange,tworange,threerange,fourrange,\ntrim(ccid) ccid,\nTRIM(id) id,\nTRIM(pastureid) pastureid,\nCONCAT(onerange,tworange,threerange,fourrange) standard\nFROM\n pennsieve\nWHERE pastureid = ? \nand id = ?','pastureid,id','getPennsieveListDetailAPP','GetDataByName','宾州筛列表','tmrgo','{\"name\":\"getPennsieveList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3028006959913108480\",\"barname\":\"15\",\"emp\":\"张三\",\"fourrange\":\"60-100\",\"fourrate\":\"40\",\"fourweight\":\"40\",\"ftid\":\"11\",\"ftname\":\"22\",\"id\":\"3025176271438480385\",\"onerange\":\"5-15\",\"onerate\":\"10\",\"oneweight\":\"10\",\"operatetime\":\"2020-09-08T00:00:00+08:00\",\"pastureid\":\"3025176271438480383\",\"planid\":33,\"remark\":\"111\",\"threerange\":\"35-60\",\"threerate\":\"30\",\"threeweight\":\"30\",\"times\":\"3\",\"tworange\":\"15-35\",\"tworate\":\"20\",\"twoweight\":\"20\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  499. (1703,357,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nstandardscore,cowsum,1score score1,2score score2,3score score3,4score score4,5score score5,remark,emp,ftname,\ntrim(ftid) ftid,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n dungscore\nWHERE pastureid = ? \n AND id =?\nORDER BY id DESC','pastureid,id','getDungscoreListDetailAPP','GetDataByName','粪便评分列表','tmrgo','{\"name\":\"getDungscoreList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"1score\":5,\"2score\":10,\"3score\":45,\"4score\":20,\"5score\":25,\"barid\":\"3028006959913108480\",\"barname\":\"15\",\"cowsum\":105,\"emp\":\"老八\",\"ftid\":\"1\",\"ftname\":\"1\",\"id\":\"3025176271438480384\",\"operatetime\":\"2020-09-08\",\"pastureid\":\"3025176271438480383\",\"remark\":\"单\",\"standardscore\":\"3\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  500. (1704,358,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nstandardscore,cowsum,remark,emp,ftname,\nscore25,score275,score3,score325,score35,score375,`score4`,\ntrim(ftid) ftid,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n bodyscore\nWHERE pastureid = ? \n AND id = ?\nORDER BY id DESC','pastureid,id','getBodyscoreListDetailAPP','GetDataByName','体况评分列表','tmrgo','{\"name\":\"getBodyscoreList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"2\",\"barname\":\"1\",\"cowsum\":100,\"emp\":\"朱一\",\"ftid\":\"1\",\"ftname\":\"2\",\"id\":\"3025176271438480387\",\"operatetime\":\"2020-09-08\",\"pastureid\":\"3025176271438480383\",\"remark\":\"0\",\"score25\":10,\"score275\":20,\"score3\":30,\"score325\":40,\"score35\":0,\"score375\":0,\"score4\":0,\"standardscore\":\"4\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  501. (1705,354,'SELECT\nTRIM(eqid) eqid,eqclass,eqcode,driver,TRIM(driverid) driverid,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,\nTRIM(id) id,\nTRIM(pastureid) pastureid,emp\nFROM\n dutyrecord\nWHERE pastureid = ? \n AND id=?','pastureid,id','getDutyrecordListDetailAPP','GetDataByName','值班记录列表','tmrgo','{\"name\":\"getDutyrecordList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,\\nTRIM(id) id,\\nTRIM(pastureid) pa\' at line 14\"',0,1,0,0,0),
  502. (1706,356,'SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nonerate,oneweight,tworate,twoweight,threerate,threeweight,remark,emp,planid,ccname,onerange,tworange,threerange,\ntrim(ccid) ccid,\nTRIM(id) id,\nTRIM(pastureid) pastureid,\n CONCAT(onerange,tworange,threerange) standard\nFROM\n dungsieve\nWHERE pastureid = ? \n AND id = ?\nORDER BY id DESC','pastureid,id','getDungsieveListDetailAPP','GetDataByName','粪便筛列表','tmrgo','{\"name\":\"getDungsieveList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  503. (1707,343,'\nSELECT\neqcode,\ntname,\ndatacaptureno,\nTRIM(tclassid) tclassid,\nCONCAT(tname,\' / \',eqcode) tmrmix,\ntclassname,\nmaxstirfeed,\nremark,\n`enable`,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n tmr\nWHERE pastureid = ? AND ENABLE=1 AND IF(?=1,tclassid IN(1,2),tclassid = ?)\n\nUNION ALL\nSELECT \'任意车\',\'任意车\',\'-1\',-1,\'任意车\',\'任意车\',100000,\'任意车\',1,-1,?\n\nORDER BY id DESC','pastureid,eqtype,eqtype,pastureid','getTMRListEnableType','GetDataByName','tmr列表','tmrgo','{\"name\":\"getTMRListEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"eqtype\":\"2\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":2,\"enable\":1,\"eqcode\":\"05841\",\"id\":\"3029300176059106304\",\"maxstirfeed\":0,\"pastureid\":\"3025176271438480383\",\"remark\":\"维修中\",\"tclassid\":\"0\",\"tclassname\":\"\",\"tname\":\"东区铲车\"},{\"datacaptureno\":7,\"enable\":1,\"eqcode\":\"017288\",\"id\":\"3029299420144862208\",\"maxstirfeed\":2000,\"pastureid\":\"3025176271438480383\",\"remark\":\"在用\",\"tclassid\":\"2\",\"tclassname\":\"固定式\",\"tname\":\"拖拉机\"},{\"datacaptureno\":8,\"enable\":1,\"eqcode\":\"0000158\",\"id\":\"3027989712817619968\",\"maxstirfeed\":1000,\"pastureid\":\"3025176271438480383\",\"remark\":\"\",\"tclassid\":\"1\",\"tclassname\":\"自走式\",\"tname\":\"装载机\"},{\"datacaptureno\":4,\"enable\":1,\"eqcode\":\"09874\",\"id\":\"3026792763464614912\",\"maxstirfeed\":0,\"pastureid\":\"3025176271438480383\",\"remark\":\"保养中\",\"tclassid\":\"0\",\"tclassname\":\"\",\"tname\":\"西区铲车\"},{\"datacaptureno\":12,\"enable\":1,\"eqcode\":\"11\",\"id\":\"3026731597124076544\",\"maxstirfeed\":1,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"1\",\"tclassname\":\"自走式\",\"tname\":\"11\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":5}',0,1,0,0,0),
  504. (1708,338,'SELECT \n(SELECT SUM(weight) FROM fpdetaildate fpdv WHERE fpdv.pastureid = fpd.pastureid \nAND fpdv.barid = fpd.barid AND fpdv.date = fpd.date) sumweight,\nTRIM(fd.id) fpid,\n TRIM(fpd.`id`) id,\n TRIM(fpd.`pastureid`)pastureid,\n TRIM(fpd.`barid`) barid,\n fpd.`barname`,\nfpd.`times` timesin,\nCASE fpd.`times`\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND times ,\n fpd.`tratio`,\nfpd.weight,\n@unlockwe :=ROUND(IFNULL((SELECT SUM(ftd.`fweight`) FROM `ftdetail` ftd\nWHERE ftd.pastureid = fpd.`pastureid` AND ftd.ftid = fpd.`ptid` AND ftd.islockcount = 0\n),0),2) unlockweight,\n\n@lockwe :=ROUND(IFNULL((SELECT SUM(ftd.`fweight`) FROM `ftdetail` ftd\nWHERE ftd.pastureid = fpd.`pastureid` AND ftd.ftid = fpd.`ptid` AND ftd.islockcount = 1\n),0),2) lockweight,\n\n@pwe :=ROUND(@unlockwe*fpd.ccountradio*fpd.cowcount/100 + @lockwe*fpd.cowcount,2) pweight,\n\n\n@punlockwe :=ROUND(IFNULL((SELECT SUM(ftd.`fweight`) FROM `ftdetail` ftd\nWHERE ftd.pastureid = fpd.`pastureid` AND ftd.ftid = fpd.`ptsid` AND ftd.islockcount = 0\n),0),2) punlockweight,\n\n@plockwe :=ROUND(IFNULL((SELECT SUM(ftd.`fweight`) FROM `ftdetail` ftd\nWHERE ftd.pastureid = fpd.`pastureid` AND ftd.ftid = fpd.`ptsid` AND ftd.islockcount = 1\n),0),2) plockweight,\nROUND(@punlockwe*fpd.ccountradio*fpd.cowcount/100 + @plockwe*fpd.cowcount,2) ptweight,\n fpd.`ptsrate`,\n (SELECT tname FROM `feedtemplet` ft1 WHERE ft1.pastureid =fpd.pastureid AND ft1.id=fpd.`ptid`)ptname,\n (SELECT tname FROM `feedtemplet` ft1 WHERE ft1.pastureid =fpd.pastureid AND ft1.id=fpd.`ptsid`)ptsname,\n TRIM(fpd.`ptid`)ptid,\n TRIM(fpd.`ptsid`) ptsid,\n fpd.`ptuse`,\n fpd.`ptsuse`,\n fpd.cowcount ccount,\n fpd.`ccountradio` ratio,\n ROUND( fpd.`ccountradio`* fpd.`cowcount`/100,2) ccountratio,\n fd.`softccount`,\n@dryw :=ROUND(IFNULL((SELECT SUM(\nIF(ftd.preftid<>0,\n ftd.`fweight`*IFNULL((SELECT SUM(ftd.`fweight`*dry/100)/SUM(ftd.`fweight`) FROM `ftdetail` ftd\nJOIN feednur f ON f.fid= ftd.fid AND f.pastureid = ftd.pastureid\nWHERE ftd.pastureid = fpd.`pastureid` AND ftd.ftid = fpd.`ptid`),0),\nftd.`fweight`*dry/100)\n)/SUM(ftd.`fweight`)\n FROM `ftdetail` ftd\nLEFT JOIN feednur f ON f.fid= ftd.fid AND f.pastureid = ftd.pastureid\nWHERE ftd.pastureid = fpd.`pastureid` AND ftd.ftid = fpd.`ptid`),0),2) dryweight1,\n\n\n@acrate:= IFNULL((SELECT actweight FROM `ftdry` WHERE ftdry.`pastureid` =fpd.`pastureid` \nAND ftdry.`barid` = fpd.`barid` AND ftdry.`times` = fpd.`times` AND ftdry.`operatetime` = DATE_ADD( fpd.`date`,INTERVAL -1 DAY)),0)actweightrate,\n@acrate1:= IFNULL((SELECT actweight FROM `ftdry` WHERE ftdry.`pastureid` =fpd.`pastureid` AND ftdry.`barid` = fpd.`barid` AND ftdry.`times` = fpd.`times` AND ftdry.`operatetime` = DATE_ADD( fpd.`date`,INTERVAL -2 DAY)),0)actweightrate1,\n@swyes:=ROUND(IFNULL((SELECT ROUND(fpd1.weight*(1-fpd1.ptsrate)*@acrate1/fpd1.cowcount/fpd1.ccountradio*100,2) FROM `fpdetaildate` fpd1 WHERE fpd1.pastureid = fpd.pastureid AND fpd1.barid = fpd.barid AND fpd1.times = fpd.times AND fpd1.date = DATE_ADD( fpd.`date`,INTERVAL -1 DAY)),0),2)swdryw1,\n@sw:=ROUND(weight*(1-ptsrate)*@acrate/fpd.cowcount/fpd.ccountradio*100,2)swdryw2,\nCONCAT(@sw,\'( 昨:\',@swyes,IF(@sw>@swyes,\' + \',\' - \'),ABS(@sw-@swyes),\')\') swdryw,\nROUND(@pwe*@acrate/fpd.cowcount/fpd.ccountradio*100,2)cydryw,\nROUND(@dryw*@pwe/fpd.cowcount/fpd.ccountradio*100 ,2) dryweight\n FROM `fpdetaildate` fpd\n \nJOIN feedpdate fd ON fd.`pastureid` = fpd.`pastureid` AND fd.`barid` = fpd.`barid` AND fd.`date` = fpd.`date`\nJOIN bar ON bar.`pastureid` = fpd.`pastureid` AND bar.`id` = fpd.barid\nWHERE fpd.`pastureid` = ? AND fpd.`date` = ? \nAND bar.`enable` = 1\nAND fpd.times <= (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= fpd.`pastureid` AND sysopt.`inforname`=\'times\')\n\n\n','pastureid,date','getPlanModifyFPlist','GetDataByName','修改计划-栏舍配方列表','tmrgo','{\"name\":\"getPlanModifyFPlist\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"date\":\"2021-04-07\",\"sort\":\"0\",\"enable\":1}}','\"Error 1054: Unknown column \'fpd.ccountratio\' in \'field list\'\"',0,1,0,0,0),
  505. (1709,338,'UPDATE\n`fpdetaildate`\nSET\n `tratio` = ?,\n `weight` = ?,\n `ptsrate` = ifnull(?/?,0),\n `cowcount` = ?,\n `ccountradio` = ?,\n `ptid` = ?,\n `ptsid` = ?\nWHERE `id` = ? \n AND `pastureid` =?\n AND `date` = ?','tratio,weight,ptweight,pweight,cowcount,ccountradio,ptid,ptsid,id,pastureid,date','updatePlanModifyFPlist','GetDataByName','修改计划-栏舍配方修改','tmrgo','{\"name\":\"getPlanModifyFPlist\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"date\":\"2021-04-07\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"预混配方\",\"id\":\"8874176271438480590\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方2\"},{\"ccid\":1,\"enable\":1,\"fttype\":\"饲喂配方\",\"id\":\"8874176271438480589\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  506. (1710,365,'SELECT TRIM(feedp.pastureid) pastureid,feedp.barname,TRIM(feedp.barid) barid,TRIM(ft.id) arrid,1 AS type,? AS times,ft.tname ftname,ft.tcolor background,feedp.date\nFROM feedpdate feedp\nINNER JOIN `fpdetaildate` fpd ON fpd.`date` = feedp.`date` AND fpd.`barid` = feedp.`barid` AND fpd.`pastureid` = feedp.`pastureid`\nINNER JOIN feedtemplet ft\nON ft.id = fpd.`ptid` AND ft.pastureid=?\nWHERE feedp.pastureid = ? AND feedp.date=?\nGROUP BY fpd.`ptid`\nUNION\nSELECT TRIM(feedp.pastureid) pastureid,feedp.barname,feedp.barid,TRIM(ft.id) arrid,0 AS type,? AS times,ft.tname ptsfname ,ft.tcolor background ,feedp.date \nFROM feedpdate feedp\nINNER JOIN `fpdetaildate` fpd ON fpd.`date` = feedp.`date` AND fpd.`barid` = feedp.`barid` AND fpd.`pastureid` = feedp.`pastureid`\nINNER JOIN feedtemplet ft\nON ft.id = fpd.`ptsid` AND ft.pastureid=?\nWHERE feedp.pastureid = ? AND (SELECT inforvalue FROM sysopt WHERE sysopt.`pastureid`=feedp.pastureid AND sysopt.`inforname`= \'isEnableSupplyFeed\') = 1 AND feedp.date=?\nGROUP BY fpd.`ptsid`','times,pastureid,pastureid,date,times ,pastureid,pastureid,date','geFTListByFPdate','GetArrList','配方列表','tmrgo','{\"name\":\"geFTListByFP\",\"name1\":\"geFTListByFPDetail\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'ft.pastureid=?\\nWHERE feedp.pastureid = ? \\nGROUP BY feedp.`ptsfid`\' at line 9\"',0,1,0,0,0),
  507. (1711,365,'SELECT TRIM(id) id,times,tratio,ROUND(ptsrate*weight,2)-ptsuse weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM(ptid) ptid,TRIM(ptsid ) ptsid ,\n(select bname from bar where pastureid =fpdetail.pastureid and id = fpdetail.barid ) barname,\n ? AS background,? AS fttype,cowcount,ccountradio FROM fpdetaildate fpdetail\nWHERE fpdetail.pastureid = ? AND ( fpdetail.`ptsid`=?) AND times=? AND ptsuse< ROUND(ptsrate*weight,2) and fpdetail.date = ?\n\nUNION\nSELECT TRIM(id) id,times,tratio,ROUND((1-ptsrate)*weight,2)-ptuse weight,TRIM(barid) barid,TRIM(pastureid) pastureid,TRIM(ptid) ptid,TRIM(ptsid ) ptsid ,\n(select bname from bar where pastureid =fpdetail.pastureid and id = fpdetail.barid ) barname, \n? AS background,? AS fttype,cowcount,ccountradio FROM fpdetaildate fpdetail\nWHERE fpdetail.pastureid = ? AND (fpdetail.`ptid`=? ) AND times=? AND ptuse<ROUND((1-ptsrate)*weight,2) and fpdetail.date = ?\nORDER BY barid','background,type,pastureid,arrid,times,date,background,type,pastureid,arrid,times,date','geFTListByFPDetaildate','GetDataByName','配方栏舍列表','tmrgo','{\"name\":\"geFTListByFPDetail\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"arrid\":\"3045510162053334000\",\"times\":\"1\",\"enable\":1}}','\"sql: expected 10 arguments, got 12\"',0,1,0,0,0),
  508. (1712,365,'SELECT\nlpplan.date,\n-- ifnull((select eqcode from tmr where pastureid =lpplan.pastureid and id = lpplan.tmrid ),lpplan.tmrname) \nlpplan.tmrname tmrname,trim(tmrid) tmrid,sort,sel,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND timesstr,issplit,\ntimes,display,begintime,\n(select tname from feedtemplet where pastureid =lpplan.pastureid and id = lpplan.ftid ) ftname,sumcowcount,\nIFNULL(round((SELECT SUM(lpplandtl1.lweight) FROM `lpplandtl1date` lpplandtl1 WHERE lpplandtl1.`lppid`=lpplan.id and lpplandtl1.date= ?),2),0) sumweight ,\nmaxweight,\nTRIM(ftid) ftid,\nTRIM(id) id,\nTRIM(id) lppid,\nTRIM(pastureid) pastureid\n\nFROM\n lpplandate lpplan\nWHERE pastureid = ? and date =? and times <= (SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= lpplan.pastureid AND sysopt.`inforname`=\'times\')\nORDER BY lpplan.sort','date,pastureid,date ','getLppListdate','GetArrList','发料计划列表','tmrgo','{\"name\":\"getLppList\",\"name1\":\"getLppdList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'2),0),2) sumcowcount,maxweight,\\nTRIM(ftid) ftid,\\nTRIM(id) id,\\nTRIM(id) lppid,\\nTR\' at line 2\"',0,1,0,0,0),
  509. (1713,365,'delete from lpplandate where pastureid=? and id = ? and date = ?','pastureid,id,date','deleteLppdate','PostDataByName','删除发料计划','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  510. (1714,365,'INSERT INTO lpplandate(id,pastureid,tmrname,tmrid,sort,sel,times,display,begintime,ftname,ftid,sumweight,maxweight,issplit,date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ','snowid,pastureid,tmrname,tmrid,sort,sel,times,display,begintime,ftname,ftid,sumweight,maxweight,issplit,date','insertLppdate','PostDataByName','新增发料计划','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  511. (1715,365,'update lpplandate set tmrname =?,tmrid =?,sort =?,sel =?,times =?,display =?,begintime =?,ftname =?,ftid =?,sumweight =?,sumcowcount =?,maxweight =?,issplit= ?\nwhere pastureid=? and id=? and date=?','tmrname,tmrid,sort,sel,times,display,begintime,ftname,ftid,sumweight,sumcowcount,maxweight,issplit,pastureid,id,date','updateLppdate','PostDataByName','修改发料计划','tmrgo','{\"name\":\"updateDutyrecord\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  512. (1716,365,'delete from lpplandtl1date where pastureid=? and id = ? and date = ?','pastureid,id,date','deleteLppddate','PostDataByName','删除发料计划-子','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  513. (1717,365,'INSERT INTO lpplandtl1date(id,pastureid,lppid,barid,barname,fpdid,lweight,sort,tmrid,tmrname,fttype,background,cowcount,ccountradio,date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,if(?=\'\',0,?),if(?=\'\',0,?),?) ON DUPLICATE KEY UPDATE lweight=lweight+?','snowid,pastureid,lppid,barid,barname,fpdid,lweight,sort,tmrid,tmrname,fttype,background,cowcount,cowcount,ccountradio,ccountradio,date,lweight','insertLppddate','PostDataByName','新增发料计划-子','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  514. (1718,365,'update lpplandtl1date set lppid =?,barid =?,barname =?,fpdid =?,lweight =?,sort =?,tmrid =?,tmrname =?,background=?\nwhere pastureid=? and id=? and date=?','lppid,barid,barname,fpdid,lweight,sort,tmrid,tmrname,background,pastureid,id,date','updateLppddate','PostDataByName','修改发料计划-子','tmrgo','{\"name\":\"updateDutyrecord\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  515. (1721,365,'SELECT\ntrim(lpplandtl1.lppid) lppid,lweight,\nlpplandtl1.lweight weight,lpplandtl1.sort,\n(select bname from bar where pastureid =lpplandtl1.pastureid and id = lpplandtl1.barid ) barname,\nTRIM(lpplandtl1.fpdid) fpdid,\nTRIM(lpplandtl1.barid) barid,\nTRIM(lpplandtl1.id) id,\nTRIM(lpplandtl1.pastureid) pastureid,\nlpplandtl1.background,\nlpplandtl1.fttype,\ntrim(lpplandtl1.tmrid) tmrid,\nifnull((select eqcode from tmr where pastureid =lpplandtl1.pastureid and id = lpplandtl1.tmrid ),lpplandtl1.tmrname) tmrname,\nifnull((select tcolor from tmr where pastureid =lpplandtl1.pastureid and id = lpplandtl1.tmrid ),\'#ccc\') tbackground,\nfpdetail.ptid,\nfpdetail.ptsid,\nfpdetail.times,\nfpdetail.cowcount,\nfpdetail.ccountradio\nFROM\n lpplandtl1date lpplandtl1\ninner join fpdetaildate fpdetail\non lpplandtl1.fpdid= fpdetail.id and lpplandtl1.pastureid = fpdetail.pastureid and lpplandtl1.date = fpdetail.date\nWHERE lpplandtl1.pastureid = ? and lpplandtl1.lppid= ? and lpplandtl1.date = ? and lpplandtl1.lweight>0\nORDER BY lpplandtl1.sort','pastureid,lppid,date','getLppdListdate','GetDataByName','发料计划列表-子','tmrgo','{\"name\":\"getLppdList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"lppid\":\"3025176271438480384\",\"sort\":\"0\",\"enable\":1}}','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'.weight,lpplandtl1.sort,lpplandtl1.barname,\\nTRIM(lpplandtl1.fpdid) fpdid,\\nTRIM(l\' at line 3\"',0,1,0,0,0),
  516. (1722,365,'SELECT \ntname,usedsum,\nifnull(MAX(CASE\n WHEN times = 1 THEN\n usesum\n END\n) ,0)AS onetime,\nifnull(MAX(CASE\n WHEN times = 2 THEN\n usesum\n END\n) ,0)AS twotime\n,\nifnull(MAX(CASE\n WHEN times = 3 THEN\n usesum\n END\n),0) AS threetime,\nifnull(MAX(CASE\n WHEN times = 4 THEN\n usesum\n END\n) ,0)AS fourtime\nFROM \n\n(SELECT IFNULL(tem.tname,qq.tname) tname,IFNULL(tem.ptid,qq.ptid) ptid,tem.times times,\n IFNULL(tem.barsum,0) usesum , IFNULL(qq.barsum,0) usedsum \nFROM \n(SELECT ft.`tname` ,COUNT(fpdetail.`barid`)barsum,fpdetail.ptid,times\nFROM `fpdetaildate` fpdetail\nINNER JOIN feedtemplet ft\nON ft.id = fpdetail .ptid AND ft.pastureid=?\nWHERE fpdetail.`pastureid` = ? AND ptuse < ROUND((1-ptsrate)*fpdetail.weight,2) and fpdetail.`date` = ?\nGROUP BY ptid,times\nUNION \nSELECT ft.`tname` ,COUNT(fpdetail.`barid`) barsum,fpdetail.ptsid,times\nFROM `fpdetaildate` fpdetail\nINNER JOIN feedtemplet ft\nON ft.id = fpdetail .ptsid AND ft.pastureid=?\nWHERE fpdetail.`pastureid` = ? AND ptsuse < ROUND(ptsrate*fpdetail.weight,2) and fpdetail.`date` = ?\nGROUP BY ptsid,times) tem\n#####\n\nLEFT JOIN \n#####\n(SELECT ft.`tname` ,COUNT(fpdetail.`barid`)barsum,fpdetail.ptid\nFROM `fpdetaildate` fpdetail\nINNER JOIN feedtemplet ft\nON ft.id = fpdetail .ptid AND ft.pastureid=?\nWHERE fpdetail.`pastureid` = ? and fpdetail.`date` = ?\nGROUP BY ptid\n\nUNION \nSELECT ft.`tname` ,COUNT(fpdetail.`barid`) barsum,fpdetail.ptsid\nFROM `fpdetaildate` fpdetail\nINNER JOIN feedtemplet ft\nON ft.id = fpdetail .ptsid AND ft.pastureid=?\nWHERE fpdetail.`pastureid` = ? and fpdetail.`date` = ?\nGROUP BY ptsid)qq\n#####\nON qq.ptid= tem.ptid )ww\n\n GROUP BY ww.tname','pastureid,pastureid,date,pastureid,pastureid,date,pastureid,pastureid,date,pastureid,pastureid,date','getLppUseSUMListdate','GetDataByName','发料计划列表-子','tmrgo','{\"name\":\"getLppUseSUMList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"lppid\":\"3025176271438480384\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"onetime\":4,\"threetime\":3,\"tname\":\"test\",\"twotime\":4,\"usedsum\":12},{\"threetime\":2,\"tname\":\"补料1\",\"twotime\":2,\"usedsum\":6},{\"onetime\":1,\"threetime\":2,\"tname\":\"补料2\",\"twotime\":2,\"usedsum\":6},{\"onetime\":1,\"tname\":\"补料3\",\"usedsum\":3},{\"threetime\":2,\"tname\":\"配方1\",\"twotime\":2,\"usedsum\":6},{\"threetime\":2,\"tname\":\"配方2\",\"twotime\":2,\"usedsum\":6}],\"message\":\"ok\",\"pageSize\":0,\"total\":6}',0,1,0,0,0),
  517. (1723,365,'update fpdetaildate set ptuse=if(?=1,ptuse+?,ptuse),ptsuse=if(?=0,ptsuse+?,ptsuse)\nwhere pastureid=? and id=? and date = ?','fttype,lweight,fttype,lweight,pastureid,id,date','updateFpdetailUsedate','PostDataByName','修改栏舍配方子','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  518. (1725,365,'UPDATE `lpplandtl1date` SET sort=sort+1 WHERE pastureid=? AND sort>=? AND lppid =? and date = ?','pastureid,sort,lppid,date','updateLpplandtlSortsdate','PostDataByName','修改栏舍配方子sort','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  519. (1726,365,'UPDATE `lpplandtl1date` SET sort=? WHERE pastureid=? AND id =? and date=?','pastureid,id,date','updateLpplandtlSortonedate','PostDataByName','修改栏舍配方子','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  520. (1727,365,'UPDATE `lpplandate` lpplan SET sumweight = ifnull((SELECT SUM(lpplandtl1.lweight) FROM `lpplandtl1` WHERE lpplandtl1.`lppid`=lpplan.id),0)\nwhere lpplan.pastureid=? and lpplan.id = ? and lpplan.date = ?','pastureid,lppid,date ','updateLppWeightdate','PostDataByName','修改发料总重','tmrgo','{\"name\":\"updateLpp\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  521. (1729,365,'SELECT \n(\nSELECT CASE \nWHEN (SELECT ftid FROM `lpplandate` lpplan\nWHERE lpplan.`pastureid` = ?\nAND id= ? AND lpplan.date =?)<>IF (1 =?, ?,?)\nAND (SELECT COUNT(lppd1.`id`) FROM `lpplandtl1date` lppd1\nINNER JOIN `lpplandate` lpplan\nON lppd1.`lppid` = lpplan.`id` AND lppd1.`pastureid` = lpplan.`pastureid` and lpplan.date = lppd1.date\nWHERE lpplan.`pastureid` = ? AND lpplan.id= ? AND lppd1.`barid`= ? and lpplan.date = ?)=0\nTHEN CONCAT(\'该栏舍配方与计划配方不匹配,无法分配\')\nWHEN ?<>?\nTHEN CONCAT(\'该栏舍配方与计划配方班次不匹配,无法分配\')\nELSE \'\' END AS vmsg \n\n) vmsg','pastureid,lppid,date,fttype,ptid,ptsid,pastureid,lppid,barid,date,times,timesTem','checkLLPDetailInsertdate','GetDataByName','新生成--撒料计划是否可插入','tmrgo','{\"name\":\"checkLLPDetailInsert\",\"parammaps\": {\n \"pastureid\": \"3025176271438480383\",\n \"barid\": \"3050941006599422976\",\n \"lppid\": \"3025176271438480384\",\n \"times\": 1,\n \"ptsid\": \"-1\",\n \"ptid\": \"3025176272438480393\",\n \"fttype\": \"1\"\n }}','{\"code\":0,\"list\":[{\"vmsg\":\"该栏舍配方与计划配方不匹配,无法分配\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  522. (1730,365,'SELECT \n(\nSELECT CASE \nWHEN (SELECT ftid FROM `lpplan`\nWHERE lpplan.`pastureid` = ?\nAND id= ?)<>IF (1 =?, ?,?)\nAND (SELECT COUNT(lppd1.`id`) FROM `lpplandtl1` lppd1\nINNER JOIN `lpplan`\nON lppd1.`lppid` = lpplan.`id` AND lppd1.`pastureid` = lpplan.`pastureid`\nWHERE lpplan.`pastureid` = ? AND lpplan.id= ? AND lppd1.`barid`= ? )=0\nTHEN CONCAT(\'该栏舍配方与计划配方不匹配,无法分配\')\nWHEN ?<>?\nTHEN CONCAT(\'该栏舍配方与计划配方班次不匹配,无法分配\')\nELSE \'\' END AS vmsg \n\n) vmsg','pastureid,lppid,fttype,ptid,ptsid,pastureid,lppid,barid,times,timesTem','checkLLPDetailInsertV2date','GetDataByName','新生成--撒料计划是否可插入','tmrgo','{\"name\":\"checkLLPDetailInsert\",\"parammaps\": {\n \"pastureid\": \"3025176271438480383\",\n \"barid\": \"3050941006599422976\",\n \"lppid\": \"3025176271438480384\",\n \"times\": 1,\n \"ptsid\": \"-1\",\n \"ptid\": \"3025176272438480393\",\n \"fttype\": \"1\"\n }}','{\"code\":0,\"list\":[{\"vmsg\":\"该栏舍配方与计划配方不匹配,无法分配\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  523. (1741,336,'SELECT \ntrim(id) id,trim(pastureid) pastureid,trim(ftid) ftid,ftname,sort,\ntrim(tmrid) tmrid,\n-- if (tmrid=-1,\'任意车\',(select eqcode from tmr where pastureid =pp.pastureid and id = pp.tmrid )) \ntmrcode,trim(lppid) lppid,\n(select CONCAT(lpplan .sort,\' \',lpplan .display) from lpplandate lpplan where pastureid =pp.pastureid and id = pp.lppid and date =pp.date ) lppcode,\nenable,ptime,maxweight,operateweight,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes \nFROM\n premixplandate pp\n\nWHERE pp.pastureid = ? and pp.date = ?\norder by sort\n','pastureid,date','getPremixplanListdate','GetDataByName','预混计划列表-历史计划','tmrgo','{\"name\":\"getPremixplanList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"enable\":1,\"ftid\":\"1\",\"ftname\":\"1\",\"id\":\"3025176271438480385\",\"lppcode\":6,\"lppid\":\"5\",\"maxweight\":\"5000.00\",\"operateweight\":\"2000.00\",\"pastureid\":\"3025176271438480383\",\"ptime\":\"08:00\",\"times\":\"4\",\"timesstr\":\"第四班\",\"tmrcode\":\"3\",\"tmrid\":\"2\"},{\"enable\":1,\"ftid\":\"1\",\"ftname\":\"1\",\"id\":\"3025176271438480386\",\"lppcode\":6,\"lppid\":\"5\",\"maxweight\":\"5000.00\",\"operateweight\":\"2000.00\",\"pastureid\":\"3025176271438480383\",\"ptime\":\"08:00\",\"times\":\"4\",\"timesstr\":\"第四班\",\"tmrcode\":\"任意车\",\"tmrid\":\"-1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  524. (1742,336,'delete from premixplandate where pastureid=? and id = ? and date = ?','pastureid,id,date ','deletePremixplandate','PostDataByName','删除预混计划-历史计划','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  525. (1743,336,'INSERT INTO premixplandate(id,pastureid,ftid,ftname,tmrid,tmrcode,times,lppid,lppcode,enable,ptime,maxweight,operateweight,sort,date) VALUES (?,?,?,?,?,?,?,if(?=\'\',null,?),if(?=\'\',null,?),?,?,?,?,?,?) ','snowid,pastureid,ftid,ftname,tmrid,tmrcode,times,lppid,lppid,lppcode,lppcode,enable,ptime,maxweight,operateweight,sort,date','insertPremixplandate','PostDataByName','新增预混计划-历史计划','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  526. (1744,336,'update premixplandate set ftid =?,ftname =?,tmrid =?,tmrcode =?,times =?,lppid =if(?=\'\',null,?),lppcode =if(?=\'\',null,?),enable =?,ptime =?,maxweight =?,operateweight =?,sort=?\nwhere pastureid=? and id=? and date = ?','ftid,ftname,tmrid,tmrcode,times,lppid,lppid,lppcode,lppcode,enable,ptime,maxweight,operateweight,sort,pastureid,id,date','updatePremixplandate','PostDataByName','修改预混计划-历史计划','tmrgo','{\"name\":\"updateChar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  527. (1745,365,'SELECT\nconcat(sort,\' \',display) lppcode,\nTRIM(id) id\nFROM\n lpplandate\nWHERE pastureid = ? AND sel=1 AND times=? and date = ?\n\nORDER BY sort \n','pastureid,times,date','getLPPCodeListdate','GetDataByName','撒料车次','tmrgo','{\"name\":\"getLPPCodeList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"2\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"id\":\"3052796725653144576\",\"lppcode\":4},{\"id\":\"3051413601262240768\",\"lppcode\":3}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  528. (1746,338,'call updatedownloadedplanDone(?,?)','date,pastureid','updatedownloadedplanDone','PostDataByName','新生成日执行计划','tmrgo','{\"name\":\"checkDLPIsStart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"date\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"vmsg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  529. (1747,338,'SELECT \n(SELECT SUM(weight) FROM fpdetaildate fpdv WHERE fpdv.pastureid = fpd.pastureid \nAND fpdv.barid = fpd.barid AND fpdv.date = fpd.date) sumweight,\n TRIM(fpd.`id`) id,\n TRIM(fpd.`pastureid`)pastureid,\n TRIM(fpd.`barid`) barid,\n fpd.`barname`,\nCASE fpd.`times`\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND times ,\n fpd.`tratio`,\n fpd.`weight`,\n fpd.`ptsrate`,\n TRIM(fpd.`ptid`)ptid,\n TRIM(fpd.`ptsid`) ptsid,\n weight*ptsrate ptweight,\n weight*(1-ptsrate) pweight,\n fpd.`ptuse`,\n fpd.`ptsuse`,\n fpd.cowcount ccount,\n fpd.`ccountradio` ratio,\n round( fpd.`ccountradio`* fpd.`cowcount`/100,2) ccountratio,\n fd.`softccount`,\n @dryw :=ROUND(IFNULL((SELECT SUM(ftd.`fweight`*dry/100) FROM `ftdetaildate` ftd\nJOIN feednur f ON f.fid= ftd.fid AND f.pastureid = ftd.pastureid\nWHERE ftd.pastureid = fpd.`pastureid` AND ftd.ftid = fpd.`ptid` AND \nftd.`date` = fpd.`date` AND ftd.`version` = \n(SELECT MAX(VERSION) FROM `ftdetaildate` ftd\nWHERE ftd.pastureid = fpd.`pastureid` AND ftd.ftid = fpd.`ptid` AND \nftd.`date` = fpd.`date`)\n),0),2) dryweight,\nROUND(@dryw*ratio/100,2)swdryw,\n@acrate:= IFNULL((SELECT actweight FROM `ftdry` WHERE ftdry.`pastureid` =fpd.`pastureid` \nAND ftdry.`barid` = fpd.`barid` AND ftdry.`times` = fpd.`times` AND ftdry.`operatetime` = DATE_ADD( fpd.`date`,INTERVAL -1 DAY)),0)actweightrate,\nROUND(@acrate* weight*(1-ptsrate)/(fpd.ccountradio*fpd.cowcount/100),2) cydryw\n FROM `fpdetaildate` fpd\n \nJOIN feedpdate fd ON fd.`pastureid` = fpd.`pastureid` AND fd.`barid` = fpd.`barid` AND fd.`date` = fpd.`date`\nWHERE fpd.`pastureid` = ? AND fpd.`date` = ?\n\n\n','pastureid,date','getPlanModifyFPlist_copy0409','GetDataByName','修改计划-栏舍配方列表','tmrgo','{\"name\":\"getPlanModifyFPlist\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"date\":\"2021-04-07\",\"sort\":\"0\",\"enable\":1}}','\"Error 1054: Unknown column \'fpd.ccountratio\' in \'field list\'\"',0,1,0,0,0),
  530. (1748,334,'call updateLPPbyFPChangedate(?,?,?,?)','date,fpid,pastureid,timesin','updateLPPbyFPChangedate','PostDataByName','配方修改更新栏舍配方','tmrgo','{\"name\":\"updateFPbyFTChange\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"ftid \":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  531. (1749,335,'SELECT ftdry.`barname`,\nCASE ftdry.times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes\n,ftdry.`freshweight`,ftdry.`dryweight`,ftdry.`thoweight`,ftdry.`actweight`,ftdry.`emp`,\nDATE_FORMAT(ftdry.`operatetime` , \'%Y-%m-%d\') operatetime\n\n FROM `ftdry`\nJOIN `fpdetaildate` fpd ON fpd.pastureid = ftdry.pastureid \nAND fpd.barid = ftdry.barid AND fpd.times = ftdry.times AND fpd.date = ftdry.`operatetime`\n\n WHERE ftdry.pastureid = ? AND fpd.ptid =?\n AND ftdry.`operatetime` = ? \nand(ftdry.`barid` = ? or ?=\'\')\n and(ftdry.`times` = ? or ?=\'\')','pastureid,ftid,date,barid,barid,times,times','getftdrycylist','GetDataByName','干物质调节列表','tmrgo','{\"name\":\"judgenurBarHSL\",\"parammaps\":{\"pastureid\":\"1\",\"barid\":\"1\",\"date\":\"2021-01-20\",\"enable\":1}}','{\"code\":0,\"list\":[{},{\"actualweightminus\":\"0.000000000000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  532. (1750,335,'\nSELECT \n\nDATE_FORMAT(ftdry.`operatetime` , \'%Y-%m-%d\')date\n\n FROM `ftdry`\nJOIN `fpdetaildate` fpd ON fpd.pastureid = ftdry.pastureid \nAND fpd.barid = ftdry.barid AND fpd.times = ftdry.times\n\n WHERE ftdry.pastureid = ? AND fpd.ptid = ? \n GROUP BY ftdry.`operatetime`\norder by date desc','pastureid,ftid','getftdrydatelist','GetDataByName','干物质调节日期列表','tmrgo','{\"name\":\"judgenurBarHSL\",\"parammaps\":{\"pastureid\":\"1\",\"barid\":\"1\",\"date\":\"2021-01-20\",\"enable\":1}}','{\"code\":0,\"list\":[{},{\"actualweightminus\":\"0.000000000000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  533. (1751,335,'SELECT trim(tem.pastureid)pastureid,trim(id)id,tem.barid,tem.barname,\nCASE ww.times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes\n,\nww.weight,# 调节前班次重量\nCONCAT(ROUND(ww.weightafter,2),\' (\',IF(dryt>drya,\'+\',\'-\'),ABS(ROUND(ww.weightafter,2)-ww.weight),\')\')weightafter, # 调节后班次重量\nROUND(ftweight*dryt,2) ftweight,# 调节前理论干物质量\n \nCONCAT(ROUND(tem.weightafter*dryt/ccount/ratio*100,2),\' (\',\nIF(ROUND(tem.weightafter*dryt/ccount/ratio*100,2)>ROUND(ftweight*dryt,2),\'+\',\'-\'),ABS(ROUND(tem.weightafter*dryt/ccount/ratio*100,2)-ROUND(ftweight*dryt,2)),\')\')ftweightafter, # 调节后理论干物质量\nROUND(tem.weight*drya/ccount/ratio*100,2) cyweight,# 调节前采样干物质量\n\nCONCAT(ROUND(tem.weightafter*drya/ccount/ratio*100,2),\' (\',\nIF(ROUND(tem.weightafter*drya/ccount/ratio*100,2)>ROUND(tem.weight*drya/ccount/ratio*100,2),\'+\',\'-\'),ABS(ROUND(tem.weightafter*drya/ccount/ratio*100,2)-ROUND(tem.weight*drya/ccount/ratio*100,2)),\')\')cyweightafter,# 调节后采样干物质量\n \nROUND(tem.weight,2) totalweight, # 调节前日重量\nCONCAT(ROUND(tem.weightafter,2),\' (\',IF(dryt>drya,\'+\',\'-\'),ABS(ROUND(tem.weightafter,2)-ROUND(tem.weight,2)),\')\')totalweightafter # 调节后日重量\n FROM \n(\nSELECT fp.id,fp.pastureid,fpd.`barname`,SUM(fpd.`weight`)weight,fp.barid,\n(SELECT SUM(fweight)FROM `ftdetail` WHERE ftdetail.pastureid = fp.pastureid AND ftdetail.ftid = fp.ftid) ftweight,\n(select ?) drya ,\n(select ?) dryt,fp.`ccount`,fp.`ratio`,\nSUM(fpd.weight*?/?) weightafter\n FROM `fpdetail` fpd\nJOIN feedp fp ON fp.pastureid = fpd.`pastureid` AND fpd.`barid` = fp.barid\nWHERE fpd.`pastureid` = ? AND fp.ftid= ? AND fpd.`times`<= \n( SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= fp.pastureid AND sysopt.`inforname`=\'times\')\n GROUP BY fp.id\n)tem\n\nJOIN (SELECT fpd.times,fp.barid,\nfpd.`weight`,\nfpd.weight*?/? weightafter\n FROM `fpdetail` fpd\nJOIN feedp fp ON fp.pastureid = fpd.`pastureid` AND fpd.`barid` = fp.barid\nWHERE fpd.`pastureid` = ? AND fp.ftid= ? AND fpd.`times`<= \n( SELECT sysopt.inforvalue FROM sysopt \n WHERE sysopt.`pastureid`= fp.pastureid AND sysopt.`inforname`=\'times\') \n ) ww ON ww.barid = tem.barid','actweight,thoweight,thoweight,actweight,pastureid,ftid,thoweight,actweight,pastureid,ftid','getftdryafterlist','GetDataByName','干物质调节-变化详情','tmrgo','{\"name\":\"getftdryafterlist\",\"parammaps\":{\"actweight\":\"0.5\",\"thoweight\":\"0.6\",\"pastureid\":\"3264108097970897920\",\"ftid\":3283121581907772416}}','\"Error 1054: Unknown column \'dryt\' in \'field list\'\"',0,1,0,0,0),
  534. (1752,335,'UPDATE\n `fpdetail` fpd\nJOIN feedp fp ON fp.pastureid = fpd.`pastureid` AND fpd.`barid` = fp.barid\nSET fpd.`weight`= fpd.weight*?/?\nWHERE fpd.`pastureid` = ? AND fp.ftid= ? ','thoweight,actweight,pastureid,ftid','saveFPFTdryChange','GetDataByName','干物质调节保存','tmrgo','{\"name\":\"judgenurBarHSL\",\"parammaps\":{\"pastureid\":\"1\",\"barid\":\"1\",\"date\":\"2021-01-20\",\"enable\":1}}','{\"code\":0,\"list\":[{},{\"actualweightminus\":\"0.000000000000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  535. (1753,338,'call copydownloadedplan(?,?,?,?)','date,startTime,stopTime,pastureid','copydownloadedplan','PostDataByName','复制日执行计划','tmrgo','{\"name\":\"checkDLPIsStart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"date\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"vmsg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  536. (1754,338,'update downloadedplan set \nsort = ? where pastureid = ? and id =?','sort,pastureid,id','updatedownloadesort','PostDataByName','新生成日执行计划','tmrgo','{\"name\":\"updatedownloadesort\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"date\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"vmsg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  537. (1755,365,'SELECT \n(\nSELECT CASE \nWHEN (SELECT ftid FROM `lpplan`\nWHERE lpplan.`pastureid` = ?\nAND id= ?)<>IF (1 =?, ?,?)\nAND (SELECT COUNT(lppd1.`id`) FROM `lpplandtl1` lppd1\nINNER JOIN `lpplan`\nON lppd1.`lppid` = lpplan.`id` AND lppd1.`pastureid` = lpplan.`pastureid`\nWHERE lpplan.`pastureid` = ? AND lpplan.id= ? AND lppd1.`barid`= ? )=0\nTHEN CONCAT(\'该栏舍配方与计划配方不匹配,无法分配\')\nWHEN ?<>?\nTHEN CONCAT(\'该栏舍配方与计划配方班次不匹配,无法分配\')\nELSE \'\' END AS vmsg \n\n) vmsg','pastureid,lppid,fttype,ptid,ptsid,pastureid,lppid,barid,times,timesTem','checkLLPDetailInsertV2dateV2','GetDataByName','新生成--撒料计划是否可插入','tmrgo','{\"name\":\"checkLLPDetailInsert\",\"parammaps\": {\n \"pastureid\": \"3025176271438480383\",\n \"barid\": \"3050941006599422976\",\n \"lppid\": \"3025176271438480384\",\n \"times\": 1,\n \"ptsid\": \"-1\",\n \"ptid\": \"3025176272438480393\",\n \"fttype\": \"1\"\n }}','{\"code\":0,\"list\":[{\"vmsg\":\"该栏舍配方与计划配方不匹配,无法分配\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  538. (1756,326,'\n\nSELECT \n\nCONCAT(pennsieve.onerate,\'%: \',pennsieve.tworate,\'%: \',pennsieve.threerate,\'%: \',pennsieve.fourrate,\'%\') pennsievestr,\nCONCAT(dungsieve.onerate,\'%: \',dungsieve.tworate,\'%: \',dungsieve.threerate,\'%: \') dungsievestr,\nCONCAT(dungscore.score1,\': \',dungscore.score2,\': \',dungscore.score3,\': \',dungscore.score4,\': \',dungscore.score5,\': \') dungscorestr,\nCONCAT(bodyscore.score25,\': \',bodyscore.score275,\': \',bodyscore.score3,\': \',bodyscore.score325,\': \',bodyscore.score35,\': \',bodyscore.score375,\': \',bodyscore.score4,\': \') bodyscorestr\n\n\nFROM (SELECT 1)ww\n,\n(SELECT tem.barid,tem.barname,tem.sumweight,\n ROUND(oneweight/sumweight*100,2) onerate,\n ROUND(twoweight/sumweight*100,2) tworate,\n ROUND(threeweight/sumweight*100,2) threerate,\n 100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)+ROUND(threeweight/sumweight*100,2)) fourrate\n\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,p.barname,\n SUM(p.oneweight+p.twoweight+p.threeweight+p.fourweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight,\n ROUND(SUM(p.fourweight),2) fourweight\n\n FROM `pennsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n (SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1) =?\n) tem) pennsieve\n\n,\n(\nSELECT tem.barid,tem.barname,tem.sumweight,\n ROUND(oneweight/sumweight*100,2) onerate,\n ROUND(twoweight/sumweight*100,2) tworate,\n CONCAT(100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)),\'%\') threerate\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,p.barname,\n SUM(p.oneweight+p.twoweight+p.threeweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight\n\n\n FROM `dungsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n (SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1) =?\n) tem ) dungsieve\n\n,\n(\nSELECT tem.standardscore,tem.barname,tem.sumcowcount,\n CONCAT(ROUND(score25/sumcowcount*100,2),\'%\') score25,\n CONCAT(ROUND(score275/sumcowcount*100,2),\'%\') score275,\n CONCAT(ROUND(score3/sumcowcount*100,2),\'%\') score3,\n CONCAT(ROUND(score325/sumcowcount*100,2),\'%\') score325,\n CONCAT(ROUND(score35/sumcowcount*100,2),\'%\') score35,\n CONCAT(ROUND(score375/sumcowcount*100,2),\'%\') score375,\n CONCAT(100-(ROUND(score25/sumcowcount*100,2)\n +ROUND(score275/sumcowcount*100,2)+ROUND(score3/sumcowcount*100,2)\n +ROUND(score325/sumcowcount*100,2)+ROUND(score35/sumcowcount*100,2)\n +ROUND(score375/sumcowcount*100,2)),\'%\') score4\n\nFROM (\nSELECT\n p.pastureid,p.barid,p.standardscore,\n p.barname,\n\n SUM(p.score25+p.score275+p.score3+p.score325+p.score35+p.score375+p.score4) sumcowcount,\n ROUND(SUM(p.score25),2) score25,\n ROUND(SUM(p.score275),2)score275,\n ROUND(SUM(p.score3),2)score3,\n ROUND(SUM(p.score325),2) score325,\n ROUND(SUM(p.score35),2) score35,\n ROUND(SUM(p.score375),2) score375,\n ROUND(SUM(p.score4),2) score4\n FROM `bodyscore` p\n\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n (SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1) = ?\n) tem\n ) bodyscore\n ,\n(\nSELECT tem.standardscore,tem.barname,tem.sumcowcount,\n CONCAT(ROUND(1score/sumcowcount*100,2),\'%\') score1,\n CONCAT(ROUND(2score/sumcowcount*100,2),\'%\') score2,\n CONCAT(ROUND(3score/sumcowcount*100,2),\'%\') score3,\n CONCAT(ROUND(4score/sumcowcount*100,2),\'%\') score4,\n CONCAT(100-(ROUND(1score/sumcowcount*100,2)\n +ROUND(2score/sumcowcount*100,2)+ROUND(3score/sumcowcount*100,2)\n +ROUND(4score/sumcowcount*100,2)),\'%\') score5\n\nFROM (\nSELECT\n p.pastureid,p.barid,p.standardscore,\n p.barname,\n\n SUM(p.1score+p.2score+p.3score+p.4score+p.5score) sumcowcount,\n ROUND(SUM(p.1score),2) 1score,\n ROUND(SUM(p.2score),2)2score,\n ROUND(SUM(p.3score),2)3score,\n ROUND(SUM(p.4score),2) 4score,\n ROUND(SUM(p.5score),2) 5score\n FROM `dungscore` p\n\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n (SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1) = ?\n) tem\n\n ) dungscore\n','pastureid,date,name,pastureid,date,name,pastureid,date,name,pastureid,date,name','getAssessCowPennAPPSC','GetDataByName','牛群评估-宾州筛分析列表APP-牲畜类别','tmrgo','{\"name\":\"getAssessCowPenn\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3027996177498375168\",\"barname\":\"西区#1/高产牛\",\"fourrate\":\"7.14%\",\"fourweight\":\"10.00\",\"onerate\":\"42.86%\",\"oneweight\":\"60.00\",\"pastureid\":3025176271438480400,\"standard\":\"(50-100)(30-50)(10-20)(0-10)\",\"sumweight\":\"140.00\",\"threerate\":\"14.29%\",\"threeweight\":\"20.00\",\"tworate\":\"35.71%\",\"twoweight\":\"50.00\"},{\"barid\":\"3028006959913108480\",\"barname\":\"西区#2/荷兰大奶牛\",\"fourrate\":\"4.83%\",\"fourweight\":\"5.00\",\"onerate\":\"48.29%\",\"oneweight\":\"50.00\",\"pastureid\":3025176271438480400,\"standard\":\"(10-20)(30-40)(10-20)(30-40)\",\"sumweight\":\"103.55\",\"threerate\":\"22.74%\",\"threeweight\":\"23.55\",\"tworate\":\"24.14%\",\"twoweight\":\"25.00\"},{\"barid\":\"3050941006599422976\",\"barname\":\"北区#1/水牛\",\"fourrate\":\"24.48%\",\"fourweight\":\"35.00\",\"onerate\":\"15.38%\",\"oneweight\":\"22.00\",\"pastureid\":3025176271438480400,\"standard\":\"(1-1)(3-4)(5-6)(7-8)\",\"sumweight\":\"143.00\",\"threerate\":\"37.06%\",\"threeweight\":\"53.00\",\"tworate\":\"23.08%\",\"twoweight\":\"33.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  539. (1760,326,'\n\nSELECT \n\nCONCAT(pennsieve.onerate,\'%: \',pennsieve.tworate,\'%: \',pennsieve.threerate,\'%: \',pennsieve.fourrate,\'%\') pennsievestr,\nCONCAT(dungsieve.onerate,\'%: \',dungsieve.tworate,\'%: \',dungsieve.threerate,\'%: \') dungsievestr,\nCONCAT(dungscore.score1,\': \',dungscore.score2,\': \',dungscore.score3,\': \',dungscore.score4,\': \',dungscore.score5,\': \') dungscorestr,\nCONCAT(bodyscore.score25,\': \',bodyscore.score275,\': \',bodyscore.score3,\': \',bodyscore.score325,\': \',bodyscore.score35,\': \',bodyscore.score375,\': \',bodyscore.score4,\': \') bodyscorestr\n\n\nFROM (SELECT 1)ww\n,\n(SELECT tem.barid,tem.barname,tem.sumweight,\n ROUND(oneweight/sumweight*100,2) onerate,\n ROUND(twoweight/sumweight*100,2) tworate,\n ROUND(threeweight/sumweight*100,2) threerate,\n 100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)+ROUND(threeweight/sumweight*100,2)) fourrate\n\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,p.barname,\n SUM(p.oneweight+p.twoweight+p.threeweight+p.fourweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight,\n ROUND(SUM(p.fourweight),2) fourweight\n\n FROM `pennsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\np.`barname` = ?\n) tem) pennsieve\n\n,\n(\nSELECT tem.barid,tem.barname,tem.sumweight,\n ROUND(oneweight/sumweight*100,2) onerate,\n ROUND(twoweight/sumweight*100,2) tworate,\n CONCAT(100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)),\'%\') threerate\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,p.barname,\n SUM(p.oneweight+p.twoweight+p.threeweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight\n\n\n FROM `dungsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n p.`barname` = ?\n) tem ) dungsieve\n\n,\n(\nSELECT tem.standardscore,tem.barname,tem.sumcowcount,\n CONCAT(ROUND(score25/sumcowcount*100,2),\'%\') score25,\n CONCAT(ROUND(score275/sumcowcount*100,2),\'%\') score275,\n CONCAT(ROUND(score3/sumcowcount*100,2),\'%\') score3,\n CONCAT(ROUND(score325/sumcowcount*100,2),\'%\') score325,\n CONCAT(ROUND(score35/sumcowcount*100,2),\'%\') score35,\n CONCAT(ROUND(score375/sumcowcount*100,2),\'%\') score375,\n CONCAT(100-(ROUND(score25/sumcowcount*100,2)\n +ROUND(score275/sumcowcount*100,2)+ROUND(score3/sumcowcount*100,2)\n +ROUND(score325/sumcowcount*100,2)+ROUND(score35/sumcowcount*100,2)\n +ROUND(score375/sumcowcount*100,2)),\'%\') score4\n\nFROM (\nSELECT\n p.pastureid,p.barid,p.standardscore,\n p.barname,\n\n SUM(p.score25+p.score275+p.score3+p.score325+p.score35+p.score375+p.score4) sumcowcount,\n ROUND(SUM(p.score25),2) score25,\n ROUND(SUM(p.score275),2)score275,\n ROUND(SUM(p.score3),2)score3,\n ROUND(SUM(p.score325),2) score325,\n ROUND(SUM(p.score35),2) score35,\n ROUND(SUM(p.score375),2) score375,\n ROUND(SUM(p.score4),2) score4\n FROM `bodyscore` p\n\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n p.`barname` = ?\n) tem\n ) bodyscore\n ,\n(\nSELECT tem.standardscore,tem.barname,tem.sumcowcount,\n CONCAT(ROUND(1score/sumcowcount*100,2),\'%\') score1,\n CONCAT(ROUND(2score/sumcowcount*100,2),\'%\') score2,\n CONCAT(ROUND(3score/sumcowcount*100,2),\'%\') score3,\n CONCAT(ROUND(4score/sumcowcount*100,2),\'%\') score4,\n CONCAT(100-(ROUND(1score/sumcowcount*100,2)\n +ROUND(2score/sumcowcount*100,2)+ROUND(3score/sumcowcount*100,2)\n +ROUND(4score/sumcowcount*100,2)),\'%\') score5\n\nFROM (\nSELECT\n p.pastureid,p.barid,p.standardscore,\n p.barname,\n\n SUM(p.1score+p.2score+p.3score+p.4score+p.5score) sumcowcount,\n ROUND(SUM(p.1score),2) 1score,\n ROUND(SUM(p.2score),2)2score,\n ROUND(SUM(p.3score),2)3score,\n ROUND(SUM(p.4score),2) 4score,\n ROUND(SUM(p.5score),2) 5score\n FROM `dungscore` p\n\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\np.`barname` = ?\n) tem\n\n ) dungscore\n','pastureid,date,name,pastureid,date,name,pastureid,date,name,pastureid,date,name','getAssessCowPennAPPLS','GetDataByName','牛群评估-宾州筛分析列表APP-栏舍','tmrgo','{\"name\":\"getAssessCowPenn\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3027996177498375168\",\"barname\":\"西区#1/高产牛\",\"fourrate\":\"7.14%\",\"fourweight\":\"10.00\",\"onerate\":\"42.86%\",\"oneweight\":\"60.00\",\"pastureid\":3025176271438480400,\"standard\":\"(50-100)(30-50)(10-20)(0-10)\",\"sumweight\":\"140.00\",\"threerate\":\"14.29%\",\"threeweight\":\"20.00\",\"tworate\":\"35.71%\",\"twoweight\":\"50.00\"},{\"barid\":\"3028006959913108480\",\"barname\":\"西区#2/荷兰大奶牛\",\"fourrate\":\"4.83%\",\"fourweight\":\"5.00\",\"onerate\":\"48.29%\",\"oneweight\":\"50.00\",\"pastureid\":3025176271438480400,\"standard\":\"(10-20)(30-40)(10-20)(30-40)\",\"sumweight\":\"103.55\",\"threerate\":\"22.74%\",\"threeweight\":\"23.55\",\"tworate\":\"24.14%\",\"twoweight\":\"25.00\"},{\"barid\":\"3050941006599422976\",\"barname\":\"北区#1/水牛\",\"fourrate\":\"24.48%\",\"fourweight\":\"35.00\",\"onerate\":\"15.38%\",\"oneweight\":\"22.00\",\"pastureid\":3025176271438480400,\"standard\":\"(1-1)(3-4)(5-6)(7-8)\",\"sumweight\":\"143.00\",\"threerate\":\"37.06%\",\"threeweight\":\"53.00\",\"tworate\":\"23.08%\",\"twoweight\":\"33.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  540. (1761,326,'\n\nSELECT \n\nCONCAT(pennsieve.onerate,\'%: \',pennsieve.tworate,\'%: \',pennsieve.threerate,\'%: \',pennsieve.fourrate,\'%\') pennsievestr,\nCONCAT(dungsieve.onerate,\'%: \',dungsieve.tworate,\'%: \',dungsieve.threerate,\'%: \') dungsievestr,\nCONCAT(dungscore.score1,\': \',dungscore.score2,\': \',dungscore.score3,\': \',dungscore.score4,\': \',dungscore.score5,\': \') dungscorestr,\nCONCAT(bodyscore.score25,\': \',bodyscore.score275,\': \',bodyscore.score3,\': \',bodyscore.score325,\': \',bodyscore.score35,\': \',bodyscore.score375,\': \',bodyscore.score4,\': \') bodyscorestr\n\n\nFROM (SELECT 1)ww\n,\n(SELECT tem.barid,tem.barname,tem.sumweight,\n ROUND(oneweight/sumweight*100,2) onerate,\n ROUND(twoweight/sumweight*100,2) tworate,\n ROUND(threeweight/sumweight*100,2) threerate,\n 100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)+ROUND(threeweight/sumweight*100,2)) fourrate\n\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,p.barname,\n SUM(p.oneweight+p.twoweight+p.threeweight+p.fourweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight,\n ROUND(SUM(p.fourweight),2) fourweight\n\n FROM `pennsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n (SELECT fp.ftname FROM `feedpdate` fp WHERE fp.`barid` = p.barid AND fp.pastureid=p.pastureid AND fp.date =p.`operatetime` LIMIT 1) = ?\n) tem) pennsieve\n\n,\n(\nSELECT tem.barid,tem.barname,tem.sumweight,\n ROUND(oneweight/sumweight*100,2) onerate,\n ROUND(twoweight/sumweight*100,2) tworate,\n CONCAT(100-(ROUND(oneweight/sumweight*100,2)+ROUND(twoweight/sumweight*100,2)),\'%\') threerate\nFROM (\nSELECT\np.pastureid,TRIM(p.barid) barid,p.barname,\n SUM(p.oneweight+p.twoweight+p.threeweight) sumweight,\n ROUND(SUM(p.oneweight),2) oneweight,\n ROUND(SUM(p.twoweight),2)twoweight,\n ROUND(SUM(p.threeweight),2)threeweight\n\n\n FROM `dungsieve` p\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n (SELECT fp.ftname FROM `feedpdate` fp WHERE fp.`barid` = p.barid AND fp.pastureid=p.pastureid AND fp.date =p.`operatetime` LIMIT 1) = ?\n) tem ) dungsieve\n\n,\n(\nSELECT tem.standardscore,tem.barname,tem.sumcowcount,\n CONCAT(ROUND(score25/sumcowcount*100,2),\'%\') score25,\n CONCAT(ROUND(score275/sumcowcount*100,2),\'%\') score275,\n CONCAT(ROUND(score3/sumcowcount*100,2),\'%\') score3,\n CONCAT(ROUND(score325/sumcowcount*100,2),\'%\') score325,\n CONCAT(ROUND(score35/sumcowcount*100,2),\'%\') score35,\n CONCAT(ROUND(score375/sumcowcount*100,2),\'%\') score375,\n CONCAT(100-(ROUND(score25/sumcowcount*100,2)\n +ROUND(score275/sumcowcount*100,2)+ROUND(score3/sumcowcount*100,2)\n +ROUND(score325/sumcowcount*100,2)+ROUND(score35/sumcowcount*100,2)\n +ROUND(score375/sumcowcount*100,2)),\'%\') score4\n\nFROM (\nSELECT\n p.pastureid,p.barid,p.standardscore,\n p.barname,\n\n SUM(p.score25+p.score275+p.score3+p.score325+p.score35+p.score375+p.score4) sumcowcount,\n ROUND(SUM(p.score25),2) score25,\n ROUND(SUM(p.score275),2)score275,\n ROUND(SUM(p.score3),2)score3,\n ROUND(SUM(p.score325),2) score325,\n ROUND(SUM(p.score35),2) score35,\n ROUND(SUM(p.score375),2) score375,\n ROUND(SUM(p.score4),2) score4\n FROM `bodyscore` p\n\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n (SELECT fp.ftname FROM `feedpdate` fp WHERE fp.`barid` = p.barid AND fp.pastureid=p.pastureid AND fp.date =p.`operatetime` LIMIT 1) = ?\n) tem\n ) bodyscore\n ,\n(\nSELECT tem.standardscore,tem.barname,tem.sumcowcount,\n CONCAT(ROUND(1score/sumcowcount*100,2),\'%\') score1,\n CONCAT(ROUND(2score/sumcowcount*100,2),\'%\') score2,\n CONCAT(ROUND(3score/sumcowcount*100,2),\'%\') score3,\n CONCAT(ROUND(4score/sumcowcount*100,2),\'%\') score4,\n CONCAT(100-(ROUND(1score/sumcowcount*100,2)\n +ROUND(2score/sumcowcount*100,2)+ROUND(3score/sumcowcount*100,2)\n +ROUND(4score/sumcowcount*100,2)),\'%\') score5\n\nFROM (\nSELECT\n p.pastureid,p.barid,p.standardscore,\n p.barname,\n\n SUM(p.1score+p.2score+p.3score+p.4score+p.5score) sumcowcount,\n ROUND(SUM(p.1score),2) 1score,\n ROUND(SUM(p.2score),2)2score,\n ROUND(SUM(p.3score),2)3score,\n ROUND(SUM(p.4score),2) 4score,\n ROUND(SUM(p.5score),2) 5score\n FROM `dungscore` p\n\n WHERE p.`pastureid` =? AND p.`operatetime` =? AND\n (SELECT fp.ftname FROM `feedpdate` fp WHERE fp.`barid` = p.barid AND fp.pastureid=p.pastureid AND fp.date =p.`operatetime` LIMIT 1) = ?\n) tem\n\n ) dungscore\n','pastureid,date,name,pastureid,date,name,pastureid,date,name,pastureid,date,name','getAssessCowPennAPPPF','GetDataByName','牛群评估-宾州筛分析列表APP-配方','tmrgo','{\"name\":\"getAssessCowPenn\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"3027996177498375168\",\"barname\":\"西区#1/高产牛\",\"fourrate\":\"7.14%\",\"fourweight\":\"10.00\",\"onerate\":\"42.86%\",\"oneweight\":\"60.00\",\"pastureid\":3025176271438480400,\"standard\":\"(50-100)(30-50)(10-20)(0-10)\",\"sumweight\":\"140.00\",\"threerate\":\"14.29%\",\"threeweight\":\"20.00\",\"tworate\":\"35.71%\",\"twoweight\":\"50.00\"},{\"barid\":\"3028006959913108480\",\"barname\":\"西区#2/荷兰大奶牛\",\"fourrate\":\"4.83%\",\"fourweight\":\"5.00\",\"onerate\":\"48.29%\",\"oneweight\":\"50.00\",\"pastureid\":3025176271438480400,\"standard\":\"(10-20)(30-40)(10-20)(30-40)\",\"sumweight\":\"103.55\",\"threerate\":\"22.74%\",\"threeweight\":\"23.55\",\"tworate\":\"24.14%\",\"twoweight\":\"25.00\"},{\"barid\":\"3050941006599422976\",\"barname\":\"北区#1/水牛\",\"fourrate\":\"24.48%\",\"fourweight\":\"35.00\",\"onerate\":\"15.38%\",\"oneweight\":\"22.00\",\"pastureid\":3025176271438480400,\"standard\":\"(1-1)(3-4)(5-6)(7-8)\",\"sumweight\":\"143.00\",\"threerate\":\"37.06%\",\"threeweight\":\"53.00\",\"tworate\":\"23.08%\",\"twoweight\":\"33.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":3}',0,1,0,0,0),
  541. (1762,404,'\nSELECT \n@product:=(SELECT SUM(product) product FROM \n`feedpdate` fp \nLEFT JOIN `barmilk` bm\nON bm.`pastureid` = fp.pastureid AND bm.`barid` = fp.barid\n AND bm.`productdate` = (SELECT MAX(productdate) FROM barmilk WHERE `pastureid` = fp.pastureid AND bm.`barid` = fp.barid AND productdate<?)\n WHERE fp.`pastureid` = rr.pastureid AND fp.`ftid` = rr.ftid AND fp.`date` = ?) pp,\n @fat:=(SELECT AVG(fat) product FROM \n`feedpdate` fp \nLEFT JOIN `barmilk` bm\nON bm.`pastureid` = fp.pastureid AND bm.`barid` = fp.barid\n AND bm.`productdate` = (SELECT MAX(productdate) FROM barmilk WHERE `pastureid` = fp.pastureid AND bm.`barid` = fp.barid AND productdate<?)\n WHERE fp.`pastureid` = rr.pastureid AND fp.`ftid` = rr.ftid AND fp.`date` = ?) ff,\nTRIM(rr.ftid) ftid,\nrr.tname,\nTRIM(rr.pastureid) pastureid,\nIFNULL((\nSELECT SUM(ccount) FROM`feedpdate` WHERE DATE BETWEEN ? AND ? AND pastureid = rr.pastureid AND ftid = rr.`ftid`\n),0)ccount,\n\nIFNULL((\n\nSELECT \nIFNULL(SUM((SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` de WHERE de.pastureid = d2.`pastureid` AND de.flpid = d2.`flpid` AND de.type = 0 ))\n* SUM(d2.`actualweightminus`)/SUM((SELECT SUM(actualweightminus) FROM `downloadplandtl2` de WHERE de.pastureid = d2.`pastureid` AND de.flpid = d2.`flpid` AND de.type = 0))\n/(\nSELECT SUM(ccountratio) FROM`feedpdate` WHERE DATE BETWEEN ? AND ? AND pastureid = rr.pastureid AND ftid = rr.`ftid`\n),0) ac \nFROM `downloadplandtl2` d2\n\nWHERE d2.date BETWEEN ? AND ? AND d2.pastureid =rr.pastureid AND (SELECT tempid FROM `downloadedplan` WHERE pastureid = d2.pastureid AND id = d2.pid) =rr.ftid AND d2.type = 0\n\n)/(SELECT SUM(fweight) FROM `ftdetail` WHERE pastureid = rr.pastureid AND ftid =rr.ftid)\n,0)Hrate,\n\nIFNULL((\nSELECT \nIFNULL(SUM(d2.`actualweightminus`)/(\nSELECT SUM(ccountratio) FROM`feedpdate` WHERE DATE BETWEEN ? AND ? AND pastureid = rr.pastureid AND ftid = rr.`ftid`\n),0) ac \nFROM `downloadplandtl2` d2\n\nWHERE d2.date BETWEEN ? AND ? AND d2.pastureid =rr.pastureid AND (SELECT tempid FROM `downloadedplan` WHERE pastureid = d2.pastureid AND id = d2.pid) = rr.ftid AND d2.`type` = 0\n)/(SELECT SUM(fweight) FROM `ftdetail` WHERE pastureid = rr.pastureid AND ftid =rr.ftid ),0)Srate,\n\nIFNULL(CAST(SUM(dry)AS DECIMAL(20,3)),0)dry, -- 干物质(kg)\nIFNULL(CAST(SUM(dry)/SUM(cdry) AS DECIMAL(20,3)),0) jcrate, -- 精粗比\nIFNULL(CAST(SUM(cdry)AS DECIMAL(20,3)),0)cdry, -- 粗料中的干物质\nIFNULL(CAST(SUM(n)/100 AS DECIMAL(20,3)),0)nm, -- 产奶净能(MJ)\nIFNULL(CAST(SUM(n)/3.138/100 AS DECIMAL(20,3)),0) nuint, -- 奶牛能量单位(NND)\nIFNULL(CAST(SUM(cp)/100 AS DECIMAL(20,3)),0)cp, -- 粗蛋白(g)\nIFNULL(CAST(SUM(cp)/SUM(dry)/1000 AS DECIMAL(20,3)),0)cpd, -- 粗蛋白(%DM)\nIFNULL(CAST(SUM(ca)/100 AS DECIMAL(20,3)),0) ca, -- 钙(g)\nIFNULL(CAST(SUM(p)/100 AS DECIMAL(20,3)),0) p,-- 磷(g)\n\nIFNULL(CAST(SUM(nm)/SUM(dry)/100 AS DECIMAL(20,3)),0) nmd,-- 产奶净能(Mcal/DM)\nIFNULL(CAST(SUM(rr.fat)/SUM(dry)/100 AS DECIMAL(20,3)),0) fat, -- 脂肪\nIFNULL(CAST(SUM(starch)/SUM(dry)/100 AS DECIMAL(20,3)),0) starch,-- 淀粉\nIFNULL(CAST(SUM(ndf)/SUM(dry)/100 AS DECIMAL(20,3)),0) ndf, -- NDF(%DM)\n\nIFNULL(CAST(SUM(cndf)/SUM(dry)/100 AS DECIMAL(20,3)),0) cndf,-- 粗料中的NDF(%DM)\nIFNULL(CAST(SUM(adf)/SUM(dry)/100 AS DECIMAL(20,3)),0) adf, -- ADF(%DM)\nIFNULL(CAST(SUM(ca)/SUM(dry)/1000 AS DECIMAL(20,3)),0) cad, -- 钙(%DM)\nIFNULL(CAST(SUM(p)/SUM(dry)/1000 AS DECIMAL(20,3)),0) pd,-- 磷(%DM)\nIFNULL(CAST(SUM(uprice)AS DECIMAL(20,3)),0) uprice, -- 日粮成本\n\n\n\n\nIFNULL(CAST((0.35*IFNULL(@product,0)+15*IFNULL(@fat,0)/100*IFNULL(@product,0))/SUM(dry) AS DECIMAL(20,3)),0) trans4f, -- 4.0转化效率\nIFNULL(CAST((0.35*IFNULL(@product,0)+18.57*IFNULL(@fat,0)/100*IFNULL(@product,0))/SUM(dry) AS DECIMAL(20,3)),0) trans35f,-- 3.5转化效率\nIFNULL(CAST(SUM(uprice)/IFNULL(@product,0)AS DECIMAL(20,3)),0) kprice -- 公斤奶成本\n\n FROM (\nSELECT \ntem.tname,\ntem.ftid,\ntem.pastureid,\ntem.fweight*fu.`dry`/100 dry,-- 干物质(kg)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`/100,IF(fc.bigfeedclassname=\'精粗各半\', tem.fweight*fu.`dry`*0.5/100,0)) cdry,-- 粗料中的干物质\ntem.fweight*fu.`dry`*fu.`n` n, -- 产奶净能(MJ)\ntem.fweight*fu.`dry`*fu.`cp`*10 cp, -- 粗蛋白(g)\ntem.fweight*fu.`dry`*fu.`ca`*10 ca, -- 钙(g)\ntem.fweight*fu.`dry`*fu.`p`*10 p, -- 磷(g)\ntem.fweight*fu.`dry`*fu.`n`*0.2389 nm, -- 产奶净能(Mcal/DM)\ntem.fweight*fu.`dry`*fu.`fat` fat, -- 脂肪\ntem.fweight*fu.`dry`*fu.`starch` starch, -- 淀粉\n\n\ntem.fweight*fu.`dry`*fu.`ndf` ndf, -- NDF(%DM)\nIF(fc.bigfeedclassname=\'粗料\', tem.fweight*fu.`dry`*fu.`ndf`,0) cndf,-- 粗料中的NDF(%DM)\ntem.fweight*fu.`dry`*fu.`adf` adf, -- ADF(%DM)\ntem.fweight*feed.`uprice` uprice, -- 日粮成本\ntem.fweight*feed.`uprice`/(tem.fweight*fu.`dry`) upriced-- 干物质成本(元/公斤)\nFROM \n (SELECT ft.id ftid,ft.`pastureid`,ft.tname,\n IFNULL(ftd1.`fweight`*ftd.`fweight`/\n (SELECT SUM(fweight) FROM `ftdetail` WHERE ftdetail.`pastureid` = ftd1.`pastureid` AND ftdetail.`ftid` = ftd1.`ftid`),\n ftd.`fweight`)fweight,\n IFNULL(ftd1.`fname`,ftd.fname) fname,\n IFNULL(ftd1.`fid`,ftd.`fid`) fid\n FROM `feedtemplet` ft\n INNER JOIN `downloadedplan` d\n ON ft.`pastureid` = d.`pastureid` AND ft.`id` = d.`tempid` AND d.`mydate` BETWEEN ? AND ?\n INNER JOIN `ftdetail` ftd\n ON ft.`pastureid` = ftd.`pastureid` AND ft.`id` = ftd.`ftid`\n LEFT JOIN `ftdetail` ftd1\n ON ft.`pastureid` = ftd1.`pastureid` AND ftd1.`ftid` = ftd.`preftid`\n WHERE ft.`pastureid` = ?\n GROUP BY d.`tempid`,ftd1.id,ftd.id\n ) tem\nJOIN feed ON feed.`pastureid` = tem.pastureid AND feed.`id` = tem.fid\nJOIN `feednur` fu ON feed.`pastureid` = fu.`pastureid` AND feed.`id`= fu.`fid`\nJOIN `feedclass` fc ON fc.pastureid = feed.`pastureid` AND fc.id = feed.`fclassid`\n) rr\n\nGROUP BY rr.ftid\n\nhaving rr.ftid = ?','stopTime,stopTime,stopTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,startTime,stopTime,pastureid,ftid','judgenurFTReportDetail','GetDataByName','配方评估列表','tmrgo','{\"name\":\"judgenurFT\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"startTime\":\"2021-01-21\",\"stopTime\":\"2021-01-21\",\"fat\":4}}','{\"code\":0,\"list\":[{\"adf\":\"0.000\",\"ca\":\"0.000\",\"cad\":\"0.000\",\"cdry\":\"0.000\",\"cndf\":\"0.000\",\"cp\":\"0.000\",\"cpd\":\"0.000\",\"dry\":\"0.000\",\"fat\":\"0.000\",\"jcrate\":\"0.000\",\"kprice\":\"0.000\",\"n\":\"0.000\",\"ndf\":\"0.000\",\"nm\":\"0.000\",\"nuint\":\"0.000\",\"p\":\"0.000\",\"pd\":\"0.000\",\"starch\":\"0.000\",\"trans35f\":\"0.000\",\"trans4f\":\"0.000\",\"uprice\":\"0.000\",\"upriced\":\"0.000\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  542. (1763,337,'SELECT GROUP_CONCAT(bar.`bname`) bnames FROM \nbar \nLEFT JOIN `rpdetail`rp ON rp.`pastureid` = bar.`pastureid` AND rp.`barid` = bar.`id` AND rp.`type` = 0\nWHERE bar.pastureid = ? AND bar.`enable` = 1 AND rp.`id` IS NULL ','pastureid','checkRemainplan','GetDataByName','剩料计划-校验','tmrgo','{\"name\":\"checkRemainplan\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','{\"code\":0,\"list\":[{\"GROUP_CONCAT(bar.`bname`)\":\"东区高产牛,北区干奶牛\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  543. (1764,334,'SELECT\nft.tname,ft.tcolor,ft.ccid,ft.ccname,ft.fttype, ft.remark,ft.`enable`,ft.source,ft.fttypeid,ft.tcode,\nTRIM(ft.id) id,\nTRIM(ft.pastureid)pastureid,ft.version,\nftd.`feedgroup`,ftd.`fname`,ftd.`fweight`,ftd.`autosecond`,ftd.`islockcount`,ftd.`sort`\n\n\nFROM\n feedtemplet ft\nJOIN `ftdetail` ftd ON ft.`pastureid` = ftd.`pastureid` AND ft.`id` = ftd.`ftid`\n\n\nWHERE ft.pastureid = ? \n AND ( ft.ccname =? OR ? = \'\')\n AND ( ft.fttype =? OR ? = \'\')\n AND (ft.enable =? OR ? = \'\')\n AND ( ft.tname LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nAND ( ft.remark LIKE CONCAT(\'%\',?,\'%\') OR ? = \'\')\nORDER BY ft.id DESC,ftd.`sort`','pastureid,ccname ,ccname ,fttype ,fttype ,enable,enable,tname,tname,remark,remark','downloadFTList','GetDataByName','配方模板列表','tmrgo','{\"name\":\"getFTList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"预混配方\",\"id\":\"8874176271438480590\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方2\"},{\"ccid\":1,\"enable\":1,\"fttype\":\"饲喂配方\",\"id\":\"8874176271438480589\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  544. (1765,334,'SELECT \n\nround(SUM(\nIF(ftd.preftid<>0,\n ftd.`fweight`*IFNULL((SELECT SUM(ftd1.`fweight`*f1.dry/100)/SUM(ftd1.`fweight`) FROM `ftdetail` ftd1\nJOIN feednur f1 ON f1.fid= ftd1.fid AND f1.pastureid = ftd1.pastureid\nWHERE ftd1.pastureid = ftd.`pastureid` AND ftd1.ftid = ftd.`preftid`),0),\nftd.`fweight`*f.dry/100)) ,2)\ndryweight\n FROM `ftdetail` ftd\nLEFT JOIN feednur f ON f.fid= ftd.fid AND f.pastureid = ftd.pastureid\nWHERE ftd.pastureid = ? AND ftd.ftid = ?\n','pastureid,ftid','getFTdryweight','GetDataByName','配方模板列表','tmrgo','{\"name\":\"getFTList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"预混配方\",\"id\":\"8874176271438480590\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方2\"},{\"ccid\":1,\"enable\":1,\"fttype\":\"饲喂配方\",\"id\":\"8874176271438480589\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  545. (1766,365,'update lpplan set sort =?\nwhere pastureid=? and id=?','sort,pastureid,id','updateLppSort','PostDataByName','修改发料计划','tmrgo','{\"name\":\"updateDutyrecord\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  546. (1767,406,'SELECT \n(SELECT `fweight` FROM `ftdetail` WHERE pastureid = d1.pastureid AND ftid =(SELECT `tempid` FROM `downloadedplan` WHERE pastureid = d1.pastureid AND id= d1.pid)\nAND fid = d1.fid) ftweight,\nTRIM(d1.id) ID,TRIM(d1.`pid`) projuctid,\nTRIM(d1.pastureid)pastureid,d1.fname optname,\n(select feedcode from feed where id =d1.fid and pastureid = d1.pastureid) optid,\nd1.lweight targetweight,\nIFNULL(feed.`autozone`,10)autozone,\nIFNULL(feed.`autosecond`,0) autosecond,\nd1.`stirdelay` delaytime,\n(SELECT MAX(havebuttom) FROM `downloadplandtl1` d1t\nWHERE d1t.`pastureid` = d1.pastureid AND d1t.`pid` = d1.`pid`)firstReget,\nIFNULL(feed.confirmstart,0) needBegin,\nd1.`sort` pfsort,\n0 inorout,CONCAT(d1.fname,\' : \',d1.lweight) mixdesc,\nIFNULL(feed.`jmp`,0) jmp,\n0 ismix,\n0 `type`,\nnull bname\nFROM `downloadplandtl1` d1\nLEFT JOIN feed ON feed.`pastureid` = d1.`pastureid` AND d1.`fid` = feed.`id` \nWHERE d1.`pastureid` =? AND d1.`pid` = ?\n\n\nUNION ALL\n\nSELECT \n0,TRIM(d1.id) ID,TRIM(d1.`pid`) projuctid,\nTRIM(d1.pastureid) pastureid,d1.fname optname,\n(select eqcode from tmr where id =d1.fbarid and pastureid = d1.pastureid) optid,\nd1.lweight targetweight,\nIFNULL(bar.`autozone`,10)autozone,\nIFNULL(bar.`autosecond`,0) autosecond,\n0 delaytime,\n(SELECT MAX(havebuttom) FROM `downloadplandtl2` d1t\nWHERE d1t.`pastureid` = d1.pastureid AND d1t.`pid` = d1.`pid`) firstReget,\n0 needBegin,\nd1.`sort` pfsort,\n1 inorout,\'\',0 jmp,0,\nd1.type,\nIF(d1.type = 0,(SELECT bname FROM bar WHERE pastureid = d1.`pastureid` AND id = d1.fbarid),(SELECT eqcode FROM tmr WHERE id =d1.fbarid AND pastureid = d1.`pastureid`)) bname\n\nFROM `downloadplandtl2` d1\nLEFT JOIN bar ON bar.`pastureid` = d1.`pastureid` AND d1.`fbarid` = bar.`id` \nWHERE d1.`pastureid` = ? AND d1.`pid` = ?\n','pastureid,id,pastureid,id','getRLSBdetail','GetArrList','获取计划饲料子表','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  547. (1768,406,'SELECT \ntrim(id) id,\n`id` projuctid, -- 计划标识符\ntrim(`pastureid`) pastureid,\nDATE_FORMAT(mydate, \'%Y-%m-%d\') mydate,\n`projname` name, -- 计划名称\n`datacaptureno` eqid, -- 执行车号\n`times` shifts, -- 班次\n`lpplantype`,\n`tmrtname` tmrname,\n(select imei from tmr where pastureid = d.pastureid and id = d.tmrid)imei ,\n`sort`,\n`remark`, \n`itemnum`, -- 混料个数\n`outitems`, -- 发料个数\n`lweight` sumweight, -- 总重\n`havebutton` started, -- 是否已经开始\niscompleted completed, \ntempletname ftname,\n(select tcode from feedtemplet where id = d.tempid and pastureid = d.pastureid ) ftcode,\n(SELECT COUNT(`id`) AS remains FROM `downloadedplan` WHERE `tmrid` =(SELECT `id` FROM `tmr` WHERE `imei`=? ) AND `mydate`=DATE(NOW()) AND `havebutton` =0) remains, -- 剩余车数\n(SELECT COUNT(`id`) AS unallocateds FROM `downloadedplan` WHERE `tmrid` IS NULL AND `mydate`=DATE(NOW()) AND pastureid = d.`pastureid` AND `tmrid` =(SELECT `id` FROM `tmr` WHERE `imei`=? ) ) unallocateds -- 未分配车数\n FROM `downloadedplan` d\n\nWHERE d.`iscompleted`=0 AND d.`pastureid` =(SELECT `pastureid` FROM `tmr` WHERE `imei`=? ) AND \n`tmrid` =(SELECT `id` FROM `tmr` WHERE `imei`=? ) AND d.lpplantype = 5 and d.enable =1\nAND (d.`mydate`=DATE(NOW())\n OR (DATE(d.Mydate)= DATE(DATE_ADD(NOW(), INTERVAL 1 DAY)) AND (SELECT inforvalue FROM `sysopt` \n WHERE pastureid = (SELECT `pastureid` FROM `tmr` WHERE `imei`=? ) AND inforname = \'isGetNextPlan\')=1 ) \n OR (DATE(d.Mydate)= DATE(DATE_ADD(NOW(), INTERVAL -1 DAY)) AND (SELECT inforvalue FROM `sysopt` \n WHERE pastureid = (SELECT `pastureid` FROM `tmr` WHERE `imei`=? ) AND inforname = \'isGetLastPlan\')=1 ))\nORDER BY d.mydate,d.sort \n\n','imei,imei,imei,imei,imei,imei','getRLSB','PostRJSBDatas','获取计划主表列表','tmrgo','[{\"name\":\"updatePlan\",\"parammaps\":{ \"pastureid\":\"1620961391\",\"completed\":\"0\",\"started\":\"1\",\"projuctid\":\"20\",\"weight\":\"100\",\"begintime\":\"2021-06-22 17:32:37\",\"endtime\":\"2021-06-22 17:32:37\",\"beginweight\":\"0\",\"endweight\":\"100\",\"empcode\":\"1002\",\"empname\":\"中控员\",\"ID\":\"134\",\"Inorout\":\"0\"} }]','\"ok\"',0,1,0,0,0),
  548. (1770,406,'SELECT \ntrim(d.id) id,\ntrim(d.id) projuctid,\n trim(d.pastureid) pastureid,\n d.`projname` `name`,\n d.`datacaptureno` `eqid`,\n d.`lweight` sumweight,\n d.`havebutton` started,\n d.`iscompleted` completed,\n d.`intime` begintime,\n d.`completedtime` endtime\n FROM `downloadedplan` d\n WHERE pastureid= ? AND mydate = DATE(NOW())','pastureid','getdownloadedplanDateALL','GetArrList','获取计划主表列表','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  549. (1771,406,'UPDATE \n`downloadedplan` d\nSET \nd.id = IFNULL((SELECT id FROM(SELECT id FROM downloadedplan WHERE id = ? AND pastureid = ?)tem),\'计划不存在\'),\nd.`intime` = if(?=\'\',null,?),\nd.`iscompleted` = ?,\nd.`completedtime` = if(?=\'\',null,?),\nd.`havebutton` =?\nWHERE pastureid = ? AND id =IFNULL((SELECT id FROM(SELECT id FROM downloadedplan WHERE id = ? AND pastureid = ?)tem),(SELECT id FROM(SELECT id FROM downloadedplan WHERE pastureid = ? LIMIT 1)tem))\n','projuctid,pastureid,begintime,begintime,completed,endtime,endtime,started,pastureid,projuctid,pastureid,pastureid','updatedownloadedplanYJ','PostRJSBDatas','更新主表','tmrgo','[{\n \"name\": \"updatePlan\",\n \"parammaps\": {\n \"pastureid\": \"1623032987\",\n \"completed\": \"0\",\n \"started\": \"1\",\n \"projuctid\": \"2664\",\n \"weight\": \"0\",\n \"begintime\": \"2021-06-18 00:00:00\",\n \"endtime\": \"2021-06-18 00:00:00\",\n \"beginweight\": \"0\",\n \"endweight\": \"0\",\n \"empcode\": \"1002\",\n \"empname\": \"中控员\",\n \"ID\": \"2664\",\n \"Inorout\": \"0\"\n }\n}]','\"sql: expected 12 arguments, got 13\"',0,1,0,0,0),
  550. (1772,406,'UPDATE \n`downloadplandtl1` d1\nJOIN downloadplandtl1_exec d1e ON d1.pastureid = d1e.pastureid AND d1.pid=d1e.pid AND d1.sort = d1e.sort\nSET d1.`actualweightminus` =?*d1.`lweight`/d1e.lweight,\nd1.`begintime` = if(?=\'\',null,?),\nd1.`intime` = if(?=\'\',null,?),\nd1.`lastactualweight` =?*d1.`lweight`/d1e.lweight,\nd1.`actualweight` =?*d1.`lweight`/d1e.lweight\nWHERE d1.pastureid = ? AND d1e.id =? AND 0=?','weight,begintimeD,begintimeD,endtime,endtimeD,beginweight,endweight,pastureid,ID,inorout','updated1YJ','PostDataByName','更新d1','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  551. (1773,406,'UPDATE \n`downloadplandtl2` d1\nSET d1.`actualweightminus` =?,\nd1.`begintime` = if(?=\'\',null,?),\nd1.`intime` = if(?=\'\',null,?),\nd1.`lastactualweight` =?,\nd1.`actualweight` =?\nWHERE pastureid = ? AND id =? AND 1=?','weight,begintimeD,begintimeD,endtimeD,endtimeD,beginweight,endweight,pastureid,ID,inorout','updated2YJ','PostDataByName','更新d2','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  552. (1774,406,'UPDATE \n`downloadplandtl1_exec` d1\nSET d1.`actualweightminus` =?,\nd1.`begintime` = if(?=\'\',null,?),\nd1.`intime` = if(?=\'\',null,?),\nd1.`lastactualweight` =?,\nd1.`actualweight` =?\nWHERE pastureid = ? AND id =? AND 0=?','weight,begintimeD,begintimeD,endtimeD,endtimeD,beginweight,endweight,pastureid,ID,inorout','updated1execYJ','PostDataByName','更新d1e','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  553. (1775,406,'\nINSERT INTO emprecord (\n `pastureid`,\n `imei`,\n `empid`,\n `empcode`,\n `empname`,\n `type`,\n `recordtime`\n)\nSELECT\n tmr.`pastureid`,\n tmr.imei,\n driver.`id`,\n driver.`drivercode`,\n driver.`drivername`,\n ?,\n NOW()\nFROM\n `tmr`\n JOIN `driver`\n ON driver.`drivercode` = ?\n AND driver.`pastureid` = tmr.`pastureid`\n AND tmr.imei = ?\n \n ','type,drivercode,imei','driverlogin','PostDataByName','插入打卡记录','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  554. (1776,406,'SELECT `datacaptureno`,`dctype`,`tclassid`,`tclassname`,`tname`,`tmr`.`pastureid`,`pasture`.`pasture_code`,`pasture`.`pasture_name`,`imei`\nFROM `tmr` JOIN `pasture` ON `pasture`.`pastureid`=`tmr`.`pastureid`\nWHERE `imei`=?','imei','getTMRByIMEI','GetDataByName','获取tmr信息','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  555. (1777,326,'\nSELECT \n日期,\n栏舍 名称,\nIFNULL(ROUND(IFNULL(产奶量/实际牛头数,0)/((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)*100,2),0.00) 准确率 -- 饲料转化率\n FROM (\nSELECT \nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期,\nfp.ccount 实际牛头数,\nd2.fname 栏舍,\nbm.product*bm.cowsum 产奶量,\nSUM(d2.`actualweightminus`) 撒料量,\nIFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0) 今日剩料量,\nAVG(IFNULL((SELECT AVG(actweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)) TMR干物质\n\n\n FROM \n`downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND fp.`barid` = d2.`fbarid`\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =fp.`pastureid` AND bm.`barid` = fp.`barid` AND bm.`productdate` =(SELECT MAX(`productdate`) FROM barmilk WHERE barmilk.productdate <=fp.`date` AND barmilk.`pastureid` = fp.`pastureid` and barmilk.barid = fp.`barid`)\n\n\nWHERE d.pastureid = ? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.`type` = 0\nGROUP BY d2.fbarid,d.`mydate` ) tem\nORDER BY 名称,日期','pastureid,startTime,stopTime ','getFeedEffZHLS','GetDataByName','饲喂效率图表-转化率-栏舍','tmrgo','{\"name\":\"getFeedEffZH\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'= ? AND fp.`date` BETWEEN ? AND ?\\nGROUP BY fp.`ftid`,fp.`date` ) tem\\nORDER BY \' at line 24\"',0,1,0,0,0),
  556. (1779,326,'\nSELECT \n日期,\nifnull(牲畜,\'无类别\') 名称,\nIFNULL(ROUND(IFNULL(产奶量/实际牛头数,0)/((撒料量 - 今日剩料量)*TMR干物质/实际牛头数)*100,2),0.00) 准确率 -- 饲料转化率\n FROM (\nSELECT \nDATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 日期,\n @tcowclass := (SELECT `cowclass` FROM `barmilk` WHERE pastureid = d2.pastureid AND `barid` = d2.fbarid AND `productdate` <= d2.date ORDER BY productdate DESC LIMIT 1) 牲畜,\n(SELECT SUM(ccount) FROM feedpdate fpt \nJOIN barmilk bm1\nON bm1.`pastureid` =fpt.`pastureid` AND bm1.`barid` = fpt.`barid` AND bm1.`productdate` = \n(SELECT MAX(barmilk.`productdate`) FROM barmilk WHERE barmilk.productdate <=fpt.`date` AND barmilk.`pastureid` = fpt.`pastureid` AND barmilk.`barid` = fpt.`barid`)\nWHERE fpt.pastureid = d.pastureid AND fpt.date = d2.date AND bm1.`cowclass` = @tcowclass)实际牛头数,\n@tid := IFNULL(d2.cowclassid,-1) cowclassid,\n@da := d.mydate,\n\n(SELECT SUM(bm.`product`*bm.`cowsum`) FROM \n(SELECT DISTINCT d21.`fbarid`,d21.`date`,d21.`pastureid`,d21.`fname`,IFNULL(d21.`cowclassid`,-1)cowclassid FROM \n`downloadedplan` d1\nJOIN `downloadplandtl2` d21\nON d21.`pastureid` = d1.`pastureid` AND d21.`pid` = d1.`id`\nWHERE d1.`mydate` between ? and ? AND d1.pastureid =? AND d1.lpplantype IN (0,1,2,5) AND d21.type = 0\nGROUP BY d21.`cowclassid`,d21.date) ww\nLEFT JOIN barmilk bm\nON bm.`pastureid` =ww.`pastureid` AND bm.`barid` = ww.`fbarid` AND bm.`productdate` \n= \n(\nSELECT MAX(`productdate`) FROM barmilk \nWHERE barmilk.productdate <= ww.`date` \nAND barmilk.`pastureid` = ww.`pastureid` \nAND barmilk.barid = ww.`fbarid`\n)\nWHERE ww.cowclassid = @tid and ww.date = @da\n) 产奶量,\nSUM(d2.`actualweightminus`) 撒料量,\nSUM(IFNULL((SELECT SUM(remain) FROM barfeedremain bf WHERE bf.`pastureid` = fp.`pastureid` AND bf.`barid` = fp.`barid` AND bf.`remaindate` = fp.`date`),0)) 今日剩料量,\nSUM(IFNULL((SELECT AVG(actweight) FROM ftdry fd WHERE fd.`pastureid` = fp.`pastureid` AND fd.`barid` = fp.`barid` AND fd.`operatetime` = (SELECT MAX(operatetime) FROM ftdry fd1 WHERE fd1.`pastureid` = fp.`pastureid` AND fd1.`barid` = fp.`barid` AND fd1.`operatetime` <=fp.`date` )),0)*d2.`actualweightminus`)/SUM(d2.actualweightminus) TMR干物质\n\n FROM \n`downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND fp.`barid` = d2.`fbarid`\n\n\nWHERE d.pastureid = ? AND d.`mydate` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) AND d2.`type` = 0\nGROUP BY (SELECT `cowclass` FROM `barmilk` WHERE pastureid = d2.pastureid AND `barid` = d2.fbarid AND `productdate` <= d2.date ORDER BY productdate DESC LIMIT 1),d.`mydate` ) tem\nORDER BY 名称,日期','startTime,stopTime,pastureid,pastureid,startTime,stopTime ','getFeedEffZHSC','GetDataByName','饲喂效率图表-转化率-牲畜','tmrgo','{\"name\":\"getFeedEffZH\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','\"Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'= ? AND fp.`date` BETWEEN ? AND ?\\nGROUP BY fp.`ftid`,fp.`date` ) tem\\nORDER BY \' at line 24\"',0,1,0,0,0),
  557. (1781,406,'SELECT \nTRIM(d1.id) ID,TRIM(d1.`pid`) projuctid,\nTRIM(d1.pastureid)pastureid,d1.fname optname,TRIM(d1.fid) optid,\nSUM(d1.lweight) targetweight,\nIFNULL(MAX(feed.`autozone`),10)autozone,\nIFNULL(MAX(feed.`autosecond`),0) autosecond,\nd1.`stirdelay` delaytime,\n(SELECT MAX(havebuttom) FROM `downloadplandtl1` d1t\nWHERE d1t.`pastureid` = d1.pastureid AND d1t.`pid` = d1.`pid`)firstReget,\nIFNULL(MAX(feed.confirmstart),0) needBegin,\nd1.`sort` pfsort,\n0 inorout,GROUP_CONCAT(d1.fname,\' : \',d1.lweight) mixdesc,\nIFNULL(feed.`jmp`,0) jmp,\nif (count(*)>1,1,0) ismix\nFROM `downloadplandtl1` d1\nLEFT JOIN feed ON feed.`pastureid` = d1.`pastureid` AND d1.`fid` = feed.`id` \nWHERE d1.`pastureid` =? AND d1.`pid` = ?\nGROUP BY d1.`sort`\n\nUNION ALL\n\nSELECT TRIM(d1.id) ID,TRIM(d1.`pid`) projuctid,\nTRIM(d1.pastureid) pastureid,d1.fname optname,TRIM(d1.fbarid) optid,\nd1.lweight targetweight,\nIFNULL(bar.`autozone`,10)autozone,\nIFNULL(bar.`autosecond`,0) autosecond,\n0 delaytime,\n(SELECT MAX(havebuttom) FROM `downloadplandtl2` d1t\nWHERE d1t.`pastureid` = d1.pastureid AND d1t.`pid` = d1.`pid`) firstReget,\n0 needBegin,\nd1.`sort` pfsort,\n1 inorout,\'\',0 jmp,0\nFROM `downloadplandtl2` d1\nLEFT JOIN bar ON bar.`pastureid` = d1.`pastureid` AND d1.`fbarid` = bar.`id` \nWHERE d1.`pastureid` = ? AND d1.`pid` = ?\n','pastureid,id,pastureid,id','getRLSBdetailAll','GetArrList','获取计划饲料子表','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  558. (1782,390,'SELECT \ntem.eqcode tname,tem.remark,TRIM(tem.`projid`)pid,tem.datacaptureno,tem.id\nFROM \n\n(\nSELECT tmr.`eqcode`,tmr.`tname`,d.`remark`,tmr.`projid`,tmr.`datacaptureno`,TRIM(tmr.id) id\n\nFROM tmr\nINNER JOIN downloadedplan d\nON d.`pastureid` = tmr.`pastureid` AND d.`id` = tmr.`projid`\nLEFT JOIN `downloadplandtl1_exec` de\nON de.`pastureid` = tmr.`pastureid` AND de.`pid` = d.`id` AND tmr.`inorout` = 0 \nLEFT JOIN `downloadplandtl2` d2\nON d2.`pastureid` = tmr.`pastureid` AND d2.`pid` = d.`id` AND tmr.`inorout` = 1 AND (tmr.nextsort = d2.sort OR tmr.nextsort=-1 )\n\nWHERE tmr.`pastureid` =? AND d.`havebutton` = 1 AND d.`iscompleted` = 0 \nAND (( \nIF(tmr.nextsort=-1,de.sort = (SELECT MAX(sort) FROM downloadplandtl1_exec d1e WHERE d1e.`pastureid` = tmr.`pastureid` AND d1e.`pid` = d.`id` ),tmr.nextsort = de.sort)\n )\nOR (\nIF(tmr.nextsort=-1,d2.sort = (SELECT MAX(sort) FROM downloadplandtl2 d2e WHERE d2e.`pastureid` = tmr.`pastureid` AND d2e.`pid` = d.`id` ),tmr.nextsort = d2.sort)\n ))\n)tem\n','pastureid','getHomepageTMRListAPP','GetDataByName','过程分析轮播','tmrgo','{\"name\":\"getHomepageLBList\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  559. (1783,390,'SELECT \ntem.eqcode tname,tem.remark,tem.fname,tem.inorout,IFNULL(tem.lweight,0) lweight,tem.lastactualweight,TRIM(tem.`projid`)pid,tem.datacaptureno,tem.id,\nIFNULL(tem.doneweight,0) doneweight,\ntem.nowweight,\nIFNULL(tem.lweight- tem.doneweight,0) leftweight,\nCONCAT(ROUND(tem.doneweight/tem.lweight*100,2),\'%\') donerate\nFROM \n\n(\nSELECT tmr.`eqcode`,tmr.`tname`,d.`remark`,tmr.`projid`,tmr.`datacaptureno`,TRIM(tmr.id) id,\ntmr.`inorout`,\nIF(tmr.`nextsort`=-1,\'无\',IF(tmr.`inorout`=0,de.`fname`,d2.`fname`)) fname,\nIF(tmr.`inorout`=0,\n(SELECT SUM(lweight) FROM downloadplandtl1_exec d1e WHERE d1e.`pastureid` = tmr.`pastureid` AND d1e.`pid` = d.`id` AND d1e.sort = tmr.`nextsort` )\n, (SELECT SUM(lweight) FROM downloadplandtl2 d2e WHERE d2e.`pastureid` = tmr.`pastureid` AND d2e.`pid` = d.`id` AND d2e.sort = tmr.`nextsort` )) lweight,\nIF(tmr.`inorout`=0,de.lastactualweight,d2.lastactualweight) lastactualweight,\ntmr.`lastweight`,\nABS((SELECT weight FROM `recweight` r WHERE r.pastureid= tmr.`pastureid` AND r.srcaddr = tmr.`datacaptureno` ORDER BY mtime DESC LIMIT 1)-tmr.`lastweight`) doneweight,\n(SELECT weight FROM `recweight` r WHERE r.pastureid= tmr.`pastureid` AND r.srcaddr = tmr.`datacaptureno` ORDER BY mtime DESC LIMIT 1) nowweight\nFROM tmr\nINNER JOIN downloadedplan d\nON d.`pastureid` = tmr.`pastureid` AND d.`id` = tmr.`projid`\nLEFT JOIN `downloadplandtl1_exec` de\nON de.`pastureid` = tmr.`pastureid` AND de.`pid` = d.`id` AND tmr.`inorout` = 0 \nLEFT JOIN `downloadplandtl2` d2\nON d2.`pastureid` = tmr.`pastureid` AND d2.`pid` = d.`id` AND tmr.`inorout` = 1 AND (tmr.nextsort = d2.sort OR tmr.nextsort=-1 )\n\nWHERE tmr.`pastureid` =? AND d.`havebutton` = 1 AND d.`iscompleted` = 0 \nAND (( \nIF(tmr.nextsort=-1,de.sort = (SELECT MAX(sort) FROM downloadplandtl1_exec d1e WHERE d1e.`pastureid` = tmr.`pastureid` AND d1e.`pid` = d.`id` ),tmr.nextsort = de.sort)\n )\nOR (\nIF(tmr.nextsort=-1,d2.sort = (SELECT MAX(sort) FROM downloadplandtl2 d2e WHERE d2e.`pastureid` = tmr.`pastureid` AND d2e.`pid` = d.`id` ),tmr.nextsort = d2.sort)\n ))\n)tem\nwhere tem.id = ?\n','pastureid,id','getHomepageTMRListDetailAPP','GetDataByName','过程分析轮播','tmrgo','{\"name\":\"getHomepageLBList\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  560. (1787,334,'UPDATE `feedtemplet` SET VERSION = VERSION+1\nWHERE pastureid = ? AND id = ?\n','pastureid,id','updateftversion','GetDataByName','配方模板列表','tmrgo','{\"name\":\"getFTList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"ccid\":1,\"ccname\":\"泌乳牛\",\"enable\":1,\"fttype\":\"预混配方\",\"id\":\"8874176271438480590\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方2\"},{\"ccid\":1,\"enable\":1,\"fttype\":\"饲喂配方\",\"id\":\"8874176271438480589\",\"pastureid\":\"3025176271438480383\",\"tcolor\":\"55\",\"tname\":\"配方1\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  561. (1789,334,'UPDATE `ftdetail` SET `feedgroup` = `fname` WHERE \nftid = ? AND pastureid = ?\nAND id IN (SELECT id FROM (\n SELECT \n id ,COUNT(*) cou\n FROM ftdetail ftd \n WHERE ftd.`pastureid` = ? AND ftd.`ftid` =? GROUP BY sort\n HAVING cou= 1)dd)\n','ftid,pastureid,pastureid,ftid','updateFTdetailGroup','PostDataByName','修改配方模板详情','tmrgo','{\"name\":\"updateBar\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  562. (1790,343,'\nSELECT\neqcode,\ntname,\ndatacaptureno,\ntrim(tclassid) tclassid,\nconcat(tname,\' / \',eqcode) tmrmix,\ntclassname,\nmaxstirfeed,\nremark,\n`enable`,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n tmr\nWHERE pastureid = ? and enable=1 and tclassid in (1,2,3)\n\nUNION ALL\nSELECT \'任意车\',\'任意车\',\'-2\',-2,\'任意车\',\'任意车\',100000,\'任意车\',1,-2,?\n\nORDER BY id DESC','pastureid,pastureid','getTMRListEnableTypeAll','GetDataByName','tmr列表','tmrgo','{\"name\":\"getTMRListEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"eqtype\":\"2\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":2,\"enable\":1,\"eqcode\":\"05841\",\"id\":\"3029300176059106304\",\"maxstirfeed\":0,\"pastureid\":\"3025176271438480383\",\"remark\":\"维修中\",\"tclassid\":\"0\",\"tclassname\":\"\",\"tname\":\"东区铲车\"},{\"datacaptureno\":7,\"enable\":1,\"eqcode\":\"017288\",\"id\":\"3029299420144862208\",\"maxstirfeed\":2000,\"pastureid\":\"3025176271438480383\",\"remark\":\"在用\",\"tclassid\":\"2\",\"tclassname\":\"固定式\",\"tname\":\"拖拉机\"},{\"datacaptureno\":8,\"enable\":1,\"eqcode\":\"0000158\",\"id\":\"3027989712817619968\",\"maxstirfeed\":1000,\"pastureid\":\"3025176271438480383\",\"remark\":\"\",\"tclassid\":\"1\",\"tclassname\":\"自走式\",\"tname\":\"装载机\"},{\"datacaptureno\":4,\"enable\":1,\"eqcode\":\"09874\",\"id\":\"3026792763464614912\",\"maxstirfeed\":0,\"pastureid\":\"3025176271438480383\",\"remark\":\"保养中\",\"tclassid\":\"0\",\"tclassname\":\"\",\"tname\":\"西区铲车\"},{\"datacaptureno\":12,\"enable\":1,\"eqcode\":\"11\",\"id\":\"3026731597124076544\",\"maxstirfeed\":1,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"1\",\"tclassname\":\"自走式\",\"tname\":\"11\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":5}',0,1,0,0,0),
  563. (1791,325,'SELECT * FROM (\nSELECT DATE_FORMAT(de.`date`, \'%Y-%m-%d\') 计划时间,\nIFNULL((SELECT d.`templetname` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid),de.`fname`) 配方名称,\nROUND(SUM(de.`lweight`),2) 理论重量,\nROUND(SUM(de.`actualweightminus`),2) 实际重量,\nSUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\nSUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , \nSUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , \nROUND(ABS(SUM(de.`lweight`)-SUM(de.`actualweightminus`)),2) 混料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0)),0) 混料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 混料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\nFROM `downloadplandtl1` de \n\nWHERE de.pastureid=? AND de.`date` BETWEEN ? AND ?\n AND de.`type` = 0 \nAND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) IN (0,1,2,5)\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY de.date,(SELECT d.`templetname` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid)\nORDER BY 计划时间,混料准确率 DESC,配方名称\n) tem\nwhere tem.配方名称 = ? or ?=\'\'','pastureid,startTime,stopTime,fname,fname','getAccuracyHFTDate','GetDataByName',' 汇总-配方混料准确率-日期','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  564. (1792,325,'SELECT * FROM (\nSELECT \n(SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = de.`pastureid` AND dr.`eqid` = de.`optdevice` AND dr.times= (SELECT d.times FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) AND dr.`operatetime` <=de.`date` \nORDER BY dr.`operatetime` DESC LIMIT 1)驾驶员,\nDATE_FORMAT(de.`date`, \'%Y-%m-%d\') 计划时间,\nIFNULL((SELECT d.`projname` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid)\n,\'无车次\') 车次,\nCASE (SELECT d.`times` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid)\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND 班次,\n(SELECT d.tmrtname FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) TMR名称,\nROUND(SUM(de.`lweight`),2) 理论重量,\nROUND(SUM(de.`actualweightminus`),2) 实际重量,\nSUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\nSUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , \nSUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , \nROUND(ABS(SUM(de.`lweight`)-SUM(de.`actualweightminus`)),2) 混料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\n\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0)),0) 混料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 混料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\nFROM `downloadplandtl1` de \n\nWHERE de.pastureid=? AND de.`date` BETWEEN ? AND ?\n-- AND de.`type` = 0 \n-- AND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) IN (0,1,2,5)\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY de.date, de.`pid`\nORDER BY 计划时间,混料准确率 DESC,TMR名称 ) tem\n\nWHERE (tem.车次 = ? OR ?=\'\') AND (tem.班次 = ? OR ?=\'\') AND (tem.TMR名称 = ? OR ?=\'\')\n','pastureid,startTime,stopTime,projname,projname,times,times,tmrname,tmrname','getAccuracyHCCDate','GetDataByName',' 汇总- 车次混料准确率-日期','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  565. (1793,325,'SELECT DATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 计划时间, de.`fname` 原料名称,\nSUM(de.`lweight`) 理论重量,SUM(de.`actualweightminus`) 实际重量,SUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , ROUND(ABS(SUM(de.`lweight`)-SUM(de.`actualweightminus`)),2) 混料误差值,\nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\n\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差\nFROM `downloadplandtl1_exec` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.`pastureid` = de.`pastureid`\nWHERE d.pastureid = ? AND d.mydate BETWEEN ? AND ? AND d.lpplantype<3\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY de.date,de.`fname`\nORDER BY AVG(ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)','pastureid,startTime,stopTime','getAccuracyHYLDate','GetDataByName',' 汇总-原料混料准确率-日期','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  566. (1794,325,'\nSELECT * FROM (\n\nSELECT DATE_FORMAT(de.`date`, \'%Y-%m-%d\') 计划时间,\nIFNULL((SELECT ft.`ccname` FROM `downloadedplan` d\nJOIN `feedtemplet` ft ON ft.`pastureid` = d.`pastureid` AND ft.id = d.`tempid`WHERE d.pastureid = de.pastureid AND d.id = de.pid)\n,\'无类别\') 牲畜类别,\nROUND(SUM(de.`lweight`),2) 理论重量,\nROUND(SUM(de.`actualweightminus`),2) 实际重量,\nSUM(1) 计划混料操作数,SUM(de.`havebuttom`) 已混料操作数, \nCONCAT(ROUND(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 混料操作率,\nSUM(IF(de.`buttontype` =1,1,0)) 混料自动跳转次数 , \nSUM(IF(de.`buttontype`>1,1,0)) 混料手动跳转次数 , \nROUND(ABS(SUM(de.`lweight`)-SUM(de.`actualweightminus`)),2) 混料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')混料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nROUND(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0)),0) 混料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 混料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\nFROM `downloadplandtl1` de \n\nWHERE de.pastureid=? AND de.`date` BETWEEN ? AND ?\n AND de.`type` = 0 \nAND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = de.pastureid AND d.id = de.pid) IN (0,1,2,5)\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY de.date,(SELECT ft.`ccname` FROM `downloadedplan` d\nJOIN `feedtemplet` ft ON ft.`pastureid` = d.`pastureid` AND ft.id = d.`tempid`WHERE d.pastureid = de.pastureid AND d.id = de.pid)\nORDER BY 计划时间,混料准确率 DESC,牲畜类别\n\n) tem\n\nWHERE (tem.牲畜类别 = ? OR ?=\'\')','pastureid,startTime,stopTime,fname,fname','getAccuracyHSCDate','GetDataByName',' 汇总-牲畜类别混料准确率-日期','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  567. (1795,325,'SELECT\n 计划时间,\n 栏舍名称,\n ROUND(理论重量,2)理论重量,\n ROUND(实际重量,2)实际重量,\n 计划混料操作数,\n 已混料操作数, \n CONCAT(ROUND( 已混料操作数/ 计划混料操作数 *100 ,2),\'%\') 混料操作率,\n 混料自动跳转次数 , \n 混料手动跳转次数 , \n ROUND(ABS(理论重量-实际重量),2) 混料误差值, \nCONCAT( \nIF (实际重量>理论重量,\nROUND((理论重量/实际重量*100),2) ,\nROUND((实际重量/理论重量*100) ,2)),\'%\')混料准确率,\n 取消次数,\n 方差,混料正确数,\nCONCAT(ROUND(IFNULL(混料正确数/ 计划混料操作数,0)*100,2),\'%\') 混料正确率,\nCONCAT(ROUND(IFNULL(去除取消混料正确数/去除取消混料数,0)*100,2),\'%\') 去除取消正确率\nFROM \n(\nSELECT \nd2.`type`,\nDATE_FORMAT(d2.`date`, \'%Y-%m-%d\') 计划时间,\nIFNULL(d2.`fname`\n,\'无栏舍\') 栏舍名称,\nSUM(d2.lweight) 理论重量,\nSUM((SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.flpid = d2.flpid AND dt.type = 0 AND dt.date = d2.date)*\n(d2.lweight/(SELECT SUM(lweight) FROM `downloadplandtl2` dt WHERE dt.pastureid = d2.pastureid AND dt.flpid = d2.flpid AND dt.type = 0 AND dt.date = d2.date))) 实际重量,\nSUM((SELECT SUM(1) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 计划混料操作数,\nSUM((SELECT SUM(dt.`havebuttom`) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 已混料操作数,\nSUM((SELECT SUM(IF(dt.`buttontype` =1,1,0)) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 混料自动跳转次数,\nSUM((SELECT SUM(IF(dt.`buttontype` >1,1,0)) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 混料手动跳转次数,\nSUM((SELECT SUM(CASE WHEN (ABS(dt.`actualweightminus`-dt.`lweight`)/dt.`lweight`)>3 AND dt.`lweight` >30 AND dt.`actualweightminus` >30 THEN 1 ELSE 0 END) \nFROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)) 取消次数,\nROUND(STD(ABS((SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid)*\n(d2.lweight/(SELECT SUM(lweight) FROM `downloadplandtl2` dt WHERE dt.pastureid = d2.pastureid AND dt.pid = d2.pid))- d2.lweight)) ,2)方差,\n IFNULL(\nSUM((SELECT SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0)) FROM `downloadplandtl1_exec` de WHERE de.pastureid = d2.pastureid AND de.pid = d2.pid))\n,0) 混料正确数,\n\n IFNULL(\nSUM((SELECT SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )) FROM `downloadplandtl1_exec` de WHERE de.pastureid = d2.pastureid AND de.pid = d2.pid))\n,0) 去除取消混料数,\n IFNULL(\nSUM((SELECT SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`feedallowratio` AND de.`actualweightminus`<>0,1,0),0\n)) FROM `downloadplandtl1_exec` de WHERE de.pastureid = d2.pastureid AND de.pid = d2.pid))\n,0) 去除取消混料正确数\n\nFROM \n `downloadplandtl2` d2\n WHERE d2.pastureid=? AND d2.`date` BETWEEN ? AND ?\nAND (SELECT d.`lpplantype` FROM `downloadedplan` d WHERE d.pastureid = d2.pastureid AND d.id = d2.pid) IN (0,1,2,5)\nand d2.`type` = 0\nGROUP BY d2.date,d2.`fbarid`\n\n) tem\nWHERE 栏舍名称= ? OR ?=\'\'\nORDER BY 计划时间,混料准确率 DESC,栏舍名称\n','pastureid,startTime,stopTime,fname,fname','getAccuracyHNSDate','GetDataByName',' 汇总-牛舍混料准确率-日期','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  568. (1796,325,'SELECT DATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 计划时间,ifnull(d.`templetname`,de.`feedtempletname`) 配方名称,\nSUM(de.`lweight`) 理论重量,round(SUM(de.`actualweightminus`)) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数 , \nABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0)),0) 撒料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 撒料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\n\n\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.pastureid = de.pastureid\nWHERE d.pastureid=? AND d.`mydate` BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.mydate,d.`templetname`\nHAVING d.`templetname` = ? OR ?=\'\'\nORDER BY 计划时间,撒料准确率 DESC,配方名称','pastureid,startTime,stopTime,fname,fname','getAccuracySFTDate','GetDataByName',' 汇总-配方撒料准确率-日期','tmrgo','{\"name\":\"getAccuracySFT\",\"page\":1,\"offset\":1,\"pagecount\":\"\",\"returntype\":\"Map\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"startTime\":\"2021-03-15\",\"stopTime\":\"2021-03-15\",\"inputDatetime\":[\"2021-03-16T06:45:08.771Z\",\"2021-03-16T06:45:08.771Z\"],\"fname\":\"泌乳牛配方\",\"sort\":\"\",\"times\":\"\"}}','{\"code\":0,\"list\":[{\"取消次数\":\"0\",\"实际重量\":\"390\",\"已撒料操作数\":\"1\",\"撒料准确率\":\"32.10%\",\"撒料手动跳转次数\":\"0\",\"撒料操作率\":\"33.33%\",\"撒料自动跳转次数\":\"1\",\"撒料误差值\":\"960.00\",\"方差\":271.75,\"理论重量\":\"1350.00\",\"计划撒料操作数\":\"3\",\"计划时间\":\"2021-03-15T00:00:00+08:00\",\"配方名称\":\"泌乳牛配方\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  569. (1797,325,'SELECT DATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 计划时间,\n(SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = de.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1)驾驶员,d.`projname` 车次,\nCASE d.times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND 班次,\nd.tmrtname TMR名称,\n\nSUM(de.`lweight`) 理论重量,round(SUM(de.`actualweightminus`)) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数 ,\nABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)),2) 方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0)),0) 撒料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 撒料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\n\n\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.pastureid = de.pastureid \nWHERE d.pastureid = ? AND DATE(d.`mydate`) BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n -- AND de.`type` = 0\nAND (d.`tmrtname` = ? OR ?=\'\')\nAND (d.`projname` = ? OR ?= \'\')\n\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.mydate,d.`projname`\nHAVING (班次 = ? OR ?= \'\')\nORDER BY 计划时间,撒料准确率 DESC,车次\n','pastureid,startTime,stopTime,fname,fname,projname,projname,times,times','getAccuracySCCDate','GetDataByName',' 汇总- 车次撒料准确率','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  570. (1798,325,'SELECT DATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 计划时间, de.`fname` 原料名称,\nSUM(de.`lweight`) 理论重量,SUM(de.`actualweightminus`) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数 ,\n ABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0)),0) 撒料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 撒料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\n\n\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.`pastureid` = de.`pastureid`\nWHERE d.pastureid = ? AND DATE(d.`mydate`) BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\nAND (de.`fname` = ? OR ?=\'\')\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY de.date,de.`fname`\nORDER BY 计划时间,撒料准确率 DESC','pastureid,startTime,stopTime,fname,fname','getAccuracySYLDate','GetDataByName',' 汇总-原料撒料准确率-日期','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  571. (1799,325,'SELECT DATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 计划时间,ifnull((SELECT concat(bm.bigcowclass,\'-\',bm.cowclass) FROM barmilk bm WHERE bm.`barid` = de.fbarid AND bm.pastureid=de.pastureid AND bm.productdate<=de.`date` ORDER BY bm.productdate DESC LIMIT 1) ,\'无类别\') 牲畜类别,\nSUM(de.`lweight`) 理论重量,SUM(de.`actualweightminus`) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \nconcat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数, \nABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值, \nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0)),0) 撒料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 撒料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\n\n\nFROM `downloadedplan` d JOIN `downloadplandtl2` de\nON d.`id`=de.`pid` AND d.`pastureid` = de.`pastureid`\nWHERE d.pastureid = ? AND DATE(d.`mydate`) BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\nAND (de.`cowclassname` = ? OR ?=\'\')\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY d.mydate,(SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = de.fbarid AND bm.pastureid=de.pastureid AND bm.productdate<=de.`date` ORDER BY bm.productdate DESC LIMIT 1) \nORDER BY 计划时间,撒料准确率 DESC,牲畜类别','pastureid,startTime,stopTime,fname,fname','getAccuracySSCDate','GetDataByName',' 汇总-牲畜类别撒料准确率-日期','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  572. (1800,325,'SELECT DATE_FORMAT(d.`mydate`, \'%Y-%m-%d\') 计划时间,de.`fname` 栏舍名称,\nSUM(de.`lweight`) 理论重量,SUM(de.`actualweightminus`) 实际重量,SUM(1) 计划撒料操作数,SUM(de.`havebuttom`) 已撒料操作数, \n SUM(IF(de.`buttontype` =1,1,0)) 撒料自动跳转次数 , SUM(IF(de.`buttontype`>1,1,0)) 撒料手动跳转次数, \nABS(SUM(de.`actualweightminus`)-SUM(de.`lweight`)) 撒料误差值,\n concat(round(SUM(de.`havebuttom`)/SUM(1)*100,2),\'%\') 撒料操作率,\nCONCAT( \nIF (SUM(de.`actualweightminus`)>SUM(de.`lweight`),\nROUND((SUM(de.`lweight`)/SUM(de.`actualweightminus`)*100),2) ,\nROUND((SUM(de.`actualweightminus`)/SUM(de.`lweight`)*100) ,2)),\'%\')撒料准确率,\nSUM(CASE WHEN (ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)>3 AND de.`lweight` >30 AND de.`actualweightminus` >30 THEN 1 ELSE 0 END) 取消次数,\nround(STD(ABS(de.`actualweightminus`-de.`lweight`)) ,2)方差,\nIFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0)),0) 撒料正确数,\nCONCAT(ROUND(IFNULL(SUM(IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0))/SUM(1),0)*100,2),\'%\') 撒料正确率,\nCONCAT(ROUND(IFNULL(SUM(\nIF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),IF(ABS(de.`actualweightminus`-de.`lweight`)<=de.`allowratio` AND de.`actualweightminus`<>0,1,0),0\n))/SUM(IF(((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )),1,0 )),0)*100,2),\'%\') 去除取消正确率\n\n\nFROM `downloadplandtl2` de JOIN `downloadedplan` d ON d.`id`=de.`pid` AND d.`pastureid` = de.`pastureid`\nWHERE d.pastureid = ? AND DATE(d.`mydate`) BETWEEN ? AND ? \n AND d.lpplantype IN (0,1,2,5)\n AND de.`type` = 0\nAND (de.`fname` = ? OR ?=\'\')\n-- 加上就是不含取消操作\n-- AND ((ABS(de.`actualweightminus`-de.`lweight`)/de.`lweight`)<=3 OR (de.`lweight` <30 AND de.`actualweightminus` <30 )) \nGROUP BY de.date,de.`fname`\nORDER BY 计划时间,撒料准确率 DESC,栏舍名称','pastureid,startTime,stopTime,fname,fname','getAccuracySNSDate','GetDataByName',' 汇总-牛舍撒料准确率-日期','tmrgo','{\"name\":\"getFTAccuracy\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  573. (1801,334,'select DATE_FORMATdate , \'%Y-%m-%d\') date\n from feedtempletdate where pastureid=?\nand date <= date(now())\ngroup by date','pastureid','getFTHisDateList','GetDataByName','配方模板列表历史最近日全球','tmrgo','{\"name\":\"getFTMaxDate\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"maxdate\":\"2020-08-31\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  574. (1802,404,'SELECT fpd.`barname`,TRIM(fpd.`barid`) barid,TRIM(fpd.`pastureid`)pastureid \nFROM `feedpdate` fpd WHERE fpd.`date` BETWEEN ? AND ?\n AND fpd.`ftid` = ? AND fpd.`pastureid` = ?\ngroup by fpd.`barid`','startTime,stopTime,ftid,pastureid','getjudgenurBarlist','GetDataByName','配方评估栏舍列表','tmrgo','{\"name\":\"judgenurBarHSL\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"barid\":\"1\",\"startTime\":\"2021-04-16\",\"stopTime\":\"2021-04-16\"}}','{\"code\":0,\"list\":[{},{}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  575. (1803,338,'SELECT \n(SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = dlp.`pastureid` AND dr.`eqid` = dlp.`tmrid` and dr.times= dlp.times AND dr.`operatetime` <=dlp.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1)driver,\nGROUP_CONCAT(d2.fname ORDER BY d2.`sort` ) barnames,plantime,\nmydate,projname,datacaptureno,tmrid,tmrtname,havebutton,inbuttontype,dlp.intime,dlp.completedtime,dlp.processtime,iscompleted, lpplantype,\nCASE times\nWHEN 1 THEN\n\'第一班\'\nWHEN 2 THEN\n\'第二班\'\nWHEN 3 THEN\n\'第三班\'\nWHEN 4 THEN\n\'第四班\'\nEND \ntimes,dlp.sort,dlp.remark,itemnum,outitems,feedpname,feedpcount,trim(dlp.pid)pid,tempid,templetname,thoweight,fpweight,dlp.lweight,iweight,oweight,\nTRIM(dlp.id) id,\ndlp.enable,\nTRIM(dlp.pastureid) pastureid\nFROM\n downloadedplan dlp\n left JOIN downloadplandtl2 d2\n ON d2.pastureid=dlp.pastureid AND d2.`pid` = dlp.`id` AND d2.date = dlp.`mydate` \nWHERE dlp.pastureid = ? \n AND ( mydate =? ) \n AND (dlp.id=? )\nGROUP BY dlp.`id`','pastureid,mydate,id','getDownloadedplanDetailApp','GetDataByName','日执行计划主列表','tmrgo','{\"name\":\"getDownloadedplanList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barnames\":\"西区#6,东区#1\",\"datacaptureno\":5,\"driver\":\"2号驾驶员\",\"feedpcount\":0,\"havebutton\":0,\"id\":\"141\",\"inbuttontype\":0,\"iscompleted\":0,\"itemnum\":3,\"lpplantype\":2,\"lweight\":100,\"mydate\":\"2020-09-15T00:00:00+08:00\",\"outitems\":2,\"pastureid\":\"3025176271438480383\",\"pid\":\"3025176271438480384\",\"projname\":\"1.001\",\"sort\":1,\"tempid\":3025176272438480400,\"templetname\":\"配方1\",\"times\":1,\"tmrid\":3052766172849636400,\"tmrtname\":\"TMR004\"},{\"barnames\":\"西区#2,西区#6\",\"datacaptureno\":6,\"driver\":\"1号驾驶员\",\"feedpcount\":0,\"havebutton\":0,\"id\":\"142\",\"inbuttontype\":0,\"iscompleted\":0,\"itemnum\":3,\"lpplantype\":2,\"lweight\":100,\"mydate\":\"2020-09-15T00:00:00+08:00\",\"outitems\":2,\"pastureid\":\"3025176271438480383\",\"pid\":\"3025176271438480385\",\"projname\":\"3.002\",\"sort\":2,\"tempid\":3051208869281268700,\"templetname\":\"配方2\",\"times\":3,\"tmrid\":3052769584060302300,\"tmrtname\":\"TMR005\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  576. (1804,404,'select * from (SELECT\n(SELECT cc.`parentname` FROM `cowclass` cc WHERE cc.pastureid = bm.`pastureid` AND cc.id = bm.`cowclassid`) `bigcowclass`,\n TRIM(pastureid)pastureid,\nTRIM(barid) barid,barname,productdate,product,avgmonthage,bw,dayw,fetal,avgdim,dayspre,fat,pro,lactose,source,tem,cowsum,cowclass,\nTRIM(cowclassid) cowclassid,emp \n\n FROM `barmilk` bm WHERE pastureid = ? AND barid = ? AND `productdate` <= ? ORDER BY productdate LIMIT 1) ww','pastureid,barid,stopTime','getjudgenurBarDetailAPP','GetDataByName','配方评估栏舍列表','tmrgo','{\"name\":\"judgenurBarHSL\",\"parammaps\":{\"pastureid\":\"1\",\"barid\":\"1\",\"date\":\"2021-01-20\",\"enable\":1}}','{\"code\":0,\"list\":[{},{}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  577. (1805,326,'SELECT tem.standardscore,tem.barname,tem.product,tem.avgdim,tem.sumcowcount,\n CONCAT(1score,\'(\',ROUND(1score/sumcowcount*100,2),\'%)\') score1,\n CONCAT(2score,\'(\',ROUND(2score/sumcowcount*100,2),\'%)\') score2,\n CONCAT(3score,\'(\',ROUND(3score/sumcowcount*100,2),\'%)\') score3,\n CONCAT(4score,\'(\',ROUND(4score/sumcowcount*100,2),\'%)\') score4,\n CONCAT((sumcowcount-1score-2score-3score-4score),\'(\',100-(ROUND(1score/sumcowcount*100,2)\n +ROUND(2score/sumcowcount*100,2)+ROUND(3score/sumcowcount*100,2)\n +ROUND(4score/sumcowcount*100,2)),\'%)\') score5\n\nFROM (\nSELECT\nstandardscore,\n p.pastureid,p.barid,\n CONCAT(p.barname,\'/\',IFNULL((SELECT bm.cowclass FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1),\'\'))barname,\n \n (SELECT bm.product FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)product,\n (SELECT bm.avgdim FROM barmilk bm WHERE bm.`barid` = p.barid AND bm.pastureid=p.pastureid AND bm.productdate<=p.`operatetime` ORDER BY bm.productdate DESC LIMIT 1)avgdim,\n SUM(p.1score+p.2score+p.3score+p.4score+p.5score) sumcowcount,\n ROUND(SUM(p.1score),2) 1score,\n ROUND(SUM(p.2score),2)2score,\n ROUND(SUM(p.3score),2)3score,\n ROUND(SUM(p.4score),2) 4score,\n ROUND(SUM(p.5score),2) 5score\n FROM `dungscore` p\n WHERE p.`pastureid` =? AND p.`operatetime` = ?\nGROUP BY p.barid) tem\nORDER BY barid','pastureid,date','getAssessDungscoreV2','GetDataByName','牛群评估-粪便评分','tmrgo','{\"name\":\"getAssessDungscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"date\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"enable\":1}}','{\"code\":0,\"list\":[{\"CONCAT(p.onerange,p.tworange,p.threerange)\":\"(1-2)(3-4)(5-6)\",\"barid\":3050941006599423000,\"barname\":\"北区#1/水牛\",\"fourrate\":\"24.16%\",\"onerate\":\"62.92%\",\"oneweight\":\"112.00\",\"pastureid\":3025176271438480400,\"sumweight\":\"178.00\",\"threerate\":\"24.16%\",\"threeweight\":\"43.00\",\"tworate\":\"12.92%\",\"twoweight\":\"23.00\"},{\"CONCAT(p.onerange,p.tworange,p.threerange)\":\"(0-20)(0-20)(0-20)\",\"barid\":3055340423423198000,\"barname\":\"南区#1/干奶后期 产前-分娩\",\"fourrate\":\"25.78%\",\"onerate\":\"39.06%\",\"oneweight\":\"50.00\",\"pastureid\":3025176271438480400,\"sumweight\":\"128.00\",\"threerate\":\"25.78%\",\"threeweight\":\"33.00\",\"tworate\":\"35.16%\",\"twoweight\":\"45.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":2}',0,1,0,0,0),
  578. (1806,357,'SELECT barid,barname,operatetime,times,standardscore,cowsum,remark,emp,ftname,ftid,id,pastureid,\n CONCAT(1score,\'(\',ROUND(1score/sumcowcount*100,2),\'%)\') score1,\n CONCAT(2score,\'(\',ROUND(2score/sumcowcount*100,2),\'%)\') score2,\n CONCAT(3score,\'(\',ROUND(3score/sumcowcount*100,2),\'%)\') score3,\n CONCAT(4score,\'(\',ROUND(4score/sumcowcount*100,2),\'%)\') score4,\n CONCAT((sumcowcount-1score-2score-3score-4score),\'(\',100-(ROUND(1score/sumcowcount*100,2)\n +ROUND(2score/sumcowcount*100,2)+ROUND(3score/sumcowcount*100,2)\n +ROUND(4score/sumcowcount*100,2)),\'%)\') score5\n FROM \n (\n SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nstandardscore,cowsum,1score ,2score ,3score ,4score ,5score,remark,emp,ftname,\n(1score+2score+3score+4score+5score)sumcowcount,\nTRIM(ftid) ftid,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n dungscore\nWHERE pastureid = ? \n AND (( operatetime >=? AND operatetime<=?) OR ? = \'\')\n AND (barid=? OR ? = \'\' )\n AND (times=? OR ? = \'\' )\nORDER BY id DESC) tem','pastureid,startTime,stopTime,startTime,barid,barid,times,times','getDungscoreListV2','GetDataByName','粪便评分列表','tmrgo','{\"name\":\"getDungscoreList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"1score\":5,\"2score\":10,\"3score\":45,\"4score\":20,\"5score\":25,\"barid\":\"3028006959913108480\",\"barname\":\"15\",\"cowsum\":105,\"emp\":\"老八\",\"ftid\":\"1\",\"ftname\":\"1\",\"id\":\"3025176271438480384\",\"operatetime\":\"2020-09-08\",\"pastureid\":\"3025176271438480383\",\"remark\":\"单\",\"standardscore\":\"3\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  579. (1807,358,'SELECT barid,barname,operatetime,times,standardscore,cowsum,remark,emp,ftname,ftid,id,pastureid,\n CONCAT(score25,\'(\',ROUND(score25/sumcowcount*100,2),\'%)\') score25,\n CONCAT(score275,\'(\',ROUND(score275/sumcowcount*100,2),\'%)\') score275,\n CONCAT(score3,\'(\',ROUND(score3/sumcowcount*100,2),\'%)\') score3,\n CONCAT(score325,\'(\',ROUND(score325/sumcowcount*100,2),\'%)\') score325,\n CONCAT(score35,\'(\',ROUND(score35/sumcowcount*100,2),\'%)\') score35,\n CONCAT(score375,\'(\',ROUND(score375/sumcowcount*100,2),\'%)\') score375,\n CONCAT((sumcowcount-score25-score275-score3-score325-score35-score375),\'(\',100-(ROUND(score25/sumcowcount*100,2)\n +ROUND(score275/sumcowcount*100,2)+ROUND(score3/sumcowcount*100,2)\n +ROUND(score325/sumcowcount*100,2)+ROUND(score35/sumcowcount*100,2)\n +ROUND(score375/sumcowcount*100,2)),\'%)\') score4\n \n FROM \n (\n SELECT\nTRIM(barid) barid,barname,DATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,times,\nstandardscore,cowsum,remark,emp,ftname,\nscore25,score275,score3,score325,score35,score375,`score4`,\n(score25+score275+score3+score325+score35+score375+`score4`) sumcowcount,\nTRIM(ftid) ftid,\nTRIM(id) id,\nTRIM(pastureid) pastureid\nFROM\n bodyscore\nWHERE pastureid = ? \n AND (( operatetime >=? AND operatetime<=?) OR ? = \'\')\n AND (barid=? OR ? = \'\' )\n AND (times=? OR ? = \'\' )\nORDER BY id DESC) tem','pastureid,startTime,stopTime,startTime,barid,barid,times,times','getBodyscoreListV2','GetDataByName','体况评分列表','tmrgo','{\"name\":\"getBodyscoreList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"barid\":\"2\",\"barname\":\"1\",\"cowsum\":100,\"emp\":\"朱一\",\"ftid\":\"1\",\"ftname\":\"2\",\"id\":\"3025176271438480387\",\"operatetime\":\"2020-09-08\",\"pastureid\":\"3025176271438480383\",\"remark\":\"0\",\"score25\":10,\"score275\":20,\"score3\":30,\"score325\":40,\"score35\":0,\"score375\":0,\"score4\":0,\"standardscore\":\"4\",\"times\":\"3\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  580. (1808,351,'SELECT IF((SELECT id FROM bar WHERE pastureid = ? AND bname = trim(?)) IS NULL ,\'栏舍名称不存在\',\'\') msg','pastureid,栏舍名称','checkbarname','PostDataByName','导入栏舍生产性能-栏舍','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  581. (1809,338,'update downloadedplan set \nenable= ? where pastureid = ? and id =? and HaveButton <> 1 and mydate >=date(now())','enable,pastureid,id','updatedownloadenable','PostDataByName','新生成日执行计划','tmrgo','{\"name\":\"updatedownloadesort\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"mydate\":\"2020-09-15\",\"date\":\"2020-09-14\",\"enable\":1}}','{\"code\":0,\"list\":[{\"vmsg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  582. (1810,390,'\nSELECT \n日期,\n牲畜类别 名称,\nIFNULL(ROUND(配方单价*实际混料量/实际牛头数,2),0)field2, -- 实际成本,\nIFNULL(ROUND(实际混料量*配方单价/产奶量,2),0) field1 -- 公斤奶饲料成本\n FROM (\nSELECT \nDATE_FORMAT(fp.`date`, \'%Y-%m-%d\') 日期,\nIFNULL(bm.`cowclass` ,\'无类别\')牲畜类别,\nround(SUM((SELECT SUM(d1e.actualweightminus) FROM `downloadplandtl1_exec` d1e \nWHERE d1e.pastureid = d.`pastureid` AND d1e.date = d2.`date` AND d1e.flpid = d2.`flpid` AND d1e.type =0 )*d2.lweight/d.lweight),2)实际混料量,\nSUM(bm.product*bm.cowsum)产奶量,\n\n(SELECT SUM(\nIF(ftd.`preftid`<>0,\n(SELECT SUM(f1.`uprice`* ftd1.fweight)/SUM(ftd1.fweight) FROM `ftdetaildate` ftd1 \nLEFT JOIN feed f1\nON f1.`pastureid` = ftd1.`pastureid` AND f1.id = ftd1.`fid`\nWHERE ftd1.`pastureid` = ftd.pastureid AND ftd1.`date` = ftd.date AND ftd1.`ftid` = ftd.`preftid` \n AND ftd1.version = (SELECT MAX(VERSION) FROM ftdetaildate ftd2 WHERE ftd2.`pastureid` = ftd.pastureid AND ftd2.`date` = ftd.date AND ftd2.`ftid` = ftd.`preftid`)),\n \nf.`uprice`)*ftd.fweight)/SUM(ftd.fweight) FROM `ftdetaildate` ftd \nLEFT JOIN feed f\nON f.`pastureid` = ftd.`pastureid` AND f.id = ftd.`fid`\nWHERE ftd.`pastureid` = fp.pastureid AND ftd.`date` = fp.date AND ftd.`ftid` = fp.`ftid` AND ftd.`version` = d.tversion\n\n) 配方单价 ,\nSUM(fp.ccount )实际牛头数\n FROM \n`downloadedplan` d\nJOIN `downloadplandtl2` d2\nON d2.pastureid = d.pastureid AND d2.pid = d.id\n\nLEFT JOIN `feedpdate` fp\nON d.`pastureid` = fp.`pastureid` AND d.`mydate` = fp.`date` AND fp.`barid` = d2.`fbarid`\n\nLEFT JOIN barmilk bm\nON bm.`pastureid` =fp.`pastureid` AND bm.`barid` = fp.`barid` AND bm.`productdate` = (SELECT MAX(`productdate`) FROM barmilk WHERE barmilk.productdate <=fp.`date` AND barmilk.`pastureid` = fp.`pastureid` AND barmilk.barid = fp.`barid`)\n\n\nWHERE fp.pastureid = ? AND fp.`date` BETWEEN ? AND ? AND d.lpplantype IN (0,1,2,5) and d2.type = 0 \nGROUP BY fp.`date`) tem\nORDER BY 日期','pastureid,startTime,stopTime ','getHomepageCBV2','GetReportform','首页-成本图表','tmrgo','{\"name\":\"getFeedEffCB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-11-01\",\"stopTime\":\"2020-11-11\",\"enable\":1}} ','{\"code\":0,\"data\":[{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-01\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-02\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-03\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-04\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-05\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-06\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-07\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-08\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-09\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-10\"},{\"准确率\":\"2.00\",\"名称\":\"无类别\",\"日期\":\"2020-11-11\"}],\"list\":{\"data1\":[\"无类别\"],\"data2\":[\"2020-11-01\",\"2020-11-02\",\"2020-11-03\",\"2020-11-04\",\"2020-11-05\",\"2020-11-06\",\"2020-11-07\",\"2020-11-08\",\"2020-11-09\",\"2020-11-10\",\"2020-11-11\"],\"data3\":[{\"data\":[\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\",\"2.00\"]}]},\"message\":\"ok\"}',0,1,0,0,0),
  583. (1811,351,'INSERT INTO barmilk(id,pastureid,barid,barname,productdate,product,avgmonthage,bw,dayw,fetal,avgdim,\ndayspre,fat,pro,lactose,source,tem,cowsum,cowclass,cowclassid,bigcowclass,emp) VALUES (\n?,?,\n(SELECT id FROM bar WHERE pastureid = ? AND bname = ?),\n?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,\n(SELECT id FROM cowclass WHERE pastureid = ? AND classname =?),\n(SELECT parentname FROM cowclass WHERE pastureid = ? AND classname =?),\n?) ','snowid,pastureid,pastureid,栏舍名称,栏舍名称,生效日期,产奶量(kg/头),平均月龄,体重(kg),日增重(kg),胎次,平均泌乳天数,怀孕天数,乳脂率(%),乳蛋白率(%),乳糖率(%),source,环境温度(℃),牛头数,牲畜类别,pastureid,牲畜类别,pastureid,牲畜类别,记录人','insertBarmilkUpload','PostDataByName','导入栏舍生产性能','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  584. (1812,351,'SELECT IF((SELECT id FROM cowclass WHERE pastureid = ? AND classname= trim(?)) IS NULL ,if(trim(?)<>\'损耗\',\'牲畜类别不存在\',\'\'),\'\') msg','pastureid,牲畜类别,操作类型','checkclassname','GetDataByName','导入栏舍生产性能-牲畜类别','tmrgo','{\"name\":\"checkclassname\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"牲畜类别\":\"\",\"操作类型\":\"损耗\",\"enable\":1}}','{\"code\":0,\"list\":[{\"msg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  585. (1813,351,'SELECT IF((SELECT ? IN (\'第一班\',\'第二班\',\'第三班\',\'第四班\') msg)=0,\'班次不存在\',\'\')msg','班次','checktimes','PostDataByName','导入班次校验','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  586. (1814,355,'INSERT INTO pennsieve(id,pastureid,barid,barname,\ntimes,\nonerate,oneweight,tworate,twoweight,threerate,threeweight,fourrate,fourweight,\nremark,emp,operatetime,\nonerange,tworange,threerange,fourrange,ccid,ccname) \nSELECT \n?,?,(SELECT id FROM bar WHERE pastureid = ? AND bname = ?),?,\n(CASE ? \nWHEN \'第一班\' THEN 1 \nWHEN \'第二班\' THEN 2\nWHEN \'第三班\' THEN 3 \nWHEN \'第四班\' THEN 4\nEND), tem.q1/tem.s1*100,tem.q1,tem.q2/tem.s1*100,tem.q2,tem.q3/tem.s1*100,tem.q3,tem.q4/tem.s1*100,tem.q4,\n?,?,?,\nww.onerange,ww.tworange,ww.threerange,ww.fourrange,ww.ccid,ww.ccname\n\n FROM (\nSELECT ? AS q1,? AS q2,? AS q3 ,? AS q4,(?+?+?+?) s1)tem\nleft join \n(SELECT bm.`cowclass` ccname,TRIM(bm.`cowclassid`) ccid,b.id,CONCAT(\'(\',bzonemin,\'-\',bzonemax,\')\')oneRange, CONCAT(\'(\',bztwomin,\'-\',bztwomax,\')\')twoRange, \nCONCAT(\'(\',bzthreemin,\'-\',bzthreemax,\')\')threeRange, CONCAT(\'(\',bzfourmin,\'-\',bzfourmax,\')\')fourRange FROM bar b\nLEFT JOIN barmilk bm\nON bm.`barid` = b.`id` AND bm.`pastureid` = b.pastureid\nLEFT JOIN optrange op\nON op.`cowclassid` = bm.`cowclassid` AND op.`pastureid` = b.pastureid\nWHERE b.pastureid=? AND b.`id` =(SELECT id FROM bar WHERE pastureid = ? AND bname = ?) AND bm.productdate <= ?\n ORDER BY bm.`productdate` DESC LIMIT 1) ww on 1=1','snowid,pastureid,pastureid,栏舍名称,栏舍名称,班次,备注,操作人,操作日期,第一层重量(g),第二层重量(g),第三层重量(g),第四层重量(g),第一层重量(g),第二层重量(g),第三层重量(g),第四层重量(g),pastureid,pastureid,栏舍名称,操作日期','insertPennsieveUpload','PostDataByName','导入宾州筛','tmrgo','{\"name\":\"insertBarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  587. (1815,356,' INSERT INTO dungsieve(id,pastureid,\nbarid,barname,\ntimes,onerate,oneweight,\n tworate,twoweight,threerate,threeweight,remark,emp,operatetime,\n onerange,tworange,threerange,ccid,ccname) \nSELECT \n?,?,\n(SELECT id FROM bar WHERE pastureid = ? AND bname = ?),?,\n(CASE ? \nWHEN \'第一班\' THEN 1 \nWHEN \'第二班\' THEN 2\nWHEN \'第三班\' THEN 3 \nWHEN \'第四班\' THEN 4\nEND), tem.q1/tem.s1*100,tem.q1,tem.q2/tem.s1*100,tem.q2,tem.q3/tem.s1*100,tem.q3,\n?,?,?,\nww.onerange,ww.tworange,ww.threerange,ww.ccid,ww.ccname\n\n\n FROM (\nSELECT ? AS q1,? AS q2,? AS q3 ,(?+?+?) s1)tem\nleft join \n(SELECT bm.`cowclass` ccname,TRIM(bm.`cowclassid`) ccid,b.id,CONCAT(\'(\',fbonemin,\'-\',fbonemax,\')\')oneRange, CONCAT(\'(\',fbtwomin,\'-\',fbtwomax,\')\')twoRange, \nCONCAT(\'(\',fbthreemin,\'-\',fbthreemax,\')\')threeRange FROM bar b\nLEFT JOIN barmilk bm\nON bm.`barid` = b.`id` AND bm.`pastureid` = b.pastureid\nLEFT JOIN optrange op\nON op.`cowclassid` = bm.`cowclassid` AND op.`pastureid` = b.pastureid\nWHERE b.pastureid=? AND b.`id` =(SELECT id FROM bar WHERE pastureid = ? AND bname = ?) AND bm.productdate <= ?\n ORDER BY bm.`productdate` DESC LIMIT 1) ww on 1=1','snowid,pastureid,pastureid,栏舍名称,栏舍名称,班次,备注,操作人,操作日期,第一层重量(g),第二层重量(g),第三层重量(g),第一层重量(g),第二层重量(g),第三层重量(g),pastureid,pastureid,栏舍名称,操作日期','insertDungsieveUpload','PostDataByName','导入粪便筛','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  588. (1816,357,'INSERT INTO dungscore(id,pastureid,barname,\nbarid,\nstandardscore,\ncowsum,\n1score,2score,3score,4score,5score,\nremark,emp,operatetime,ftid,ftname) \nSELECT ?,?,?,\n(SELECT id FROM bar WHERE pastureid = ? AND bname = ?),\nww.dungstandard,\nww.ccount,\n?,?,?,?,?,?,?,?,\nww.ftid,ww.ftname FROM (SELECT 1) tew\nLEFT JOIN \n(\nSELECT b.id,op.`dungstandard`,op.`bodystandard`,fp.ftid,fp.`ftname`,fp.ccount FROM bar b\nLEFT JOIN feedpdate fp\nON fp.`barid` = b.`id` AND fp.`pastureid` = b.pastureid\nLEFT JOIN `optscore` op\nON op.`ftid` =fp.`ftid` AND op.`pastureid` = b.pastureid\nWHERE b.pastureid=? AND b.bname =? AND fp.date<= ?\n ORDER BY fp.`date` DESC LIMIT 1\n)ww ON 1=1','snowid,pastureid,栏舍名称,pastureid,栏舍名称,1分(头),2分(头),3分(头),4分(头),5分(头),备注,操作人,操作日期,pastureid,栏舍名称,操作日期','insertDungscoreUpload','PostDataByName','导入粪便评分','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  589. (1817,358,'INSERT INTO bodyscore(id,pastureid,barname,\nbarid,\nstandardscore,cowsum,\nscore25,score275,score3,score325,score35,score375,score4,\nremark,emp,operatetime,\nftname,ftid) \nSELECT ?,?,?,\n(SELECT id FROM bar WHERE pastureid = ? AND bname = ?),\nww.bodystandard,\nww.ccount,\n?,?,?,?,?,?,?,?,?,?,\nww.ftname,ww.ftid FROM (select 1) tew left join\n(\nSELECT b.id,op.`dungstandard`,op.`bodystandard`,fp.ftid,fp.`ftname`,fp.ccount FROM bar b\nLEFT JOIN feedpdate fp\nON fp.`barid` = b.`id` AND fp.`pastureid` = b.pastureid\nLEFT JOIN `optscore` op\nON op.`ftid` =fp.`ftid` AND op.`pastureid` = b.pastureid\nWHERE b.pastureid=? AND b.bname =? AND fp.date<= ?\n ORDER BY fp.`date` DESC limit 1\n)ww on 1=1\n','snowid,pastureid,栏舍名称,pastureid,栏舍名称,2.75-分(头),2.75分(头),3分(头),3.25分(头),3.5分(头),3.75分(头),4+分(头),备注,操作人,操作日期,pastureid,栏舍名称,操作日期','insertBodyscoreUpload','PostDataByName','导入体况评分','tmrgo','{\"name\":\"insertDungsieve\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  590. (1818,352,'INSERT INTO barfeedremain(id,pastureid,operatetime,emp,barname,barid,\nremaindate,remain,times) \nVALUES (\n?,?,?,?,?,\n(SELECT id FROM bar WHERE pastureid = ? AND bname = ?),\n?,?,\n(CASE ? \nWHEN \'第一班\' THEN 1 \nWHEN \'第二班\' THEN 2\nWHEN \'第三班\' THEN 3 \nWHEN \'第四班\' THEN 4\nEND)) ','snowid,pastureid,收集时间,操作人,栏舍名称,pastureid,栏舍名称,收集时间,剩料量(kg),班次','insertBarfeedremainUpload','PostDataByName','导入剩料记录','tmrgo','{\"name\":\"insertBarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  591. (1819,353,'INSERT INTO ftdry(id,pastureid,barid,barname,times,freshweight,\ndryweight,thoweight,actweight,emp,operatetime) \nVALUES (?,?,\n(SELECT id FROM bar WHERE pastureid = ? AND bname = ?),\n?,\n(CASE ? \nWHEN \'第一班\' THEN 1 \nWHEN \'第二班\' THEN 2\nWHEN \'第三班\' THEN 3 \nWHEN \'第四班\' THEN 4\nEND),\n?,?,\n(SELECT \nROUND(SUM(\nIF(ftd.preftid<>0,\n ftd.`fweight`*IFNULL((SELECT SUM(ftd1.`fweight`*f1.dry/100)/SUM(ftd1.`fweight`) FROM `ftdetail` ftd1\nJOIN feednur f1 ON f1.fid= ftd1.fid AND f1.pastureid = ftd1.pastureid\nWHERE ftd1.pastureid = ftd.`pastureid` AND ftd1.ftid = ftd.`preftid`),0),\nftd.`fweight`*f.dry/100)) ,2)/SUM(ftd.fweight)\ndryweight\n FROM `ftdetail` ftd\nLEFT JOIN feednur f ON f.fid= ftd.fid AND f.pastureid = ftd.pastureid\nWHERE ftd.pastureid = ? AND ftd.ftid = (SELECT fp.`ftid` FROM `feedp` fp WHERE fp.pastureid = ftd.pastureid and fp.`barid` = (SELECT id FROM bar WHERE pastureid = ? AND bname = ?))),\n?/?,\n?,?) ','snowid,pastureid,pastureid,栏舍名称,栏舍名称,班次,鲜样重量(g),烘干重量(g),pastureid,pastureid,栏舍名称,烘干重量(g),鲜样重量(g),操作人,操作日期','insertFtdryUpload','PostDataByName','导入配方干物质','tmrgo','{\"name\":\"insertBarfeedremain\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  592. (1820,353,'SELECT IFNULL(ROUND(tem.ftweight/tem.sumweight*thoweight+ tem.supplyweight/tem.sumweight*thoweightS,2),0) thoweight1,tem.thoweight \nFROM (\nSELECT fp.`ftid`,fpd.`id`,\nIFNULL(fpd.`ftweight`+fpd.supplyweight,0)sumweight,\nIFNULL(fpd.`ftweight`,0)ftweight,\nIFNULL(fpd.`supplyweight`,0)supplyweight,\nROUND(IFNULL(\n(SELECT SUM(ftdetail.fweight/(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ftid` AND ftd.`pastureid`=?)*feednur.`dry`/100)\n FROM `ftdetaildate` ftdetail\n LEFT JOIN feednur \n ON feednur.`fid` =ftdetail.`fid` AND feednur.`pastureid`=?\n WHERE ftdetail.ftid =fpd.`ftid` AND ftdetail.`pastureid`=? AND ftdetail.date =?\n),\n######\nIFNULL((SELECT SUM(ftdetail.fweight/(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ftid` AND ftd.`pastureid`=?)*feednur.`dry`/100) \n FROM `ftdetail`\n LEFT JOIN feednur \n ON feednur.`fid` =ftdetail.`fid` AND feednur.`pastureid`=?\n WHERE ftdetail.ftid =fpd.`ftid` AND ftdetail.`pastureid`=?\n),0)\n\n),2) thoweight,\nROUND(IFNULL((SELECT SUM(ftdetail.fweight/(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ptsfid` AND ftd.`pastureid`=?)*feednur.`dry`/100)\n FROM `ftdetaildate` ftdetail\n LEFT JOIN feednur \n ON feednur.`fid` =ftdetail.`fid` AND feednur.`pastureid`=?\n WHERE ftdetail.ftid =fpd.`ptsfid` AND ftdetail.`pastureid`=? AND ftdetail.date = ?\n),\n######\nIFNULL((SELECT SUM(ftdetail.fweight/(SELECT SUM(ftd.`fweight`) FROM ftdetail ftd WHERE ftd.ftid =fpd.`ptsfid` AND ftd.`pastureid`=?)*feednur.`dry`/100) \n FROM `ftdetail`\n LEFT JOIN feednur \n ON feednur.`fid` =ftdetail.`fid` AND feednur.`pastureid`=?\n WHERE ftdetail.ftid =fpd.`ptsfid` AND ftdetail.`pastureid`=?\n),0)\n\n),2) thoweightS\n\n FROM \n`feedpdate` fpd\nLEFT JOIN `feedp` fp\nON fp.`barid`= ? AND fp.`pastureid` = ?\n\nWHERE fpd.`pastureid` = ? AND fpd.`barid`=? AND fpd.`date`=(SELECT MAX(`date`) FROM feedpdate WHERE pastureid= fpd.`pastureid` AND barid=fpd.barid AND `date`<=? ) ) tem','pastureid,pastureid,pastureid,date,pastureid,pastureid,pastureid,pastureid,pastureid,pastureid,date,pastureid,pastureid,pastureid,barid,pastureid,pastureid,barid,date','getFtdrytweightV2','GetDataByName','配方干物质列表','tmrgo','{\"name\":\"getFtdrytweight\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"barid\":\"3028006959913108480\",\"sort\":\"0\",\"date\":\"2020-09-06\"}}','{\"code\":0,\"list\":[{\"thoweight\":\"0.36\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  593. (1821,362,'INSERT INTO feedinventory(id,pastureid,remark,inventorydate,createuser) VALUES (?,?,?,?,?) ON DUPLICATE KEY UPDATE createuser = createuser','snowid,pastureid,备注,盘点日期,盘点人','insertBigInventoryUpload','PostDataByName','导入盘点主','tmrgo','{\"name\":\"insertBigInventory\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  594. (1822,362,'INSERT INTO feedinventorydetail(id,pastureid,invid,feedid,feedname,theoryweight,factweight)\n VALUES (?,?,\n(select id from feedinventory where pastureid = ? and inventorydate = ?),\n(SELECT id FROM feed WHERE pastureid = ? AND fname= ?),\n?,\nifnull((select ifnull(f.stockweight,0) from feedstorage f where f.pastureid = ? and f.feedid = \n(SELECT id FROM feed WHERE pastureid = ? AND fname= ?)),0),\n?) ','snowid,pastureid,pastureid,盘点日期,pastureid,饲料名称,饲料名称,pastureid,pastureid,饲料名称,实际重量(kg)','insertInventoryUpload','PostDataByName','导入盘点子','tmrgo','{\"name\":\"insertBigInventory\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  595. (1823,351,'SELECT IF((SELECT id FROM feed WHERE pastureid = ? AND fname= trim(?)) IS NULL ,\'饲料名称不存在\',\'\') msg','pastureid,饲料名称','checkFeed','PostDataByName','导入饲料check','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  596. (1825,361,'INSERT INTO feeduse(id,pastureid,usedate,\nfeedid,\nfeedname,\ncowclassid,\ncowclass,usetype,operateweight,\nrepertoryweight,createemp,remark,price) \nVALUES \n(?,?,?,\n(SELECT id FROM feed WHERE pastureid = ? AND fname= ?),\n?,\nIF(?<>\'损耗\',(SELECT id FROM cowclass WHERE pastureid = ? AND classname =?),NULL),\nIF(?<>\'损耗\',?,NULL),?,?,\nIFNULL((SELECT IFNULL(f.stockweight,0) FROM feedstorage f WHERE f.pastureid = ? AND f.feedid = \n(SELECT id FROM feed WHERE pastureid = ? AND fname= ?)),0),\n?,?,\nIFNULL((SELECT f.`price` FROM feedstorage f WHERE f.pastureid = ? AND f.feedid = \n(SELECT id FROM feed WHERE pastureid = ? AND fname= ?)),(SELECT uprice FROM feed WHERE pastureid = ? AND fname= ?))\n) ','snowid,pastureid,出库日期,pastureid,饲料名称,饲料名称,pastureid,操作类型,牲畜类别,操作类型,牲畜类别,操作类型,操作重量(kg),pastureid,pastureid,饲料名称,备注,操作人,pastureid,pastureid,饲料名称,pastureid,饲料名称','insertFeeduseUpload','PostDataByName','导入出库人工用量','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  597. (1826,361,'SELECT IF(? NOT IN (SELECT label FROM dictlist WHERE pid = 5),\'操作类型不存在\',\'\') msg','操作类型','checkfeedusetype','PostDataByName','导入人工用量类型校验','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  598. (1828,359,'INSERT INTO feedlaid(id,pastureid,laiddate,\nfeedid,feedname,\nproviderid,providername,contractcode,\nlicence,pcpde,remark,createemp,\nstartweight,\npricenew,grossweight,tareweight,operateweight,wagonnumber) \nVALUES (\n?,?,?,\n(SELECT id FROM feed WHERE pastureid = ? AND fname= ?),?,\n(SELECT id FROM `provider` WHERE pastureid = ? AND `providerName` = ?),?,?,\n?,?,?,?,\nIFNULL((SELECT IFNULL(f.stockweight,0) FROM feedstorage f WHERE f.pastureid = ? AND f.feedid = \n(SELECT id FROM feed WHERE pastureid = ? AND fname= ?)),0),\n\n?,?,?,?,? )','snowid,pastureid,入库日期,pastureid,饲料名称,饲料名称,pastureid,供应商,供应商,合同编号,许可证号,批号,备注,创建人,pastureid,pastureid,饲料名称,单价(元),毛重(kg),皮重(kg),入库重量(kg),送货单编号','insertFeedlaidUpload','PostDataByName','导入入库','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  599. (1829,361,'INSERT INTO feedstorage(id,pastureid,feedid,feedname,stockweight,price)\n VALUES (?,?,\n (SELECT id FROM feed WHERE pastureid = ? AND fname= ?),\n ?,0-?,\n IFNULL((SELECT f.`price` FROM feedstorage f WHERE f.pastureid = ? AND f.feedid = \n(SELECT id FROM feed WHERE pastureid = ? AND fname= ?)),(SELECT uprice FROM feed WHERE pastureid = ? AND fname= ?))\n ) \nON DUPLICATE KEY UPDATE stockweight=stockweight-?','snowid,pastureid,pastureid,饲料名称,饲料名称,操作重量(kg),pastureid,pastureid,饲料名称,pastureid,饲料名称,操作重量(kg)','insertFeedstorageUseUpload','PostDataByName','导入出库新增库存','tmrgo','{\"name\":\"insertFeedstorageLaid\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  600. (1830,389,'INSERT INTO contract(id,pastureid,bigid,feedid,feedname,price) \nVALUES (?,?,\n(SELECT id FROM `bigcontract` WHERE pastureid = ? AND `contractcode` = ? ),\n(SELECT id FROM feed WHERE pastureid = ? AND fname= ?),\n?,?) ','snowid,pastureid,pastureid,合同编号,pastureid,饲料名称,饲料名称,饲料价格(元)','insertContractupload','PostDataByName','导入合同','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  601. (1831,389,'INSERT INTO bigcontract(id,pastureid,contractcode,\nproviderid,providername,\nemp,operatetime) \nVALUES (?,?,?,\n(SELECT id FROM `provider` WHERE pastureid = ? AND `providerName` = ?),?,\n\'导入\',?) \nON DUPLICATE KEY UPDATE emp = emp','snowid,pastureid,合同编号,pastureid,供应商,供应商,录入日期','insertBigContractUpload','PostDataByName','导入主合同','tmrgo','{\"name\":\"insertChart\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  602. (1832,389,'SELECT IF((SELECT id FROM provider WHERE pastureid = ? AND providerName= trim(?)) IS NULL ,\'供应商不存在\',\'\') msg','pastureid,供应商','checkProvider','PostDataByName','导入供应商check','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  603. (1833,359,'INSERT INTO feedstorage(id,pastureid,feedid,feedname,stockweight,price,pcpde)\n VALUES (?,?,\n (SELECT id FROM feed WHERE pastureid = ? AND fname= ?),?,\n?,?,?)\nON DUPLICATE KEY UPDATE pcpde=?, price=(stockweight*price+?*?)/(stockweight+?),stockweight=stockweight+?','snowid,pastureid,pastureid,饲料名称,饲料名称,入库重量(kg),单价(元),批号,批号,入库重量(kg),单价(元),入库重量(kg),入库重量(kg)','insertFeedstorageLaidUpload','PostDataByName','导入出库新增库存','tmrgo','{\"name\":\"insertFeedstorageLaid\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"cname\":\"1\",\"display\":\"李五\",\"enable\":1}}','null',0,1,0,0,0),
  604. (1834,361,'SELECT IF(? NOT IN (SELECT label FROM dictlist WHERE pid = 17),\'牲畜大类不存在\',\'\') msg','牲畜类别','checkbigcowclass','PostDataByName','导入牲畜大类校验','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  605. (1835,361,'SELECT IF(? NOT IN (SELECT label FROM dictlist WHERE pid = 49),\'配方类型不存在\',\'\') msg','配方类型','checkfttype','PostDataByName','导入配方类型校验','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  606. (1836,334,'INSERT INTO feedtemplet(id,pastureid,tname,\nccid,ccname,fttypeid,fttype,\nsource,remark) \nVALUES (?,?,?,\n(SELECT `value` FROM dictlist WHERE pid = 17 AND label = ? LIMIT 1),?,\n(SELECT `value` FROM dictlist WHERE pid = 49 AND label = ? LIMIT 1),?,\n\'导入\',?) ON DUPLICATE KEY UPDATE remark= remark','snowid,pastureid,配方名称,牲畜类别,牲畜类别,配方类型,配方类型,备注','insertFTUpload','PostDataByName','导入配方模板主','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  607. (1837,334,'\nINSERT INTO ftdetail\n(id,pastureid,\n ftid,\n fid,fname,\n fweight,\n islockcount,\n sort,\n feedgroup,\n preftid,\n autosecond,autosecondname) \nVALUES (?,?,\n(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname =? ),\n(SELECT id FROM feed WHERE pastureid = ? AND fname =?),?,\n?,\nIF(?=\'是\',1,0),\n(SELECT * FROM (SELECT IFNULL((SELECT MAX(sort) FROM ftdetail WHERE pastureid = ? AND ftid =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname =? ) ),1))ww),\nif(?=\'\',?,?),0,\n?,?)','snowid,pastureid,pastureid,配方名称,pastureid,饲料名称,饲料名称,重量(kg),是否锁定牛头数比例,pastureid,pastureid,配方名称,饲料组,饲料名称,饲料组,搅拌延时(min),搅拌延时(min)','insertFTdetailUpload','PostDataByName','导入配方模板详情','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  608. (1838,361,'SELECT IF((SELECT id FROM feedtemplet WHERE pastureid = ? AND tname= trim(?) AND fttypeid = 1) IS NULL ,\'配方模板不存在\',\'\') msg','pastureid,配方模板','checkftsw','PostDataByName','导入配方校验-饲喂','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  609. (1839,361,'SELECT IF((SELECT id FROM feedtemplet WHERE pastureid = ? AND tname= trim(?) AND fttypeid = 3) IS NULL ,if(?=\'\',\'\',\'补料配方不存在\'),\'\') msg','pastureid,补料配方,补料配方','checkftbl','PostDataByName','导入配方校验-补料','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  610. (1840,335,'\nINSERT INTO fpdetail(id,pastureid,\nbarid,barname,\ntimes,\ntratio,weight,\ncowcount,ccountradio,\nptid,ptsid,ptsrate) \nVALUES \n(\n?,?,\n(SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ),?,\n1,\n?,IFNULL((SELECT `ftweight`+`supplyweight` FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) )*?/100,0),\n?,?,\n (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\n (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nIFNULL((SELECT `supplyweight`/(supplyweight+`ftweight`) FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) ),0)\n) \nON DUPLICATE KEY UPDATE \ntratio =?,\nweight =IFNULL((SELECT `ftweight`+`supplyweight` FROM `feedp` WHERE pastureid = ? AND barid =(SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) )*?/100,0),\ncowcount =?,ccountradio =?,\nptid =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nptsid =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nptsrate=IFNULL((SELECT `supplyweight`/(supplyweight+`ftweight`) FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) ),0)','snowid,pastureid,pastureid,栏舍名称,栏舍名称,第一班比例(%),pastureid,pastureid,栏舍名称,第一班比例(%),实际牛头数,系数(%),pastureid,配方模板,pastureid,补料配方,pastureid,pastureid,栏舍名称,第一班比例(%),pastureid,pastureid,栏舍名称,第一班比例(%),实际牛头数,系数(%),pastureid,配方模板,pastureid,补料配方,pastureid,pastureid,栏舍名称','updateBigFPDetailUpload','PostDataByName','导入栏舍配方子','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  611. (1841,335,'INSERT INTO feedp(\nid,pastureid,\nbarname,barid,\nccount,ratio,ccountratio,\nftid,ftname,\nptsfid,ptsfname,\nfeedweight,ftweight,supplyweight) \nVALUES \n(?,?,\n?,(SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ),\n?,?,?*?/100,\nftid = (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),?,\nftid = (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),?,\n0,\n\n(SELECT ww.SfweightLock*?+ww.Sfweight*?*?/100 FROM (SELECT\nIFNULL((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`=feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN 0\nWHEN 1 THEN( SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=1 )\nEND),0) SfweightLock,\n\nIFNULL ((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid)\nWHEN 1 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=0 )\nEND),0) Sfweight\n\n\nFROM\nfeedtemplet\nWHERE pastureid=? AND id =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ) AND ENABLE=1 AND fttypeid=1 \nORDER BY id DESC) ww),\n\n\n(SELECT ww.SfweightLock*?+ww.Sfweight*?*?/100 FROM (SELECT\nIFNULL((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`=feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN 0\nWHEN 1 THEN( SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=1 )\nEND),0) SfweightLock,\n\nIFNULL ((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid)\nWHEN 1 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=0 )\nEND),0) Sfweight\n\n\nFROM\nfeedtemplet\nWHERE pastureid=? AND id =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ) AND ENABLE=1 AND fttypeid=3\nORDER BY id DESC) ww))\n\n\nON DUPLICATE KEY UPDATE `ccount` = ? ,\nratio = ?,\nccountratio =?*?/100,\nftid = (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nftname = ?,\nptsfid = (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nptsfname = ?,feedweight=0,\nftweight=(SELECT ww.SfweightLock*?+ww.Sfweight*?*?/100 FROM (SELECT\nIFNULL((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`=feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN 0\nWHEN 1 THEN( SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=1 )\nEND),0) SfweightLock,\n\nIFNULL ((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid)\nWHEN 1 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=0 )\nEND),0) Sfweight\n\n\nFROM\nfeedtemplet\nWHERE pastureid=? AND id = (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ) AND ENABLE=1 AND fttypeid=1 \nORDER BY id DESC) ww),supplyweight =(SELECT ww.SfweightLock*?+ww.Sfweight*?*?/100 FROM (SELECT\nIFNULL((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`=feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN 0\nWHEN 1 THEN( SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=1 )\nEND),0) SfweightLock,\n\nIFNULL ((CASE (SELECT sysopt.inforvalue FROM sysopt WHERE sysopt.`pastureid`= feedtemplet.pastureid AND sysopt.`inforname`= \'isLockCount\')\nWHEN 0 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid)\nWHEN 1 THEN (SELECT SUM(fweight) FROM `ftdetail` WHERE ftid=feedtemplet.id AND pastureid=feedtemplet.pastureid AND islockcount=0 )\nEND),0) Sfweight\n\n\nFROM\nfeedtemplet\nWHERE pastureid=? AND id = (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ) AND ENABLE=1 AND fttypeid=3 \nORDER BY id DESC) ww)\n','snowid,pastureid,栏舍名称,pastureid,栏舍名称,实际牛头数,系数(%),实际牛头数,系数(%),pastureid,配方模板,配方模板,pastureid,补料配方,补料配方,实际牛头数,实际牛头数,系数(%),pastureid,pastureid,配方模板,实际牛头数,实际牛头数,系数(%),pastureid,pastureid,补料配方,实际牛头数,系数(%),实际牛头数,系数(%),pastureid,配方模板,配方模板,pastureid,补料配方,补料配方,实际牛头数,实际牛头数,系数(%),pastureid,pastureid,配方模板,实际牛头数,实际牛头数,系数(%),pastureid,pastureid,补料配方','updateBigFPUpload','PostDataByName','导入栏舍配方主','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  612. (1842,335,'UPDATE feedp SET feedweight = ftweight+IFNULL(supplyweight,0) ,\nsupplyweight = IFNULL(supplyweight,0)\nWHERE barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) AND pastureid = ?','pastureid,栏舍名称,pastureid ','updateBigFPfeedweightUpload','PostDataByName','导入修改栏舍配方主','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  613. (1846,335,'\nINSERT INTO fpdetail(id,pastureid,\nbarid,barname,\ntimes,\ntratio,weight,\ncowcount,ccountradio,\nptid,ptsid,ptsrate) \nVALUES \n(\n?,?,\n(SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ),?,\n2,\n?,IFNULL((SELECT `ftweight`+`supplyweight` FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) )*?/100,0),\n?,?,\n (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\n (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nIFNULL((SELECT `supplyweight`/(supplyweight+`ftweight`) FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) ),0)\n) \nON DUPLICATE KEY UPDATE \ntratio =?,\nweight =IFNULL((SELECT `ftweight`+`supplyweight` FROM `feedp` WHERE pastureid = ? AND barid =(SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) )*?/100,0),\ncowcount =?,ccountradio =?,\nptid =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nptsid =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nptsrate=IFNULL((SELECT `supplyweight`/(supplyweight+`ftweight`) FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) ),0)','snowid,pastureid,pastureid,栏舍名称,栏舍名称,第二班比例(%),pastureid,pastureid,栏舍名称,第二班比例(%),实际牛头数,系数(%),pastureid,配方模板,pastureid,补料配方,pastureid,pastureid,栏舍名称,第二班比例(%),pastureid,pastureid,栏舍名称,第二班比例(%),实际牛头数,系数(%),pastureid,配方模板,pastureid,补料配方,pastureid,pastureid,栏舍名称','updateBigFPDetailUploadV1','PostDataByName','导入栏舍配方子','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  614. (1847,335,'\nINSERT INTO fpdetail(id,pastureid,\nbarid,barname,\ntimes,\ntratio,weight,\ncowcount,ccountradio,\nptid,ptsid,ptsrate) \nVALUES \n(\n?,?,\n(SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ),?,\n3,\n?,IFNULL((SELECT `ftweight`+`supplyweight` FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) )*?/100,0),\n?,?,\n (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\n (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nIFNULL((SELECT `supplyweight`/(supplyweight+`ftweight`) FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) ),0)\n) \nON DUPLICATE KEY UPDATE \ntratio =?,\nweight =IFNULL((SELECT `ftweight`+`supplyweight` FROM `feedp` WHERE pastureid = ? AND barid =(SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) )*?/100,0),\ncowcount =?,ccountradio =?,\nptid =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nptsid =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nptsrate=IFNULL((SELECT `supplyweight`/(supplyweight+`ftweight`) FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) ),0)','snowid,pastureid,pastureid,栏舍名称,栏舍名称,第三班比例(%),pastureid,pastureid,栏舍名称,第三班比例(%),实际牛头数,系数(%),pastureid,配方模板,pastureid,补料配方,pastureid,pastureid,栏舍名称,第三班比例(%),pastureid,pastureid,栏舍名称,第三班比例(%),实际牛头数,系数(%),pastureid,配方模板,pastureid,补料配方,pastureid,pastureid,栏舍名称','updateBigFPDetailUploadV2','PostDataByName','导入栏舍配方子','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  615. (1848,335,'\nINSERT INTO fpdetail(id,pastureid,\nbarid,barname,\ntimes,\ntratio,weight,\ncowcount,ccountradio,\nptid,ptsid,ptsrate) \nVALUES \n(\n?,?,\n(SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ),?,\n4,\n?,IFNULL((SELECT `ftweight`+`supplyweight` FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) )*?/100,0),\n?,?,\n (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\n (SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nIFNULL((SELECT `supplyweight`/(supplyweight+`ftweight`) FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) ),0)\n) \nON DUPLICATE KEY UPDATE \ntratio =?,\nweight =IFNULL((SELECT `ftweight`+`supplyweight` FROM `feedp` WHERE pastureid = ? AND barid =(SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) )*?/100,0),\ncowcount =?,ccountradio =?,\nptid =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nptsid =(SELECT id FROM `feedtemplet` WHERE pastureid = ? AND tname = ? ),\nptsrate=IFNULL((SELECT `supplyweight`/(supplyweight+`ftweight`) FROM `feedp` WHERE pastureid = ? AND barid = (SELECT id FROM `bar` WHERE pastureid = ? AND bname = ? ) ),0)','snowid,pastureid,pastureid,栏舍名称,栏舍名称,第四班比例(%),pastureid,pastureid,栏舍名称,第四班比例(%),实际牛头数,系数(%),pastureid,配方模板,pastureid,补料配方,pastureid,pastureid,栏舍名称,第四班比例(%),pastureid,pastureid,栏舍名称,第四班比例(%),实际牛头数,系数(%),pastureid,配方模板,pastureid,补料配方,pastureid,pastureid,栏舍名称','updateBigFPDetailUploadV3','PostDataByName','导入栏舍配方子','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  616. (1849,361,'SELECT IF((SELECT id FROM feedtemplet WHERE pastureid = ? AND tname= trim(?) ) IS NULL ,\'配方模板不存在\',\'\') msg','pastureid,配方名称','checkft','PostDataByName','导入配方校验-饲喂','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  617. (1850,348,'INSERT INTO optscore(id,pastureid,\nftid,ftname,\nbodystandard,bodysource,dungstandard,dungsource) \nVALUES (?,?,\n(SELECT id FROM feedtemplet WHERE pastureid = ? AND tname= TRIM(?)),?,\n?,?,?,?) \nON DUPLICATE KEY UPDATE\nbodystandard=?,bodysource=?,dungstandard=?,dungsource=?','snowid,pastureid,pastureid,配方名称,配方名称,体况评分标准(分),体况评分数据来源,粪便评分标准(分),粪便评分数据来源,体况评分标准(分),体况评分数据来源,粪便评分标准(分),粪便评分数据来源','updateOptscoreUpload','PostDataByName','上传体况粪便评分标准','tmrgo','{\"name\":\"updateOptscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  618. (1851,348,'INSERT INTO optrange(\nid,pastureid,\ncowname,cowclassid,\nfbonemin,fbonemax,fbtwomin,fbtwomax,fbthreemin,fbthreemax,fbsource,\nbzonemin,bzonemax,bztwomin,bztwomax,bzthreemin,bzthreemax,bzfourmin,bzfourmax,bzsource) \nVALUES (?,?,\n?,(select id from cowclass where pastureid = ? and classname = ?),\nCAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nCAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nCAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\n?,\nCAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nCAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nCAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nCAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\n?) \nON DUPLICATE KEY UPDATE\nfbonemin=CAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),fbonemax=CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nfbtwomin=CAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),fbtwomax=CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nfbthreemin=CAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),fbthreemax=CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nfbsource=?,\nbzonemin=CAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),bzonemax=CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nbztwomin=CAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),bztwomax=CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nbzthreemin=CAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),bzthreemax=CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nbzfourmin=CAST(SUBSTRING_INDEX(?,\'-\',1) AS SIGNED),bzfourmax=CAST(SUBSTRING_INDEX(?,\'-\',-1) AS SIGNED),\nbzsource=?\n','snowid,pastureid,牲畜子类,pastureid,牲畜子类,粪便筛一层(%),粪便筛一层(%),粪便筛二层(%),粪便筛二层(%),粪便筛三层(%),粪便筛三层(%),粪便筛数据来源,宾州筛一层(%),宾州筛一层(%),宾州筛二层(%),宾州筛二层(%),宾州筛三层(%),宾州筛三层(%),宾州筛四层(%),宾州筛四层(%),粪便筛数据来源,粪便筛一层(%),粪便筛一层(%),粪便筛二层(%),粪便筛二层(%),粪便筛三层(%),粪便筛三层(%),粪便筛数据来源,宾州筛一层(%),宾州筛一层(%),宾州筛二层(%),宾州筛二层(%),宾州筛三层(%),宾州筛三层(%),宾州筛四层(%),宾州筛四层(%),宾州筛数据来源','insertOptrangeUpload','PostDataByName','上传宾州筛粪便筛标准范围','tmrgo','{\"name\":\"updateOptscore\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"88\",\"drivername\":\"李五\",\"id\":\"3026386153072231424\",\"enable\":\"1\"}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  619. (1852,361,'SELECT IF(? NOT IN (SELECT label FROM dictlist WHERE pid = 17),\'牲畜父类不存在\',\'\') msg','牲畜父类','checkbigcowclassW','PostDataByName','导入牲畜大类校验','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  620. (1853,351,'SELECT IF((SELECT id FROM cowclass WHERE pastureid = ? AND classname= TRIM(?)) IS NULL ,\'牲畜类别不存在\',\'\') msg','pastureid,牲畜子类','checkclassnameW','GetDataByName','导入栏舍生产性能-牲畜类别','tmrgo','{\"name\":\"checkclassname\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"牲畜类别\":\"\",\"操作类型\":\"损耗\",\"enable\":1}}','{\"code\":0,\"list\":[{\"msg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  621. (1854,389,'SELECT\nDATE_FORMAT(operatetime, \'%Y-%m-%d\')operatetime,contractcode,providername,\nTRIM(bc.id) id,\nTRIM(bc.pastureid) pastureid,\n(SELECT fname FROM feed WHERE pastureid =c.pastureid AND id = c.feedid ) feedname,c.price\nFROM\n bigcontract bc\n JOIN contract c ON c.`pastureid`= bc.pastureid AND c.`bigid` = bc.id\nWHERE bc.pastureid = ? \n AND ((bc.operatetime>= ? AND bc.operatetime<= ?) OR ? = \'\')\n AND (providerid =? OR ? = \'\' )\nORDER BY bc.id DESC,c.id','pastureid,startTime,stopTime,startTime,providerid,providerid ','DownloadContractList','GetDataByName','合同列表','tmrgo','{\"name\":\"getBigContractList\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"empid\":\"1\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"contractcode\":\"1250\",\"emp\":\"2\",\"id\":\"1\",\"operatetime\":\"2020-10-13\",\"pastureid\":\"3025176271438480383\",\"providerid\":\"1\",\"providername\":\"1.00\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  622. (1855,353,'SELECT IF(CAST(? AS DECIMAL )>CAST(? AS DECIMAL ),\'烘干重量不可大于鲜样重量\',\'\') msg','烘干重量(g),鲜样重量(g)','checkdryfresh','PostDataByName','导入烘干重量不可大于鲜样重量检查','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  623. (1856,389,'SELECT IF((SELECT id FROM provider WHERE pastureid = ? AND (providerName= trim(?) or ?=\'\') limit 1) IS NULL ,\'供应商不存在\',\'\') msg','pastureid,供应商,供应商','checkProviderRK','PostDataByName','导入供应商check(非必填)','tmrgo','{\"name\":\"insertFeed\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"drivercode\":\"1\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  624. (1857,351,'SELECT IF((SELECT id FROM bigcontract WHERE pastureid = ? AND ((contractcode= TRIM(?)and providername = ?) or ?=\'\') ) IS NULL ,\'合同编号不存在或与供应商不匹配\',\'\') msg','pastureid,合同编号,供应商,合同编号','checkcontractcode','GetDataByName','导入栏舍生产性能-牲畜类别','tmrgo','{\"name\":\"checkclassname\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"牲畜类别\":\"\",\"操作类型\":\"损耗\",\"enable\":1}}','{\"code\":0,\"list\":[{\"msg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  625. (1858,351,'SELECT IF((SELECT bc.id FROM`contract` c \n JOIN `bigcontract` bc \n ON c.bigid= bc.id AND c.pastureid = bc.pastureid \n WHERE bc.pastureid = ? AND bc.`contractcode` = TRIM(?)\n AND c.`feedid` = (SELECT id FROM feed WHERE pastureid = bc.pastureid AND fname = ?) AND c.price = ? LIMIT 1) IS NULL,IF(?=\'\',\'\',\'合同单价不匹配\'),\'\') msg','pastureid,合同编号,饲料名称,单价(元),合同编号','checkcontractcodePrice','GetDataByName','导入栏舍生产性能-牲畜类别','tmrgo','{\"name\":\"checkclassname\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"牲畜类别\":\"\",\"操作类型\":\"损耗\",\"enable\":1}}','{\"code\":0,\"list\":[{\"msg\":\"\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0),
  626. (1859,324,'SELECT tem.id,tem.pastureid,tem.optdevice,tem.proesstime,DATE_FORMAT(startstime, \'%H:%i:%s\') startstime,\nDATE_FORMAT(intime, \'%H:%i:%s\') intime,tem.sort,tem.actualweightminus,\nDATE_FORMAT(r.`mtime`, \'%H:%i:%s\') mtime,r.`weight`, tem.`lastactualweight`,tem.lweight,\ntem.`actualweight`,\nDATE_FORMAT(r.`mtime`, \'%Y-%m-%d\') `date`\nFROM (SELECT\nTRIM(d1.`id`) id,\nd1.`pastureid`,\nd1.`optdevice`,\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid))\n) proesstime, \nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)\n, (SELECT MAX(intime) FROM downloadedplan d2 \nWHERE d1.`date`=d2.`mydate` AND d1.pastureid = d2.pastureid AND d2.id=d1.pid)\n),\'%Y-%m-%d %H:%i:%s\') startstime,\n\nd1.sort,\nd1.lastactualweight+ d1.`lweight` lweight ,\nd1.`actualweightminus`,\nDATE_FORMAT(d1.intime, \'%Y-%m-%d %H:%i:%s\') intime,\nd1.`lastactualweight`,\nd1.`actualweight`\n\nFROM\n `downloadplandtl1_exec` d1\nWHERE d1.`pastureid` = ?\nAND pid =?\n\nUNION ALL\n\nSELECT\nTRIM(d1.`id`) id,\nd1.`pastureid`,\nd1.`optdevice` ,\nIFNULL(TIMEDIFF (d1.intime,(SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime))\n, TIMEDIFF(intime,(SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`date`=d2.`date` AND d1.pastureid = d2.pastureid AND d2.pid=d1.pid))\n) proesstime, \nDATE_FORMAT(IFNULL((SELECT MAX(intime) FROM downloadplandtl2 d2 \nWHERE d1.`pid`=d2.`pid` AND d1.pastureid = d2.pastureid AND d2.intime<d1.intime)\n, (SELECT MAX(intime) FROM downloadplandtl1_exec d2 \nWHERE d1.`date`=d2.`date` AND d1.pastureid = d2.pastureid AND d2.pid=d1.pid)\n),\'%Y-%m-%d %H:%i:%s\') starttime, \nd1.sort,\nd1.lastactualweight - d1.`lweight` lweight ,\nd1.`actualweightminus`,\nDATE_FORMAT(d1.intime, \'%Y-%m-%d %H:%i:%s\') intime,\nd1.`lastactualweight`,\nd1.`actualweight`\n\nFROM\n `downloadplandtl2` d1\nWHERE d1.`pastureid` = ?\nAND pid =?\n\nORDER BY sort\n) tem \nINNER JOIN tmr \nON tmr.`pastureid` = tem.pastureid AND tmr.`id`= tem.optdevice\nINNER JOIN `recweight` r\nON r.`pastureid` = tem.pastureid AND r.`srcaddr` = tmr.`datacaptureno` \nWHERE r.`mtime` >=tem.startstime AND r.`mtime` <=tem.intime\n \nORDER BY sort , mtime\n\n','pastureid,pid,pastureid,pid','getprocessAnalysisTB','GetDataByName','监控图1','tmrgo','{\"name\":\"getprocessAnalysisTB\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','\"sql: expected 7 arguments, got 5\"',0,1,0,0,0),
  627. (1860,406,'SELECT \ntrim(id) id,\n`id` projuctid, -- 计划标识符\ntrim(`pastureid`) pastureid,\nDATE_FORMAT(mydate, \'%Y-%m-%d\') mydate,\n`projname` name, -- 计划名称\n`datacaptureno` eqid, -- 执行车号\n`times` shifts, -- 班次\n`lpplantype`,\n`tmrtname` tmrname,\n(select imei from tmr where pastureid = d.pastureid and id = d.tmrid)imei ,\n`sort`,\n`remark`, \n`itemnum`, -- 混料个数\n`outitems`, -- 发料个数\n`lweight` sumweight, -- 总重\n`havebutton` started, -- 是否已经开始\niscompleted completed, \ntempletname ftname,\n(select tcode from feedtemplet where id = d.tempid and pastureid = d.pastureid ) ftcode,\n(SELECT COUNT(`id`) AS remains FROM `downloadedplan` WHERE `tmrid` =(SELECT `id` FROM `tmr` WHERE `imei`=? ) AND `mydate`=DATE(NOW()) AND `havebutton` =0) remains, -- 剩余车数\n(SELECT COUNT(`id`) AS unallocateds FROM `downloadedplan` WHERE `tmrid` IS NULL AND `mydate`=DATE(NOW()) AND pastureid = d.`pastureid` AND `tmrid` =(SELECT `id` FROM `tmr` WHERE `imei`=? ) ) unallocateds -- 未分配车数\n FROM `downloadedplan` d\n\nWHERE d.`iscompleted`=0 AND d.`pastureid` =(SELECT `pastureid` FROM `tmr` WHERE `imei`=? ) AND \n`tmrid` =(SELECT `id` FROM `tmr` WHERE `imei`=? ) \nAND (d.`mydate`=DATE(NOW())\n OR (DATE(d.Mydate)= DATE(DATE_ADD(NOW(), INTERVAL 1 DAY)) AND (SELECT inforvalue FROM `sysopt` \n WHERE pastureid = (SELECT `pastureid` FROM `tmr` WHERE `imei`=? ) AND inforname = \'isGetNextPlan\')=1 ) \n OR (DATE(d.Mydate)= DATE(DATE_ADD(NOW(), INTERVAL -1 DAY)) AND (SELECT inforvalue FROM `sysopt` \n WHERE pastureid = (SELECT `pastureid` FROM `tmr` WHERE `imei`=? ) AND inforname = \'isGetLastPlan\')=1 ))\nORDER BY d.mydate,d.sort \n\n','imei,imei,imei,imei,imei,imei','getRLSBV2','GetArrList','获取计划主表列表','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  628. (1861,406,'SELECT \nTRIM(d1.id) ID,TRIM(d1.`pid`) projuctid,\nTRIM(d1.pastureid)pastureid,d1.fname optname,\n(select feedcode from feed where id =d1.fid and pastureid = d1.pastureid) optid,\nSUM(d1.lweight) targetweight,\nIFNULL(MAX(feed.`autozone`),10)autozone,\nIFNULL(MAX(feed.`autosecond`),0) autosecond,\nd1.`stirdelay` delaytime,\n(SELECT MAX(havebuttom) FROM `downloadplandtl1` d1t\nWHERE d1t.`pastureid` = d1.pastureid AND d1t.`pid` = d1.`pid`)firstReget,\nIFNULL(MAX(feed.confirmstart),0) needBegin,\nd1.`sort` pfsort,\n0 inorout,GROUP_CONCAT(d1.fname,\' : \',d1.lweight) mixdesc,\nIFNULL(feed.`jmp`,0) jmp,\nif (count(*)>1,1,0) ismix,\n0 `type`,\nnull bname\nFROM `downloadplandtl1` d1\nLEFT JOIN feed ON feed.`pastureid` = d1.`pastureid` AND d1.`fid` = feed.`id` \nWHERE d1.`pastureid` =? AND d1.`pid` = ?\nGROUP BY d1.`sort`\n\nUNION ALL\n\nSELECT TRIM(d1.id) ID,TRIM(d1.`pid`) projuctid,\nTRIM(d1.pastureid) pastureid,d1.fname optname,\n(select bcode from bar where id =d1.fbarid and pastureid = d1.pastureid) optid,\nd1.lweight targetweight,\nIFNULL(bar.`autozone`,10)autozone,\nIFNULL(bar.`autosecond`,0) autosecond,\n0 delaytime,\n(SELECT MAX(havebuttom) FROM `downloadplandtl2` d1t\nWHERE d1t.`pastureid` = d1.pastureid AND d1t.`pid` = d1.`pid`) firstReget,\n0 needBegin,\nd1.`sort` pfsort,\n1 inorout,\'\',0 jmp,0,\nd1.type,\nIF(d1.type = 0,(SELECT bname FROM bar WHERE pastureid = d1.`pastureid` AND id = d1.fbarid),(SELECT eqcode FROM tmr WHERE id =d1.fbarid AND pastureid = d1.`pastureid`)) bname\n\nFROM `downloadplandtl2` d1\nLEFT JOIN bar ON bar.`pastureid` = d1.`pastureid` AND d1.`fbarid` = bar.`id` \nWHERE d1.`pastureid` = ? AND d1.`pid` = ?\n','pastureid,id,pastureid,id','getRLSBdetailV2','GetArrList','获取计划饲料子表','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  629. (1862,406,'SELECT \nTRIM(d1.id) ID,TRIM(d1.`pid`) projuctid,\nTRIM(d1.pastureid)pastureid,d1.fname optname,TRIM(d1.fid) optid,\nSUM(d1.lweight) targetweight,\nIFNULL(MAX(feed.`autozone`),10)autozone,\nIFNULL(MAX(feed.`autosecond`),0) autosecond,\nd1.`stirdelay` delaytime,\n(SELECT MAX(havebuttom) FROM `downloadplandtl1` d1t\nWHERE d1t.`pastureid` = d1.pastureid AND d1t.`pid` = d1.`pid`)firstReget,\nIFNULL(MAX(feed.confirmstart),0) needBegin,\nd1.`sort` pfsort,\n0 inorout,GROUP_CONCAT(d1.fname,\' : \',d1.lweight) mixdesc,\nIFNULL(feed.`jmp`,0) jmp,\nif (count(*)>1,1,0) ismix\nFROM `downloadplandtl1` d1\nLEFT JOIN feed ON feed.`pastureid` = d1.`pastureid` AND d1.`fid` = feed.`id` \nWHERE d1.`pastureid` =? AND d1.`pid` = ?\nGROUP BY d1.`sort`\n\nUNION ALL\n\nSELECT TRIM(d1.id) ID,TRIM(d1.`pid`) projuctid,\nTRIM(d1.pastureid) pastureid,d1.fname optname,TRIM(d1.fbarid) optid,\nd1.lweight targetweight,\nIFNULL(bar.`autozone`,10)autozone,\nIFNULL(bar.`autosecond`,0) autosecond,\n0 delaytime,\n(SELECT MAX(havebuttom) FROM `downloadplandtl2` d1t\nWHERE d1t.`pastureid` = d1.pastureid AND d1t.`pid` = d1.`pid`) firstReget,\n0 needBegin,\nd1.`sort` pfsort,\n1 inorout,\'\',0 jmp,0\nFROM `downloadplandtl2` d1\nLEFT JOIN bar ON bar.`pastureid` = d1.`pastureid` AND d1.`fbarid` = bar.`id` \nWHERE d1.`pastureid` = ? AND d1.`pid` = ?\n','pastureid,id,pastureid,id','getRLSBdetailAllV2','GetArrList','获取计划饲料子表','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  630. (1863,349,'INSERT `sysopt`(`pastureid`,`inforname`,`inforvalue`)\nSELECT pastureid ,\'isDataSync\',\'0\'\nFROM `sysopt`\nGROUP BY pastureid','pastureid','INSERTsys','PostDataByName','更新专用','tmrgo','{\"name\":\"deleteProvider\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"id\":\"3025176271438481111\",\"drivername\":\"李五\",\"enable\":1}}','{\"LastInsertId\":0,\"RowsAffected\":1,\"result\":{\"Locker\":{}}}',0,1,0,0,0),
  631. (1864,406,'UPDATE \n`downloadplandtl1` d1\nJOIN downloadplandtl1_exec d1e ON d1.pastureid = d1e.pastureid AND d1.pid=d1e.pid AND d1.sort = d1e.sort\nSET d1.`actualweightminus` =?*d1.`lweight`/d1e.lweight,\nd1.`begintime` = if(?=\'\',null,?),\nd1.`intime` = if(?=\'\',null,?),\nd1.`lastactualweight` =?*d1.`lweight`/d1e.lweight,\nd1.`actualweight` =?*d1.`lweight`/d1e.lweight\nWHERE d1.pastureid = ? AND d1e.id =? AND 0=?','weight,begintime,begintime,endtime,endtime,beginweight,endweight,pastureid,ID,inorout','updated1YJV2','PostDataByName','更新d1','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  632. (1865,406,'UPDATE \n`downloadplandtl2` d1\nSET d1.`actualweightminus` =(SELECT SUM(actualweightminus) FROM `downloadplandtl1_exec` WHERE pastureid = d1.`pastureid` AND pid = d1.pid ),\nd1.`begintime` = IF(?=\'\',NULL,?),\nd1.`intime` = IF(?=\'\',NULL,?),\nd1.`lastactualweight` = d1.`actualweightminus` ,\nd1.`actualweight` =0\nWHERE pastureid = ? AND pid =?','begintime,begintime,endtime,endtime,pastureid,projuctid','updated2YJV2','PostDataByName','更新d2','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  633. (1866,406,'UPDATE \n`downloadplandtl1_exec` d1\nSET d1.`actualweightminus` =?,\nd1.`begintime` = if(?=\'\',null,?),\nd1.`intime` = if(?=\'\',null,?),\nd1.`lastactualweight` =?,\nd1.`actualweight` =?\nWHERE pastureid = ? AND id =? AND 0=?','weight,begintime,begintime,endtime,endtime,beginweight,endweight,pastureid,ID,inorout','updated1execYJV2','PostDataByName','更新d1e','tmrgo','{\"name\":\"getdownloadedplanRLSB\",\"name1\":\"getdownloadplandtl1RLSB\",\"parammaps\":{\"imei\":\"122\",\"times\":\"1\",\"sort\":\"0\",\"enable\":1}}','',0,1,0,0,0),
  634. (1867,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(d1.`fname`,\"\")fname,d1.`lweight`,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') and d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\nLEFT JOIN feed ON feed.id = d1.fid AND feed.`pastureid` = d1.pastureid and (feed.printgroup = ? or ?=\'\')\n\nORDER BY d.`tmrid`,d.times,d.projname,d1.`fid`','date,pastureid,lpplantype,lpplantype,times,times,printType,printType','downloadPlanTLJDTMR','GetReportform','导出日执行计划-投料简打-TMR','tmrgo','{\"name\":\"downloadPlanTLJD\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"enable\":1}}','{\"code\":0,\"data\":null,\"list\":{\"data1\":[{\"label\":\"车次\",\"prop\":\"projname\"},{\"label\":\"时间\",\"prop\":\"plantime\"},{\"label\":\"班组\",\"prop\":\"times\"},{\"label\":\"驾驶员\",\"prop\":\"driver\"},{\"label\":\"日系数比例\",\"prop\":\"rate\"},{\"label\":\"牛头数\",\"prop\":\"feedpcount\"},{\"label\":\"配方模板\",\"prop\":\"templetname\"}],\"data2\":[{}]},\"message\":\"ok\"}',0,1,0,0,0),
  635. (1868,338,'SELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(d1.`fname`,\"\")fname,\nd1.lweight,\nd1.sort,\n(SELECT SUM(lweight) FROM `downloadplandtl1` de WHERE de.`pid`= d.`id` AND de.`pastureid` = d.`pastureid` AND de.`fname`<= d1.`fname`) `lweight`,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') and d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`projname`)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\nORDER BY d.`projname`,d1.`fid`','date,pastureid,lpplantype,lpplantype,times,times','downloadPlanTLLD','GetReportform','导出日执行计划-投料累打-发料顺序','tmrgo','{\"name\":\"downloadPlanTLJD\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','{\"code\":0,\"data\":null,\"list\":{\"data1\":[{\"label\":\"车次\",\"prop\":\"projname\"},{\"label\":\"时间\",\"prop\":\"plantime\"},{\"label\":\"班组\",\"prop\":\"times\"},{\"label\":\"驾驶员\",\"prop\":\"driver\"},{\"label\":\"日系数比例\",\"prop\":\"rate\"},{\"label\":\"牛头数\",\"prop\":\"feedpcount\"},{\"label\":\"配方模板\",\"prop\":\"templetname\"}],\"data2\":[{}]},\"message\":\"ok\"}',0,1,0,0,0),
  636. (1869,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(d1.`fname`,\"\")fname,d1.`lweight`,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') and d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`projname`)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\nLEFT JOIN feed ON feed.id = d1.fid AND feed.`pastureid` = d1.pastureid and (feed.printgroup = ? or ?=\'\')\n\nORDER BY d.`projname`,d1.`fid`','date,pastureid,lpplantype,lpplantype,times,times,printType,printType','downloadPlanTLJD','GetReportform','导出日执行计划-投料简打-发料顺序','tmrgo','{\"name\":\"downloadPlanTLJD\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"enable\":1}}','{\"code\":0,\"data\":null,\"list\":{\"data1\":[{\"label\":\"车次\",\"prop\":\"projname\"},{\"label\":\"时间\",\"prop\":\"plantime\"},{\"label\":\"班组\",\"prop\":\"times\"},{\"label\":\"驾驶员\",\"prop\":\"driver\"},{\"label\":\"日系数比例\",\"prop\":\"rate\"},{\"label\":\"牛头数\",\"prop\":\"feedpcount\"},{\"label\":\"配方模板\",\"prop\":\"templetname\"}],\"data2\":[{}]},\"message\":\"ok\"}',0,1,0,0,0),
  637. (1870,338,'SELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(d1.`fname`,\"\")fname,\nd1.lweight,\nd1.sort,\n(SELECT SUM(lweight) FROM `downloadplandtl1` de WHERE de.`pid`= d.`id` AND de.`pastureid` = d.`pastureid` AND de.`fname`<= d1.`fname`) `lweight`,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') and d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\nORDER BY d.`tmrid`,d.times,d.projname,d1.`fid`','date,pastureid,lpplantype,lpplantype,times,times','downloadPlanTLLDTMR','GetReportform','导出日执行计划-投料累打-TMR','tmrgo','{\"name\":\"downloadPlanTLJD\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','{\"code\":0,\"data\":null,\"list\":{\"data1\":[{\"label\":\"车次\",\"prop\":\"projname\"},{\"label\":\"时间\",\"prop\":\"plantime\"},{\"label\":\"班组\",\"prop\":\"times\"},{\"label\":\"驾驶员\",\"prop\":\"driver\"},{\"label\":\"日系数比例\",\"prop\":\"rate\"},{\"label\":\"牛头数\",\"prop\":\"feedpcount\"},{\"label\":\"配方模板\",\"prop\":\"templetname\"}],\"data2\":[{}]},\"message\":\"ok\"}',0,1,0,0,0),
  638. (1871,338,'SELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n@fn:=LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\') fn,\nCONCAT(\'发料位\',@fn)fname,\nCONCAT(d1.fname,\'(\',d1.lweight,\')\') lweight,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') and d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`projname`)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\nORDER BY d.`projname`,d1.`fname`','date,pastureid,lpplantype,lpplantype,times,times','downloadPlanSLJD','GetReportform','导出日执行计划-撒料简打-发料顺序','tmrgo','{\"name\":\"SLJDdownloadPlan\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','null',0,1,0,0,0),
  639. (1872,338,'SELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n@fn:=LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\') fn,\nCONCAT(\'发料位\',@fn)fname,\nCONCAT(d1.fname,\'(\',d1.lweight,\')\') lweight,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') and d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\nORDER BY d.`tmrid`,d.times,d.projname,d1.`fname`','date,pastureid,lpplantype,lpplantype,times,times','downloadPlanSLJDTMR','GetReportform','导出日执行计划-撒料简打-TMR','tmrgo','{\"name\":\"downloadPlanTLJD\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','{\"code\":0,\"data\":null,\"list\":{\"data1\":[{\"label\":\"车次\",\"prop\":\"projname\"},{\"label\":\"时间\",\"prop\":\"plantime\"},{\"label\":\"班组\",\"prop\":\"times\"},{\"label\":\"驾驶员\",\"prop\":\"driver\"},{\"label\":\"日系数比例\",\"prop\":\"rate\"},{\"label\":\"牛头数\",\"prop\":\"feedpcount\"},{\"label\":\"配方模板\",\"prop\":\"templetname\"}],\"data2\":[{}]},\"message\":\"ok\"}',0,1,0,0,0),
  640. (1873,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(CONCAT(\' \',d1.`fname`),\"\")fname,\nd1.lweight,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n UNION ALL\n \n SELECT \'2\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n\nCONCAT(\'发料位\',LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\')) fname,\nCONCAT(d1.fname,\'(\',d1.lweight,\')\') lweight,\nd.lweight sumlweight\n\nFROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ?\nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n \nORDER BY tmrid,times,projname,dtype,fname\n','date,pastureid,lpplantype,lpplantype,times,times,date,pastureid,lpplantype,lpplantype,times,times','downloadPlanTSLJDTMR','GetReportform','导出日执行计划-投撒料简打-TMR','tmrgo','{\"name\":\"downloadPlanTLJD\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','{\"code\":0,\"data\":null,\"list\":{\"data1\":[{\"label\":\"车次\",\"prop\":\"projname\"},{\"label\":\"时间\",\"prop\":\"plantime\"},{\"label\":\"班组\",\"prop\":\"times\"},{\"label\":\"驾驶员\",\"prop\":\"driver\"},{\"label\":\"日系数比例\",\"prop\":\"rate\"},{\"label\":\"牛头数\",\"prop\":\"feedpcount\"},{\"label\":\"配方模板\",\"prop\":\"templetname\"}],\"data2\":[{}]},\"message\":\"ok\"}',0,1,0,0,0),
  641. (1874,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(CONCAT(\' \',d1.`fname`),\"\")fname,\nd1.lweight,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n UNION ALL\n \n SELECT \'2\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n\nCONCAT(\'发料位\',LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\')) fname,\nCONCAT(d1.fname,\'(\',d1.lweight,\')\') lweight,\nd.lweight sumlweight\n\nFROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ?\nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`projname`)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n \nORDER BY projname,dtype,fname\n','date,pastureid,lpplantype,lpplantype,times,times,date,pastureid,lpplantype,lpplantype,times,times','downloadPlanTSLJD','GetReportform','导出日执行计划-投撒料简打-发料顺序','tmrgo','{\"name\":\"SLJDdownloadPlan\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','null',0,1,0,0,0),
  642. (1875,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(CONCAT(\' \',d1.`fname`),\"\")fname,\n(SELECT SUM(lweight) FROM `downloadplandtl1` de WHERE de.`pid`= d.`id` AND de.`pastureid` = d.`pastureid` AND de.`fname`<= d1.`fname`) `lweight`,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n UNION ALL\n \n SELECT \'2\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n\nCONCAT(\'发料位\',LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\')) fname,\nCONCAT(d1.fname,\'(\',(d.lweight-(SELECT SUM(lweight) FROM `downloadplandtl2` de WHERE de.`pid`= d.`id` AND de.`pastureid` = d.`pastureid` AND de.`sort`<= d1.`sort`)) ,\')\') lweight,\nd.lweight sumlweight\n\nFROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ?\nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n \nORDER BY tmrid,times,projname,dtype,fname\n','date,pastureid,lpplantype,lpplantype,times,times,date,pastureid,lpplantype,lpplantype,times,times','downloadPlanTSLLDTMR','GetReportform','导出日执行计划-投撒料累加-TMR','tmrgo','{\"name\":\"downloadPlanTLJD\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','{\"code\":0,\"data\":null,\"list\":{\"data1\":[{\"label\":\"车次\",\"prop\":\"projname\"},{\"label\":\"时间\",\"prop\":\"plantime\"},{\"label\":\"班组\",\"prop\":\"times\"},{\"label\":\"驾驶员\",\"prop\":\"driver\"},{\"label\":\"日系数比例\",\"prop\":\"rate\"},{\"label\":\"牛头数\",\"prop\":\"feedpcount\"},{\"label\":\"配方模板\",\"prop\":\"templetname\"}],\"data2\":[{}]},\"message\":\"ok\"}',0,1,0,0,0),
  643. (1876,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(CONCAT(\' \',d1.`fname`),\"\")fname,\n(SELECT SUM(lweight) FROM `downloadplandtl1` de WHERE de.`pid`= d.`id` AND de.`pastureid` = d.`pastureid` AND de.`fname`<= d1.`fname`) `lweight`,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n UNION ALL\n \n SELECT \'2\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n\nCONCAT(\'发料位\',LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\')) fname,\nCONCAT(d1.fname,\'(\',(d.lweight-(SELECT SUM(lweight) FROM `downloadplandtl2` de WHERE de.`pid`= d.`id` AND de.`pastureid` = d.`pastureid` AND de.`sort`<= d1.`sort`)) ,\')\') lweight,\nd.lweight sumlweight\n\nFROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ?\nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`projname`)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n \nORDER BY projname,dtype,fname\n','date,pastureid,lpplantype,lpplantype,times,times,date,pastureid,lpplantype,lpplantype,times,times','downloadPlanTSLLD','GetReportform','导出日执行计划-投撒料累加-发料顺序','tmrgo','{\"name\":\"SLJDdownloadPlan\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','null',0,1,0,0,0),
  644. (1877,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(CONCAT(\' \',d1.`fname`),\"\")fname,\nround( IFNULL(d1.`lweight`/(SELECT unitweight FROM feed WHERE pastureid = d1.`pastureid` AND id = d1.`fid`),0),2) lweight,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n UNION ALL\n \n SELECT \'2\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n\nCONCAT(\'发料位\',LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\')) fname,\nCONCAT(d1.fname,\'(\',d1.lweight,\')\') lweight,\nd.lweight sumlweight\n\nFROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ?\nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n \nORDER BY tmrid,times,projname,dtype,fname\n','date,pastureid,lpplantype,lpplantype,times,times,date,pastureid,lpplantype,lpplantype,times,times','downloadPlanBZJDTMR','GetReportform','导出日执行计划-包装简打-TMR','tmrgo','{\"name\":\"downloadPlanTLJD\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','{\"code\":0,\"data\":null,\"list\":{\"data1\":[{\"label\":\"车次\",\"prop\":\"projname\"},{\"label\":\"时间\",\"prop\":\"plantime\"},{\"label\":\"班组\",\"prop\":\"times\"},{\"label\":\"驾驶员\",\"prop\":\"driver\"},{\"label\":\"日系数比例\",\"prop\":\"rate\"},{\"label\":\"牛头数\",\"prop\":\"feedpcount\"},{\"label\":\"配方模板\",\"prop\":\"templetname\"}],\"data2\":[{}]},\"message\":\"ok\"}',0,1,0,0,0),
  645. (1878,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(CONCAT(\' \',d1.`fname`),\"\")fname,\nround( IFNULL(d1.`lweight`/(SELECT unitweight FROM feed WHERE pastureid = d1.`pastureid` AND id = d1.`fid`),0),2) lweight,\nd.lweight sumlweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n UNION ALL\n \n SELECT \'2\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n\nCONCAT(\'发料位\',LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\')) fname,\nCONCAT(d1.fname,\'(\',d1.lweight,\')\') lweight,\nd.lweight sumlweight\n\nFROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ?\nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`projname`)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n \nORDER BY projname,dtype,fname\n','date,pastureid,lpplantype,lpplantype,times,times,date,pastureid,lpplantype,lpplantype,times,times','downloadPlanBZJD','GetReportform','导出日执行计划-包装简打-发料顺序','tmrgo','{\"name\":\"SLJDdownloadPlan\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','null',0,1,0,0,0),
  646. (1879,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(CONCAT(\' \',d1.`fname`),\"\")fname,\nd1.`actualweightminus` lweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n UNION ALL\n \n SELECT \'2\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n\nCONCAT(\'发料位\',LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\')) fname,\nCONCAT(d1.fname,\'(\',d1.actualweightminus,\')\') lweight\n\n\nFROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ?\nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`tmrid`,d.times,d.projname)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n \nORDER BY tmrid,times,projname,dtype,fname\n','date,pastureid,lpplantype,lpplantype,times,times,date,pastureid,lpplantype,lpplantype,times,times','downloadPlanSFJDTMR','GetReportform','导出日执行计划-实发简打-TMR','tmrgo','{\"name\":\"downloadPlanTLJD\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','{\"code\":0,\"data\":null,\"list\":{\"data1\":[{\"label\":\"车次\",\"prop\":\"projname\"},{\"label\":\"时间\",\"prop\":\"plantime\"},{\"label\":\"班组\",\"prop\":\"times\"},{\"label\":\"驾驶员\",\"prop\":\"driver\"},{\"label\":\"日系数比例\",\"prop\":\"rate\"},{\"label\":\"牛头数\",\"prop\":\"feedpcount\"},{\"label\":\"配方模板\",\"prop\":\"templetname\"}],\"data2\":[{}]},\"message\":\"ok\"}',0,1,0,0,0),
  647. (1880,338,'\nSELECT \'1\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,IFNULL(CONCAT(\' \',d1.`fname`),\"\")fname,\nd1.`actualweightminus` lweight\n\n FROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ? \nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY projname)d\n JOIN `downloadplandtl1` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n UNION ALL\n \n SELECT \'2\' dtype ,d.`projname`,IFNULL(d.`templetname`,\'\')templetname,d.tmrid,\n@ftw:=(SELECT SUM(fweight) FROM ftdetaildate WHERE ftid = d.tempid AND pastureid = d.pastureid AND `version` = d.tversion AND `date` = d.mydate) ftw,\nIFNULL(round(d.`lweight`/@ftw),\'\')feedpcount,\nCONCAT(ROUND(IFNULL((d.`lweight`/d.`feedpcount`)/@ftw*100,0),2),\'%\')rate,\nIFNULL(d.`tmrtname`,\'\') `tmrtname`,d.`times`,\nIFNULL((SELECT dr.`driver` FROM `dutyrecord` dr \nWHERE dr.`pastureid` = d.`pastureid` AND dr.`eqid` = d.`tmrid` AND dr.times= d.times AND dr.`operatetime` <=d.`mydate` \nORDER BY dr.`operatetime` DESC LIMIT 1),\"\")driver,\nIFNULL(d.`plantime`,\"\")plantime,\n\nCONCAT(\'发料位\',LPAD((SELECT COUNT(*)FROM downloadplandtl2 WHERE pastureid = d1.`pastureid` AND pid = d1.`pid` AND sort <= d1.`sort`),2,\'0\')) fname,\nCONCAT(d1.fname,\'(\',d1.actualweightminus,\')\') lweight\n\nFROM (SELECT * FROM `downloadedplan` d WHERE d.mydate = ? AND d.pastureid = ?\nAND (d.`lpplantype` =? OR ?=\'\') AND d.`lpplantype` <>3\nAND (d.times =? OR ?= \'\') ORDER BY d.`projname`)d\n JOIN `downloadplandtl2` d1 ON d1.`pid`= d.`id` AND d1.`pastureid` = d.`pastureid`\n \n \nORDER BY projname,dtype,fname\n','date,pastureid,lpplantype,lpplantype,times,times,date,pastureid,lpplantype,lpplantype,times,times','downloadPlanSFJD','GetReportform','导出日执行计划-实发简打-发料顺序','tmrgo','{\"name\":\"SLJDdownloadPlan\",\"parammaps\":{\"pastureid\":\"3264108097970897920\",\"mydate\":\"2020-09-15\",\"date\":\"2021-06-28\",\"projname\":\"projname\"}}','null',0,1,0,0,0),
  648. (1881,343,'\nSELECT\neqcode,\ntname,\ndatacaptureno,\nTRIM(tclassid) tclassid,\nCONCAT(tname,\' / \',eqcode) tmrmix,\ntclassname,\nmaxstirfeed,\nremark,\n`enable`,\nTRIM(id) id,\nTRIM(pastureid)pastureid\nFROM\n tmr\nWHERE pastureid = ? AND ENABLE=1 AND IF(?=1,tclassid IN(1,2),tclassid = ?)\n\nORDER BY id DESC','pastureid,eqtype,eqtype','getTMRListEnableTypeFeed','GetDataByName','tmr列表','tmrgo','{\"name\":\"getTMRListEnable\",\"parammaps\":{\"pastureid\":\"3025176271438480383\",\"eqtype\":\"2\",\"sort\":\"0\",\"enable\":1}}','{\"code\":0,\"list\":[{\"datacaptureno\":2,\"enable\":1,\"eqcode\":\"05841\",\"id\":\"3029300176059106304\",\"maxstirfeed\":0,\"pastureid\":\"3025176271438480383\",\"remark\":\"维修中\",\"tclassid\":\"0\",\"tclassname\":\"\",\"tname\":\"东区铲车\"},{\"datacaptureno\":7,\"enable\":1,\"eqcode\":\"017288\",\"id\":\"3029299420144862208\",\"maxstirfeed\":2000,\"pastureid\":\"3025176271438480383\",\"remark\":\"在用\",\"tclassid\":\"2\",\"tclassname\":\"固定式\",\"tname\":\"拖拉机\"},{\"datacaptureno\":8,\"enable\":1,\"eqcode\":\"0000158\",\"id\":\"3027989712817619968\",\"maxstirfeed\":1000,\"pastureid\":\"3025176271438480383\",\"remark\":\"\",\"tclassid\":\"1\",\"tclassname\":\"自走式\",\"tname\":\"装载机\"},{\"datacaptureno\":4,\"enable\":1,\"eqcode\":\"09874\",\"id\":\"3026792763464614912\",\"maxstirfeed\":0,\"pastureid\":\"3025176271438480383\",\"remark\":\"保养中\",\"tclassid\":\"0\",\"tclassname\":\"\",\"tname\":\"西区铲车\"},{\"datacaptureno\":12,\"enable\":1,\"eqcode\":\"11\",\"id\":\"3026731597124076544\",\"maxstirfeed\":1,\"pastureid\":\"3025176271438480383\",\"tclassid\":\"1\",\"tclassname\":\"自走式\",\"tname\":\"11\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":5}',0,1,0,0,0),
  649. (1882,324,'\nSELECT \n(SELECT `pasture_name` FROM `pasture` WHERE pastureid = tem.pastureid)pastureName,\ntem.eqcode tname,tem.remark,tem.fname,tem.inorout,IFNULL(tem.lweight,0) lweight,tem.lastactualweight,TRIM(tem.`projid`) pid,tem.datacaptureno,tem.id,\nround(IFNULL(tem.doneweight,0) ,2)doneweight,\nround(tem.nowweight,2) nowweight,\nround(IFNULL(tem.lweight- tem.doneweight,0),2) leftweight,\nCONCAT(ROUND(tem.doneweight/tem.lweight*100,2),\'%\') donerate\nFROM \n\n(\nSELECT tmr.`eqcode`,tmr.`tname`,d.`remark`,tmr.`projid`,tmr.`datacaptureno`,TRIM(tmr.id) id,d.pastureid,\ntmr.`inorout`,\nIF(tmr.`nextsort`=-1,\'无\',IF(tmr.`inorout`=0,de.`fname`,d2.`fname`)) fname,\nIF(tmr.`inorout`=0,\n(SELECT SUM(lweight) FROM downloadplandtl1_exec d1e WHERE d1e.`pastureid` = tmr.`pastureid` AND d1e.`pid` = d.`id` AND d1e.sort = tmr.`nextsort` )\n, (SELECT SUM(lweight) FROM downloadplandtl2 d2e WHERE d2e.`pastureid` = tmr.`pastureid` AND d2e.`pid` = d.`id` AND d2e.sort = tmr.`nextsort` )) lweight,\nIF(tmr.`inorout`=0,de.lastactualweight,d2.lastactualweight) lastactualweight,\ntmr.`lastweight`,\nABS((SELECT weight FROM `recweight` r WHERE r.pastureid= tmr.`pastureid` AND r.srcaddr = tmr.`datacaptureno` ORDER BY mtime DESC LIMIT 1)-tmr.`lastweight`) doneweight,\n(SELECT weight FROM `recweight` r WHERE r.pastureid= tmr.`pastureid` AND r.srcaddr = tmr.`datacaptureno` ORDER BY mtime DESC LIMIT 1) nowweight\nFROM tmr\nINNER JOIN downloadedplan d\nON d.`pastureid` = tmr.`pastureid` AND d.`id` = tmr.`projid`\nRIGHT JOIN \n(SELECT pastureid FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid FROM pasture WHERE groupsid = ?\n) tem1 \nON tem1.`pastureid` = d.`pastureid`\nLEFT JOIN `downloadplandtl1_exec` de\nON de.`pastureid` = tmr.`pastureid` AND de.`pid` = d.`id` AND tmr.`inorout` = 0 \nLEFT JOIN `downloadplandtl2` d2\nON d2.`pastureid` = tmr.`pastureid` AND d2.`pid` = d.`id` AND tmr.`inorout` = 1 AND (tmr.nextsort = d2.sort OR tmr.nextsort=-1 )\nWHERE d.`havebutton` = 1 AND d.`iscompleted` = 0 \nAND (( \nIF(tmr.nextsort=-1,de.sort = (SELECT MAX(sort) FROM downloadplandtl1_exec d1e WHERE d1e.`pastureid` = tmr.`pastureid` AND d1e.`pid` = d.`id` ),tmr.nextsort = de.sort)\n )\nOR (\nIF(tmr.nextsort=-1,d2.sort = (SELECT MAX(sort) FROM downloadplandtl2 d2e WHERE d2e.`pastureid` = tmr.`pastureid` AND d2e.`pid` = d.`id` ),tmr.nextsort = d2.sort)\n ))\n)tem\n\n\n\n','pastureid,pastureid','getHomepageLBListJT','GetDataByName','过程分析轮播-集团','tmrgo','{\"name\":\"getHomepageLBList\",\"parammaps\":{\"pastureid\":\"3025176271438480386\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','{\"code\":0,\"list\":null,\"message\":\"ok\",\"pageSize\":0,\"total\":0}',0,1,0,0,0),
  650. (1883,390,'SELECT \n\n\nSUM((SELECT COUNT(*)FROM downloadedplan dt WHERE dt.pastureid= d.pastureid AND dt.mydate = d.mydate AND dt.iscompleted=1)) doneTimes,\nSUM((SELECT COUNT(*)FROM downloadedplan dt WHERE dt.pastureid= d.pastureid AND dt.mydate = d.mydate )) planTimes,\nSUM(IFNULL((SELECT SUM(dc.actualweightminus) FROM downloadplandtl1_exec dc WHERE dc.pastureid = d.pastureid AND dc.date = d.mydate),0)) doneWeight,\nSUM(IFNULL((SELECT SUM(dc.lweight ) FROM downloadplandtl1_exec dc WHERE dc.pastureid = d.pastureid AND dc.date = d.mydate),0)) planWeight\n FROM \n(SELECT pastureid,DATE_FORMAT(NOW(),\'%Y-%m-%d\') mydate FROM groups_pasture WHERE groupsid = ?\n UNION \n SELECT pastureid,DATE_FORMAT(NOW(),\'%Y-%m-%d\') mydate FROM pasture WHERE groupsid = ?\n) d\n','pastureid,pastureid','getHomepageStrJTPlan','GetDataByName','首页监控数据-集团-今日计划统计','tmrgo','{\"name\":\"getHomepageStr\",\"parammaps\":{\"pastureid\":\"3025176271438480387\",\"startTime\":\"2020-09-15\",\"stopTime\":\"2020-09-16\",\"pid\":220849}}','{\"code\":0,\"list\":[{\"pastureid\":\"3025176271438480387\"}],\"message\":\"ok\",\"pageSize\":0,\"total\":1}',0,1,0,0,0);
  651. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  652. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  653. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  654. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;