package com.mirs.biz.service.impl;

import java.util.List;

import com.mirs.biz.dto.IndexSearchDTO;
import com.mirs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mirs.biz.mapper.SampleMapper;
import com.mirs.biz.domain.Sample;
import com.mirs.biz.service.ISampleService;

/**
 * 样片管理Service业务层处理
 * 
 * @author kk
 * @date 2025-04-27
 */
@Service
public class SampleServiceImpl implements ISampleService 
{
    @Autowired
    private SampleMapper sampleMapper;

    /**
     * 查询样片管理
     * 
     * @param id 样片管理主键
     * @return 样片管理
     */
    @Override
    public Sample selectSampleById(Long id)
    {
        return sampleMapper.selectSampleById(id);
    }

    /**
     * 查询样片管理列表
     * 
     * @param sample 样片管理
     * @return 样片管理
     */
    @Override
    public List<Sample> selectSampleList(Sample sample)
    {
        return sampleMapper.selectSampleList(sample);
    }

    /**
     * 新增样片管理
     * 
     * @param sample 样片管理
     * @return 结果
     */
    @Override
    public int insertSample(Sample sample)
    {
        sample.setCreateTime(DateUtils.getNowDate());
        return sampleMapper.insertSample(sample);
    }

    /**
     * 修改样片管理
     * 
     * @param sample 样片管理
     * @return 结果
     */
    @Override
    public int updateSample(Sample sample)
    {
        sample.setUpdateTime(DateUtils.getNowDate());
        return sampleMapper.updateSample(sample);
    }

    /**
     * 批量删除样片管理
     * 
     * @param ids 需要删除的样片管理主键
     * @return 结果
     */
    @Override
    public int deleteSampleByIds(Long[] ids)
    {
        return sampleMapper.deleteSampleByIds(ids);
    }

    /**
     * 删除样片管理信息
     * 
     * @param id 样片管理主键
     * @return 结果
     */
    @Override
    public int deleteSampleById(Long id)
    {
        return sampleMapper.deleteSampleById(id);
    }

    @Override
    public Sample getOne(Sample sample) {
        return sampleMapper.getOne(sample);
    }

    @Override
    public List getSampleType(String dataType) {
        return sampleMapper.getSampleType(dataType);
    }

    @Override
    public List getSampleModel(IndexSearchDTO dto) {
        return sampleMapper.getSampleModel(dto);
    }
}
