package com.dxhy.core.job.dao;

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

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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dxhy.core.job.entity.TDxCustomsApplyRecord;
import com.dxhy.api.model.custom.TdxCustomsRecord;
import com.dxhy.core.job.pojo.LegalizeResult;

/**
 * @author user
 */
@SuppressWarnings("AlibabaClassNamingShouldBeCamel")
@Mapper
public interface CoreTDxCustomsRecordDao extends BaseMapper<TdxCustomsRecord> {
    /**
     * 缴款书最后采集时间
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param taxno
     * @return java.lang.String
     */
    String selectLastCustomsDate(@Param("taxno") String taxno);

    /**
     * 最后采集时间
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param taxno
     * @param type
     * @return java.lang.String
     */
    String selectLastReqDate(@Param("taxno") String taxno, @Param("type") String type);

    /**
     * 功能描述
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param customsCode
     * @return com.dxhy.api.model.custom.TdxCustomsRecord
     */
    TdxCustomsRecord getByCustomsCode(@Param("customsCode") String customsCode);

    /**
     * 功能描述
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param customsCode
     * @return int
     */
    int getExportByCustomsCode(@Param("customsCode") String customsCode);

    /**
     * 更新缴款书
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param entity
     * @return void
     */
    void updateCustoms(TdxCustomsRecord entity);

    /**
     * 更新缴款书状态
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param state
     * @return void
     */
    void updateCustomsState(TdxCustomsRecord state);

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

    /**
     * 功能描述
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param taxno
     * @return int
     */
    int getApplyCustomsCount(@Param("taxno") String taxno);

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

    /**
     * 查询申请缴款书
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param taxno
     * @return java.util.List<com.dxhy.api.model.custom.TdxCustomsRecord>
     */
    List<TdxCustomsRecord> getApplyCustoms(@Param("taxno") String taxno);

    /**
     * 更新缴款书
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param customsCode
     * @param rzlx
     * @return void
     */
    void updateCustomsRecord(@Param("customsCode") String customsCode, @Param("rzlx") String rzlx);

    /**
     * 更新缴款书上传信息
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param customsCode
     * @return void
     */
    void updateCustomsUploadInfo(@Param("customsCode") String customsCode);

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

    /**
     * 功能描述
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param customsCode
     * @param recordType
     * @return void
     */
    void updateApply(@Param("customsCode") String customsCode, @Param("recordType") String recordType);

    /**
     * 更新撤销不低口
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param result
     * @param rzhDate
     * @return void
     */
    void updateRecordForRebackNoDeduction(@Param("result") LegalizeResult result, @Param("rzhDate") Date rzhDate);

    /**
     * 更新不低口
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param result
     * @param rzhDate
     * @return void
     */
    void updateRecordForNoDeduction(@Param("result") LegalizeResult result, @Param("rzhDate") Date rzhDate);

    /**
     * 退税认证更新
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param result
     * @param rzhDate
     * @return void
     */
    void updateRecordForDrawback(@Param("result") LegalizeResult result, @Param("rzhDate") Date rzhDate);

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

    /**
     * 查询需要上传税号
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param
     * @return java.util.List<java.lang.String>
     */
    List<String> getNeedUploadTaxNo();

    /**
     * 查询上传缴款书数量
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param taxno
     * @return int
     */
    int getUploadCustomsCount(@Param("taxno") String taxno);

    /**
     * 需要上传缴款书
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param taxno
     * @return java.util.List<com.dxhy.api.model.custom.TdxCustomsRecord>
     */
    List<TdxCustomsRecord> getUploadCustoms(@Param("taxno") String taxno);

    /**
     * 更新上传状态
     *
     * @author 陈刚扬
     * @date 2020/10/30
     * @param result
     * @return void
     */
    void updateUploadResult(@Param("result") TdxCustomsRecord result);
}
