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.CompanyAppMapper;
import com.ruoyi.system.domain.CompanyApp;
import com.ruoyi.system.service.ICompanyAppService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客户端Service业务层处理
 *
 * @author ruoyi
 * @date 2023-05-15
 */
@Service
public class CompanyAppServiceImpl implements ICompanyAppService
{
    @Autowired
    private CompanyAppMapper companyAppMapper;

    /**
     * 查询客户端
     *
     * @param id 客户端主键
     * @return 客户端
     */
    @Override
    public CompanyApp selectCompanyAppById(Long id)
    {
        return companyAppMapper.selectCompanyAppById(id);
    }

    /**
     * 查询客户端列表
     *
     * @param companyApp 客户端
     * @return 客户端
     */
    @Override
    public List<CompanyApp> selectCompanyAppList(CompanyApp companyApp)
    {
        return companyAppMapper.selectCompanyAppList(companyApp);
    }

    /**
     * 新增客户端
     *
     * @param companyApp 客户端
     * @return 结果
     */
    @Override
    public int insertCompanyApp(CompanyApp companyApp)
    {
        companyApp.setCreateTime(DateUtils.getNowDate());
        return companyAppMapper.insertCompanyApp(companyApp);
    }

    /**
     * 修改客户端
     *
     * @param companyApp 客户端
     * @return 结果
     */
    @Override
    public int updateCompanyApp(CompanyApp companyApp)
    {
        companyApp.setUpdateTime(DateUtils.getNowDate());
        return companyAppMapper.updateCompanyApp(companyApp);
    }

    /**
     * 批量删除客户端
     *
     * @param ids 需要删除的客户端主键
     * @return 结果
     */
    @Override
    public int deleteCompanyAppByIds(String ids)
    {
        return companyAppMapper.deleteCompanyAppByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除客户端信息
     *
     * @param id 客户端主键
     * @return 结果
     */
    @Override
    public int deleteCompanyAppById(Long id)
    {
        return companyAppMapper.deleteCompanyAppById(id);
    }
}
