| | |
| | | |
| | | <!--查询当天体温数据统计--> |
| | | <select id="getAnimalStatis" resultType="java.util.HashMap"> |
| | | SELECT 1 `status`,count(`status`) number FROM `blade_animal_heat` where |
| | | SELECT 1 `name`,count(`status`) value FROM `blade_animal_heat` where |
| | | TO_DAYS(create_time)=TO_DAYS(now()) and `status`=1 |
| | | UNION |
| | | SELECT 0 `status`,count(`status`) number FROM `blade_animal_heat` where |
| | | SELECT 0 `name`,count(`status`) value FROM `blade_animal_heat` where |
| | | TO_DAYS(create_time)=TO_DAYS(now()) and `status`=0 |
| | | </select> |
| | | |
| | | <!--获取本周的体温统计数据--> |
| | | <select id="getAnimalStatisWeek" resultType="java.util.HashMap"> |
| | | SELECT 1 `status`,count(`status`) number FROM `blade_animal_heat` where |
| | | SELECT 1 `name`,count(`status`) value FROM `blade_animal_heat` where |
| | | YEARWEEK(date_format(create_time,'%Y-%m-%d')) = YEARWEEK(now()) and `status`=1 |
| | | UNION |
| | | SELECT 0 `status`,count(`status`) number FROM `blade_animal_heat` where |
| | | SELECT 0 `name`,count(`status`) value FROM `blade_animal_heat` where |
| | | YEARWEEK(date_format(create_time,'%Y-%m-%d')) = YEARWEEK(now()) and `status`=0 |
| | | </select> |
| | | |