<?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.test.TestMapper">
<!--   <select id="selectData" resultType="com.lemon.lifecenter.TestDTO"> -->
<!--     <![CDATA[ -->
<!--       SELECT * -->
<!--         FROM member -->
<!--     ]]> -->
<!--   </select> -->
  
<!--   <select id="selectOne" parameterType="com.lemon.lifecenter.TestSDTO" resultType="com.lemon.lifecenter.TestDTO"> -->
<!--   	<![CDATA[ -->
<!--       SELECT * -->
<!--         FROM member -->
<!--        WHERE id = 'admin' -->
<!--     ]]> -->
<!--   </select> -->
  
  <insert id="insertPatientCare" parameterType="com.lemon.lifecenter.dto.PatientDTO">
    <![CDATA[ 
       INSERT 
         INTO patient_care
              ( patient_name, gender, ward_number, room_number, final_clinic_date, hospitalization_date, state, center_code, jumin, patient_phone, guardian_phone, symptom_start_date, confirmation_date, disisolation_date, basal_disease_yn, drug_yn,drug_content, pregnancy_status, pregnancy_week, id, pw, create_date, update_date, create_by, update_by) 
       VALUES ( #{patientName}, 'M', #{wardNumber}, #{roomNumber}, NOW(), NOW(), 'Y', '0000', #{jumin}, #{patientPhone}, #{guardianPhone}, NOW(), NOW(), NOW(), 'N', 'N','', 'N','', '1504102', #{pw}, NOW(), NOW(), '', '');
     ]]> 
   </insert>
   
   
   <insert id="insertPatientSymptom" parameterType="com.lemon.lifecenter.dto.PatientDTO">
    <![CDATA[ 
       INSERT 
         INTO patient_symptom
              (patient_idx, fever_check, cough_check, colic, cold_fit_check, sputum_check, ocin_check, fever_right, fever_left, fatigue_check, etc_check, etc_content, chest_pain, nose_check, vomiting_check, muscle_pain_check, sore_throat_check, diarrhea_check, headache_check, dyspnea_check) 
       VALUES (#{patientIdx}, IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N'),IF( random() % 2 +1 = 1, 'Y', 'N') )
     ]]> 
   </insert>
   
   <insert id="insertPatientDisease" parameterType="com.lemon.lifecenter.dto.PatientDTO">
    <![CDATA[ 
        INSERT 
          INTO patient_disease 
               (patient_idx, high_blood_pressure_check, low_blood_pressure_check, 
               organ_transplant_check, diabetes_check, respiratory_disease_check, 
               immunological_disease_check, dyspnea_check, cold_fit_check, 
               muscle_pain_check, headache_check, sore_throat_check, 
               smell_palate_check, fatigue_check, heart_disease, 
               liver_disease, [operation], operation_content, 
               allergy_check, kidney_disease, cancer_check, cancer_name, etc_check, etc_content) 
        VALUES (#{patientIdx}, IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), 
                IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), 
                IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), 
                IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), 
                IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), 
                IF( random() % 2 +1 = 1, 'Y', 'N'), '', 'sample content', 
                IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), IF( random() % 2 +1 = 1, 'Y', 'N'), '발암', '', 'sample content' )
    ]]> 
   </insert>
   
   
</mapper>