TYPE=VIEW
query=select date_format(`heatwatch`.`cow`.`productionDate`,\'%y年%m月\') AS `date`,sum(if((`heatwatch`.`cow`.`intCurFetal` = 0),0,1)) AS `adult_no`,sum(if((`heatwatch`.`cow`.`intCurFetal` = 0),1,0)) AS `heifer_no`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from `heatwatch`.`cow` where (isnull(`heatwatch`.`cow`.`dateLeave`) and (`heatwatch`.`cow`.`sireClass` = \'已孕\')) group by date_format(`heatwatch`.`cow`.`productionDate`,\'%y年%m月\'),`heatwatch`.`cow`.`intPastureId` union select \'合计\' AS `date`,sum(if((`heatwatch`.`cow`.`intCurFetal` = 0),0,1)) AS `adult_no`,sum(if((`heatwatch`.`cow`.`intCurFetal` = 0),1,0)) AS `heifer_no`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from `heatwatch`.`cow` where (isnull(`heatwatch`.`cow`.`dateLeave`) and (`heatwatch`.`cow`.`sireClass` = \'已孕\')) group by `heatwatch`.`cow`.`intPastureId`
md5=e53ebc2b6f066ed8ef33b02c6222ccd8
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 date_format(`cow`.`productionDate`,\'%y年%m月\') AS `date`,sum(if(`cow`.`intCurFetal` = 0,0,1)) AS `adult_no`,sum(if(`cow`.`intCurFetal` = 0,1,0)) AS `heifer_no`,`cow`.`intPastureId` AS `intPastureId` from `cow` where `cow`.`dateLeave` is null and `cow`.`sireClass` = \'已孕\' group by date_format(`cow`.`productionDate`,\'%y年%m月\'),`cow`.`intPastureId` union select \'合计\' AS `date`,sum(if(`cow`.`intCurFetal` = 0,0,1)) AS `adult_no`,sum(if(`cow`.`intCurFetal` = 0,1,0)) AS `heifer_no`,`cow`.`intPastureId` AS `intPastureId` from `cow` where `cow`.`dateLeave` is null and `cow`.`sireClass` = \'已孕\' group by `cow`.`intPastureId`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select date_format(`heatwatch`.`cow`.`productionDate`,\'%y年%m月\') AS `date`,sum(if((`heatwatch`.`cow`.`intCurFetal` = 0),0,1)) AS `adult_no`,sum(if((`heatwatch`.`cow`.`intCurFetal` = 0),1,0)) AS `heifer_no`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from `heatwatch`.`cow` where (isnull(`heatwatch`.`cow`.`dateLeave`) and (`heatwatch`.`cow`.`sireClass` = \'已孕\')) group by date_format(`heatwatch`.`cow`.`productionDate`,\'%y年%m月\'),`heatwatch`.`cow`.`intPastureId` union select \'合计\' AS `date`,sum(if((`heatwatch`.`cow`.`intCurFetal` = 0),0,1)) AS `adult_no`,sum(if((`heatwatch`.`cow`.`intCurFetal` = 0),1,0)) AS `heifer_no`,`heatwatch`.`cow`.`intPastureId` AS `intPastureId` from `heatwatch`.`cow` where (isnull(`heatwatch`.`cow`.`dateLeave`) and (`heatwatch`.`cow`.`sireClass` = \'已孕\')) group by `heatwatch`.`cow`.`intPastureId`
