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.CompanyExtInfoMapper;
import com.dgtly.companyext.domain.CompanyExtInfo;
import com.dgtly.companyext.service.ICompanyExtInfoService;
import com.dgtly.common.core.text.Convert;

/**
 * 商户扩展信息Service业务层处理
 * 
 * @author dgtly
 * @date 2020-02-13
 */
@Service
public class CompanyExtInfoServiceImpl implements ICompanyExtInfoService 
{
    @Autowired
    private CompanyExtInfoMapper companyExtInfoMapper;

    /**
     * 查询商户扩展信息
     * 
     * @param id 商户扩展信息ID
     * @return 商户扩展信息
     */
    @Override
    public CompanyExtInfo selectCompanyExtInfoById(Long id)
    {
        return companyExtInfoMapper.selectCompanyExtInfoById(id);
    }

    /**
     * 查询商户扩展信息列表
     * 
     * @param companyExtInfo 商户扩展信息
     * @return 商户扩展信息
     */
    @Override
    public List<CompanyExtInfo> selectCompanyExtInfoList(CompanyExtInfo companyExtInfo)
    {
        return companyExtInfoMapper.selectCompanyExtInfoList(companyExtInfo);
    }

    /**
     * 新增商户扩展信息
     * 
     * @param companyExtInfo 商户扩展信息
     * @return 结果
     */
    @Override
    public int insertCompanyExtInfo(CompanyExtInfo companyExtInfo)
    {
        companyExtInfo.setCreateTime(DateUtils.getNowDate());
        return companyExtInfoMapper.insertCompanyExtInfo(companyExtInfo);
    }

    /**
     * 修改商户扩展信息
     * 
     * @param companyExtInfo 商户扩展信息
     * @return 结果
     */
    @Override
    public int updateCompanyExtInfo(CompanyExtInfo companyExtInfo)
    {
        companyExtInfo.setUpdateTime(DateUtils.getNowDate());
        return companyExtInfoMapper.updateCompanyExtInfo(companyExtInfo);
    }

    /**
     * 删除商户扩展信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCompanyExtInfoByIds(String ids)
    {
        return companyExtInfoMapper.deleteCompanyExtInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商户扩展信息信息
     * 
     * @param id 商户扩展信息ID
     * @return 结果
     */
    @Override
    public int deleteCompanyExtInfoById(Long id)
    {
        return companyExtInfoMapper.deleteCompanyExtInfoById(id);
    }

    /**
     * 查询商户扩展信息
     *
     * @param companyId 商户ID
     * @return 商户扩展信息
     */
    @Override
    public CompanyExtInfo selectCompanyExtInfoByCompanyId(Long companyId) {
        return companyExtInfoMapper.selectCompanyExtInfoByCompanyId(companyId);
    }
}
