vr_weekhybri.frm 3.4 KB

123456789101112131415
  1. TYPE=VIEW
  2. query=select `c`.`varCowCode` AS `varCowCode`,`c`.`dateCurPz` AS `dateCurPz`,`c`.`intHyCount` AS `intHyCount`,`c`.`intPastureId` AS `intPastureId`,if((substring_index(group_concat(ifnull(`e`.`falsedel`,0) order by `e`.`filter_highest` DESC separator \',\'),\',\',1) = 1),\'±\',(case substring_index(group_concat(`e`.`actlevel` order by `e`.`filter_highest` DESC separator \',\'),\',\',1) when 3 then \'+++\' when 2 then \'++\' when 1 then \'+\' else \'\' end)) AS `actlevel`,ifnull(`e5`.`varNotes`,\'\') AS `varNotes` from ((`heatwatch`.`cow` `c` left join `heatwatch`.`estrusact` `e` on(((`c`.`varCowCode` = `e`.`varcowcode`) and ((to_days(`e`.`actdatetime`) = to_days(`c`.`dateCurPz`)) or ((to_days(`e`.`actdatetime`) + 1) = to_days(`c`.`dateCurPz`)))))) left join `heatwatch`.`events` `e5` on(((`c`.`intCowId` = `e5`.`intCowId`) and (`e5`.`intClass` = \'配种\') and (`c`.`dateCurPz` = `e5`.`dateEvtDate`)))) where ((`c`.`dateCurPz` >= (curdate() + interval -(7) day)) and (`c`.`EID1` > 0)) group by `c`.`varCowCode`,`c`.`dateCurPz` desc order by `c`.`dateCurPz` desc,`c`.`varCowCode`
  3. md5=e8e43c030049e5ed97e28c302752306c
  4. updatable=0
  5. algorithm=0
  6. definer_user=roo
  7. definer_host=%
  8. suid=1
  9. with_check_option=0
  10. timestamp=2022-12-14 10:07:38
  11. create-version=1
  12. source=select `c`.`varCowCode` AS `varCowCode`,`c`.`dateCurPz` AS `dateCurPz`,`c`.`intHyCount` AS `intHyCount`,`c`.`intPastureId` AS `intPastureId`,if(substring_index(group_concat(ifnull(`e`.`falsedel`,0) order by `e`.`filter_highest` DESC separator \',\'),\',\',1) = 1,\'±\',case substring_index(group_concat(`e`.`actlevel` order by `e`.`filter_highest` DESC separator \',\'),\',\',1) when 3 then \'+++\' when 2 then \'++\' when 1 then \'+\' else \'\' end) AS `actlevel`,ifnull(`e5`.`varNotes`,\'\') AS `varNotes` from ((`cow` `c` left join `estrusact` `e` on(`c`.`varCowCode` = `e`.`varcowcode` and (to_days(`e`.`actdatetime`) = to_days(`c`.`dateCurPz`) or to_days(`e`.`actdatetime`) + 1 = to_days(`c`.`dateCurPz`)))) left join `events` `e5` on(`c`.`intCowId` = `e5`.`intCowId` and `e5`.`intClass` = \'配种\' and `c`.`dateCurPz` = `e5`.`dateEvtDate`)) where `c`.`dateCurPz` >= curdate() + interval -7 day and `c`.`EID1` > 0 group by `c`.`varCowCode`,`c`.`dateCurPz` desc order by `c`.`dateCurPz` desc,`c`.`varCowCode`
  13. client_cs_name=utf8
  14. connection_cl_name=utf8_general_ci
  15. view_body_utf8=select `c`.`varCowCode` AS `varCowCode`,`c`.`dateCurPz` AS `dateCurPz`,`c`.`intHyCount` AS `intHyCount`,`c`.`intPastureId` AS `intPastureId`,if((substring_index(group_concat(ifnull(`e`.`falsedel`,0) order by `e`.`filter_highest` DESC separator \',\'),\',\',1) = 1),\'±\',(case substring_index(group_concat(`e`.`actlevel` order by `e`.`filter_highest` DESC separator \',\'),\',\',1) when 3 then \'+++\' when 2 then \'++\' when 1 then \'+\' else \'\' end)) AS `actlevel`,ifnull(`e5`.`varNotes`,\'\') AS `varNotes` from ((`heatwatch`.`cow` `c` left join `heatwatch`.`estrusact` `e` on(((`c`.`varCowCode` = `e`.`varcowcode`) and ((to_days(`e`.`actdatetime`) = to_days(`c`.`dateCurPz`)) or ((to_days(`e`.`actdatetime`) + 1) = to_days(`c`.`dateCurPz`)))))) left join `heatwatch`.`events` `e5` on(((`c`.`intCowId` = `e5`.`intCowId`) and (`e5`.`intClass` = \'配种\') and (`c`.`dateCurPz` = `e5`.`dateEvtDate`)))) where ((`c`.`dateCurPz` >= (curdate() + interval -(7) day)) and (`c`.`EID1` > 0)) group by `c`.`varCowCode`,`c`.`dateCurPz` desc order by `c`.`dateCurPz` desc,`c`.`varCowCode`