package com.flossom.system.service.impl;

import com.flossom.common.core.domain.entity.WxInstrumentNameRelate;
import com.flossom.common.core.mapper.WxInstrumentNameRelateMapper;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.system.service.IWxInstrumentNameRelateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 仪器关联正品控产品名Service业务层处理
 *
 * @author flossom
 * @date 2024-01-15
 */
@Service
public class WxInstrumentNameRelateServiceImpl implements IWxInstrumentNameRelateService {

    @Autowired
    private WxInstrumentNameRelateMapper wxInstrumentNameRelateMapper;

    /**
     * 查询仪器关联正品控产品名
     *
     * @param id 仪器关联正品控产品名主键
     * @return 仪器关联正品控产品名
     */
    @Override
    public WxInstrumentNameRelate selectWxInstrumentNameRelateById(Long id) {
        return wxInstrumentNameRelateMapper.selectWxInstrumentNameRelateById(id);
    }

    /**
     * 查询仪器关联正品控产品名列表
     *
     * @param wxInstrumentNameRelate 仪器关联正品控产品名
     * @return 仪器关联正品控产品名
     */
    @Override
    public List<WxInstrumentNameRelate> selectWxInstrumentNameRelateList(WxInstrumentNameRelate wxInstrumentNameRelate) {
        return wxInstrumentNameRelateMapper.selectWxInstrumentNameRelateList(wxInstrumentNameRelate);
    }

    /**
     * 新增仪器关联正品控产品名
     *
     * @param wxInstrumentNameRelate 仪器关联正品控产品名
     * @return 结果
     */
    @Override
    public int insertWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate) {
        wxInstrumentNameRelate.setCreateTime(DateUtils.getNowDate());
        return wxInstrumentNameRelateMapper.insertWxInstrumentNameRelate(wxInstrumentNameRelate);
    }

    /**
     * 修改仪器关联正品控产品名
     *
     * @param wxInstrumentNameRelate 仪器关联正品控产品名
     * @return 结果
     */
    @Override
    public int updateWxInstrumentNameRelate(WxInstrumentNameRelate wxInstrumentNameRelate) {
        return wxInstrumentNameRelateMapper.updateWxInstrumentNameRelate(wxInstrumentNameRelate);
    }

    /**
     * 批量删除仪器关联正品控产品名
     *
     * @param ids 需要删除的仪器关联正品控产品名主键
     * @return 结果
     */
    @Override
    public int deleteWxInstrumentNameRelateByIds(Long[] ids) {
        return wxInstrumentNameRelateMapper.deleteWxInstrumentNameRelateByIds(ids);
    }

    /**
     * 删除仪器关联正品控产品名信息
     *
     * @param id 仪器关联正品控产品名主键
     * @return 结果
     */
    @Override
    public int deleteWxInstrumentNameRelateById(Long id) {
        return wxInstrumentNameRelateMapper.deleteWxInstrumentNameRelateById(id);
    }
}
