package com.miyzh.service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.miyzh.entity.Manage;
import com.miyzh.entity.UploadExceptionLog;
import com.miyzh.mapper.pre.UploadExcepctionLogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * description: UploadExceptionLogService
 * date: 2020/6/18 15:36
 * author: SZQ
 */
@Slf4j
@Service
public class UploadExceptionLogService {

    @Autowired
    private UploadExcepctionLogMapper uploadExcepctionLogMapper;

    @Autowired
    private UploadService uploadService;

    public List<UploadExceptionLog> listUploadExceptionLogLimit(int count) {
        return uploadExcepctionLogMapper.selectListLimit(count);
    }

    public List<UploadExceptionLog> listUploadExceptionLogByDate(String startDate, String endDate) {
        Map<String, Object> params = new HashMap<>();
        params.put("startDate", startDate);
        params.put("endDate", endDate);
        return uploadExcepctionLogMapper.selectListByDate(params);
    }

    public Integer update(UploadExceptionLog uploadExceptionLog) {
        return uploadExcepctionLogMapper.update(uploadExceptionLog);
    }

    public Integer inster(UploadExceptionLog uploadExceptionLog) {
        return uploadExcepctionLogMapper.insert(uploadExceptionLog);
    }

    public Integer saveUploadDocStatusReq(UploadExceptionLog uploadExceptionLog) {
        return uploadExcepctionLogMapper.saveUploadDocStatusReq(uploadExceptionLog);
    }

    public List<UploadExceptionLog> listUploadDocStatus() {
        return uploadExcepctionLogMapper.selectUploadDocStatusList();
    }

    public List<UploadExceptionLog> listUploadPatbillInfo() {
        return uploadExcepctionLogMapper.selectUploadPatbillInfoList();
    }

    public Integer saveUploadPatBillInfoReq(UploadExceptionLog uploadExceptionLog) {
        return uploadExcepctionLogMapper.saveUploadPatBillInfoReq(uploadExceptionLog);
    }

    public String searchBySerialNo(String serialNo) {
        return uploadExcepctionLogMapper.searchBySerialNo(serialNo);
    }

    public String searchDocBySerialNo(String serialNo) {
        return uploadExcepctionLogMapper.searchDocBySerialNo(serialNo);
    }

    public String searchErrBySerialNo(String serialNo) {
        return uploadExcepctionLogMapper.searchErrBySerialNo(serialNo);
    }

    public Manage init() {
        return uploadExcepctionLogMapper.init();
    }

    public Manage initY() {
        return uploadExcepctionLogMapper.initY();
    }

}
