package com.ruoyi.project.invoice.service.impl;

import com.ruoyi.project.invoice.domain.TInvoiceContractor;
import com.ruoyi.project.invoice.mapper.TInvoiceContractorMapper;
import com.ruoyi.project.invoice.service.ITInvoiceContractorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 承包商信息Service业务层处理
 *
 * @author ruoyi
 * @date 2022-08-24
 */
@Service
public class TInvoiceContractorServiceImpl implements ITInvoiceContractorService
{
    @Autowired
    private TInvoiceContractorMapper tInvoiceContractorMapper;

    /**
     * 查询承包商信息
     *
     * @param id 承包商信息ID
     * @return 承包商信息
     */
    @Override
    public TInvoiceContractor selectTInvoiceContractorById(Long id)
    {
        return tInvoiceContractorMapper.selectTInvoiceContractorById(id);
    }

    /**
     * 查询承包商信息列表
     *
     * @param tInvoiceContractor 承包商信息
     * @return 承包商信息
     */
    @Override
    public List<TInvoiceContractor> selectTInvoiceContractorList(TInvoiceContractor tInvoiceContractor)
    {
        return tInvoiceContractorMapper.selectTInvoiceContractorList(tInvoiceContractor);
    }

    /**
     * 新增承包商信息
     *
     * @param tInvoiceContractor 承包商信息
     * @return 结果
     */
    @Override
    public int insertTInvoiceContractor(TInvoiceContractor tInvoiceContractor)
    {
        return tInvoiceContractorMapper.insertTInvoiceContractor(tInvoiceContractor);
    }

    /**
     * 修改承包商信息
     *
     * @param tInvoiceContractor 承包商信息
     * @return 结果
     */
    @Override
    public int updateTInvoiceContractor(TInvoiceContractor tInvoiceContractor)
    {
        return tInvoiceContractorMapper.updateTInvoiceContractor(tInvoiceContractor);
    }

    /**
     * 批量删除承包商信息
     *
     * @param ids 需要删除的承包商信息ID
     * @return 结果
     */
    @Override
    public int deleteTInvoiceContractorByIds(Long[] ids)
    {
        return tInvoiceContractorMapper.deleteTInvoiceContractorByIds(ids);
    }

    /**
     * 删除承包商信息信息
     *
     * @param id 承包商信息ID
     * @return 结果
     */
    @Override
    public int deleteTInvoiceContractorById(Long id)
    {
        return tInvoiceContractorMapper.deleteTInvoiceContractorById(id);
    }


    /**
     * 根据名字找到承包商信息承包商信息信息
     *
     * @param username 承包商信息ID
     * @return 结果
     */
    @Override
    public TInvoiceContractor selectTInvoiceContractorByName(String username) {
      return  tInvoiceContractorMapper.selectTInvoiceContractorByName(username);
    }


    /**
     *  查询承包商列表
     */
    @Override
    public List<String> selectTInvoiceContractorAllList() {
        return tInvoiceContractorMapper.selectTInvoiceContractorAllList();
    }
}
