package com.benyun.project.third.longxiang.service.impl;

import java.util.List;
import com.benyun.common.utils.DateUtils;
import com.benyun.project.third.longxiang.domain.BySynMaterialMsg;
import com.benyun.project.third.longxiang.mapper.BySynMaterialMsgMapper;
import com.benyun.project.third.longxiang.service.IBySynMaterialMsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.benyun.common.utils.text.Convert;

/**
 * 同步物料回执信息Service业务层处理
 *
 * @author benyun
 * @date 2023-12-08
 */
@Service
public class BySynMaterialMsgServiceImpl implements IBySynMaterialMsgService
{
    @Autowired
    private BySynMaterialMsgMapper bySynMaterialMsgMapper;

    /**
     * 查询同步物料回执信息
     *
     * @param id 同步物料回执信息主键
     * @return 同步物料回执信息
     */
    @Override
    public BySynMaterialMsg selectBySynMaterialMsgById(Long id)
    {
        return bySynMaterialMsgMapper.selectBySynMaterialMsgById(id);
    }

    /**
     * 查询同步物料回执信息列表
     *
     * @param bySynMaterialMsg 同步物料回执信息
     * @return 同步物料回执信息
     */
    @Override
    public List<BySynMaterialMsg> selectBySynMaterialMsgList(BySynMaterialMsg bySynMaterialMsg)
    {
        return bySynMaterialMsgMapper.selectBySynMaterialMsgList(bySynMaterialMsg);
    }

    /**
     * 新增同步物料回执信息
     *
     * @param bySynMaterialMsg 同步物料回执信息
     * @return 结果
     */
    @Override
    public int insertBySynMaterialMsg(BySynMaterialMsg bySynMaterialMsg)
    {
        bySynMaterialMsg.setCreateTime(DateUtils.getNowDate());
        return bySynMaterialMsgMapper.insertBySynMaterialMsg(bySynMaterialMsg);
    }

    /**
     * 修改同步物料回执信息
     *
     * @param bySynMaterialMsg 同步物料回执信息
     * @return 结果
     */
    @Override
    public int updateBySynMaterialMsg(BySynMaterialMsg bySynMaterialMsg)
    {
        return bySynMaterialMsgMapper.updateBySynMaterialMsg(bySynMaterialMsg);
    }

    /**
     * 批量删除同步物料回执信息
     *
     * @param ids 需要删除的同步物料回执信息主键
     * @return 结果
     */
    @Override
    public int deleteBySynMaterialMsgByIds(String ids)
    {
        return bySynMaterialMsgMapper.deleteBySynMaterialMsgByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除同步物料回执信息信息
     *
     * @param id 同步物料回执信息主键
     * @return 结果
     */
    @Override
    public int deleteBySynMaterialMsgById(Long id)
    {
        return bySynMaterialMsgMapper.deleteBySynMaterialMsgById(id);
    }
}
