package com.mh.user.mapper; import com.mh.user.entity.AlarmInfoEntity; import com.mh.user.entity.PumpSetEntity; import org.apache.ibatis.annotations.*; @Mapper public interface PumpSetMapper { //插入记录 @Insert("insert into pump_set(building_id,pump_id,pump_name,temp_set,water_temp,start_time1,close_time1,start_time2,close_time2) values (" + "#{buildingId},#{pumpId},#{pumpName},#{tempSet},#{waterTemp},#{startTime1},#{closeTime1},#{startTime2},#{closeTime2})") void savePumpSet(PumpSetEntity pumpSetEntity); //修改记录 @Update("") void updatePumpSet(PumpSetEntity pumpSetEntity); //更新设定温度 @Update("update pump_set set temp_set=#{tempSet} where building_id = #{buildingId} and pump_id=#{pumpId}") void updatePumpSetTemp(@Param("tempSet") String tempSet,@Param("buildingId") String buildingId,@Param("pumpId") String pumpId); //查询记录数 @Select("select count(*) from pump_set where building_id=#{buildingId} and pump_id=#{pumpId}") int selectCount(@Param("buildingId") String buildingId,@Param("pumpId") String pumpId); //查询记录 @Results(id="rs", value = { @Result(column = "building_id",property = "buildingId" ), @Result(column = "pump_id", property = "pumpId"), @Result(column = "pump_name", property = "pumpName"), @Result(column = "temp_set", property = "tempSet"), @Result(column = "water_temp", property = "waterTemp"), @Result(column = "start_time1", property = "startTime1"), @Result(column = "close_time1", property = "closeTime1"), @Result(column = "start_time2", property = "startTime2"), @Result(column = "close_time2", property = "closeTime2") }) @Select("select * from Pump_Set where pump_id=#{pumpId} and building_id=#{buildingId}") PumpSetEntity queryPumpSet(@Param("pumpId") String pumpId,@Param("buildingId") String buildingId); //查询记录 @ResultMap("rs") @Select("select * from Pump_Set where building_id='001'") PumpSetEntity queryHandTime(); }