package com.zhyc.module.dairyProducts.service.impl;

import java.util.List;
import com.zhyc.common.utils.DateUtils;
import com.zhyc.common.annotation.DataScope;
import com.zhyc.module.dairyProducts.domain.NpYogurtInsp;
import com.zhyc.module.dairyProducts.mapper.NpYogurtInspMapper;
import com.zhyc.module.dairyProducts.service.INpYogurtInspService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 酸奶生产，成品检疫记录Service业务层处理
 * * @author ruoyi
 * @date 2025-07-17
 */
@Service
public class NpYogurtInspServiceImpl implements INpYogurtInspService
{
    @Autowired
    private NpYogurtInspMapper npYogurtInspMapper;

    /**
     * 查询酸奶生产，成品检疫记录
     * * @param id 酸奶生产，成品检疫记录主键
     * @return 酸奶生产，成品检疫记录
     */
    @Override
    public NpYogurtInsp selectNpYogurtInspById(Long id)
    {
        return npYogurtInspMapper.selectNpYogurtInspById(id);
    }

    /**
     * 查询酸奶生产，成品检疫记录列表
     * * @param npYogurtInsp 酸奶生产，成品检疫记录
     * @return 酸奶生产，成品检疫记录
     */
    @Override
    @DataScope(deptAlias = "a", userAlias = "a")
    public List<NpYogurtInsp> selectNpYogurtInspList(NpYogurtInsp npYogurtInsp)
    {
        return npYogurtInspMapper.selectNpYogurtInspList(npYogurtInsp);
    }

    /**
     * 新增酸奶生产，成品检疫记录
     * * @param npYogurtInsp 酸奶生产，成品检疫记录
     * @return 结果
     */
    @Override
    public int insertNpYogurtInsp(NpYogurtInsp npYogurtInsp)
    {
        npYogurtInsp.setCreateTime(DateUtils.getNowDate());
        return npYogurtInspMapper.insertNpYogurtInsp(npYogurtInsp);
    }

    /**
     * 修改酸奶生产，成品检疫记录
     * * @param npYogurtInsp 酸奶生产，成品检疫记录
     * @return 结果
     */
    @Override
    public int updateNpYogurtInsp(NpYogurtInsp npYogurtInsp)
    {
        return npYogurtInspMapper.updateNpYogurtInsp(npYogurtInsp);
    }

    /**
     * 批量删除酸奶生产，成品检疫记录
     * * @param ids 需要删除的酸奶生产，成品检疫记录主键
     * @return 结果
     */
    @Override
    public int deleteNpYogurtInspByIds(Long[] ids)
    {
        return npYogurtInspMapper.deleteNpYogurtInspByIds(ids);
    }

    /**
     * 删除酸奶生产，成品检疫记录信息
     * * @param id 酸奶生产，成品检疫记录主键
     * @return 结果
     */
    @Override
    public int deleteNpYogurtInspById(Long id)
    {
        return npYogurtInspMapper.deleteNpYogurtInspById(id);
    }
}