package com.dgtly.companyext.service.impl;

import java.util.List;
import com.dgtly.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dgtly.companyext.mapper.CompanyHonourMapper;
import com.dgtly.companyext.domain.CompanyHonour;
import com.dgtly.companyext.service.ICompanyHonourService;
import com.dgtly.common.core.text.Convert;

/**
 * 企业荣誉Service业务层处理
 * 
 * @author qxp
 * @date 2020-03-02
 */
@Service
public class CompanyHonourServiceImpl implements ICompanyHonourService 
{
    @Autowired
    private CompanyHonourMapper companyHonourMapper;

    /**
     * 查询企业荣誉
     * 
     * @param honourId 企业荣誉ID
     * @return 企业荣誉
     */
    @Override
    public CompanyHonour selectCompanyHonourById(Long honourId)
    {
        return companyHonourMapper.selectCompanyHonourById(honourId);
    }

    /**
     * 查询企业荣誉列表
     * 
     * @param companyHonour 企业荣誉
     * @return 企业荣誉
     */
    @Override
    public List<CompanyHonour> selectCompanyHonourList(CompanyHonour companyHonour)
    {
        return companyHonourMapper.selectCompanyHonourList(companyHonour);
    }

    /**
     * 新增企业荣誉
     * 
     * @param companyHonour 企业荣誉
     * @return 结果
     */
    @Override
    public int insertCompanyHonour(CompanyHonour companyHonour)
    {
        companyHonour.setCreateTime(DateUtils.getNowDate());
        return companyHonourMapper.insertCompanyHonour(companyHonour);
    }

    /**
     * 修改企业荣誉
     * 
     * @param companyHonour 企业荣誉
     * @return 结果
     */
    @Override
    public int updateCompanyHonour(CompanyHonour companyHonour)
    {
        companyHonour.setUpdateTime(DateUtils.getNowDate());
        return companyHonourMapper.updateCompanyHonour(companyHonour);
    }

    /**
     * 删除企业荣誉对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCompanyHonourByIds(String ids)
    {
        return companyHonourMapper.deleteCompanyHonourByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除企业荣誉信息
     * 
     * @param honourId 企业荣誉ID
     * @return 结果
     */
    @Override
    public int deleteCompanyHonourById(Long honourId)
    {
        return companyHonourMapper.deleteCompanyHonourById(honourId);
    }
}
