package com.dxhy.erp.dao;

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

import com.dxhy.api.model.custom.TdxCustomsRecord;
import com.dxhy.api.model.invoice.TDxRecordInvoice;
import com.dxhy.erp.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxhy.erp.model.AuthStatus;
import com.dxhy.erp.model.CustomsApplyReq;

/**
 * 海关缴款书底账表dao
 * 
 * @author jiaohongyang
 *
 */
@Mapper
public interface ErpTdxCustomsRecordDao extends BaseMapper<TdxCustomsRecord> {

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

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

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

    /**
     * 待填
     *
     * @param map
     * @return
     */
    List<TdxCustomsRecord> selectCustoms(@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 customsCode
     * @return
     */
    TdxCustomsRecord getCustomsRecord(@Param("buyerTaxNo") String buyerTaxNo, @Param("customsCode") String customsCode);


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

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

    /**
     * 待填
     *
     * @param authState
     * @param bdkStatus
     */
    void updateRz(@Param("params") CustomsApplyReq authState, @Param("bdkStatus") String bdkStatus);

    /**
     * 待填
     *
     * @param batchNo
     * @return
     */
    Integer selectAuthResult(@Param("batchNo") String batchNo);

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

    /**
     * 待填
     *
     * @param batchNo
     * @return
     */
    Integer selectUploadResult(@Param("batchNo") String batchNo);

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

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


    /**
     * 梁鑫
     *
     * @param batchNo
     * @return
     */
    int countBatChno(@Param("batchNo") String batchNo);

    void saveAccountBat(@Param("list")List<CustomsInAccountData> list, @Param("batchNo")String batchNo);

    int setAccount(CustomsInAccountData item);
}
