<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.server.reportmanager.mapper.TbasicMapper">

    <select id="getPatientIds" resultType="java.lang.String">
        select  patient_id
        from docus_medicalrecord.t_basic
        WHERE 1=1
          <if test="qrDto.inpatientNo  != null and qrDto.inpatientNo != ''">
            and inpatient_no=#{qrDto.inpatientNo}
          </if>
        <if test="qrDto.admissTimes  != null ">
            and  admiss_times=#{qrDto.admissTimes}
        </if>
        <if test="qrDto.admissDateBegin  != null and qrDto.admissDateBegin != ''">
            and admiss_date BETWEEN #{qrDto.admissDateBegin} and #{qrDto.admissDateEnd}
        </if>
        <if test="qrDto.disDateBegin != null and qrDto.disDateBegin != ''">
            and dis_date BETWEEN #{qrDto.disDateBegin} and #{qrDto.disDateEnd}
        </if>
        <if test="qrDto.name  != null and qrDto.name != ''">
            and name=#{qrDto.name}
        </if>
        <if test="qrDto.idCard  != null and qrDto.idCard != ''">
            and id_card=#{qrDto.idCard}
        </if>
        <if test="qrDto.jzh  != null and qrDto.jzh != ''">
            and jzh=#{qrDto.jzh}
        </if>
        LIMIT ${offset},${size}
    </select>
</mapper>
