1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?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.PatientPHRHistoryMapper">
- <insert id="insertPHRHistory" parameterType="PatientPHRHistoryDTO" useGeneratedKeys="true">
- <![CDATA[
- INSERT INTO patient_phr_history (patient_idx, phr_type, phr_value, recorded_by_name
- ]]>
- <if test='recordedById != null and recordedById != ""'>
- <![CDATA[
- , recorded_by_id
- ]]>
- </if>
- <![CDATA[
- , create_date)
- VALUE (#{patientIdx}, #{phrType}, #{phrValue}, #{recordedByName}
- ]]>
- <if test='recordedById != null and recordedById != ""'>
- <![CDATA[
- , #{recordedById}
- ]]>
- </if>
- <![CDATA[
- , NOW())
- ]]>
- </insert>
- <select id="selectPHRHistoryCount" parameterType="PatientPHRHistoryDTO" resultType="int">
- <![CDATA[
- SELECT count(*) AS total
- FROM patient_phr_history
- WHERE
- patient_idx = #{patientIdx}
- AND
- phr_type = #{phrType}
- ]]>
- </select>
- <select id="selectPHRHistoryList" parameterType="PatientPHRHistoryDTO" resultType="PatientPHRHistoryDTO">
- <![CDATA[
- SELECT create_date AS createDate,
- phr_value AS phrValue,
- recorded_by_name AS recordedByName
- FROM patient_phr_history
- WHERE
- patient_idx = #{patientIdx}
- AND
- phr_type = #{phrType}
- ORDER BY create_date DESC
- ]]>
- </select>
- </mapper>
|