package com.ruoyi.inhospvisit.api;
|
|
import com.ruoyi.common.core.service.ArchiveReadApi;
|
import com.ruoyi.common.core.service.dto.VisitArchiveRow;
|
import com.ruoyi.inhospvisit.mapper.VisitArchiveMapper;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* {@link ArchiveReadApi} 的实现(<b>常驻 Bean</b>)。
|
*
|
* <h3>为什么实现在本模块</h3>
|
* 出入院随访模块自第 6 步起就自带 {@link VisitArchiveMapper}
|
* (只读 {@code pat_archive} 的 10 列,与 smartor 的
|
* {@code PatArchiveMapper.selectPatArchiveByPatid} 等价)。
|
* 本类只是把它包成 ruoyi-common 的契约,供其它随访模块经契约调用,
|
* 避免每个模块各写一份同表只读 SQL。
|
*
|
* <h3>⚠️ 纯转发</h3>
|
* 不加工条件、不补默认值。查询条件就是原实现的
|
* {@code where id = #{patid} and del_flag = 0}。
|
*/
|
@Slf4j
|
@Component
|
public class DefaultArchiveReadApi implements ArchiveReadApi {
|
|
@Autowired
|
private VisitArchiveMapper visitArchiveMapper;
|
|
@Override
|
public VisitArchiveRow findByPatid(Long patid) {
|
if (patid == null) {
|
return null;
|
}
|
return visitArchiveMapper.selectByPatid(patid);
|
}
|
}
|