package com.diagbot.service.impl;

import com.diagbot.dto.MedicalRecordDTO;
import com.diagbot.dto.RecordContentDTO;
import com.diagbot.entity.MedicalRecord;
import com.diagbot.mapper.MedicalRecordMapper;
import com.diagbot.service.MedicalRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.diagbot.vo.RecordContentVO;
import com.diagbot.vo.RecordDataVO;
import com.diagbot.vo.RecordTypeVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhoutg
 * @since 2020-04-13
 */
@Service
public class MedicalRecordServiceImpl extends ServiceImpl<MedicalRecordMapper, MedicalRecord> implements MedicalRecordService {

    @Override
    public List<RecordContentDTO> getRecordContent(RecordContentVO recordContentVO) {
        return baseMapper.getRecordContent(recordContentVO);
    }
    @Override
    public List<RecordContentDTO> getRecordData(RecordDataVO recordContentVO) {
        return baseMapper.getRecordData(recordContentVO);
    }

    @Override
    public int getRecordCount(RecordTypeVO recordContentVO) {
        return baseMapper.getRecordCount(recordContentVO);
    }

    @Override
    public List<MedicalRecordDTO> getMedicalRecord(RecordTypeVO recordContentVO) {
        return baseMapper.getMedicalRecord(recordContentVO);
    }

    /**
     * 根据文书编码、医院编码、病人住院编码
     * @param list
     */
    public void updateBatchByKey(List<MedicalRecord> list){
        this.baseMapper.updateBatchByKey(list);
    }
}
