package com.yanzhu.jh.project.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.jh.project.mapper.SurProjectCheckDetectionMapper;
import com.yanzhu.jh.project.domain.SurProjectCheckDetection;
import com.yanzhu.jh.project.service.ISurProjectCheckDetectionService;
import com.ruoyi.common.utils.SecurityUtils;
/**
 * 材料送检Service业务层处理
 * 
 * @author JiangYuQi
 * @date 2023-08-26
 */
@Service
public class SurProjectCheckDetectionServiceImpl implements ISurProjectCheckDetectionService 
{
    @Autowired
    private SurProjectCheckDetectionMapper surProjectCheckDetectionMapper;

    /**
     * 查询材料送检
     * 
     * @param id 材料送检主键
     * @return 材料送检
     */
    @Override
    public SurProjectCheckDetection selectSurProjectCheckDetectionById(Long id)
    {
        return surProjectCheckDetectionMapper.selectSurProjectCheckDetectionById(id);
    }

    /**
     * 查询材料送检列表
     * 
     * @param surProjectCheckDetection 材料送检
     * @return 材料送检
     */
    @Override
    public List<SurProjectCheckDetection> selectSurProjectCheckDetectionList(SurProjectCheckDetection surProjectCheckDetection)
    {
        return surProjectCheckDetectionMapper.selectSurProjectCheckDetectionList(surProjectCheckDetection);
    }

    /**
     * 新增材料送检
     * 
     * @param surProjectCheckDetection 材料送检
     * @return 结果
     */
    @Override
    public int insertSurProjectCheckDetection(SurProjectCheckDetection surProjectCheckDetection)
    {
        surProjectCheckDetection.setCreateBy(SecurityUtils.getUsername());
        surProjectCheckDetection.setCreateTime(DateUtils.getNowDate());
        return surProjectCheckDetectionMapper.insertSurProjectCheckDetection(surProjectCheckDetection);
    }

    /**
     * 修改材料送检
     * 
     * @param surProjectCheckDetection 材料送检
     * @return 结果
     */
    @Override
    public int updateSurProjectCheckDetection(SurProjectCheckDetection surProjectCheckDetection)
    {
        surProjectCheckDetection.setUpdateBy(SecurityUtils.getUsername());
        surProjectCheckDetection.setUpdateTime(DateUtils.getNowDate());
        return surProjectCheckDetectionMapper.updateSurProjectCheckDetection(surProjectCheckDetection);
    }

    /**
     * 批量删除材料送检
     * 
     * @param ids 需要删除的材料送检主键
     * @return 结果
     */
    @Override
    public int deleteSurProjectCheckDetectionByIds(Long[] ids)
    {
        return surProjectCheckDetectionMapper.deleteSurProjectCheckDetectionByIds(ids);
    }

    /**
     * 删除材料送检信息
     * 
     * @param id 材料送检主键
     * @return 结果
     */
    @Override
    public int deleteSurProjectCheckDetectionById(Long id)
    {
        return surProjectCheckDetectionMapper.deleteSurProjectCheckDetectionById(id);
    }

    @Override
    public List<SurProjectCheckDetection> groupByCheckType(SurProjectCheckDetection where) {
        return surProjectCheckDetectionMapper.groupByCheckType(where);
    }
}
