package com.dxhy.core.dao;

import java.util.Date;
import java.util.List;

import com.dxhy.core.job.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxhy.core.entity.TDxRecordInvoice;
import com.dxhy.core.job.pojo.LegalizeResult;
import com.dxhy.core.job.pojo.TaxCurrent;
import com.dxhy.core.job.pojo.TaxHandlelog;

/**
 * @author user
 */

@Mapper
public interface ConfirmDao extends BaseMapper<TDxHttpLog> {

    /**
     * 查询税号
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param
     * @return java.util.List<com.dxhy.core.job.entity.TAcOrg>
     */
    List<TAcOrg> getTaxno();

    /**
     * 查询升级税号
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param
     * @return java.util.List<com.dxhy.core.job.entity.TAcOrg>
     */
    List<TAcOrg> getUpgradTaxno();

    /**
     * 查询税号
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param
     * @return java.util.List<com.dxhy.core.job.entity.TAcOrg>
     */
    List<TAcOrg> getTaxnoForQpm();

    /**
     * 查询属期信息
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return com.dxhy.core.job.pojo.TaxCurrent
     */
    TaxCurrent qryTaxCurrent(@Param("taxno") String taxno);

    /**
     * 查询统计信息
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return java.util.List<com.dxhy.core.job.entity.TDxDkCount>
     */
    List<TDxDkCount> findAllDkCount(@Param("taxno") String taxno);

    /**
     * 属期信息入库
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxCurrent
     * @return void
     */
    void insertCurrent(@Param("taxCurrent") TaxCurrent taxCurrent);

    /**
     * 更新属期信息
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxCurrent
     * @return void
     */
    void updateCurrent(@Param("taxCurrent") TaxCurrent taxCurrent);

    /**
     * 查询批次号
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param
     * @return java.util.List<com.dxhy.core.job.entity.TDxApplyRecord>
     */
    List<TDxApplyRecord> getBatchNo();

    /**
     * 更新认证信息
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param result
     * @param uuid
     * @param rzhDate
     * @return void
     */
    void updateRecord(@Param("result") LegalizeResult result, @Param("uuid") String uuid,
        @Param("rzhDate") Date rzhDate);

    /**
     * 更新申请记录
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param uuid
     * @return void
     */
    void updateApply(@Param("uuid") String uuid);

    /**
     * 请求日志入库
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param tDxHttpLog
     * @return void
     */
    void saveLog(@Param("tDxHttpLog") TDxHttpLog tDxHttpLog);

    /**
     * 查询申请发票
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return java.util.List<com.dxhy.core.entity.TDxRecordInvoice>
     */
    List<TDxRecordInvoice> getApplyInvoice(@Param("taxno") String taxno);

    /**
     * 申请记录入库
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param tDxApplyRecord
     * @param batchNo
     * @return void
     */
    void insertApplyRecord(@Param("tDxApplyRecord") TDxApplyRecord tDxApplyRecord, @Param("batchNo") String batchNo);

    /**
     * 统计申请发票数量
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return int
     */
    int getApplyInvoiceByCount(@Param("taxno") String taxno);

    /**
     * 更新发票申请状态
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param tDxApplyRecord
     * @return void
     */
    void updateInvoiceRecord(@Param("tDxApplyRecord") TDxApplyRecord tDxApplyRecord);

    /**
     * 删除申请日志
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param httpLogId
     * @return void
     */
    void deleteLog(@Param("httpLogId") Long httpLogId);

    /**
     * 查询数据源
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param
     * @return java.util.List<java.lang.String>
     */
    List<String> getDbSource();

    /**
     * 操作日志入库
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param handlelog
     * @return void
     */
    void insertHandlelog(@Param("handlelog") TaxHandlelog handlelog);

    /**
     * 统计信息入库
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param curTaxno
     * @param compName
     * @param newTaxCurrent
     * @return void
     */
    void insertDkCount(@Param("taxno") String curTaxno, @Param("compName") String compName,
        @Param("sq") String newTaxCurrent);

    /**
     * 更新统计信息
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param curTaxno
     * @return void
     */
    void updateDkCount(@Param("taxno") String curTaxno);
    void updateDkCounts(@Param("taxno") String curTaxno,@Param("skssq") String skssq);

    void updateDkCountToNew(@Param("taxno") String curTaxno, @Param("skssq") String skssq);

    void deleteDkCount(@Param("taxno") String curTaxno, @Param("skssq") String skssq);

    void deleteDkCountDetail(@Param("taxno") String curTaxno, @Param("skssq") String skssq);

    /**
     * 获取逾期申请数量
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return int
     */
    int getApplyOverdueCount(@Param("taxno") String taxno);

    /**
     * 查询逾期申请发票
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return java.util.List<com.dxhy.core.entity.TDxRecordInvoice>
     */
    List<TDxRecordInvoice> getApplyOverdue(@Param("taxno") String taxno);

    /**
     * 更新逾期申请状态
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param tDxApplyRecord
     * @return void
     */
    void updateInvoiceRecordForOverdue(@Param("tDxApplyRecord") TDxApplyRecord tDxApplyRecord);

    /**
     * 功能描述
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param result
     * @param uuid
     * @param rzhDate
     * @return void
     */
    void updateRecordForOverdue(@Param("result") LegalizeResult result, @Param("uuid") String uuid,
        @Param("rzhDate") Date rzhDate);

    /**
     * 查询不抵扣发票数量
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return int
     */
    int getApplyNoDeductionCount(@Param("taxno") String taxno);

    /**
     * 查询不抵扣发票
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return java.util.List<com.dxhy.core.entity.TDxRecordInvoice>
     */
    List<TDxRecordInvoice> getApplyNoDeduction(@Param("taxno") String taxno);

    /**
     * 功能描述
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param tDxApplyRecord
     * @return void
     */
    void updateInvoiceRecordForNoDeduction(@Param("tDxApplyRecord") TDxApplyRecord tDxApplyRecord);

    /**
     * 更新不抵扣状态
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param result
     * @param uuid
     * @param rzhDate
     * @return void
     */
    void updateRecordForNoDeduction(@Param("result") LegalizeResult result, @Param("uuid") String uuid,
        @Param("rzhDate") Date rzhDate);

    /**
     * 更新退税状态
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param result
     * @param uuid
     * @param rzhDate
     * @return void
     */
    void updateRecordForDrawback(@Param("result") LegalizeResult result, @Param("uuid") String uuid,
        @Param("rzhDate") Date rzhDate);

    /**
     * 获取撤销认证发票
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return int
     */
    int getApplyRebackRzCount(@Param("taxno") String taxno);

    /**
     * 获取撤销认证发票
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return java.util.List<com.dxhy.core.entity.TDxRecordInvoice>
     */
    List<TDxRecordInvoice> getApplyRebackRz(@Param("taxno") String taxno);

    /**
     * 更新撤销认证申请结果状态
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param tDxApplyRecord
     * @return void
     */
    void updateInvoiceRecordForRebackRz(@Param("tDxApplyRecord") TDxApplyRecord tDxApplyRecord);

    /**
     * 更新撤销认证状态
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param result
     * @param uuid
     * @param rzhDate
     * @return void
     */
    void updateRecordForRebackRz(@Param("result") LegalizeResult result, @Param("uuid") String uuid,
        @Param("rzhDate") Date rzhDate);

    /**
     * 查询撤销不抵扣发票数量
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return int
     */
    int getApplyRebackNoDeductionCount(@Param("taxno") String taxno);

    /**
     * 查询撤销不抵扣发票
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return java.util.List<com.dxhy.core.entity.TDxRecordInvoice>
     */
    List<TDxRecordInvoice> getApplyRebackNoDeduction(@Param("taxno") String taxno);

    /**
     * 更改撤销不抵扣申请记录状态
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param tDxApplyRecord
     * @return void
     */
    void updateInvoiceRecordForRebackNoDeduction(@Param("tDxApplyRecord") TDxApplyRecord tDxApplyRecord);

    /**
     * 更新撤销不抵扣状态
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param result
     * @param uuid
     * @param rzhDate
     * @return void
     */
    void updateRecordForRebackNoDeduction(@Param("result") LegalizeResult result, @Param("uuid") String uuid,
        @Param("rzhDate") Date rzhDate);

    /**
     * 更新
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param uuid
     * @return void
     */
    void updateBdkStatus(@Param("uuid") String uuid);

    /**
     * 查询抵扣统计信息
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @param incomeMoth
     * @return int
     */
    int findDkCount(@Param("taxno") String taxno, @Param("incomeMonth") String incomeMoth);

    /**
     * 查询需要发送认证税号
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param rzlx
     * @return java.util.List<java.lang.String>
     */
    List<String> getNeedSendTaxNo(@Param("rzlx") String rzlx);

    /**
     * 查询所有需要发送认证税号
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param
     * @return java.util.List<java.lang.String>
     */
    List<String> getAllNeedSendTaxNo();

    /**
     * 查询税号id，key
     *
     * @author 陈刚扬
     * @date 2020/10/28
     * @param taxno
     * @return com.dxhy.core.job.entity.TAcOrg
     */
    TAcOrg findIdAndKeyByTaxno(@Param("taxno") String taxno);

    List<TAcOrg> getTaxnoForDown();

    List<TDxHttpLogInvoiceDown> getHttpLog();

    String selectByuuid(@Param("uuid")String uuid);

    List<TAcOrg> getPullSapDataTaxNo();
}
