package com.dxhy.erp.dao;

import com.alibaba.fastjson.JSONObject;
import com.dxhy.erp.entity.alltax.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author luxiaoxu
 */
@Mapper
public interface AllTaxesDao {
    /**
     * 插入日志
     *
     * @param id
     * @param params
     * @param returnInfo
     */
    void insertHttp(@Param("id") long id, @Param("req") String params, @Param("returnInfo") String returnInfo);

    /**
     * 查当前属期认证发票份数(正常)
     *
     * @param taxNumber
     * @param monthList
     * @param deptName
     * @param confirmType
     * @return
     */
    SummaryData getOneCount(@Param("taxno") String taxNumber, @Param("monthList") List<String> monthList,
        @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 插入统计记录
     *
     * @param count
     * @param id
     * @param params
     * @param sign
     * @return
     */
    int insertCount(@Param("count") SummaryData count, @Param("id") long id, @Param("params") Params params,
        @Param("sign") String sign, @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 查当前属期认证发票份数(异常)
     *
     * @param taxNumber
     * @param monthList
     * @return
     */
    SummaryData getTwoCount(@Param("taxno") String taxNumber, @Param("monthList") List<String> monthList,
        @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 获取发票份数
     *
     * @param taxNumber
     * @param legalizeBelongDate
     * @param keyword
     * @return
     */
    int getAllTaxesInvoice(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("keyword") String keyword);

    /**
     * 删除现有记录
     *
     * @param keyword
     * @param taxNumber
     * @param legalizeBelongDate
     */
    void delAllTaxesInvoice(@Param("keyword") String keyword, @Param("taxno") String taxNumber,
        @Param("rzhBelongDate") String legalizeBelongDate, @Param("deptName") String deptName,
        @Param("confirmType") String confirmType);

    /**
     * 插入统计记录
     *
     * @param comList
     * @param sign
     * @param taxNumber
     * @param legalizeBelongDate
     */
    void insertAllTaxesInvoice(@Param("comList") List<CompInputInvoice> comList, @Param("sign") String sign,
        @Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 汇总表删除
     *
     * @param taxNumber
     * @param legalizeBelongDate
     */
    void deleteCount(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 查看统计标识
     *
     * @param taxNumber
     * @param legalizeBelongDate
     * @return
     */
    int getCountSign(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 查看统计标识
     *
     * @param taxNumber
     * @param legalizeBelongDate
     * @return
     */
    int getCountInvoice(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 获取发票信息
     *
     * @param currPage
     * @param legalizeBelongDate
     * @param pageSize
     * @param taxNumber
     * @return
     */
    List<CompInputInvoice2> getInvoiceList(@Param("start") Integer currPage,
        @Param("rzhBelongDate") String legalizeBelongDate, @Param("num") Integer pageSize,
        @Param("taxno") String taxNumber, @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 获取发票明细
     *
     * @param uuid
     * @param dxhyDetail
     * @return
     */
    List<CompInputInvoiceDetail> getInvoiceDetailList(@Param("uuid") String uuid,
        @Param("dxhyDetail") String dxhyDetail);

    /**
     * 获取发票数量
     *
     * @param currPage
     * @param legalizeBelongDate
     * @param pageSize
     * @param taxNumber
     * @return
     */
    int getInvoiceCount(@Param("start") Integer currPage, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("num") Integer pageSize, @Param("taxno") String taxNumber, @Param("deptName") String deptName,
        @Param("confirmType") String confirmType);

    /**
     * 获取总数
     *
     * @param legalizeBelongDate
     * @param taxNumber
     * @return
     */
    SummaryData getCountData(String legalizeBelongDate, String taxNumber);

    /**
     * 获取正常数据
     *
     * @param legalizeBelongDate
     * @param taxNumber
     * @return
     */
    List<SummaryData> getOneCountData(@Param("rzhBelongDate") String legalizeBelongDate,
        @Param("taxno") String taxNumber, @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 获取全税信息
     *
     * @param keyword
     * @param taxNumber
     * @param legalizeBelongDate
     * @param dxhyDetail
     * @return
     */
    List<AllTaxesInfo> getAllList(@Param("keyword") String keyword, @Param("taxno") String taxNumber,
        @Param("rzhBelongDate") String legalizeBelongDate, @Param("deptName") String deptName,
        @Param("confirmType") String confirmType, @Param("dxhyDetail") String dxhyDetail);

    /**
     * 插入记录表
     *
     * @param sign
     * @param taxNumber
     * @param legalizeBelongDate
     * @param keyword
     */
    void insertAllTaxesInvoiceNoData(@Param("sign") String sign, @Param("taxno") String taxNumber,
        @Param("rzhBelongDate") String legalizeBelongDate, @Param("keyword") String keyword,
        @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * getAllCount
     *
     * @param taxNumber
     * @param legalizeBelongDate
     * @return
     */
    int getAllCount(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 获取广告发票总数
     *
     * @param taxNumber
     * @param legalizeBelongDate
     * @return
     */
    int getCountAdvertising(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    /**
     * 更新数量
     *
     * @param normalCount
     * @param params
     * @param sign
     * @return
     */
    int updateCount(@Param("count") SummaryData normalCount, @Param("params") Params params,
        @Param("sign") String sign);

    /**
     * listCounts
     *
     * @param taxNumber
     * @param legalizeBelongDate
     * @param status
     * @return
     */
    JSONObject listCounts(@Param("taxno") String taxNumber, @Param("rzhBelongDate") String legalizeBelongDate,
        @Param("status") String status, @Param("deptName") String deptName, @Param("confirmType") String confirmType);

    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);

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