package com.ruoyi.app.service.impl;

import java.util.List;

import com.ruoyi.app.DTO.PorkOtherProduceDTO;
import com.ruoyi.app.model.request.ReqGetPorkOtherProduce;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.app.mapper.PorkOtherProduceMapper;
import com.ruoyi.app.model.PorkOtherProduce;
import com.ruoyi.app.service.IPorkOtherProduceService;

/**
 * 猪头生产记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-19
 */
@Service
public class PorkOtherProduceServiceImpl implements IPorkOtherProduceService 
{
    @Autowired
    private PorkOtherProduceMapper porkOtherProduceMapper;

    /**
     * 查询生产记录
     * 
     * @param id 生产记录主键
     * @return 生产记录
     */
    @Override
    public PorkOtherProduceDTO selectPorkOtherProduceById(Long id)
    {
        return porkOtherProduceMapper.selectPorkOtherProduceById(id);
    }

    /**
     * 查询生产记录列表
     * 
     * @param porkOtherProduce 生产记录
     * @return 生产记录
     */
    @Override
    public List<PorkOtherProduceDTO> selectPorkOtherProduceList(ReqGetPorkOtherProduce porkOtherProduce)
    {
        return porkOtherProduceMapper.selectPorkOtherProduceList(porkOtherProduce);
    }

    /**
     * 新增生产记录
     * 
     * @param porkOtherProduce 生产记录
     * @return 结果
     */
    @Override
    public int insertPorkOtherProduce(PorkOtherProduce porkOtherProduce)
    {
        porkOtherProduce.setCreateTime(DateUtils.getNowDate());
        return porkOtherProduceMapper.insertPorkOtherProduce(porkOtherProduce);
    }

    /**
     * 修改生产记录
     * 
     * @param porkOtherProduce 生产记录
     * @return 结果
     */
    @Override
    public int updatePorkOtherProduce(PorkOtherProduce porkOtherProduce)
    {
        porkOtherProduce.setUpdateTime(DateUtils.getNowDate());
        return porkOtherProduceMapper.updatePorkOtherProduce(porkOtherProduce);
    }

    /**
     * 批量删除猪头生产记录
     * 
     * @param ids 需要删除的生产记录主键
     * @return 结果
     */
    @Override
    public int deletePorkOtherProduceByIds(Long[] ids)
    {
        return porkOtherProduceMapper.deletePorkOtherProduceByIds(ids);
    }

    /**
     * 删除猪头生产记录信息
     * 
     * @param id 生产记录主键
     * @return 结果
     */
    @Override
    public int deletePorkOtherProduceById(Long id)
    {
        return porkOtherProduceMapper.deletePorkOtherProduceById(id);
    }
}
