blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/controller/AnimalHeatController.java
@@ -9,13 +9,11 @@ import org.springblade.jfpt.animalheat.entity.BladeAnimalHeat; import org.springblade.jfpt.animalheat.service.AnimalHeatService; import org.springblade.jfpt.animalheat.vo.AnimalHeatVo; import org.springblade.jfpt.animalheat.vo.StatisVo; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 体温监测控制层 @@ -44,8 +42,8 @@ /** * 体温数据的分页数据 * @param animalHeatVo 查询条件 * 体温数据的分页数据--图表的点击事件 * @param animalHeatVo 查询条件 包含时间状态type 0:本日 1:本周 2:本月 * @param query 查询页码 * @return */ blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/mapper/AnimalHeatMapper.xml
@@ -32,11 +32,15 @@ <!--查询体温数据的分页数据--> <select id="selectAnimalHeatPageList" resultType="org.springblade.jfpt.animalheat.entity.BladeAnimalHeat"> SELECT * FROM blade_animal_heat <if test="animalHeatVo.begTime!=null and animalHeatVo.begTime!=''"> and create_time >=#{animalHeatVo.begTime} where 1=1 <if test="animalHeatVo.type==0"> and to_days(create_time)=to_days(now()) </if> <if test="animalHeatVo.endTime!=null and animalHeatVo.endTime!=''"> and create_time <=#{animalHeatVo.endTime} <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> ORDER BY create_time asc </select> blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/service/impl/AnimalHeatServiceImpl.java
@@ -96,17 +96,17 @@ */ @Override public List<Map<String, Object>> getAnimalStatis(AnimalHeatVo animalHeatVo) { if(null!= animalHeatVo.getStatus()){ if(null!= animalHeatVo.getType()){ //查询当天的统计数据 if (animalHeatVo.getStatus()==0){ if (animalHeatVo.getType()==0){ return baseMapper.getAnimalStatis(); } //查询本周的统计数据 if (animalHeatVo.getStatus()==1){ if (animalHeatVo.getType()==1){ return baseMapper.getAnimalStatisWeek(); } //查询本月的统计数据 if (animalHeatVo.getStatus()==2){ if (animalHeatVo.getType()==2){ return baseMapper.getAnimalStatisMonth(); } } blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/vo/AnimalHeatVo.java
@@ -24,5 +24,5 @@ /** * 状态 0: 当天时间统计数据 1: 本周内的数据统计 */ private Integer status; private Integer type; }