package com.ho.business.service.impl;

import com.ho.business.entity.HomeConfig;
import com.ho.business.entity.Station;
import com.ho.business.mapper.HomeConfigMapper;
import com.ho.business.service.HomeConfigService;
import com.ho.business.vo.req.HomeConfigAddReqVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author gyan
 * @desc: TODO
 * @DateTime: 2023/11/16 15:05
 */
@Service
@Slf4j
public class HomeConfigServiceImpl implements HomeConfigService {
    @Autowired
    HomeConfigMapper homeConfigMapper;

    @Override
    public void inserthomeConfig(HomeConfigAddReqVO vo) {
         homeConfigMapper.delete(vo.getStationId());
         homeConfigMapper.insertSelective(vo);
    }

    @Override
    public List<HomeConfig> selectByStationId(Integer stationId) {
        List<HomeConfig> list =homeConfigMapper.selectByStationId(stationId);
        return list;
    }
}
