package thyyxxk.webserver.dao.his.ca;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import thyyxxk.webserver.entity.ca.vo.move.PatientInfo;
import thyyxxk.webserver.entity.ca.vo.move.SignMedicalRecordsOnBehalfOfOthers;

import java.util.List;

@Mapper
public interface CaPatientSignDao {

    @Select("select rtrim(inpatient_no) as patNo, admiss_times as times, rtrim(sex) as gender,rtrim(name) as name \n" +
            "from zy_actpatient\n" +
            "where inpatient_no = #{patNo}")
    PatientInfo selectPatientInfo(@Param("patNo") String patNo);

    @Select("select            emr_name        as name,\n" +
            "                  emr_document_id as documentId,\n" +
            "                  modify_id,\n" +
            "    modify_name = (select rtrim(name) from a_employee_mi where code = modify_id),\n" +
            "                  modify_date " +
            "from emr_patient_data  " +
            "where pat_no = #{patNo}\n" +
            "  and times = #{times}\n" +
            "  and del_flag <> 1\n" +
            "  and sign_complete = 1\n" +
            "  and sign_type = 2")
    List<SignMedicalRecordsOnBehalfOfOthers> selectEmr(String patNo, Integer times);
}
