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

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

/**
 * 生乳检验记录Service业务层处理
 * * @author ruoyi
 * @date 2025-07-15
 */
@Service
public class NpRawMilkInspeServiceImpl implements INpRawMilkInspeService
{
    @Autowired
    private NpRawMilkInspeMapper npRawMilkInspeMapper;

    /**
     * 查询生乳检验记录
     * * @param id 生乳检验记录主键
     * @return 生乳检验记录
     */
    @Override
    public NpRawMilkInspe selectNpRawMilkInspeById(Long id)
    {
        return npRawMilkInspeMapper.selectNpRawMilkInspeById(id);
    }

    /**
     * 查询生乳检验记录列表
     * * @param npRawMilkInspe 生乳检验记录
     * @return 生乳检验记录
     */
    @Override
    @DataScope(deptAlias = "a", userAlias = "a")
    public List<NpRawMilkInspe> selectNpRawMilkInspeList(NpRawMilkInspe npRawMilkInspe)
    {
        return npRawMilkInspeMapper.selectNpRawMilkInspeList(npRawMilkInspe);
    }

    /**
     * 新增生乳检验记录
     * * @param npRawMilkInspe 生乳检验记录
     * @return 结果
     */
    @Override
    public int insertNpRawMilkInspe(NpRawMilkInspe npRawMilkInspe)
    {
        npRawMilkInspe.setCreateTime(DateUtils.getNowDate());
        return npRawMilkInspeMapper.insertNpRawMilkInspe(npRawMilkInspe);
    }

    /**
     * 修改生乳检验记录
     * * @param npRawMilkInspe 生乳检验记录
     * @return 结果
     */
    @Override
    public int updateNpRawMilkInspe(NpRawMilkInspe npRawMilkInspe)
    {
        return npRawMilkInspeMapper.updateNpRawMilkInspe(npRawMilkInspe);
    }

    /**
     * 批量删除生乳检验记录
     * * @param ids 需要删除的生乳检验记录主键
     * @return 结果
     */
    @Override
    public int deleteNpRawMilkInspeByIds(Long[] ids)
    {
        return npRawMilkInspeMapper.deleteNpRawMilkInspeByIds(ids);
    }

    /**
     * 删除生乳检验记录信息
     * * @param id 生乳检验记录主键
     * @return 结果
     */
    @Override
    public int deleteNpRawMilkInspeById(Long id)
    {
        return npRawMilkInspeMapper.deleteNpRawMilkInspeById(id);
    }
}