
package com.tmerclub.cloud.platform.service.impl;

import com.tmerclub.cloud.api.platform.vo.OfflineHandleEventItemVO;
import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.util.PageUtil;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.platform.mapper.OfflineHandleEventItemMapper;
import com.tmerclub.cloud.platform.model.OfflineHandleEventItem;
import com.tmerclub.cloud.platform.service.OfflineHandleEventItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 下线处理事件记录项
 *
 * @author YXF
 * @date 2021-01-15 17:46:26
 */
@Service
public class OfflineHandleEventItemServiceImpl implements OfflineHandleEventItemService {

    @Autowired
    private OfflineHandleEventItemMapper offlineHandleEventItemMapper;

    @Override
    public PageVO<OfflineHandleEventItemVO> page(PageDTO pageDTO) {
        return PageUtil.doPage(pageDTO, () -> offlineHandleEventItemMapper.list());
    }

    @Override
    public OfflineHandleEventItemVO getByEventItemId(Long eventItemId) {
        return offlineHandleEventItemMapper.getByEventItemId(eventItemId);
    }

    @Override
    public void save(OfflineHandleEventItem offlineHandleEventItem) {
        offlineHandleEventItemMapper.save(offlineHandleEventItem);
    }

    @Override
    public void update(OfflineHandleEventItem offlineHandleEventItem) {
        offlineHandleEventItemMapper.update(offlineHandleEventItem);
    }

    @Override
    public OfflineHandleEventItem getNewOfflineHandleEventItem(Long eventId) {
        return offlineHandleEventItemMapper.getNewOfflineHandleEventItem(eventId);
    }

    @Override
    public void deleteByEventIds(List<Long> eventIds) {
        offlineHandleEventItemMapper.deleteByEventIds(eventIds);
    }
}
