<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.huimv.admin.mapper.FeedingDataMapper">

    <select id="listFeed" resultType="com.huimv.admin.entity.vo.FeedDataVo">
        select IFNULL(sum(food_intake),'0')  'count',upload_time dateTime,body_size bodySize from feeding_data
         ${ew.customSqlSegment}
        GROUP BY DATE_FORMAT(upload_time,'%Y-%m-%d')
        ORDER BY upload_time ASC
    </select>

    <select id="listDayFeed" resultType="com.huimv.admin.entity.vo.FeedDataVo2">
        SELECT Convert((IFNUll(sum(food_intake),'0')),DECIMAL(10,2)) 'feedValue',upload_time 'dateTime' FROM `feeding_data`
         ${ew.customSqlSegment}
        GROUP BY DATE_FORMAT(upload_time,'%Y-%m-%d')
        ORDER BY upload_time ASC
    </select>
</mapper>
