package com.gyee.alarm.mapper.auto;

import com.gyee.alarm.model.auto.ProBasicFeatureStat;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gyee.alarm.model.vo.AlarmVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 设备功能统计 Mapper 接口
 * </p>
 *
 * @author shilin
 * @since 2023-08-14
 */
public interface ProBasicFeatureStatMapper extends BaseMapper<ProBasicFeatureStat> {


    @Select({"<script>",
            "select * from pro_basic_feature_stat " ,
            "<where>" ,
            "<if test='begin != null &amp;&amp; end != null '>",
            " stat_Date &gt;= #{begin}",
            "and stat_Date &lt;= #{end}",
            "</if>",
            "<if test='stationId != null'>",
            "and station_id = #{stationId}",
            "</if>",
            "<if test='wtId != null'>",
            "and wt_id = #{wtId}",
            "</if>",
            "</where>",
            " order by wt_id  ",
            "</script>"})
    List<ProBasicFeatureStat> searchByCondition(@Param("begin") Date begin, @Param("end")Date end, @Param("stationId")String stationId, @Param("wtId")String wtId);

}
