<?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.eartag.mapper.EartagDataMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.huimv.eartag.entity.EartagData">
        <id column="id" property="id" />
        <result column="cmd_header" property="cmdHeader" />
        <result column="device" property="device" />
        <result column="earmark" property="earmark" />
        <result column="bat" property="bat" />
        <result column="ear_temp" property="earTemp" />
        <result column="ear_temp1" property="earTemp1" />
        <result column="env_temp" property="envTemp" />
        <result column="env_temp1" property="envTemp1" />
        <result column="act" property="act" />
        <result column="act1" property="act1" />
        <result column="signal1" property="signal1" />
        <result column="ask_time" property="askTime" />
        <result column="other" property="other" />
        <result column="add_time" property="addTime" />
        <result column="create_date" property="createDate" />
        <result column="farm_id" property="farmId" />
        <result column="ask_date" property="askDate" />
    </resultMap>
    <select id="getAct" resultType="com.huimv.eartag.entity.dto.EartagDataDto">

    SELECT SUM(act1) `value` ,DATE_FORMAT(  ask_date, '%m-%d' ) `time` FROM `eartag_data`
     ${ew.customSqlSegment}

    </select>

</mapper>
