package com.ruoyi.business.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.business.mapper.TbUserCompanyStoreMapper;
import com.ruoyi.business.domain.TbUserCompanyStore;
import com.ruoyi.business.service.ITbUserCompanyStoreService;
import com.ruoyi.common.core.text.Convert;

/**
 * 我收藏的企业Service业务层处理
 * 
 * @author xiatao
 * @date 2022-01-18
 */
@Service
public class TbUserCompanyStoreServiceImpl implements ITbUserCompanyStoreService 
{
    @Autowired
    private TbUserCompanyStoreMapper tbUserCompanyStoreMapper;

    /**
     * 查询我收藏的企业
     * 
     * @param userCompanyId 我收藏的企业主键
     * @return 我收藏的企业
     */
    @Override
    public TbUserCompanyStore selectTbUserCompanyStoreByUserCompanyId(Long userCompanyId)
    {
        return tbUserCompanyStoreMapper.selectTbUserCompanyStoreByUserCompanyId(userCompanyId);
    }

    /**
     * 查询我收藏的企业列表
     * 
     * @param tbUserCompanyStore 我收藏的企业
     * @return 我收藏的企业
     */
    @Override
    public List<TbUserCompanyStore> selectTbUserCompanyStoreList(TbUserCompanyStore tbUserCompanyStore)
    {
        return tbUserCompanyStoreMapper.selectTbUserCompanyStoreList(tbUserCompanyStore);
    }

    /**
     * 新增我收藏的企业
     * 
     * @param tbUserCompanyStore 我收藏的企业
     * @return 结果
     */
    @Override
    public int insertTbUserCompanyStore(TbUserCompanyStore tbUserCompanyStore)
    {
        tbUserCompanyStore.setCreateTime(DateUtils.getNowDate());
        return tbUserCompanyStoreMapper.insertTbUserCompanyStore(tbUserCompanyStore);
    }

    /**
     * 修改我收藏的企业
     * 
     * @param tbUserCompanyStore 我收藏的企业
     * @return 结果
     */
    @Override
    public int updateTbUserCompanyStore(TbUserCompanyStore tbUserCompanyStore)
    {
        return tbUserCompanyStoreMapper.updateTbUserCompanyStore(tbUserCompanyStore);
    }

    /**
     * 批量删除我收藏的企业
     * 
     * @param userCompanyIds 需要删除的我收藏的企业主键
     * @return 结果
     */
    @Override
    public int deleteTbUserCompanyStoreByUserCompanyIds(String userCompanyIds)
    {
        return tbUserCompanyStoreMapper.deleteTbUserCompanyStoreByUserCompanyIds(Convert.toStrArray(userCompanyIds));
    }

    /**
     * 删除我收藏的企业信息
     * 
     * @param userCompanyId 我收藏的企业主键
     * @return 结果
     */
    @Override
    public int deleteTbUserCompanyStoreByUserCompanyId(Long userCompanyId)
    {
        return tbUserCompanyStoreMapper.deleteTbUserCompanyStoreByUserCompanyId(userCompanyId);
    }
}
