package com.jkcredit.invoice.mapper.binvoce;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jkcredit.invoice.model.entity.invoice.SelfCarInvoice;
import com.jkcredit.invoice.model.vo.CompanyVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 自有车发票操作接口
 * @author mumuxigua
 */
@Repository
public interface SelfCarInvoiceMapper extends BaseMapper<SelfCarInvoice> {

    /**
     * 分页查询自有车发票列表
     * @param page
     * @param selfCarInvoice
     * @return
     */
    IPage<List<SelfCarInvoice>> selectAllByPage(Page page, @Param("selfCarInvoice") SelfCarInvoice selfCarInvoice);

    /**
     * 插入自有车发票
     * @param record
     * @return
     */
    @Override
    int insert(SelfCarInvoice record);

    /**
     * 更新自有车发票
     * @param record
     * @return
     */
    int updateByPrimaryKey(SelfCarInvoice record);

    /**
     * 根据交易查询自有车发票列表
     * @param tradeId
     * @return
     */
    List<SelfCarInvoice> selectByTrade(String tradeId);

    /**
     * 根据etc卡号查询自有车发票列表
     * @param cardId
     * @return
     */
    List<SelfCarInvoice> selectByCardId(String cardId);

    /**
     * 根据查询时间 查询自有车发票列表
     * @param record
     * @return
     */
    List<SelfCarInvoice> selectByTradeAndInvoiceMakeTime(SelfCarInvoice record);

    /**
     * 根据发票号码和发票代码查询自有车发票列表
     * @param record
     * @return
     */

    List<SelfCarInvoice> selectByCodeAndNum(SelfCarInvoice record);

    /**
     * 根据公司信息更新自有车发票列表
     * @param companyVo
     * @return
     */
    int upDateCompany(CompanyVo companyVo);
}
