中央热水项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.9 KiB

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("<script>" +
" update pump_set set " +
" <if test='buildingId!=null'> building_id = #{buildingId} </if>" +
" <if test='pumpName!=null'> , pump_name = #{pumpName} </if>" +
" <if test='tempSet!=null'> , temp_set = #{tempSet} </if>" +
" <if test='waterTemp!=null'> , water_temp = #{waterTemp} </if>" +
" <if test='startTime1!=null'> , start_time1 = #{startTime1} </if>" +
" <if test='closeTime1!=null'> , close_time1 = #{closeTime1} </if>" +
" <if test='startTime2!=null'> , start_time2 = #{startTime2} </if>" +
" <if test='closeTime2!=null'> , close_time2 = #{closeTime2} </if>" +
" where building_id = #{buildingId} and pump_id=#{pumpId}" +
"</script>")
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();
}