package com.gemho.meizhou.dao;


import com.gemho.meizhou.model.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

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

@Mapper
public interface UploadCloudDao {

    @Select("select * from tab_sensor where  mark like #{name}")
    List<TabSensor> findSensorDataByKind(String name);

    @Select("select * from tab_sensor where  name like '%'||#{name}||'%'")
    List<TabSensor> findbmwySensorDataByKind(String name);

    @Select("select * from tab_jiangyuliang where sensorname = #{sensorname} and jctime >=#{start} and jctime<#{end} order by id desc limit 1 offset 0  ")
    TabJiangyuliang findJylData(String sensorname, Date start, Date end);

    @Select("select * from tab_gantanweiyi where gantanid = #{sensorname} and jctime >=#{start} and jctime<#{end}  order by id desc limit 1 offset 0  ")
    TabGantanweiyi findGtData(String sensorname, Date start, Date end);

    @Select("select * from tab_gantan1value where gantanid = #{sensorname} and jctime >=#{start} and jctime<#{end}  order by id desc limit 1 offset 0  ")
    TabGantanweiyi findGt1Data(String sensorname, Date start, Date end);

    @Select("select * from tab_kushuiwei where sensorname = #{sensorname} and jctime >=#{start} and jctime<#{end}  order by id desc limit 1 offset 0  ")
    TabKushuiwei findKswData(String sensorname, Date start, Date end);

    @Select("select * from tab_jinrunxian where sensorname = #{sensorname} and jctime >=#{start} and jctime<#{end} order by id desc limit 1 offset 0  ")
    TabJinrunxian findJrxData(String sensorname, Date start, Date end);

    @Select("select * from tab_batidibiaoweiyi where sensorname = #{sensorname} and jctime >=#{start} and jctime<#{end}  order by id desc limit 1 offset 0  ")
    TabBatidibiaoweiyi findBmwyData(String sensorname, Date start, Date end);

    @Select("select * from tab_neibuchenjiang where sensorname = #{sensorname} and jctime >=#{start} and jctime<#{end}  order by id desc limit 1 offset 0  ")
    TabNeibuchenjiang findNbcjData(String sensorname, Date start, Date end);

    @Select("select * from tab_shuipingweiyi where sensorname = #{sensorname} and jctime >=#{start} and jctime<#{end}  order by id desc limit 1 offset 0  ")
    TabShuipingweiyi findNbspData(String sensorname, Date start, Date end);

}
