<?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.energy.manage.service.mappers.chartsdata.ChartsDataMapper">
    <resultMap id="resultMap" type="com.energy.manage.common.po.chartsdata.ChartsDataPo">
        <result column="active_power" property="activePower" jdbcType="DOUBLE"/>
        <result column="true_wind_direction" property="trueWindDirection" jdbcType="DOUBLE"/>
    </resultMap>
    <select id="queryData" resultType="com.energy.manage.common.po.chartsdata.ChartsDataPo">

        SELECT
            active_power AS activePower,
            true_wind_direction AS trueWindDirection
        FROM `WOF053600062-WOB00021_minute`
        limit #{startNum}, #{pageSize}
    </select>

    <select id="queryDataByTime" resultType="com.energy.manage.common.po.chartsdata.ChartsDataPo">
        SELECT
            active_power AS activePower,
            true_wind_direction AS trueWindDirection
        FROM `WOF053600062-WOB00021_minute`
        where time_stamp >= #{timeStamp}
        limit #{pageSize}
    </select>
    <select id="selectAllCount" resultType="java.lang.Integer">
        select count(*) from `WOF053600062-WOB00021_minute`
    </select>
</mapper>
