package com.jiayue.biz.mapper; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.jiayue.biz.domain.ProphaseAnemometryData; import com.jiayue.biz.domain.ProphaseAnemometryDataOrg; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.sql.Timestamp; import java.util.List; @DS("tdengine") public interface ProphaseAnemometryDataOrgMapper extends BaseMapper { @Insert("INSERT INTO anemometry_org_${equipmentId}_${layerHeight} USING prophase_anemometry_data_org TAGS(#{equipmentId}, #{layerHeight}) VALUES(#{ts}, #{wsInst}, #{wsMax}, #{wsMin}, #{wsAve}, #{wsGust}, #{wsSta}, #{wdInst}, #{wdMax}, #{wdMin}, #{wdAve}, #{wdSta})") int insertOneWithNew(ProphaseAnemometryData one); //所有层高风速风向平均值 @Select("SELECT t1.ts,t1.ws_ave,t1.wd_ave,t1.layer_height FROM prophase_anemometry_data_org t1 where t1.equipment_id = #{equipmentId} and t1.ts >= #{startTime} and t1.ts <= #{endTime}") List selectAve(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime); @Select("SELECT * FROM prophase_anemometry_data_org t1 where t1.equipment_id = #{equipmentId} and t1.ts >= #{startTime} and t1.ts <= #{endTime}") List selectAll(@Param("equipmentId") String equipmentId, @Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime); }