package com.fs.store.service.impl;

import java.util.List;
import com.fs.common.utils.DateUtils;
import com.fs.store.param.FsUsePromoterApplyParam;
import com.fs.store.vo.FsUserPromoterApplyVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.store.mapper.FsUserPromoterApplyMapper;
import com.fs.store.domain.FsUserPromoterApply;
import com.fs.store.service.IFsUserPromoterApplyService;

/**
 * 推广员申请Service业务层处理
 * 
 * @author fs
 * @date 2023-02-28
 */
@Service
public class FsUserPromoterApplyServiceImpl implements IFsUserPromoterApplyService 
{
    @Autowired
    private FsUserPromoterApplyMapper fsUserPromoterApplyMapper;

    /**
     * 查询推广员申请
     * 
     * @param applyId 推广员申请ID
     * @return 推广员申请
     */
    @Override
    public FsUserPromoterApply selectFsUserPromoterApplyById(Long applyId)
    {
        return fsUserPromoterApplyMapper.selectFsUserPromoterApplyById(applyId);
    }

    /**
     * 查询推广员申请列表
     * 
     * @param fsUserPromoterApply 推广员申请
     * @return 推广员申请
     */
    @Override
    public List<FsUserPromoterApply> selectFsUserPromoterApplyList(FsUserPromoterApply fsUserPromoterApply)
    {
        return fsUserPromoterApplyMapper.selectFsUserPromoterApplyList(fsUserPromoterApply);
    }

    /**
     * 新增推广员申请
     * 
     * @param fsUserPromoterApply 推广员申请
     * @return 结果
     */
    @Override
    public int insertFsUserPromoterApply(FsUserPromoterApply fsUserPromoterApply)
    {
        fsUserPromoterApply.setCreateTime(DateUtils.getNowDate());
        return fsUserPromoterApplyMapper.insertFsUserPromoterApply(fsUserPromoterApply);
    }

    /**
     * 修改推广员申请
     * 
     * @param fsUserPromoterApply 推广员申请
     * @return 结果
     */
    @Override
    public int updateFsUserPromoterApply(FsUserPromoterApply fsUserPromoterApply)
    {
        return fsUserPromoterApplyMapper.updateFsUserPromoterApply(fsUserPromoterApply);
    }

    /**
     * 批量删除推广员申请
     * 
     * @param applyIds 需要删除的推广员申请ID
     * @return 结果
     */
    @Override
    public int deleteFsUserPromoterApplyByIds(Long[] applyIds)
    {
        return fsUserPromoterApplyMapper.deleteFsUserPromoterApplyByIds(applyIds);
    }

    /**
     * 删除推广员申请信息
     * 
     * @param applyId 推广员申请ID
     * @return 结果
     */
    @Override
    public int deleteFsUserPromoterApplyById(Long applyId)
    {
        return fsUserPromoterApplyMapper.deleteFsUserPromoterApplyById(applyId);
    }

    @Override
    public FsUserPromoterApply selectFsUserPromoterApplyByUserId(long userId) {
        return fsUserPromoterApplyMapper.selectFsUserPromoterApplyByUserId(userId);
    }

    @Override
    public List<FsUserPromoterApplyVO> selectFsUserPromoterApplyListVO(FsUsePromoterApplyParam fsUserPromoterApply) {
        return fsUserPromoterApplyMapper.selectFsUserPromoterApplyListVO(fsUserPromoterApply);
    }
}
