package com.dxhy.erp.dao;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;

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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxhy.erp.entity.ElectronLog;
import com.dxhy.erp.entity.InvoiceElectron;
import com.dxhy.erp.entity.InvoiceImgSavePo;
import com.dxhy.erp.entity.RecordInvoice;

/**
 * @author dxhy
 */
@Mapper
public interface InvoiceElectronDao extends BaseMapper<InvoiceElectron> {

    /**
     * 待填
     *
     * @param electron
     * @return
     */
    int insertImgLog(ElectronLog electron);

    /**
     * 待填
     *
     * @param invoiceImg
     * @return
     */
    int insertImg(InvoiceImgSavePo invoiceImg);

    /**
     * 待填
     *
     * @param invoice
     * @return
     */
    int updateByInvoice(@Param("invoice") InvoiceElectron invoice);

    /**
     * 待填
     *
     * @param invoiceStatus
     * @param uuid
     * @return
     */
    int updateByInvoiceStatus(@Param("invoiceStatus") Integer invoiceStatus, @Param("uuid") String uuid);

    /**
     * 待填
     *
     * @param scanStatus
     * @param uuid
     * @return
     */
    int updateByRecordInvoice(@Param("scanStatus") Integer scanStatus, @Param("uuid") String uuid);

    /**
     * 待填
     *
     * @param recordInvoice
     * @return
     */
    int insertRecordInvoice(RecordInvoice recordInvoice);

    /**
     * 待填
     *
     * @param invoiceElectron
     * @return
     */
    int saveInvoice(InvoiceElectron invoiceElectron);

    /**
     * 待填
     *
     * @param createDate
     * @param invoiceType
     * @return
     */
    List<InvoiceElectron> selectByInvoice(@Param("createDate") String createDate,
        @Param("invoiceType") int invoiceType);

    /**
     * 待填
     *
     * @param uuid
     * @param note
     * @return
     */
    int updateByNote(@Param("uuid") String uuid, @Param("note") String note);

    /**
     * 待填
     *
     * @param createDate
     * @param note
     * @param uuid
     * @param scanId
     * @return
     */
    int updateByTimes(@Param("createDate") Date createDate, @Param("note") String note, @Param("uuid") String uuid,
        @Param("scanId") String scanId);

    /**
     * 待填
     *
     * @param gfTaxNo
     * @param xfTaxNo
     * @param totalAmount
     * @param taxAmount
     * @param invoiceAmount
     * @param invoiceDate
     * @param invoiceCode
     * @param invoiceNo
     * @param gfName
     * @param xfName
     * @return
     */
    int updateByInfo(@Param("gfTaxNo") String gfTaxNo, @Param("xfTaxNo") String xfTaxNo,
        @Param("totalAmount") BigDecimal totalAmount, @Param("taxAmount") BigDecimal taxAmount,
        @Param("invoiceAmount") BigDecimal invoiceAmount, @Param("invoiceDate") Date invoiceDate,
        @Param("invoiceCode") String invoiceCode, @Param("invoiceNo") String invoiceNo, @Param("gfName") String gfName,
        @Param("xfName") String xfName);

    /**
     * 待填
     *
     * @param uuid
     * @return
     */
    int updateByQsDate(@Param("uuid") String uuid);

    /**
     * 待填
     *
     * @param ids
     * @param isAll
     * @return
     */
    List<InvoiceElectron> selectInvoiceByIds(@Param("ids") Set<Long> ids, @Param("isAll") Long isAll);

    /**
     * 待填
     *
     * @param invoiceElectron
     * @return
     */
    int updateElectron(InvoiceElectron invoiceElectron);

    /**
     * 待填
     *
     * @param userAccount
     * @return
     */
    List<InvoiceElectron> selectInvoiceElectron(@Param("userAccount") String userAccount);

    /**
     * 待填
     *
     * @param invoiceCode
     * @param invoiceNo
     * @return
     */
    InvoiceElectron selectElectron(@Param("invoiceCode") String invoiceCode, @Param("invoiceNo") String invoiceNo);

    /**
     * 待填
     *
     * @param uuid
     * @param note
     * @param returnCode
     * @param requestId
     * @param vendorId
     * @return
     */
    int updateByCheckReturnCode(@Param("uuid") String uuid, @Param("note") String note,
        @Param("returnCode") String returnCode, @Param("requestId") String requestId,
        @Param("vendorId") String vendorId);

    /**
     * 待填
     *
     * @param uuid
     * @param requestId
     * @param vendorId
     * @return
     */
    int updateByRecordInvoiceRequestId(@Param("uuid") String uuid, @Param("requestId") String requestId,
        @Param("vendorId") String vendorId);

    /**
     * 待填
     *
     * @param requestId
     * @return
     */
    InvoiceElectron selectByRequestId(@Param("requestId") String requestId);

    /**
     * 待填
     *
     * @param uuid
     * @param requestId
     * @param vendorId
     * @param oldRequestId
     * @return
     */
    int updateByRequestId(@Param("uuid") String uuid, @Param("requestId") String requestId,
        @Param("vendorId") String vendorId, @Param("oldRequestId") String oldRequestId);

    /**
     * 待填
     *
     * @param scanId
     * @return
     */
    InvoiceImgSavePo selectByScanId(String scanId);

    /**
     * 待填
     *
     * @return
     */
    List<InvoiceElectron> selectElectronToCheck();
}
