<?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.environ.eco.mapper.SysMonthWaterMapper">

    <select id="selecAllMonthWater" resultType="com.huimv.environ.eco.entity.SysMonthWater">

        SELECT
        id,ROUND(SUM(`increase_value`),2)'value' , create_time, room_id,month_water_id FROM `sys_month_water`
            ${ew.customSqlSegment}
              GROUP BY DATE_FORMAT(create_time,"%y-%m-%d %H")
                ORDER BY create_time ASC

    </select>


    <select id="listAllWaterAndPower" resultType="com.huimv.environ.eco.entity.dto.WaterAndPower">
          SELECT  ROUND(SUM(`increase_value`),2) water
        FROM   `sys_month_water`
        WHERE farm_id = #{farmId}
        AND  TO_DAYS(create_time) = TO_DAYS(NOW())


    </select>


</mapper>
