TYPE=VIEW
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`
md5=e8e43c030049e5ed97e28c302752306c
updatable=0
algorithm=0
definer_user=roo
definer_host=%
suid=1
with_check_option=0
timestamp=2022-12-14 10:07:38
create-version=1
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`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
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`
