TYPE=VIEW
query=select `heatwatch`.`cow`.`varCowCode` AS `varCowCode`,if((`heatwatch`.`cow`.`intCurBar` > 0),`heatwatch`.`cow`.`intCurBarName`,\'待分配\') AS `intCurBarName`,\'初检\' AS `sort`,`heatwatch`.`cow`.`hybriDays` AS `hybri_Days`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from `heatwatch`.`cow` where (isnull(`heatwatch`.`cow`.`dateLeave`) and (not(`heatwatch`.`cow`.`intCowId` in (select `heatwatch`.`assist`.`intCowId` from `heatwatch`.`assist` where ((`heatwatch`.`assist`.`sort` in (1,2)) and ((to_days(curdate()) - to_days(`heatwatch`.`assist`.`eventDateTime`)) < 3) and isnull(`heatwatch`.`assist`.`checkDateTime`))))) and (`heatwatch`.`cow`.`sireClass` = \'已配未检\') and (((`heatwatch`.`cow`.`hybriDays` >= (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'成乳牛初检天数\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`)))) and (`heatwatch`.`cow`.`lactationDays` > 0)) or ((`heatwatch`.`cow`.`hybriDays` >= (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'后备牛初检天数\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`)))) and (`heatwatch`.`cow`.`lactationDays` = 0))))
md5=4641da99c7bd9614055a4aaa2ff0d3b5
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`.`varCowCode` AS `varCowCode`,if(`cow`.`intCurBar` > 0,`cow`.`intCurBarName`,\'待分配\') AS `intCurBarName`,\'初检\' AS `sort`,`cow`.`hybriDays` AS `hybri_Days`,`cow`.`intPastureId` AS `intPastureId` from `cow` where `cow`.`dateLeave` is null and !(`cow`.`intCowId` in (select `assist`.`intCowId` from `assist` where `assist`.`sort` in (1,2) and to_days(curdate()) - to_days(`assist`.`eventDateTime`) < 3 and `assist`.`checkDateTime` is null)) and `cow`.`sireClass` = \'已配未检\' and (`cow`.`hybriDays` >= (select `manageparam`.`varVal` from `manageparam` where `manageparam`.`varDiscribe` = \'成乳牛初检天数\' and `manageparam`.`intPastureId` = `cow`.`intPastureId`) and `cow`.`lactationDays` > 0 or `cow`.`hybriDays` >= (select `manageparam`.`varVal` from `manageparam` where `manageparam`.`varDiscribe` = \'后备牛初检天数\' and `manageparam`.`intPastureId` = `cow`.`intPastureId`) and `cow`.`lactationDays` = 0)
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `heatwatch`.`cow`.`varCowCode` AS `varCowCode`,if((`heatwatch`.`cow`.`intCurBar` > 0),`heatwatch`.`cow`.`intCurBarName`,\'待分配\') AS `intCurBarName`,\'初检\' AS `sort`,`heatwatch`.`cow`.`hybriDays` AS `hybri_Days`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from `heatwatch`.`cow` where (isnull(`heatwatch`.`cow`.`dateLeave`) and (not(`heatwatch`.`cow`.`intCowId` in (select `heatwatch`.`assist`.`intCowId` from `heatwatch`.`assist` where ((`heatwatch`.`assist`.`sort` in (1,2)) and ((to_days(curdate()) - to_days(`heatwatch`.`assist`.`eventDateTime`)) < 3) and isnull(`heatwatch`.`assist`.`checkDateTime`))))) and (`heatwatch`.`cow`.`sireClass` = \'已配未检\') and (((`heatwatch`.`cow`.`hybriDays` >= (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'成乳牛初检天数\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`)))) and (`heatwatch`.`cow`.`lactationDays` > 0)) or ((`heatwatch`.`cow`.`hybriDays` >= (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'后备牛初检天数\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`)))) and (`heatwatch`.`cow`.`lactationDays` = 0))))
