package com.dxhy.erp.dao;

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

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxhy.erp.entity.TdxRecordInvoice;
import com.dxhy.erp.model.AuthStatus;
import com.dxhy.erp.model.InvoiceDetailInfo;
import com.dxhy.erp.model.InvoiceScanEntity;
import com.dxhy.erp.model.State;
import com.dxhy.erp.model.TdxInvoiceAccount;
import com.dxhy.erp.model.VehicleSaleInvoices;

/**
 * 底账表dao
 *
 * @date 2019年4月23日 @author dxhy
 */
@Mapper
public interface TdxRecordInvoiceDao 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 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);

    void deleteByuuid(@Param("uuids") String[] uuids);

    List<String> selectRecords(@Param("pramsMap") Map<String, Object> pramsMap);

    void updateTaxRate(@Param("pramsMap") Map<String, String> pramsMap);
}
