<?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.lemon.lifecenter.mapper.MobilePatientMapper">
    <select id="selectMPatientCount" parameterType="PatientDTO" resultType="int">
        <![CDATA[
            SELECT COUNT(*) total
              FROM PATIENT_CARE
             WHERE 1 = 1
               AND ID = #{id}
               AND PW = #{pw}
               AND CENTER_CODE = #{centerCode}
        ]]>
    </select>
    
    <select id="selectMPatientInfo" parameterType="PatientDTO" resultType="PatientDTO">
        <![CDATA[
            SELECT PATIENT_IDX  AS patientIdx,
                   PATIENT_NAME AS patientName,
                   GENDER       AS gender,
                   WARD_NUMBER  AS wardNumber,
                   ROOM_NUMBER  AS roomNumber,
                   CENTER_CODE  AS centerCode,
                   ID           AS id,
                   PW           AS pw
              FROM PATIENT_CARE
             WHERE 1 = 1
               AND ID = #{id}
               AND PW = #{pw}
               AND CENTER_CODE = #{centerCode}
        ]]>
    </select>
</mapper>