<?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.gyee.wisdom.alarm.sharding.mapper.FeatureStatMapper">

    <select id="searchByCondition" parameterType="java.util.Map" resultType="com.gyee.wisdom.alarm.sharding.entity.FeatureStat">
        select * from  FEATURE_STAT a
        <where>
            1=1
            <if test="starttime !=null and endtime !=null">
                and statdate &gt;= #{starttime,jdbcType=DATE} and statdate &lt; #{endtime,jdbcType=DATE}
            </if>
            <if test="stationId !=null and stationId !=''">
                and a.stationid=#{stationId}
            </if>
        </where>
        order by a.id  desc
    </select>
    <select id="searchAll" parameterType="java.util.Map" resultType="com.gyee.wisdom.alarm.sharding.entity.FeatureStat">
        select * from  FEATURE_STAT a   order by a.id  desc
    </select>

    <select id="searchByCondition2" resultType="com.gyee.wisdom.alarm.sharding.entity.FeatureStat">

        select * from  FEATURE_STAT a
        <where>
            and statdate &gt;= #{currentDate,jdbcType=DATE}
            <if test="stationId !=null and stationId !=''">
                and a.stationid=#{stationId}
            </if>
        </where>
        order by a.id  desc

    </select>


</mapper>
