TYPE=VIEW
query=select `heatwatch`.`cow`.`intCowId` AS `intCowId`,`heatwatch`.`cow`.`varCowCode` AS `varCowCode`,if((`heatwatch`.`cow`.`intCurBar` > 0),`heatwatch`.`cow`.`intCurBarName`,\'待分配\') AS `intCurBarName`,if((`heatwatch`.`cow`.`lactationDays` < 55),\'预同期\',\'同期\') AS `sort`,if(((to_days(curdate()) - to_days(`heatwatch`.`cow`.`dateCurPz`)) < `heatwatch`.`cow`.`lactationDays`),concat(\'DIM:\',`heatwatch`.`cow`.`lactationDays`,\'天，配后天数：\',(to_days(curdate()) - to_days(`heatwatch`.`cow`.`dateCurPz`)),\'天\'),concat(\'DIM:\',`heatwatch`.`cow`.`lactationDays`,\'天\')) AS `DESCRIB`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from (`heatwatch`.`cow` join `heatwatch`.`bar` on(((`heatwatch`.`cow`.`intCurBar` = `heatwatch`.`bar`.`varBarCode`) and (`heatwatch`.`cow`.`intPastureId` = `heatwatch`.`bar`.`intPastureId`)))) where ((not(`heatwatch`.`cow`.`intCowId` in (select `heatwatch`.`events`.`intCowId` from `heatwatch`.`events` where ((`heatwatch`.`events`.`intClass` = \'PG\') and ((to_days(curdate()) - to_days(`heatwatch`.`events`.`dateEvtDate`)) < 13))))) and (`heatwatch`.`cow`.`belongState` = \'泌乳牛\') and ((`heatwatch`.`cow`.`sireClass` = \'未孕\') or (`heatwatch`.`cow`.`sireClass` = \'妊检未孕\')) and isnull(`heatwatch`.`cow`.`dateLeave`) and ((((`heatwatch`.`cow`.`lactationDays` between 19 and 25) or (`heatwatch`.`cow`.`lactationDays` between 33 and 39) or (`heatwatch`.`cow`.`lactationDays` between 47 and 53)) and (dayofweek(curdate()) in (3,5))) or ((`heatwatch`.`cow`.`lastTQ` = \'GnRH\') and (`heatwatch`.`cow`.`lastTQDays` = 7) and (dayofweek(curdate()) in (3,5)))))
md5=023e752df237574608894331af236b17
updatable=1
algorithm=0
definer_user=roo
definer_host=%
suid=1
with_check_option=0
timestamp=2022-12-14 10:07:39
create-version=1
source=select `cow`.`intCowId` AS `intCowId`,`cow`.`varCowCode` AS `varCowCode`,if(`cow`.`intCurBar` > 0,`cow`.`intCurBarName`,\'待分配\') AS `intCurBarName`,if(`cow`.`lactationDays` < 55,\'预同期\',\'同期\') AS `sort`,if(to_days(curdate()) - to_days(`cow`.`dateCurPz`) < `cow`.`lactationDays`,concat(\'DIM:\',`cow`.`lactationDays`,\'天，配后天数：\',to_days(curdate()) - to_days(`cow`.`dateCurPz`),\'天\'),concat(\'DIM:\',`cow`.`lactationDays`,\'天\')) AS `DESCRIB`,`cow`.`intPastureId` AS `intPastureId` from (`cow` join `bar` on(`cow`.`intCurBar` = `bar`.`varBarCode` and `cow`.`intPastureId` = `bar`.`intPastureId`)) where !(`cow`.`intCowId` in (select `events`.`intCowId` from `events` where `events`.`intClass` = \'PG\' and to_days(curdate()) - to_days(`events`.`dateEvtDate`) < 13)) and `cow`.`belongState` = \'泌乳牛\' and (`cow`.`sireClass` = \'未孕\' or `cow`.`sireClass` = \'妊检未孕\') and `cow`.`dateLeave` is null and ((`cow`.`lactationDays` between 19 and 25 or `cow`.`lactationDays` between 33 and 39 or `cow`.`lactationDays` between 47 and 53) and dayofweek(curdate()) in (3,5) or `cow`.`lastTQ` = \'GnRH\' and `cow`.`lastTQDays` = 7 and dayofweek(curdate()) in (3,5))
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `heatwatch`.`cow`.`intCowId` AS `intCowId`,`heatwatch`.`cow`.`varCowCode` AS `varCowCode`,if((`heatwatch`.`cow`.`intCurBar` > 0),`heatwatch`.`cow`.`intCurBarName`,\'待分配\') AS `intCurBarName`,if((`heatwatch`.`cow`.`lactationDays` < 55),\'预同期\',\'同期\') AS `sort`,if(((to_days(curdate()) - to_days(`heatwatch`.`cow`.`dateCurPz`)) < `heatwatch`.`cow`.`lactationDays`),concat(\'DIM:\',`heatwatch`.`cow`.`lactationDays`,\'天，配后天数：\',(to_days(curdate()) - to_days(`heatwatch`.`cow`.`dateCurPz`)),\'天\'),concat(\'DIM:\',`heatwatch`.`cow`.`lactationDays`,\'天\')) AS `DESCRIB`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from (`heatwatch`.`cow` join `heatwatch`.`bar` on(((`heatwatch`.`cow`.`intCurBar` = `heatwatch`.`bar`.`varBarCode`) and (`heatwatch`.`cow`.`intPastureId` = `heatwatch`.`bar`.`intPastureId`)))) where ((not(`heatwatch`.`cow`.`intCowId` in (select `heatwatch`.`events`.`intCowId` from `heatwatch`.`events` where ((`heatwatch`.`events`.`intClass` = \'PG\') and ((to_days(curdate()) - to_days(`heatwatch`.`events`.`dateEvtDate`)) < 13))))) and (`heatwatch`.`cow`.`belongState` = \'泌乳牛\') and ((`heatwatch`.`cow`.`sireClass` = \'未孕\') or (`heatwatch`.`cow`.`sireClass` = \'妊检未孕\')) and isnull(`heatwatch`.`cow`.`dateLeave`) and ((((`heatwatch`.`cow`.`lactationDays` between 19 and 25) or (`heatwatch`.`cow`.`lactationDays` between 33 and 39) or (`heatwatch`.`cow`.`lactationDays` between 47 and 53)) and (dayofweek(curdate()) in (3,5))) or ((`heatwatch`.`cow`.`lastTQ` = \'GnRH\') and (`heatwatch`.`cow`.`lastTQDays` = 7) and (dayofweek(curdate()) in (3,5)))))
