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

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticket;
import com.ruoyi.project.invoice.domain.TInvoiceBookingworkticketVo;
import com.ruoyi.project.invoice.domain.TInvoiceContractor;
import com.ruoyi.project.invoice.domain.TInvoiceWorkcontent;
import com.ruoyi.project.invoice.mapper.TInvoiceBookingworkticketMapper;
import com.ruoyi.project.invoice.mapper.TInvoiceContractorMapper;
import com.ruoyi.project.invoice.mapper.TInvoiceWorkcontentMapper;
import com.ruoyi.project.invoice.service.ITInvoiceBookingworkticketService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 预约作业票台账Service业务层处理
 *
 * @author ruoyi
 * @date 2022-08-25
 */
@Service("tInvoiceBookingworkticketService")
public class TInvoiceBookingworkticketServiceImpl extends ServiceImpl<TInvoiceBookingworkticketMapper, TInvoiceBookingworkticket>  implements ITInvoiceBookingworkticketService
{
    @Resource
    private TInvoiceBookingworkticketMapper tInvoiceBookingworkticketMapper;

    @Resource
    private TInvoiceContractorMapper tInvoiceContractorMapper;

    @Resource
    private TInvoiceWorkcontentMapper tInvoiceWorkcontentMapper;

    /**
     * 查询预约作业票台账
     *
     * @param id 预约作业票台账ID
     * @return 预约作业票台账
     */
    @Override
    public TInvoiceBookingworkticket selectTInvoiceBookingworkticketById(Long id)
    {
        return tInvoiceBookingworkticketMapper.selectTInvoiceBookingworkticketById(id);
    }
    @Override
    public TInvoiceBookingworkticket selectBookingworkticketById(Long id)
    {
        return tInvoiceBookingworkticketMapper.selectBookingworkticketById(id);
    }

    @Override
    public List<TInvoiceBookingworkticketVo> selectDetailById(Long id)
    {
        return tInvoiceBookingworkticketMapper.selectDetailById(id);
    }

    /**
     * 查询预约作业票台账列表
     *
     * @param tInvoiceBookingworkticket 预约作业票台账
     * @return 预约作业票台账
     */
    @Override
    public List<TInvoiceBookingworkticket> selectTInvoiceBookingworkticketList(TInvoiceBookingworkticket tInvoiceBookingworkticket)
    {
        return tInvoiceBookingworkticketMapper.selectTInvoiceBookingworkticketList(tInvoiceBookingworkticket);
    }

    /**
     * 新增预约作业票台账
     *
     * @param tInvoiceBookingworkticket 预约作业票台账
     * @return 结果
     */
    @Override
    public int insertTInvoiceBookingworkticket(TInvoiceBookingworkticket tInvoiceBookingworkticket)
    {
        return tInvoiceBookingworkticketMapper.insertTInvoiceBookingworkticket(tInvoiceBookingworkticket);
    }

    /**
     * 修改预约作业票台账
     *
     * @param tInvoiceBookingworkticket 预约作业票台账
     * @return 结果
     */
    @Override
    public int updateTInvoiceBookingworkticket(TInvoiceBookingworkticket tInvoiceBookingworkticket)
    {
        return tInvoiceBookingworkticketMapper.updateTInvoiceBookingworkticket(tInvoiceBookingworkticket);
    }

    /**
     * 批量删除预约作业票台账
     *
     * @param ids 需要删除的预约作业票台账ID
     * @return 结果
     */
    @Override
    public int deleteTInvoiceBookingworkticketByIds(Long[] ids)
    {
        return tInvoiceBookingworkticketMapper.deleteTInvoiceBookingworkticketByIds(ids);
    }

    /**
     * 删除预约作业票台账信息
     *
     * @param id 预约作业票台账ID
     * @return 结果
     */
    @Override
    public int deleteTInvoiceBookingworkticketById(Long id)
    {
        return tInvoiceBookingworkticketMapper.deleteTInvoiceBookingworkticketById(id);
    }

    /**
     * 关联ID查询预约作业票台账信息
     *
     * @param bookingticketId 预约作业票台账关联id
     * @return 结果
     */
    @Override
    public List<TInvoiceWorkcontent> selectTInvoiceWorkcontentBybookingticketId(Long bookingticketId) {
        return tInvoiceWorkcontentMapper.selectTInvoiceWorkcontentBybookingticketId(bookingticketId);
    }

    /**
     * 新增预约作业内容
     *
     * @param tInvoiceWorkcontent 预约作业内容
     * @return 结果
     */
    @Override
    public int insertTInvoiceWorkcontent(TInvoiceWorkcontent tInvoiceWorkcontent)
    {
        return tInvoiceWorkcontentMapper.insertTInvoiceWorkcontent(tInvoiceWorkcontent);
    }

    /**
     * 修改预约作业内容
     *
     * @param tInvoiceWorkcontent 预约作业内容
     * @return 结果
     */
    @Override
    public int updateTInvoiceWorkcontent(TInvoiceWorkcontent tInvoiceWorkcontent)
    {
        return tInvoiceWorkcontentMapper.updateTInvoiceWorkcontent(tInvoiceWorkcontent);
    }

    /**
     * 批量删除预约作业内容
     *
     * @param ids 需要删除的预约作业内容ID
     * @return 结果
     */
    @Override
    public int deleteTInvoiceWorkcontentByIds(Long[] ids)
    {
        return tInvoiceWorkcontentMapper.deleteTInvoiceWorkcontentByIds(ids);
    }

    /**
     * 删除预约作业内容信息
     *
     * @param id 预约作业内容ID
     * @return 结果
     */
    @Override
    public int deleteTInvoiceWorkcontentById(Long id)
    {
        return tInvoiceWorkcontentMapper.deleteTInvoiceWorkcontentById(id);
    }

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

    @Override
    public List<TInvoiceWorkcontent> selectTInvoiceWorkcontentList(TInvoiceBookingworkticket tInvoiceBookingworkticket) {
        return tInvoiceBookingworkticketMapper.selectTInvoiceWorkcontentList(tInvoiceBookingworkticket);
    }

    @Override
    public int cancelTInvoiceBookingworkticketById(Long id) {
        return tInvoiceBookingworkticketMapper.cancelTInvoiceBookingworkticketById(id);
    }
}
