package com.jsowell.pile.service.impl;

import java.util.List;

import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.framework.web.domain.server.Sys;
import com.jsowell.pile.vo.base.StationSettingRelationVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jsowell.pile.mapper.StationSettingRelationMapper;
import com.jsowell.pile.domain.StationSettingRelation;
import com.jsowell.pile.service.IStationSettingRelationService;

/**
 * 站点、第三方推送平台配置对应Service业务层处理
 *
 * @author jsowell
 * @date 2023-06-06
 */
@Service
public class StationSettingRelationServiceImpl implements IStationSettingRelationService {
    @Autowired
    private StationSettingRelationMapper stationSettingRelationMapper;

    /**
     * 查询站点、第三方推送平台配置对应
     *
     * @param id 站点、第三方推送平台配置对应主键
     * @return 站点、第三方推送平台配置对应
     */
    @Override
    public StationSettingRelation selectStationSettingRelationById(Long id) {
        return stationSettingRelationMapper.selectStationSettingRelationById(id);
    }

    /**
     * 查询站点、第三方推送平台配置对应列表
     *
     * @param stationSettingRelation 站点、第三方推送平台配置对应
     * @return 站点、第三方推送平台配置对应
     */
    @Override
    public List<StationSettingRelation> selectStationSettingRelationList(StationSettingRelation stationSettingRelation) {
        return stationSettingRelationMapper.selectStationSettingRelationList(stationSettingRelation);
    }

    /**
     * 查询站点、第三方推送平台配置
     * @param stationSettingRelation
     * @return
     */
    @Override
    public StationSettingRelationVO selectRelationInfo(StationSettingRelation stationSettingRelation) {
        return stationSettingRelationMapper.selectRelationInfo(stationSettingRelation);
    }

    /**
     * 新增站点、第三方推送平台配置对应
     *
     * @param stationSettingRelation 站点、第三方推送平台配置对应
     * @return 结果
     */
    @Override
    public int insertStationSettingRelation(StationSettingRelation stationSettingRelation) {
        // stationSettingRelation.setCreateTime(DateUtils.getNowDate());
        stationSettingRelation.setCreateBy(SecurityUtils.getUsername());
        return stationSettingRelationMapper.insertStationSettingRelation(stationSettingRelation);
    }

    /**
     * 修改站点、第三方推送平台配置对应
     *
     * @param stationSettingRelation 站点、第三方推送平台配置对应
     * @return 结果
     */
    @Override
    public int updateStationSettingRelation(StationSettingRelation stationSettingRelation) {
        // stationSettingRelation.setUpdateTime(DateUtils.getNowDate());
        return stationSettingRelationMapper.updateStationSettingRelation(stationSettingRelation);
    }

    /**
     * 批量删除站点、第三方推送平台配置对应
     *
     * @param ids 需要删除的站点、第三方推送平台配置对应主键
     * @return 结果
     */
    @Override
    public int deleteStationSettingRelationByIds(Long[] ids) {
        return stationSettingRelationMapper.deleteStationSettingRelationByIds(ids);
    }

    /**
     * 删除站点、第三方推送平台配置对应信息
     *
     * @param id 站点、第三方推送平台配置对应主键
     * @return 结果
     */
    @Override
    public int deleteStationSettingRelationById(Long id) {
        return stationSettingRelationMapper.deleteStationSettingRelationById(id);
    }
}
