package com.dxhy.erp.dao;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxhy.erp.entity.RecordInvoiceDetail;
import com.dxhy.erp.entity.TdxSaleRecordInvoice;
import com.dxhy.erp.entity.alltax.*;
import com.dxhy.erp.model.InvoiceDetailInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * @author luxiaoxu
 */
@Mapper
public interface AllTaxesSaleDao extends BaseMapper<SaleParamsEntity> {

    JSONObject getBlocInfoBytaxNo(String taxNumber);

    JSONObject listSaleCounts(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("status") String status);

    int getCountSaleSign(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("status") String s);

    int getCountSaleInvoice(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate);

    List<SaleInvoicePo> getInvoiceByParam(@Param("taxno") String taxno, @Param("monthList") List<String> monthList);

    List<SaleInvoiceDetailInfo> getInvoiceDetailByUuid(String uuid);

    int updateByRule(@Param("isAdd") Boolean isAdd, @Param("goodsNum") String goodsNum,
        @Param("invoiceType") String exchangeInvoiceType, @Param("taxRate") String taxRate,
        @Param("yhzc") String exchangeIncentiveFlag, @Param("bindDetailAmount") BigDecimal bindDetailAmount,
        @Param("bindTaxAmount") BigDecimal bindTaxAmount, @Param("bindTotalAmount") BigDecimal bindTotalAmount,
        @Param("isSpecial") boolean isSpecial);

    List<ItemPo> findAllData();

    void updateInit();

    void updateStatusById(int id);

    List<SaleInvoiceRatePo> getInvoiceCountByTaxRate(@Param("taxno") String taxno,
        @Param("monthList") List<String> monthList);

    void updateStatusByTaxNumberAndBill(@Param("taxno") String taxno, @Param("belongDate") String belongDate,
        @Param("status") String s);

    List<SummarySaleTaxRateData> getTaxRateCount(@Param("billingDate") String billingDate,
        @Param("taxno") String taxNumber);

    List<SummarySaleItemData> getItemCount(@Param("billingDate") String billingDate, @Param("taxno") String taxNumber);

    int selectCountByDateAndTax(@Param("belongDate") String billingDate, @Param("taxno") String taxNumber,
        @Param("status") String status);

    void deleteCount(@Param("belongDate") String billingDate, @Param("taxno") String taxNumber,
        @Param("status") String s);

    void deleteDetailTaxRate(@Param("belongDate") String billingDate, @Param("taxno") String taxNumber);

    void deleteDetailItem(@Param("belongDate") String billingDate, @Param("taxno") String taxNumber);
}
