| 123456789101112131415 |
- TYPE=VIEW
- query=select `evthy`.`intPastureId` AS `intPastureId`,(case when ((`lastcalving`.`bitIsfetus` = 1) or isnull(`lastcalving`.`bitIsfetus`)) then `lastevtcalv`.`dateEvtDate` else NULL end) AS `lastevtcalvDate`,(case when (`lastcalving`.`bitIsfetus` = 1) then (to_days(`evthy`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`)) else NULL end) AS `evtHYMRDate`,(case when (`lastcalving`.`bitIsfetus` = 1) then (to_days(`evtprg`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`)) else NULL end) AS `evtPRGMRDate`,(case when (`lastcalving`.`bitIsfetus` = 1) then (to_days(`evtdry`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`)) else NULL end) AS `evtDRYMRDate`,(case when (`lastcalving`.`bitIsfetus` = 1) then (to_days(`evtcalv`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`)) else NULL end) AS `evtCalvMRDate`,`evthy`.`intEvtId` AS `intEvtId`,`evthy`.`intCurFetal` AS `evtHYFetal`,if((`evthy`.`intCurFetal` = 1),\'头产\',\'经产\') AS `evtHYTcjc`,`evthy`.`intCowId` AS `evtCowId`,`evthy`.`dateEvtDate` AS `evtHYDate`,`evthy`.`intClass` AS `evtHYClass`,`evthy`.`intPersoner` AS `evtHYPersoner`,`hypersoner`.`varEmployeeName` AS `hyPersoner`,`evthy`.`varNotes` AS `evtHYNotes`,`heatwatch`.`hybri`.`intBullId` AS `intBullId`,`heatwatch`.`bull`.`varBullCode` AS `varBullCode`,`heatwatch`.`hybri`.`intHyCount` AS `intHyCount`,`heatwatch`.`hybri`.`intSemenSum` AS `intSemenSum`,`heatwatch`.`hybri`.`intWay` AS `intWay`,`evtprg`.`dateEvtDate` AS `evtPRGDate`,`evtprg`.`intClass` AS `evtPRGClass`,`evtprg`.`intPersoner` AS `evtPRGPersoner`,`prgpersoner`.`varEmployeeName` AS `prgPersoner`,`evtprg`.`varNotes` AS `evtPRGNotes`,`heatwatch`.`precheck`.`intDiagWays` AS `intDiagWays`,(case when (`heatwatch`.`precheck`.`bitCheckResult` = 0) then \'无胎\' when (`heatwatch`.`precheck`.`bitCheckResult` = 1) then \'有胎\' end) AS `bitCheckResult`,`evtdry`.`dateEvtDate` AS `evtDRYDate`,`evtdry`.`intClass` AS `evtDRYClass`,`evtdry`.`intPersoner` AS `evtDRYPersoner`,`drypersoner`.`varEmployeeName` AS `dryPersoner`,`evtdry`.`varNotes` AS `evtDRYNotes`,`heatwatch`.`drymilk`.`intDryClass` AS `intDryClass`,`evtcalv`.`dateEvtDate` AS `evtCalvDate`,`evtcalv`.`intClass` AS `evtCalvClass`,`evtcalv`.`intPersoner` AS `evtCalvPersoner`,`calvpersoner`.`varEmployeeName` AS `calvPersoner`,`evtcalv`.`varNotes` AS `evtCalvNotes`,`heatwatch`.`calving`.`intClass` AS `calvingClass`,`heatwatch`.`calving`.`intCaul` AS `intCaul`,`heatwatch`.`calving`.`intUterus` AS `intUterus`,(case when (`heatwatch`.`calving`.`bitIsfetus` = 0) then \'否\' when (`heatwatch`.`calving`.`bitIsfetus` = 1) then \'是\' end) AS `bitIsfetus` from ((((((((((((((`heatwatch`.`events` `evthy` join `heatwatch`.`hybri` on(((`heatwatch`.`hybri`.`intEvtId` = `evthy`.`intEvtId`) and (`heatwatch`.`hybri`.`intPastureId` = `evthy`.`intPastureId`)))) left join `heatwatch`.`bull` on(((`heatwatch`.`hybri`.`intBullId` = `heatwatch`.`bull`.`intBullId`) and (`heatwatch`.`hybri`.`intPastureId` = `heatwatch`.`bull`.`intPastureId`)))) left join `heatwatch`.`employee` `hypersoner` on(((`evthy`.`intPersoner` = `hypersoner`.`intEmployeeId`) and (`evthy`.`intPastureId` = `hypersoner`.`intPastureId`)))) left join `heatwatch`.`precheck` on(((`evthy`.`intEvtId` = `heatwatch`.`precheck`.`intHyEvtId`) and (`evthy`.`intPastureId` = `heatwatch`.`precheck`.`intPastureId`)))) left join `heatwatch`.`events` `evtprg` on(((`heatwatch`.`precheck`.`intEvtId` = `evtprg`.`intEvtId`) and (`heatwatch`.`precheck`.`intPastureId` = `evtprg`.`intPastureId`)))) left join `heatwatch`.`employee` `prgpersoner` on(((`evtprg`.`intPersoner` = `prgpersoner`.`intEmployeeId`) and (`evtprg`.`intPastureId` = `prgpersoner`.`intPastureId`)))) left join `heatwatch`.`drymilk` on(((`evthy`.`intEvtId` = `heatwatch`.`drymilk`.`intHyEvtId`) and (`evthy`.`intPastureId` = `heatwatch`.`drymilk`.`intPastureId`)))) left join `heatwatch`.`events` `evtdry` on(((`heatwatch`.`drymilk`.`intEvtId` = `evtdry`.`intEvtId`) and (`heatwatch`.`drymilk`.`intPastureId` = `evtdry`.`intPastureId`)))) left join `heatwatch`.`employee` `drypersoner` on(((`evtdry`.`intPersoner` = `drypersoner`.`intEmployeeId`) and (`evtdry`.`intPastureId` = `drypersoner`.`intPastureId`)))) left join `heatwatch`.`calving` on(((`evthy`.`intEvtId` = `heatwatch`.`calving`.`intHyEvtId`) and (`evthy`.`intPastureId` = `heatwatch`.`calving`.`intPastureId`)))) left join `heatwatch`.`events` `evtcalv` on(((`heatwatch`.`calving`.`intEvtId` = `evtcalv`.`intEvtId`) and (`heatwatch`.`calving`.`intPastureId` = `evtcalv`.`intPastureId`)))) left join `heatwatch`.`employee` `calvpersoner` on(((`evtcalv`.`intPersoner` = `calvpersoner`.`intEmployeeId`) and (`evtcalv`.`intPastureId` = `calvpersoner`.`intPastureId`)))) left join `heatwatch`.`events` `lastevtcalv` on(((`lastevtcalv`.`intCowId` = `evthy`.`intCowId`) and (`lastevtcalv`.`intPastureId` = `evthy`.`intPastureId`) and (`lastevtcalv`.`intClass` in (\'流产\',\'产犊\')) and (`lastevtcalv`.`dateEvtDate` < `evthy`.`dateEvtDate`)))) left join `heatwatch`.`calving` `lastcalving` on(((`lastcalving`.`intEvtId` = `lastevtcalv`.`intEvtId`) and (`lastcalving`.`intPastureId` = `lastevtcalv`.`intPastureId`))))
- md5=ab9d1830c8a82ebf8f974d7a6f46c33e
- updatable=0
- algorithm=0
- definer_user=root
- definer_host=localhost
- suid=1
- with_check_option=0
- timestamp=2022-12-14 10:07:38
- create-version=1
- source=select `evthy`.`intPastureId` AS `intPastureId`,case when (`lastcalving`.`bitIsfetus` = 1 or `lastcalving`.`bitIsfetus` is null) then `lastevtcalv`.`dateEvtDate` else NULL end AS `lastevtcalvDate`,case when `lastcalving`.`bitIsfetus` = 1 then to_days(`evthy`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`) else NULL end AS `evtHYMRDate`,case when `lastcalving`.`bitIsfetus` = 1 then to_days(`evtprg`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`) else NULL end AS `evtPRGMRDate`,case when `lastcalving`.`bitIsfetus` = 1 then to_days(`evtdry`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`) else NULL end AS `evtDRYMRDate`,case when `lastcalving`.`bitIsfetus` = 1 then to_days(`evtcalv`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`) else NULL end AS `evtCalvMRDate`,`evthy`.`intEvtId` AS `intEvtId`,`evthy`.`intCurFetal` AS `evtHYFetal`,if(`evthy`.`intCurFetal` = 1,\'头产\',\'经产\') AS `evtHYTcjc`,`evthy`.`intCowId` AS `evtCowId`,`evthy`.`dateEvtDate` AS `evtHYDate`,`evthy`.`intClass` AS `evtHYClass`,`evthy`.`intPersoner` AS `evtHYPersoner`,`hypersoner`.`varEmployeeName` AS `hyPersoner`,`evthy`.`varNotes` AS `evtHYNotes`,`hybri`.`intBullId` AS `intBullId`,`bull`.`varBullCode` AS `varBullCode`,`hybri`.`intHyCount` AS `intHyCount`,`hybri`.`intSemenSum` AS `intSemenSum`,`hybri`.`intWay` AS `intWay`,`evtprg`.`dateEvtDate` AS `evtPRGDate`,`evtprg`.`intClass` AS `evtPRGClass`,`evtprg`.`intPersoner` AS `evtPRGPersoner`,`prgpersoner`.`varEmployeeName` AS `prgPersoner`,`evtprg`.`varNotes` AS `evtPRGNotes`,`precheck`.`intDiagWays` AS `intDiagWays`,case when `precheck`.`bitCheckResult` = 0 then \'无胎\' when `precheck`.`bitCheckResult` = 1 then \'有胎\' end AS `bitCheckResult`,`evtdry`.`dateEvtDate` AS `evtDRYDate`,`evtdry`.`intClass` AS `evtDRYClass`,`evtdry`.`intPersoner` AS `evtDRYPersoner`,`drypersoner`.`varEmployeeName` AS `dryPersoner`,`evtdry`.`varNotes` AS `evtDRYNotes`,`drymilk`.`intDryClass` AS `intDryClass`,`evtcalv`.`dateEvtDate` AS `evtCalvDate`,`evtcalv`.`intClass` AS `evtCalvClass`,`evtcalv`.`intPersoner` AS `evtCalvPersoner`,`calvpersoner`.`varEmployeeName` AS `calvPersoner`,`evtcalv`.`varNotes` AS `evtCalvNotes`,`calving`.`intClass` AS `calvingClass`,`calving`.`intCaul` AS `intCaul`,`calving`.`intUterus` AS `intUterus`,case when `calving`.`bitIsfetus` = 0 then \'否\' when `calving`.`bitIsfetus` = 1 then \'是\' end AS `bitIsfetus` from ((((((((((((((`events` `evthy` join `hybri` on(`hybri`.`intEvtId` = `evthy`.`intEvtId` and `hybri`.`intPastureId` = `evthy`.`intPastureId`)) left join `bull` on(`hybri`.`intBullId` = `bull`.`intBullId` and `hybri`.`intPastureId` = `bull`.`intPastureId`)) left join `employee` `hypersoner` on(`evthy`.`intPersoner` = `hypersoner`.`intEmployeeId` and `evthy`.`intPastureId` = `hypersoner`.`intPastureId`)) left join `precheck` on(`evthy`.`intEvtId` = `precheck`.`intHyEvtId` and `evthy`.`intPastureId` = `precheck`.`intPastureId`)) left join `events` `evtprg` on(`precheck`.`intEvtId` = `evtprg`.`intEvtId` and `precheck`.`intPastureId` = `evtprg`.`intPastureId`)) left join `employee` `prgpersoner` on(`evtprg`.`intPersoner` = `prgpersoner`.`intEmployeeId` and `evtprg`.`intPastureId` = `prgpersoner`.`intPastureId`)) left join `drymilk` on(`evthy`.`intEvtId` = `drymilk`.`intHyEvtId` and `evthy`.`intPastureId` = `drymilk`.`intPastureId`)) left join `events` `evtdry` on(`drymilk`.`intEvtId` = `evtdry`.`intEvtId` and `drymilk`.`intPastureId` = `evtdry`.`intPastureId`)) left join `employee` `drypersoner` on(`evtdry`.`intPersoner` = `drypersoner`.`intEmployeeId` and `evtdry`.`intPastureId` = `drypersoner`.`intPastureId`)) left join `calving` on(`evthy`.`intEvtId` = `calving`.`intHyEvtId` and `evthy`.`intPastureId` = `calving`.`intPastureId`)) left join `events` `evtcalv` on(`calving`.`intEvtId` = `evtcalv`.`intEvtId` and `calving`.`intPastureId` = `evtcalv`.`intPastureId`)) left join `employee` `calvpersoner` on(`evtcalv`.`intPersoner` = `calvpersoner`.`intEmployeeId` and `evtcalv`.`intPastureId` = `calvpersoner`.`intPastureId`)) left join `events` `lastevtcalv` on(`lastevtcalv`.`intCowId` = `evthy`.`intCowId` and `lastevtcalv`.`intPastureId` = `evthy`.`intPastureId` and `lastevtcalv`.`intClass` in (\'流产\',\'产犊\') and `lastevtcalv`.`dateEvtDate` < `evthy`.`dateEvtDate`)) left join `calving` `lastcalving` on(`lastcalving`.`intEvtId` = `lastevtcalv`.`intEvtId` and `lastcalving`.`intPastureId` = `lastevtcalv`.`intPastureId`))
- client_cs_name=utf8
- connection_cl_name=utf8_general_ci
- view_body_utf8=select `evthy`.`intPastureId` AS `intPastureId`,(case when ((`lastcalving`.`bitIsfetus` = 1) or isnull(`lastcalving`.`bitIsfetus`)) then `lastevtcalv`.`dateEvtDate` else NULL end) AS `lastevtcalvDate`,(case when (`lastcalving`.`bitIsfetus` = 1) then (to_days(`evthy`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`)) else NULL end) AS `evtHYMRDate`,(case when (`lastcalving`.`bitIsfetus` = 1) then (to_days(`evtprg`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`)) else NULL end) AS `evtPRGMRDate`,(case when (`lastcalving`.`bitIsfetus` = 1) then (to_days(`evtdry`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`)) else NULL end) AS `evtDRYMRDate`,(case when (`lastcalving`.`bitIsfetus` = 1) then (to_days(`evtcalv`.`dateEvtDate`) - to_days(`lastevtcalv`.`dateEvtDate`)) else NULL end) AS `evtCalvMRDate`,`evthy`.`intEvtId` AS `intEvtId`,`evthy`.`intCurFetal` AS `evtHYFetal`,if((`evthy`.`intCurFetal` = 1),\'头产\',\'经产\') AS `evtHYTcjc`,`evthy`.`intCowId` AS `evtCowId`,`evthy`.`dateEvtDate` AS `evtHYDate`,`evthy`.`intClass` AS `evtHYClass`,`evthy`.`intPersoner` AS `evtHYPersoner`,`hypersoner`.`varEmployeeName` AS `hyPersoner`,`evthy`.`varNotes` AS `evtHYNotes`,`heatwatch`.`hybri`.`intBullId` AS `intBullId`,`heatwatch`.`bull`.`varBullCode` AS `varBullCode`,`heatwatch`.`hybri`.`intHyCount` AS `intHyCount`,`heatwatch`.`hybri`.`intSemenSum` AS `intSemenSum`,`heatwatch`.`hybri`.`intWay` AS `intWay`,`evtprg`.`dateEvtDate` AS `evtPRGDate`,`evtprg`.`intClass` AS `evtPRGClass`,`evtprg`.`intPersoner` AS `evtPRGPersoner`,`prgpersoner`.`varEmployeeName` AS `prgPersoner`,`evtprg`.`varNotes` AS `evtPRGNotes`,`heatwatch`.`precheck`.`intDiagWays` AS `intDiagWays`,(case when (`heatwatch`.`precheck`.`bitCheckResult` = 0) then \'无胎\' when (`heatwatch`.`precheck`.`bitCheckResult` = 1) then \'有胎\' end) AS `bitCheckResult`,`evtdry`.`dateEvtDate` AS `evtDRYDate`,`evtdry`.`intClass` AS `evtDRYClass`,`evtdry`.`intPersoner` AS `evtDRYPersoner`,`drypersoner`.`varEmployeeName` AS `dryPersoner`,`evtdry`.`varNotes` AS `evtDRYNotes`,`heatwatch`.`drymilk`.`intDryClass` AS `intDryClass`,`evtcalv`.`dateEvtDate` AS `evtCalvDate`,`evtcalv`.`intClass` AS `evtCalvClass`,`evtcalv`.`intPersoner` AS `evtCalvPersoner`,`calvpersoner`.`varEmployeeName` AS `calvPersoner`,`evtcalv`.`varNotes` AS `evtCalvNotes`,`heatwatch`.`calving`.`intClass` AS `calvingClass`,`heatwatch`.`calving`.`intCaul` AS `intCaul`,`heatwatch`.`calving`.`intUterus` AS `intUterus`,(case when (`heatwatch`.`calving`.`bitIsfetus` = 0) then \'否\' when (`heatwatch`.`calving`.`bitIsfetus` = 1) then \'是\' end) AS `bitIsfetus` from ((((((((((((((`heatwatch`.`events` `evthy` join `heatwatch`.`hybri` on(((`heatwatch`.`hybri`.`intEvtId` = `evthy`.`intEvtId`) and (`heatwatch`.`hybri`.`intPastureId` = `evthy`.`intPastureId`)))) left join `heatwatch`.`bull` on(((`heatwatch`.`hybri`.`intBullId` = `heatwatch`.`bull`.`intBullId`) and (`heatwatch`.`hybri`.`intPastureId` = `heatwatch`.`bull`.`intPastureId`)))) left join `heatwatch`.`employee` `hypersoner` on(((`evthy`.`intPersoner` = `hypersoner`.`intEmployeeId`) and (`evthy`.`intPastureId` = `hypersoner`.`intPastureId`)))) left join `heatwatch`.`precheck` on(((`evthy`.`intEvtId` = `heatwatch`.`precheck`.`intHyEvtId`) and (`evthy`.`intPastureId` = `heatwatch`.`precheck`.`intPastureId`)))) left join `heatwatch`.`events` `evtprg` on(((`heatwatch`.`precheck`.`intEvtId` = `evtprg`.`intEvtId`) and (`heatwatch`.`precheck`.`intPastureId` = `evtprg`.`intPastureId`)))) left join `heatwatch`.`employee` `prgpersoner` on(((`evtprg`.`intPersoner` = `prgpersoner`.`intEmployeeId`) and (`evtprg`.`intPastureId` = `prgpersoner`.`intPastureId`)))) left join `heatwatch`.`drymilk` on(((`evthy`.`intEvtId` = `heatwatch`.`drymilk`.`intHyEvtId`) and (`evthy`.`intPastureId` = `heatwatch`.`drymilk`.`intPastureId`)))) left join `heatwatch`.`events` `evtdry` on(((`heatwatch`.`drymilk`.`intEvtId` = `evtdry`.`intEvtId`) and (`heatwatch`.`drymilk`.`intPastureId` = `evtdry`.`intPastureId`)))) left join `heatwatch`.`employee` `drypersoner` on(((`evtdry`.`intPersoner` = `drypersoner`.`intEmployeeId`) and (`evtdry`.`intPastureId` = `drypersoner`.`intPastureId`)))) left join `heatwatch`.`calving` on(((`evthy`.`intEvtId` = `heatwatch`.`calving`.`intHyEvtId`) and (`evthy`.`intPastureId` = `heatwatch`.`calving`.`intPastureId`)))) left join `heatwatch`.`events` `evtcalv` on(((`heatwatch`.`calving`.`intEvtId` = `evtcalv`.`intEvtId`) and (`heatwatch`.`calving`.`intPastureId` = `evtcalv`.`intPastureId`)))) left join `heatwatch`.`employee` `calvpersoner` on(((`evtcalv`.`intPersoner` = `calvpersoner`.`intEmployeeId`) and (`evtcalv`.`intPastureId` = `calvpersoner`.`intPastureId`)))) left join `heatwatch`.`events` `lastevtcalv` on(((`lastevtcalv`.`intCowId` = `evthy`.`intCowId`) and (`lastevtcalv`.`intPastureId` = `evthy`.`intPastureId`) and (`lastevtcalv`.`intClass` in (\'流产\',\'产犊\')) and (`lastevtcalv`.`dateEvtDate` < `evthy`.`dateEvtDate`)))) left join `heatwatch`.`calving` `lastcalving` on(((`lastcalving`.`intEvtId` = `lastevtcalv`.`intEvtId`) and (`lastcalving`.`intPastureId` = `lastevtcalv`.`intPastureId`))))
|