Fix Bug #562: fallback修复
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
package com.openhis.application.mapper;
|
||||
|
||||
import com.openhis.application.domain.dto.PendingRecordDTO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.openhis.application.domain.entity.MedicalRecord;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 病历数据访问层
|
||||
* 修复 Bug #562:优化 SQL 查询,仅返回必要字段,利用索引加速。
|
||||
* 待写病历数据访问层
|
||||
*
|
||||
* 只查询状态为“待写”(status = 'PENDING')的记录,配合 PageHelper 实现分页。
|
||||
*/
|
||||
@Mapper
|
||||
public interface MedicalRecordMapper {
|
||||
|
||||
@Select("SELECT id, patient_name AS patientName, visit_date AS visitDate, diagnosis " +
|
||||
"FROM emr_medical_record " +
|
||||
"WHERE doctor_id = #{doctorId} AND status = 'PENDING' " +
|
||||
"ORDER BY visit_date DESC")
|
||||
List<PendingRecordDTO> selectPendingByDoctorId(@Param("doctorId") Long doctorId);
|
||||
/**
|
||||
* 查询待写病历(分页由 PageHelper 控制)。
|
||||
*
|
||||
* @return 待写病历列表
|
||||
*/
|
||||
@Select("SELECT * FROM adm_medical_record WHERE status = 'PENDING' ORDER BY create_time DESC")
|
||||
List<MedicalRecord> selectPendingRecords();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user