package com.dgtly.sync.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dgtly.sync.mapper.SyncFailDetailMapper;
import com.dgtly.sync.domain.SyncFailDetail;
import com.dgtly.sync.service.ISyncFailDetailService;
import com.dgtly.common.core.text.Convert;

/**
 * 同步解析失败详情Service业务层处理
 * 
 * @author qxp
 * @date 2020-07-14
 */
@Service
public class SyncFailDetailServiceImpl implements ISyncFailDetailService 
{
    @Autowired
    private SyncFailDetailMapper syncFailDetailMapper;

    /**
     *  查询 失败类型
     * @param packageId
     * @return
     */
    @Override
    public List<String> selectSyncExceptionTypeList(String packageId) {
        return syncFailDetailMapper.selectSyncExceptionTypeList(packageId);
    }

    /**
     * 查询同步解析失败详情
     * 
     * @param packageId 同步解析失败详情ID
     * @return 同步解析失败详情
     */
    @Override
    public SyncFailDetail selectSyncFailDetailById(String packageId)
    {
        return syncFailDetailMapper.selectSyncFailDetailById(packageId);
    }

    /**
     * 查询同步解析失败详情列表
     * 
     * @param syncFailDetail 同步解析失败详情
     * @return 同步解析失败详情
     */
    @Override
    public List<SyncFailDetail> selectSyncFailDetailList(SyncFailDetail syncFailDetail)
    {
        return syncFailDetailMapper.selectSyncFailDetailList(syncFailDetail);
    }

    /**
     * 新增同步解析失败详情
     * 
     * @param syncFailDetail 同步解析失败详情
     * @return 结果
     */
    @Override
    public int insertSyncFailDetail(SyncFailDetail syncFailDetail)
    {
        return syncFailDetailMapper.insertSyncFailDetail(syncFailDetail);
    }

    /**
     * 修改同步解析失败详情
     * 
     * @param syncFailDetail 同步解析失败详情
     * @return 结果
     */
    @Override
    public int updateSyncFailDetail(SyncFailDetail syncFailDetail)
    {
        return syncFailDetailMapper.updateSyncFailDetail(syncFailDetail);
    }

    /**
     * 删除同步解析失败详情对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSyncFailDetailByIds(String ids)
    {
        return syncFailDetailMapper.deleteSyncFailDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除同步解析失败详情信息
     * 
     * @param packageId 同步解析失败详情ID
     * @return 结果
     */
    @Override
    public int deleteSyncFailDetailById(String packageId)
    {
        return syncFailDetailMapper.deleteSyncFailDetailById(packageId);
    }

    @Override
    public Integer batchInsertSyncFailDetail(List<SyncFailDetail> failDetails) {

        return syncFailDetailMapper.batchInsertSyncFailDetail(failDetails);
    }
}
