package com.ruoyi.mall.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallAppSalesmanAchievementMapper;
import com.ruoyi.mall.domain.MallAppSalesmanAchievement;
import com.ruoyi.mall.service.IMallAppSalesmanAchievementService;

import javax.annotation.Resource;

/**
 * app-业务员业绩Service业务层处理
 *
 * @author ruoyi
 * @date 2024-07-04
 */
@Service
public class MallAppSalesmanAchievementServiceImpl implements IMallAppSalesmanAchievementService
{
    @Resource
    private MallAppSalesmanAchievementMapper mallAppSalesmanAchievementMapper;

    /**
     * 查询app-业务员业绩
     *
     * @param achievementId app-业务员业绩主键
     * @return app-业务员业绩
     */
    @Override
    public MallAppSalesmanAchievement selectMallAppSalesmanAchievementByAchievementId(Long achievementId)
    {
        return mallAppSalesmanAchievementMapper.selectMallAppSalesmanAchievementByAchievementId(achievementId);
    }

    /**
     * 查询app-业务员业绩列表
     *
     * @param mallAppSalesmanAchievement app-业务员业绩
     * @return app-业务员业绩
     */
    @Override
    public List<MallAppSalesmanAchievement> selectMallAppSalesmanAchievementList(MallAppSalesmanAchievement mallAppSalesmanAchievement)
    {
        return mallAppSalesmanAchievementMapper.selectMallAppSalesmanAchievementList(mallAppSalesmanAchievement);
    }

    /**
     * 新增app-业务员业绩
     *
     * @param mallAppSalesmanAchievement app-业务员业绩
     * @return 结果
     */
    @Override
    public int insertMallAppSalesmanAchievement(MallAppSalesmanAchievement mallAppSalesmanAchievement)
    {
        mallAppSalesmanAchievement.setCreateAt(DateUtils.getTime());
        mallAppSalesmanAchievement.setDelFlag("0");
        return mallAppSalesmanAchievementMapper.insertMallAppSalesmanAchievement(mallAppSalesmanAchievement);
    }

    /**
     * 修改app-业务员业绩
     *
     * @param mallAppSalesmanAchievement app-业务员业绩
     * @return 结果
     */
    @Override
    public int updateMallAppSalesmanAchievement(MallAppSalesmanAchievement mallAppSalesmanAchievement)
    {
        mallAppSalesmanAchievement.setUpdateAt(DateUtils.getTime());
        return mallAppSalesmanAchievementMapper.updateMallAppSalesmanAchievement(mallAppSalesmanAchievement);
    }

    /**
     * 批量删除app-业务员业绩
     *
     * @param achievementIds 需要删除的app-业务员业绩主键
     * @return 结果
     */
    @Override
    public int deleteMallAppSalesmanAchievementByAchievementIds(Long[] achievementIds)
    {
        return mallAppSalesmanAchievementMapper.deleteMallAppSalesmanAchievementByAchievementIds(achievementIds);
    }

    /**
     * 删除app-业务员业绩信息
     *
     * @param achievementId app-业务员业绩主键
     * @return 结果
     */
    @Override
    public int deleteMallAppSalesmanAchievementByAchievementId(Long achievementId)
    {
        return mallAppSalesmanAchievementMapper.deleteMallAppSalesmanAchievementByAchievementId(achievementId);
    }

    /**
     * 查询app-业务员业绩
     *
     * @param orderId app-订单主键ID
     * @return app-业务员业绩
     */
    @Override
    public MallAppSalesmanAchievement selectMallAppSalesmanAchievementByOrderId(Long orderId) {
        return mallAppSalesmanAchievementMapper.selectMallAppSalesmanAchievementByOrderId(orderId);
    }
}
