package com.shzg.project.unique.service.impl;

import java.util.List;
import com.shzg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shzg.project.unique.mapper.WornUniqueCodeMaterialMapper;
import com.shzg.project.unique.domain.WornUniqueCodeMaterial;
import com.shzg.project.unique.service.IWornUniqueCodeMaterialService;

/**
 * 唯一码物料信息Service业务层处理
 * 
 * @author shzg
 * @date 2026-03-17
 */
@Service
public class WornUniqueCodeMaterialServiceImpl implements IWornUniqueCodeMaterialService 
{
    @Autowired
    private WornUniqueCodeMaterialMapper wornUniqueCodeMaterialMapper;

    /**
     * 查询唯一码物料信息
     * 
     * @param id 唯一码物料信息主键
     * @return 唯一码物料信息
     */
    @Override
    public WornUniqueCodeMaterial selectWornUniqueCodeMaterialById(Long id)
    {
        return wornUniqueCodeMaterialMapper.selectWornUniqueCodeMaterialById(id);
    }

    /**
     * 查询唯一码物料信息列表
     * 
     * @param wornUniqueCodeMaterial 唯一码物料信息
     * @return 唯一码物料信息
     */
    @Override
    public List<WornUniqueCodeMaterial> selectWornUniqueCodeMaterialList(WornUniqueCodeMaterial wornUniqueCodeMaterial)
    {
        return wornUniqueCodeMaterialMapper.selectWornUniqueCodeMaterialList(wornUniqueCodeMaterial);
    }

    /**
     * 新增唯一码物料信息
     * 
     * @param wornUniqueCodeMaterial 唯一码物料信息
     * @return 结果
     */
    @Override
    public int insertWornUniqueCodeMaterial(WornUniqueCodeMaterial wornUniqueCodeMaterial)
    {
        wornUniqueCodeMaterial.setCreateTime(DateUtils.getNowDate());
        return wornUniqueCodeMaterialMapper.insertWornUniqueCodeMaterial(wornUniqueCodeMaterial);
    }

    /**
     * 修改唯一码物料信息
     * 
     * @param wornUniqueCodeMaterial 唯一码物料信息
     * @return 结果
     */
    @Override
    public int updateWornUniqueCodeMaterial(WornUniqueCodeMaterial wornUniqueCodeMaterial)
    {
        wornUniqueCodeMaterial.setUpdateTime(DateUtils.getNowDate());
        return wornUniqueCodeMaterialMapper.updateWornUniqueCodeMaterial(wornUniqueCodeMaterial);
    }

    /**
     * 批量删除唯一码物料信息
     * 
     * @param ids 需要删除的唯一码物料信息主键
     * @return 结果
     */
    @Override
    public int deleteWornUniqueCodeMaterialByIds(Long[] ids)
    {
        return wornUniqueCodeMaterialMapper.deleteWornUniqueCodeMaterialByIds(ids);
    }

    /**
     * 删除唯一码物料信息信息
     * 
     * @param id 唯一码物料信息主键
     * @return 结果
     */
    @Override
    public int deleteWornUniqueCodeMaterialById(Long id)
    {
        return wornUniqueCodeMaterialMapper.deleteWornUniqueCodeMaterialById(id);
    }
}
