| | |
| | | on |
| | | a.days = b.datetime |
| | | </select> |
| | | |
| | | |
| | | <!--导出体温数据列表--> |
| | | <select id="exportAnimalHeat" resultType="org.springblade.jfpt.animalheat.vo.AnimalHeatExcel"> |
| | | SELECT * FROM blade_animal_heat |
| | | where 1=1 |
| | | <if test="animalHeatVo.type==0"> |
| | | and to_days(create_time)=to_days(now()) |
| | | </if> |
| | | <if test="animalHeatVo.type==1"> |
| | | and YEARWEEK(date_format(create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1) |
| | | </if> |
| | | <if test="animalHeatVo.type==2"> |
| | | and date_format(create_time,'%Y%m') = date_format(now(),'%Y%m') |
| | | </if> |
| | | <if test="animalHeatVo.status!=null"> |
| | | and status=#{animalHeatVo.status} |
| | | </if> |
| | | <if test="animalHeatVo.begTime!=null and animalHeatVo.begTime!='' and animalHeatVo.endTime!=null and animalHeatVo.endTime!='' "> |
| | | and date(create_time) between #{animalHeatVo.begTime} and #{animalHeatVo.endTime} |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc!=null and animalHeatVo.timeDesc!=''"> |
| | | <if test="animalHeatVo.timeDesc=='0-2'"> |
| | | and hour(create_time)>=0 and hour(create_time) <2 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='2-4'"> |
| | | and hour(create_time)>=2 and hour(create_time) <4 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='4-6'"> |
| | | and hour(create_time)>=4 and hour(create_time) <6 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='6-8'"> |
| | | and hour(create_time)>=6 and hour(create_time) <8 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='8-10'"> |
| | | and hour(create_time)>=8 and hour(create_time) <10 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='10-12'"> |
| | | and hour(create_time)>=10 and hour(create_time) <12 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='12-14'"> |
| | | and hour(create_time)>=12 and hour(create_time) <14 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='14-16'"> |
| | | and hour(create_time)>=14 and hour(create_time) <16 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='16-18'"> |
| | | and hour(create_time)>=16 and hour(create_time) <18 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='18-20'"> |
| | | and hour(create_time)>=18 and hour(create_time) <20 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='20-22'"> |
| | | and hour(create_time)>=20 and hour(create_time) <22 |
| | | </if> |
| | | <if test="animalHeatVo.timeDesc=='22-24'"> |
| | | and hour(create_time)>=22 and hour(create_time) <24 |
| | | </if> |
| | | </if> |
| | | ORDER BY create_time desc |
| | | </select> |
| | | |
| | | </mapper> |