vr_duecalv.frm 2.6 KB

123456789101112131415
  1. TYPE=VIEW
  2. 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`
  3. md5=e53ebc2b6f066ed8ef33b02c6222ccd8
  4. updatable=0
  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:38
  11. create-version=1
  12. 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`
  13. client_cs_name=utf8
  14. connection_cl_name=utf8_general_ci
  15. 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`