package com.ruoyi.system.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.system.mapper.SettledMerchantsMapper;
import com.ruoyi.system.domain.SettledMerchants;
import com.ruoyi.system.service.ISettledMerchantsService;

/**
 * 入驻商家Service业务层处理
 * 
 * @author boman
 * @date 2022-06-10
 */
@Service
public class SettledMerchantsServiceImpl implements ISettledMerchantsService 
{
    @Autowired
    private SettledMerchantsMapper settledMerchantsMapper;

    /**
     * 查询入驻商家
     * 
     * @param businessId 入驻商家主键
     * @return 入驻商家
     */
    @Override
    public SettledMerchants selectSettledMerchantsByBusinessId(Long businessId)
    {
        return settledMerchantsMapper.selectSettledMerchantsByBusinessId(businessId);
    }

    /**
     * 根据政策类别获取入驻商家详细信息
     * @param menuId
     * @return
     */
    @Override
    public List<SettledMerchants> selectSettledMerchantsByMenuId(Long menuId) {
        return settledMerchantsMapper.selectSettledMerchantsByMenuId(menuId);
    }

    /**
     * 查询入驻商家列表
     * 
     * @param settledMerchants 入驻商家
     * @return 入驻商家
     */
    @Override
    public List<SettledMerchants> selectSettledMerchantsList(SettledMerchants settledMerchants)
    {
        return settledMerchantsMapper.selectSettledMerchantsList(settledMerchants);
    }

    /**
     * 新增入驻商家
     * 
     * @param settledMerchants 入驻商家
     * @return 结果
     */
    @Override
    public int insertSettledMerchants(SettledMerchants settledMerchants)
    {
        settledMerchants.setCreateTime(DateUtils.getNowDate());
        return settledMerchantsMapper.insertSettledMerchants(settledMerchants);
    }

    /**
     * 修改入驻商家
     * 
     * @param settledMerchants 入驻商家
     * @return 结果
     */
    @Override
    public int updateSettledMerchants(SettledMerchants settledMerchants)
    {
        settledMerchants.setUpdateTime(DateUtils.getNowDate());
        return settledMerchantsMapper.updateSettledMerchants(settledMerchants);
    }

    /**
     * 批量删除入驻商家
     * 
     * @param businessIds 需要删除的入驻商家主键
     * @return 结果
     */
    @Override
    public int deleteSettledMerchantsByBusinessIds(Long[] businessIds)
    {
        return settledMerchantsMapper.deleteSettledMerchantsByBusinessIds(businessIds);
    }

    /**
     * 删除入驻商家信息
     * 
     * @param businessId 入驻商家主键
     * @return 结果
     */
    @Override
    public int deleteSettledMerchantsByBusinessId(Long businessId)
    {
        return settledMerchantsMapper.deleteSettledMerchantsByBusinessId(businessId);
    }
}
