package com.ann.demo.service.impl;

import com.ann.demo.entity.interfaceEntity.ArchiveMaster;
import com.ann.demo.repository.ArchiveMasterRepository;
import com.ann.demo.service.ArchiveMasterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: LeiJiaXin
 * @Date: 2019/7/11 20:53
 */
@Service
public class ArchiveMasterServiceImpl implements ArchiveMasterService {

    @Autowired
    private ArchiveMasterRepository archiveMasterRepository;

    @Override
    public void save(ArchiveMaster archiveMaster) {
        archiveMasterRepository.save(archiveMaster);
    }

    @Override
    public ArchiveMaster findByInpNoAndVisitIdAndIsValid(String inpNo, String visitId) throws Exception {
        return archiveMasterRepository.findByInpNoAndVisitIdAndIsValid(inpNo, visitId, 0);
    }
}
