package com.ruoyi.cs.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.cs.domain.vo.CsCompanyClassVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.Reference;
import org.springframework.stereotype.Service;
import com.ruoyi.cs.mapper.CsCompanyClassMapper;
import com.ruoyi.cs.domain.CsCompanyClass;
import com.ruoyi.cs.service.ICsCompanyClassService;

import javax.annotation.Resource;

/**
 * 单位类别Service业务层处理
 *
 * @author ruoyi
 * @date 2024-04-22
 */
@Service
public class CsCompanyClassServiceImpl implements ICsCompanyClassService
{
    @Resource
    private CsCompanyClassMapper csCompanyClassMapper;

    /**
     * 查询单位类别
     *
     * @param companyClassId 单位类别主键
     * @return 单位类别
     */
    @Override
    public CsCompanyClass selectCsCompanyClassByCompanyClassId(String companyClassId)
    {
        return csCompanyClassMapper.selectCsCompanyClassByCompanyClassId(companyClassId);
    }

    /**
     * 查询单位类别列表
     *
     * @param csCompanyClass 单位类别
     * @return 单位类别
     */
    @Override
    public List<CsCompanyClass> selectCsCompanyClassList(CsCompanyClass csCompanyClass)
    {
        return csCompanyClassMapper.selectCsCompanyClassList(csCompanyClass);
    }

    /**
     * 新增单位类别
     *
     * @param csCompanyClass 单位类别
     * @return 结果
     */
    @Override
    public int insertCsCompanyClass(CsCompanyClass csCompanyClass)
    {
        csCompanyClass.setCreateAt(DateUtils.getTime());
        csCompanyClass.setDelFlag("0");
        return csCompanyClassMapper.insertCsCompanyClass(csCompanyClass);
    }

    /**
     * 修改单位类别
     *
     * @param csCompanyClass 单位类别
     * @return 结果
     */
    @Override
    public int updateCsCompanyClass(CsCompanyClass csCompanyClass)
    {
        csCompanyClass.setUpdateAt(DateUtils.getTime());
        return csCompanyClassMapper.updateCsCompanyClass(csCompanyClass);
    }

    /**
     * 批量删除单位类别
     *
     * @param companyClassIds 需要删除的单位类别主键
     * @return 结果
     */
    @Override
    public int deleteCsCompanyClassByCompanyClassIds(String[] companyClassIds)
    {
        return csCompanyClassMapper.deleteCsCompanyClassByCompanyClassIds(companyClassIds);
    }

    /**
     * 删除单位类别信息
     *
     * @param companyClassId 单位类别主键
     * @return 结果
     */
    @Override
    public int deleteCsCompanyClassByCompanyClassId(String companyClassId)
    {
        return csCompanyClassMapper.deleteCsCompanyClassByCompanyClassId(companyClassId);
    }

    /**
     * 查询单位类别下拉列表
     * @return
     */
    @Override
    public List<CsCompanyClassVO> selectCsCompanyClassVOList() {
        return csCompanyClassMapper.selectCsCompanyClassVOList();
    }
}
