南昌市物联网技防平台-后台
zengh
2021-04-06 c0892e033a19c4a481db5d661df542e30cff3ce4
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/animalheat/mapper/AnimalHeatMapper.xml
@@ -32,13 +32,23 @@
    <!--查询体温数据的分页数据-->
    <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 &gt;=#{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 &lt;=#{animalHeatVo.endTime}
        <if test="animalHeatVo.type==1">
            and YEARWEEK(date_format(create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
        </if>
        ORDER BY create_time asc
        <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>
        ORDER BY create_time desc
    </select>
    <!--查询本周每天的体温数据(按礼拜一开始计算)-->
@@ -106,5 +116,6 @@
       ) b
       on
       a.click_date = b.datetime
       order by a.click_date asc
    </select>
</mapper>