v_firstpregnancy.frm 3.8 KB

123456789101112131415
  1. TYPE=VIEW
  2. 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))))
  3. md5=4641da99c7bd9614055a4aaa2ff0d3b5
  4. updatable=1
  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:39
  11. create-version=1
  12. 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)
  13. client_cs_name=utf8
  14. connection_cl_name=utf8_general_ci
  15. 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))))