TYPE=VIEW
query=(select `heatwatch`.`cow`.`varCowCode` AS `varCowCode`,if((`heatwatch`.`cow`.`intCurBar` > 0),`heatwatch`.`cow`.`intCurBarName`,\'待分配\') AS `intCurBarName`,`heatwatch`.`classlist`.`intClassListId` AS `SORT`,concat(\'预产期:\',date_format(`heatwatch`.`cow`.`productionDate`,\'%m-%d\'),\'当前产量:\',ifnull(`heatwatch`.`cow`.`intProduceDay`,\' \'),\'Kg，胎次产量:\',ifnull(`heatwatch`.`cow`.`intCurFetalProduce`,\' \')) AS `DESCRIB`,date_format(`heatwatch`.`cow`.`productionDate`,\'%m-%d\') AS `productionDate`,ifnull(`heatwatch`.`cow`.`intCurFetalProduce`,\'\') AS `intCurFetalProduce`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from (`heatwatch`.`cow` left join `heatwatch`.`classlist` on(((`heatwatch`.`cow`.`intPastureId` = `heatwatch`.`classlist`.`intPastureId`) and (`heatwatch`.`classlist`.`varName` = \'正常干奶\')))) where (isnull(`heatwatch`.`cow`.`dateLeave`) and (`heatwatch`.`cow`.`belongState` = \'泌乳牛\') and (`heatwatch`.`cow`.`sireClass` = \'已孕\') and (`heatwatch`.`cow`.`gravidityDays` >= (280 - (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'预产前几天干奶\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`))))))) union (select `heatwatch`.`cow`.`varCowCode` AS `varCowCode`,`heatwatch`.`cow`.`intCurBarName` AS `intCurBarName`,`heatwatch`.`classlist`.`intClassListId` AS `SORT`,concat(\'预产期:\',date_format(`heatwatch`.`cow`.`productionDate`,\'%m-%d\'),\'当前产量:\',ifnull(`heatwatch`.`cow`.`intProduceDay`,\' \'),\'Kg，胎次产量:\',ifnull(`heatwatch`.`cow`.`intCurFetalProduce`,\' \')) AS `DESCRIB`,date_format(`heatwatch`.`cow`.`productionDate`,\'%m-%d\') AS `productionDate`,ifnull(`heatwatch`.`cow`.`intCurFetalProduce`,\'\') AS `intCurFetalProduce`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from (`heatwatch`.`cow` left join `heatwatch`.`classlist` on(((`heatwatch`.`cow`.`intPastureId` = `heatwatch`.`classlist`.`intPastureId`) and (`heatwatch`.`classlist`.`varName` = \'异常干奶\')))) where (isnull(`heatwatch`.`cow`.`dateLeave`) and (`heatwatch`.`cow`.`belongState` = \'泌乳牛\') and (`heatwatch`.`cow`.`gravidityDays` < (280 - (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'预产前几天干奶\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`))))) and (`heatwatch`.`cow`.`intProduceDay` <= (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'提前干奶奶量\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`))))))
md5=bfd25cac0f8eec39710948b2fc31e6e9
updatable=0
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`,`classlist`.`intClassListId` AS `SORT`,concat(\'预产期:\',date_format(`cow`.`productionDate`,\'%m-%d\'),\'当前产量:\',ifnull(`cow`.`intProduceDay`,\' \'),\'Kg，胎次产量:\',ifnull(`cow`.`intCurFetalProduce`,\' \')) AS `DESCRIB`,date_format(`cow`.`productionDate`,\'%m-%d\') AS `productionDate`,ifnull(`cow`.`intCurFetalProduce`,\'\') AS `intCurFetalProduce`,`cow`.`intPastureId` AS `intPastureId` from (`cow` left join `classlist` on(`cow`.`intPastureId` = `classlist`.`intPastureId` and `classlist`.`varName` = \'正常干奶\')) where `cow`.`dateLeave` is null and `cow`.`belongState` = \'泌乳牛\' and `cow`.`sireClass` = \'已孕\' and `cow`.`gravidityDays` >= 280 - (select `manageparam`.`varVal` from `manageparam` where `manageparam`.`varDiscribe` = \'预产前几天干奶\' and `manageparam`.`intPastureId` = `cow`.`intPastureId`)) union (select `cow`.`varCowCode` AS `varCowCode`,`cow`.`intCurBarName` AS `intCurBarName`,`classlist`.`intClassListId` AS `SORT`,concat(\'预产期:\',date_format(`cow`.`productionDate`,\'%m-%d\'),\'当前产量:\',ifnull(`cow`.`intProduceDay`,\' \'),\'Kg，胎次产量:\',ifnull(`cow`.`intCurFetalProduce`,\' \')) AS `DESCRIB`,date_format(`cow`.`productionDate`,\'%m-%d\') AS `productionDate`,ifnull(`cow`.`intCurFetalProduce`,\'\') AS `intCurFetalProduce`,`cow`.`intPastureId` AS `intPastureId` from (`cow` left join `classlist` on(`cow`.`intPastureId` = `classlist`.`intPastureId` and `classlist`.`varName` = \'异常干奶\')) where `cow`.`dateLeave` is null and `cow`.`belongState` = \'泌乳牛\' and `cow`.`gravidityDays` < 280 - (select `manageparam`.`varVal` from `manageparam` where `manageparam`.`varDiscribe` = \'预产前几天干奶\' and `manageparam`.`intPastureId` = `cow`.`intPastureId`) and `cow`.`intProduceDay` <= (select `manageparam`.`varVal` from `manageparam` where `manageparam`.`varDiscribe` = \'提前干奶奶量\' and `manageparam`.`intPastureId` = `cow`.`intPastureId`))
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`,`heatwatch`.`classlist`.`intClassListId` AS `SORT`,concat(\'预产期:\',date_format(`heatwatch`.`cow`.`productionDate`,\'%m-%d\'),\'当前产量:\',ifnull(`heatwatch`.`cow`.`intProduceDay`,\' \'),\'Kg，胎次产量:\',ifnull(`heatwatch`.`cow`.`intCurFetalProduce`,\' \')) AS `DESCRIB`,date_format(`heatwatch`.`cow`.`productionDate`,\'%m-%d\') AS `productionDate`,ifnull(`heatwatch`.`cow`.`intCurFetalProduce`,\'\') AS `intCurFetalProduce`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from (`heatwatch`.`cow` left join `heatwatch`.`classlist` on(((`heatwatch`.`cow`.`intPastureId` = `heatwatch`.`classlist`.`intPastureId`) and (`heatwatch`.`classlist`.`varName` = \'正常干奶\')))) where (isnull(`heatwatch`.`cow`.`dateLeave`) and (`heatwatch`.`cow`.`belongState` = \'泌乳牛\') and (`heatwatch`.`cow`.`sireClass` = \'已孕\') and (`heatwatch`.`cow`.`gravidityDays` >= (280 - (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'预产前几天干奶\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`))))))) union (select `heatwatch`.`cow`.`varCowCode` AS `varCowCode`,`heatwatch`.`cow`.`intCurBarName` AS `intCurBarName`,`heatwatch`.`classlist`.`intClassListId` AS `SORT`,concat(\'预产期:\',date_format(`heatwatch`.`cow`.`productionDate`,\'%m-%d\'),\'当前产量:\',ifnull(`heatwatch`.`cow`.`intProduceDay`,\' \'),\'Kg，胎次产量:\',ifnull(`heatwatch`.`cow`.`intCurFetalProduce`,\' \')) AS `DESCRIB`,date_format(`heatwatch`.`cow`.`productionDate`,\'%m-%d\') AS `productionDate`,ifnull(`heatwatch`.`cow`.`intCurFetalProduce`,\'\') AS `intCurFetalProduce`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from (`heatwatch`.`cow` left join `heatwatch`.`classlist` on(((`heatwatch`.`cow`.`intPastureId` = `heatwatch`.`classlist`.`intPastureId`) and (`heatwatch`.`classlist`.`varName` = \'异常干奶\')))) where (isnull(`heatwatch`.`cow`.`dateLeave`) and (`heatwatch`.`cow`.`belongState` = \'泌乳牛\') and (`heatwatch`.`cow`.`gravidityDays` < (280 - (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'预产前几天干奶\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`))))) and (`heatwatch`.`cow`.`intProduceDay` <= (select `heatwatch`.`manageparam`.`varVal` from `heatwatch`.`manageparam` where ((`heatwatch`.`manageparam`.`varDiscribe` = \'提前干奶奶量\') and (`heatwatch`.`manageparam`.`intPastureId` = `heatwatch`.`cow`.`intPastureId`))))))
