package com.hdkj.lt.si.service.setting.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdkj.lt.core.bizms.modle.po.FhzgSwitchProtectionSettings;
import com.hdkj.lt.modle.dto.setting.DeviceSettingDTO;
import com.hdkj.lt.modle.vo.setting.DeviceSettingVO;
import com.hdkj.lt.si.dao.FhzgSwitchProtectionSettingsMapper;
import com.hdkj.lt.si.service.setting.FhzgSwitchProtectionSettingsTyptService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangtj
 * @description 针对表【fhzg_switch_protection_settings(开关设备保护定值表)】的数据库操作Service实现
 * @createDate 2025-07-02 22:21:15
 */
@Service
@RequiredArgsConstructor
public class FhzgSwitchProtectionSettingsServiceImpl extends ServiceImpl<FhzgSwitchProtectionSettingsMapper, FhzgSwitchProtectionSettings>
        implements FhzgSwitchProtectionSettingsTyptService {

    private final FhzgSwitchProtectionSettingsMapper fhzgSwitchProtectionSettingsMapper;

    @Override
    public List<DeviceSettingVO> getDeviceSetting(DeviceSettingDTO queryDTO) {
        List<DeviceSettingVO> list = new ArrayList<>();
        if (!CollectionUtils.sizeIsEmpty(queryDTO.getSwitchPsrIds()) || !CollectionUtils.sizeIsEmpty(queryDTO.getLinePsrIds())) {
            if (!CollectionUtils.sizeIsEmpty(queryDTO.getSwitchPsrIds())) {
                queryDTO.setLinePsrIds(null);
            }
            list = fhzgSwitchProtectionSettingsMapper.getSetting(queryDTO);
        }
        return list;
    }
}




