Mommy.xml 10.8 KB
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
<?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="MommyMapper">

<resultMap id="MommyExamineInfoResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyExamineInfo">
<result column="EI_ID" property="eiId" jdbcType="VARCHAR"/>
<result column="EI_NAME" property="eiName" jdbcType="VARCHAR"/>
<result column="EI_VALUEMODEID" property="eiValuemodeid" jdbcType="VARCHAR"/>
<result column="EI_VALUEUNITID" property="eiValueunitid" jdbcType="VARCHAR"/>
<result column="EI_DATATYPEID" property="eiDatatypeid" jdbcType="VARCHAR"/>
</resultMap>

<sql id="MommyExamineInfoColumns">
EI_ID,EI_NAME,EI_VALUEMODEID,EI_VALUEUNITID,EI_DATATYPEID
</sql>

<select id="selectMommyExamineInfo" resultMap="MommyExamineInfoResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery">
select
<include refid="MommyExamineInfoColumns"/>
from (select<include refid="MommyExamineInfoColumns"/>,rownum r
from (
select
<include refid="MommyExamineInfoColumns"/>
from MOMMY_EXAMINEINFO t
where EI_OPERTIME >= #{startTime}
) h where
<![CDATA[ rownum <= #{endRow} ]]>
)
where
<![CDATA[ r >= #{startRow} ]]>
</select>




<resultMap id="MommyEmployeeResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyEmployee">
<result column="E_ID" property="eId" jdbcType="VARCHAR"/>
<result column="E_NAME" property="eName" jdbcType="VARCHAR"/>
<result column="E_SEX" property="eSex" jdbcType="INTEGER"/>
<result column="E_HOSPITALID" property="eHospitalid" jdbcType="VARCHAR"/>
<result column="E_JOBTITLEID" property="eJobtitleid" jdbcType="VARCHAR"/>
<result column="E_DEPTID" property="eDeptid" jdbcType="VARCHAR"/>
</resultMap>

<sql id="MommyEmployeeColumns">
E_ID,E_NAME,E_SEX,E_HOSPITALID,E_JOBTITLEID,E_DEPTID
</sql>

<select id="selectMommyEmployee" resultMap="MommyEmployeeResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery">
select
<include refid="MommyEmployeeColumns"/>
from (select<include refid="MommyEmployeeColumns"/>,rownum r
from (
select
<include refid="MommyEmployeeColumns"/>
from MOMMY_EMPLOYEE t
where E_OPERTIME >= #{startTime}
) h where
<![CDATA[ rownum <= #{endRow} ]]>
)
where
<![CDATA[ r >= #{startRow} ]]>
</select>




<resultMap id="MommyPatientResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyPatient">
<result column="P_NO" property="pNo" jdbcType="VARCHAR"/>
<result column="P_OPERUSER" property="pOperuser" jdbcType="VARCHAR"/>
<result column="P_TYPE" property="pType" jdbcType="INTEGER"/>
<result column="P_ISVALID" property="isValid" jdbcType="INTEGER"/>
<result column="P_PLATPATIENTID" property="pPatientid" jdbcType="VARCHAR"/>
<result column="P_LASTMENSTRUALPERIOD" property="pLastmenstrualperiod" jdbcType="TIMESTAMP"/>
<result column="P_SERVICETYPE" property="serviceType" jdbcType="INTEGER"/>
<result column="P_ISVIP" property="vip" jdbcType="INTEGER"/>
</resultMap>

<sql id="MommyPatientColumns">
P_NO,P_OPERUSER,P_TYPE,P_PLATPATIENTID,P_LASTMENSTRUALPERIOD,P_ISVALID,P_SERVICETYPE,P_ISVIP
</sql>

<select id="selectMommyPatient" resultMap="MommyPatientResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery">
select
<include refid="MommyPatientColumns"/>
from (select<include refid="MommyPatientColumns"/>,rownum r
from (
select
<include refid="MommyPatientColumns"/>
from MOMMY_PATIENT t
where P_OPERTIME >= #{startTime} <if test="hospitalForeignId != null and hospitalForeignId != ''"> and p_hospitalid = #{hospitalForeignId} </if>
) h where
<![CDATA[ rownum <= #{endRow} ]]>
)
where
<![CDATA[ r >= #{startRow} ]]>
</select>




<resultMap id="MommyPatientinfoResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyPatientinfo">
<result column="PI_ID" property="piId" jdbcType="VARCHAR"/>
<result column="PI_NAME" property="piName" jdbcType="VARCHAR"/>
<result column="PI_SEX" property="piSex" jdbcType="INTEGER"/>
<result column="PI_ISDELETE" property="isDeleted" jdbcType="INTEGER"/>
<result column="PI_KIDSTYPE" property="piKidstype" jdbcType="INTEGER"/>
<result column="PI_BIRTHDAY" property="piBirthday" jdbcType="TIMESTAMP"/>
<result column="PI_MOTHERPHONE" property="piMotherphone" jdbcType="VARCHAR"/>
<result column="PI_OPERUSER" property="piOperuser" jdbcType="VARCHAR"/>
<result column="PI_PLATPATIENTID" property="piPatientid" jdbcType="VARCHAR"/>
<result column="PI_SERVICETYPE" property="serviceType" jdbcType="INTEGER"/>
<result column="PI_ISVIP" property="vip" jdbcType="INTEGER"/>
</resultMap>

<sql id="MommyPatientinfoColumns">
PI_ID,PI_NAME,PI_SEX,PI_KIDSTYPE,PI_BIRTHDAY,PI_MOTHERPHONE,PI_OPERUSER,PI_PLATPATIENTID,PI_ISDELETE,PI_SERVICETYPE,PI_ISVIP
</sql>

<select id="selectMommyPatientinfo" resultMap="MommyPatientinfoResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery">
select
<include refid="MommyPatientinfoColumns"/>
from (select<include refid="MommyPatientinfoColumns"/>,rownum r
from (
select
<include refid="MommyPatientinfoColumns"/>
from MOMMY_PATIENTINFO t
where PI_OPERTIME >= #{startTime} <if test="hospitalForeignId != null and hospitalForeignId != ''"> and pi_bookbuildinghospitalid = #{hospitalForeignId} </if>
) h where
<![CDATA[ rownum <= #{endRow} ]]>
)
where
<![CDATA[ r >= #{startRow} ]]>
</select>




<resultMap id="MommyChildexaminerecordResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyChildexaminerecord">
<result column="CER_ID" property="cerId" jdbcType="VARCHAR"/>
<result column="CER_PATIENTID" property="cerPatientid" jdbcType="VARCHAR"/>
<result column="CER_EXAMINDATE" property="cerExaminedate" jdbcType="TIMESTAMP"/>
<result column="CER_EXAMINHOSPITAL" property="cerExaminehospital" jdbcType="VARCHAR"/>
<result column="CER_MODIFIEDOPERATOR" property="cerOperator" jdbcType="VARCHAR"/>
<result column="CER_REMARKS" property="cerRemarks" jdbcType="VARCHAR"/>
</resultMap>

<sql id="MommyChildexaminerecordColumns">
CER_ID,CER_PATIENTID,CER_EXAMINDATE,CER_EXAMINHOSPITAL,CER_MODIFIEDOPERATOR,CER_REMARKS
</sql>

<select id="selectMommyChildexaminerecord" resultMap="MommyChildexaminerecordResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery">
select
<include refid="MommyChildexaminerecordColumns"/>
from (select<include refid="MommyChildexaminerecordColumns"/>,rownum r
from (
select
<include refid="MommyChildexaminerecordColumns"/>
from MOMMY_CHILDEXAMINRECORD t
where CER_MODIFIEDTIME >= #{startTime} <if test="condition != null and condition != ''"> and ${condition} </if>
) h where
<![CDATA[ rownum <= #{endRow} ]]>
)
where
<![CDATA[ r >= #{startRow} ]]>
</select>




<resultMap id="MommyExamineResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyExamine">
<result column="E_ID" property="eId" jdbcType="VARCHAR"/>
<result column="E_CHILDEXAMINID" property="eChildexamineid" jdbcType="VARCHAR"/>
<result column="E_EXAMINEID" property="eExamineid" jdbcType="VARCHAR"/>
<result column="E_RESULT" property="eResult" jdbcType="VARCHAR"/>
<result column="E_UNIT" property="eUnit" jdbcType="VARCHAR"/>
<result column="E_EVALUATION" property="eEvaluation" jdbcType="VARCHAR"/>
</resultMap>

<sql id="MommyExamineColumns">
E_ID,E_CHILDEXAMINID,E_EXAMINEID,E_RESULT,E_UNIT,E_EVALUATION
</sql>

<select id="selectMommyExamine" resultMap="MommyExamineResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery">
select
<include refid="MommyExamineColumns"/>
from (select<include refid="MommyExamineColumns"/>,rownum r
from (
select
<include refid="MommyExamineColumns"/>
from MOMMY_EXAMINE t
where E_CHILDEXAMINID = #{ext1}
) h where
<![CDATA[ rownum <= #{endRow} ]]>
)
where
<![CDATA[ r >= #{startRow} ]]>
</select>

<select id="selectExamineDiagnosis" resultType="java.lang.String" parameterType="java.lang.String">
select ED_DIAGNOSISCONTENT FROM Mommy_ExamineDiagnosis WHERE ED_TRIAGEORDERNO = #{triageOrderNo} and ED_ISVALID = 1
</select>

<resultMap id="GuideTheWomenResultMap" type="PlatDataContent">
<result column="DC_NAME" property="dcId" jdbcType="VARCHAR"/>
<result column="ER_CONTENT" property="dcName" jdbcType="VARCHAR"/>
<result column="ES_PREGNANCYWEEK" property="week" jdbcType="INTEGER"/>
</resultMap>

<select id="selectGuideTheWomen" resultMap="GuideTheWomenResultMap" parameterType="java.lang.Integer">
select ES_PREGNANCYWEEK,DC_NAME,ER_CONTENT FROM V_GUIDETHEWOMEN
<if test="week != null">
WHERE ES_PREGNANCYWEEK = #{week}
</if>
</select>

<resultMap id="DcIdNameResultMap" type="com.lymsh.mommybaby.earlydata.model.PlatDataContent">
<result column="DC_ID" property="dcId" jdbcType="VARCHAR"/>
<result column="DC_NAME" property="dcName" jdbcType="VARCHAR"/>
</resultMap>

<select id="selectDcIdName" resultMap="DcIdNameResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery">
select DC_ID,DC_NAME FROM ${tableName}
</select>

<resultMap id="DiagnosisViewResultMap" type="com.lymsh.mommybaby.earlydata.model.DiagnosisView">
<result column="dh_pasthistoryid" property="storyId" jdbcType="VARCHAR"/>
<result column="dh_name" property="dhName" jdbcType="VARCHAR"/>
<result column="dh_historyinfo" property="historyInfo" jdbcType="VARCHAR"/>
<result column="dh_historytypeid" property="historyTypeId" jdbcType="VARCHAR"/>
</resultMap>

<select id="selectDiagnosisView" resultMap="DiagnosisViewResultMap" parameterType="java.lang.String">
select dh_pasthistoryid,decode(dh_name,'',(select dc_name from plat_datacontent where dc_id=dh_pasthistoryid),dh_name) as dh_name
,dh_historyinfo,dh_historytypeid from mommy_diseasehistory where dh_historytypeid in('77','d0b47bdc-c516-4f86-95fa-176a33ca73bf') and DH_TRIAGEORDERNO=#{triageOrderNo}
</select>





</mapper>