package com.flossom.system.service.impl;

import java.util.List;

import com.flossom.common.core.domain.entity.SiteInfoInstrument;
import com.flossom.common.core.mapper.SiteInfoInstrumentMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flossom.system.service.ISiteInfoInstrumentService;

/**
 * 站点仪器关联Service业务层处理
 *
 * @author flossom
 * @date 2024-01-08
 */
@Service
public class SiteInfoInstrumentServiceImpl implements ISiteInfoInstrumentService
{
    @Autowired
    private SiteInfoInstrumentMapper siteInfoInstrumentMapper;

    /**
     * 查询站点仪器关联
     *
     * @param id 站点仪器关联主键
     * @return 站点仪器关联
     */
    @Override
    public SiteInfoInstrument selectSiteInfoInstrumentById(Long id)
    {
        return siteInfoInstrumentMapper.selectSiteInfoInstrumentById(id);
    }

    /**
     * 查询站点仪器关联列表
     *
     * @param siteInfoInstrument 站点仪器关联
     * @return 站点仪器关联
     */
    @Override
    public List<SiteInfoInstrument> selectSiteInfoInstrumentList(SiteInfoInstrument siteInfoInstrument)
    {
        return siteInfoInstrumentMapper.selectSiteInfoInstrumentList(siteInfoInstrument);
    }

    /**
     * 新增站点仪器关联
     *
     * @param siteInfoInstrument 站点仪器关联
     * @return 结果
     */
    @Override
    public int insertSiteInfoInstrument(SiteInfoInstrument siteInfoInstrument)
    {
        siteInfoInstrument.setCreateTime(DateUtils.getNowDate());
        return siteInfoInstrumentMapper.insertSiteInfoInstrument(siteInfoInstrument);
    }

    /**
     * 修改站点仪器关联
     *
     * @param siteInfoInstrument 站点仪器关联
     * @return 结果
     */
    @Override
    public int updateSiteInfoInstrument(SiteInfoInstrument siteInfoInstrument)
    {
        siteInfoInstrument.setUpdateTime(DateUtils.getNowDate());
        return siteInfoInstrumentMapper.updateSiteInfoInstrument(siteInfoInstrument);
    }

    /**
     * 批量删除站点仪器关联
     *
     * @param ids 需要删除的站点仪器关联主键
     * @return 结果
     */
    @Override
    public int deleteSiteInfoInstrumentByIds(Long[] ids)
    {
        return siteInfoInstrumentMapper.deleteSiteInfoInstrumentByIds(ids);
    }

    /**
     * 删除站点仪器关联信息
     *
     * @param id 站点仪器关联主键
     * @return 结果
     */
    @Override
    public int deleteSiteInfoInstrumentById(Long id)
    {
        return siteInfoInstrumentMapper.deleteSiteInfoInstrumentById(id);
    }
}
