package com.dxhy.erp.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxhy.api.model.invoice.TDxRecordInvoice;
import com.dxhy.erp.model.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 底账表dao
 *
 * @date 2019年4月23日 @author dxhy
 */
@Mapper
public interface TdxRecordInvoiceErpDao extends BaseMapper<TDxRecordInvoice> {

    /**
     * 待填
     *
     * @param map
     * @return
     */
    Integer selectAllCount(@Param("pramsMap") Map<String, Object> map);

    /**
     * 待填
     *
     * @param map
     * @return
     */
    Integer selectByStateAllCount(@Param("pramsMap") Map<String, Object> map);

    /**
     * 待填
     *
     * @param map
     * @return
     */
    List<State> selectByState(@Param("pramsMap") Map<String, Object> map);

    /**
     * 待填
     *
     * @param map
     * @return
     */
    List<TDxRecordInvoice> selectByCollect(@Param("pramsMap") Map<String, Object> map);

    /**
     * 待填
     *
     * @param uuid
     * @return
     */
    List<VehicleSaleInvoices> selectVehicle(@Param("uuid") String uuid);

    /**
     * 待填
     *
     * @param uuid
     * @return
     */
    List<InvoiceDetailInfo> selectDetailInfo(@Param("uuid") String uuid);

    /**
     * 永刚进项查询未认证、可认证的发票
     *
     * @param map
     * @return
     */
    List<TDxRecordInvoice> selectAuth(@Param("pramsMap") Map<String, Object> map);

    /**
     * 待填
     *
     * @param map
     * @return
     */
    Integer selectAuthResultCount(@Param("pramsMap") Map<String, Object> map);

    /**
     * 待填
     *
     * @param map
     * @return
     */
    List<AuthStatus> selectAllAuthResult(@Param("pramsMap") Map<String, Object> map);

    /**
     * 待填
     *
     * @param buyerTaxNo
     * @param invoiceCode
     * @param invoiceNo
     * @return
     */
    TDxRecordInvoice selectSingleInvoice(@Param("buyerTaxNo") String buyerTaxNo,
                                         @Param("invoiceCode") String invoiceCode, @Param("invoiceNo") String invoiceNo);

    /**
     * 待填
     *
     * @param buyerTaxNo
     * @param invoiceCode
     * @param invoiceNo
     * @return
     */
    TDxRecordInvoice getRecordInvoice(@Param("buyerTaxNo") String buyerTaxNo, @Param("invoiceCode") String invoiceCode,
                                      @Param("invoiceNo") String invoiceNo);

    /**
     * 待填
     *
     * @param taxPeriod
     * @param uuid
     */
    void updateCxrz(@Param("taxPeriod") String taxPeriod, @Param("uuid") String uuid);

    /**
     * 待填
     *
     * @param taxPeriod
     * @param uuid
     */
    void updateCxbdk(@Param("taxPeriod") String taxPeriod, @Param("uuid") String uuid);

    /**
     * 待填
     *
     * @param authState
     * @param rzlx
     * @param bdkStatus
     * @param uuid
     */
    void updateRz(@Param("pramsMap") Map<String, Object> authState, @Param("rzlx") String rzlx,
        @Param("bdkStatus") String bdkStatus,
                  @Param("uuid") String uuid);

    /**
     * 待填
     *
     * @param authState
     * @param rzlx
     * @param bdkStatus
     * @param uuid
     */
    void updateRzBdk(@Param("pramsMap") Map<String, Object> authState, @Param("rzlx") String rzlx,
                  @Param("bdkStatus") String bdkStatus,
                  @Param("bdklx") String bdklx,
                  @Param("bdkyy") String bdkyy,
                  @Param("uuid") String uuid);

    /**
     * 待填
     *
     * @param batchNo
     * @return
     */
    List<AuthStatus> selectAuthResult(@Param("batchNo") String batchNo);

    /**
     * 待填
     *
     * @param batchNo
     * @return
     */
    List<AuthStatus> selectAuthResultBack(@Param("batchNo") String batchNo);

    /**
     * 待填
     *
     * @param uuid
     * @return
     */
    TDxRecordInvoice selectRzhStatus(@Param("uuid") String uuid);

    TDxRecordInvoice getRecordInvoiceByUuid(@Param("uuid") String uuid);

    TdxInvoiceAccount getInvoiceAccount(@Param("uuid") String uuid);

    InvoiceScanEntity getInvoice(@Param("uuid") String uuid);

    void updateRecordInvoice(@Param("entity") TDxRecordInvoice tDxRecordInvoice, @Param("uuid") String uuid);

    void saveInvoiceScan(InvoiceScanEntity newInvoiceScan);

    void updateInvoiceScan(InvoiceScanEntity newInvoiceScan);

    void updateInvoiceAccount(TdxInvoiceAccount invoice);

    void saveInvoiceAccount(TdxInvoiceAccount invoice);
}
