package com.yfd.platform.modules.auxcontrol.mapper;

import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 变电站-辅控设备-信号 Mapper 接口
 * </p>
 *
 * @author zhengsl
 * @since 2025-04-23
 */
public interface DeviceSignalMapper extends BaseMapper<DeviceSignal> {

    DeviceSignal selectOneDeviceSignal(String slaveIp, String type, String address);
    Map<String,Object> selectDeviceSignalMap(String slaveIp, String type, String address);
    List<Map<String, Object>> getDeviceSignalMaps(String stationCode, String signalName);

    List<DeviceSignal> selectDeviceSignalByIp(String ip);
    @Update("UPDATE fk_device_signal SET yc_value = #{value}, lastmodifydate = #{datetime} WHERE yc_addr = #{node_addr}")
    boolean updateDeviceSignalValue_yc(String node_addr,String value,String datetime);
    @Update("UPDATE fk_device_signal SET yx_value = #{value}, lastmodifydate = #{datetime} WHERE yx_addr = #{node_addr}")
    boolean updateDeviceSignalValue_yx(String node_addr,String value,String datetime);

    Map<String, Object> querySignalDataById(String signalId);

}
