InpPatientInfoMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.xinxin.topro.pubservice.mysqlmapper.InpPatientInfoMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.base.sqlservermodel.PatientInfo" >
  5. <result column="VisitZone" property="visitzone" jdbcType="INTEGER" />
  6. <result column="DepartNo" property="departno" jdbcType="VARCHAR" />
  7. <result column="VisitNo" property="visitno" jdbcType="VARCHAR" />
  8. <result column="ChartNo" property="chartno" jdbcType="VARCHAR" />
  9. <result column="PtName" property="ptname" jdbcType="VARCHAR" />
  10. <result column="Gender" property="gender" jdbcType="VARCHAR" />
  11. <result column="NursingLevel" property="nursinglevel" jdbcType="CHAR" />
  12. <result column="CriticalPatient" property="criticalpatient" jdbcType="CHAR" />
  13. <result column="FoodCategory" property="foodcategory" jdbcType="CHAR" />
  14. <result column="Age" property="age" jdbcType="VARCHAR" />
  15. <result column="BirthDay" property="birthday" jdbcType="DATE" />
  16. <result column="DivNo" property="divno" jdbcType="VARCHAR" />
  17. <result column="BedNo" property="bedno" jdbcType="VARCHAR" />
  18. <result column="AdmitTime" property="admittime" jdbcType="TIMESTAMP" />
  19. <result column="PreDischargeTime" property="predischargetime" jdbcType="CHAR" />
  20. <result column="DischargeTime" property="dischargetime" jdbcType="CHAR" />
  21. <result column="PtWeight" property="ptweight" jdbcType="DOUBLE" />
  22. <result column="VisitCardNum" property="visitcardnum" jdbcType="CHAR" />
  23. <result column="IdNo" property="idno" jdbcType="VARCHAR" />
  24. <result column="PhyDoctor" property="phydoctor" jdbcType="VARCHAR" />
  25. <result column="NationalityName" property="nationalityname" jdbcType="VARCHAR" />
  26. <result column="NationName" property="nationname" jdbcType="VARCHAR" />
  27. <result column="HomeAddress" property="homeaddress" jdbcType="VARCHAR" />
  28. <result column="Tel" property="tel" jdbcType="VARCHAR" />
  29. <result column="ConRelationshipName" property="conrelationshipname" jdbcType="VARCHAR" />
  30. <result column="ConName" property="conname" jdbcType="VARCHAR" />
  31. <result column="ConTel" property="contel" jdbcType="VARCHAR" />
  32. <result column="CardNo" property="cardno" jdbcType="VARCHAR" />
  33. <result column="HISID" property="hisid" jdbcType="CHAR" />
  34. <result column="InfantID" property="infantid" jdbcType="INTEGER" />
  35. <result column="AdmissDivNo" property="admissdivno" jdbcType="VARCHAR" />
  36. <result column="DischargeDivNo" property="dischargedivno" jdbcType="CHAR" />
  37. <result column="DiagName" property="diagname" jdbcType="VARCHAR" />
  38. <result column="InHospitalStatus" property="inhospitalstatus" jdbcType="INTEGER" />
  39. <result column="ResidentDoctor" property="residentdoctor" jdbcType="VARCHAR" />
  40. <result column="ChiefDoctor" property="chiefdoctor" jdbcType="CHAR" />
  41. <result column="ResponsibleNurse" property="responsiblenurse" jdbcType="VARCHAR" />
  42. <result column="FileFlag" property="fileflag" jdbcType="INTEGER" />
  43. <result column="JobType" property="jobtype" jdbcType="CHAR" />
  44. <result column="Marriage" property="marriage" jdbcType="VARCHAR" />
  45. <result column="NativeName" property="nativename" jdbcType="CHAR" />
  46. <result column="DivName" property="divname" jdbcType="CHAR" />
  47. <result column="DepartName" property="departname" jdbcType="CHAR" />
  48. <result column="AdmissDivName" property="admissdivname" jdbcType="CHAR" />
  49. <result column="MedAllergy" property="medallergy" jdbcType="CHAR" />
  50. <result column="departTime" property="departTime" jdbcType="CHAR"/>
  51. </resultMap>
  52. <select id="getBedRatio" resultMap="BaseResultMap" >
  53. SELECT DISTINCT bedNo from V_PatientInfo
  54. where AdmitTime &lt;= #{etime,jdbcType=TIMESTAMP}
  55. and DischargeTime &gt;= #{stime,jdbcType=TIMESTAMP}
  56. and DepartNo = #{DepartNo}
  57. </select>
  58. <insert id="insert" parameterType="com.xinxin.topro.base.sqlservermodel.PatientInfo" >
  59. insert into v_patientinfo (VisitZone, DepartNo, VisitNo,
  60. ChartNo, PtName, Gender,
  61. NursingLevel, CriticalPatient, FoodCategory,
  62. Name_exp_10, BirthDay, DivNo,
  63. BedNo, AdmitTime, PreDischargeTime,
  64. DischargeTime, PtWeight, VisitCardNum,
  65. IdNo, PhyDoctor, NationalityName,
  66. NationName, HomeAddress, Tel,
  67. ConRelationshipName, ConName, ConTel,
  68. CardNo, HISID, InfantID,
  69. AdmissDivNo, DischargeDivNo, DiagName,
  70. InHospitalStatus, ResidentDoctor, ChiefDoctor,
  71. ResponsibleNurse, FileFlag, JobType,
  72. Marriage, NativeName, DivName,
  73. DepartName, AdmissDivName, MedAllergy
  74. )
  75. values (#{visitzone,jdbcType=INTEGER}, #{departno,jdbcType=VARCHAR}, #{visitno,jdbcType=VARCHAR},
  76. #{chartno,jdbcType=VARCHAR}, #{ptname,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR},
  77. #{nursinglevel,jdbcType=CHAR}, #{criticalpatient,jdbcType=CHAR}, #{foodcategory,jdbcType=CHAR},
  78. #{nameExp10,jdbcType=BIGINT}, #{birthday,jdbcType=DATE}, #{divno,jdbcType=VARCHAR},
  79. #{bedno,jdbcType=VARCHAR}, #{admittime,jdbcType=TIMESTAMP}, #{predischargetime,jdbcType=CHAR},
  80. #{dischargetime,jdbcType=CHAR}, #{ptweight,jdbcType=DOUBLE}, #{visitcardnum,jdbcType=CHAR},
  81. #{idno,jdbcType=VARCHAR}, #{phydoctor,jdbcType=VARCHAR}, #{nationalityname,jdbcType=VARCHAR},
  82. #{nationname,jdbcType=VARCHAR}, #{homeaddress,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR},
  83. #{conrelationshipname,jdbcType=VARCHAR}, #{conname,jdbcType=VARCHAR}, #{contel,jdbcType=VARCHAR},
  84. #{cardno,jdbcType=VARCHAR}, #{hisid,jdbcType=CHAR}, #{infantid,jdbcType=INTEGER},
  85. #{admissdivno,jdbcType=VARCHAR}, #{dischargedivno,jdbcType=CHAR}, #{diagname,jdbcType=VARCHAR},
  86. #{inhospitalstatus,jdbcType=INTEGER}, #{residentdoctor,jdbcType=VARCHAR}, #{chiefdoctor,jdbcType=CHAR},
  87. #{responsiblenurse,jdbcType=VARCHAR}, #{fileflag,jdbcType=INTEGER}, #{jobtype,jdbcType=CHAR},
  88. #{marriage,jdbcType=VARCHAR}, #{nativename,jdbcType=CHAR}, #{divname,jdbcType=CHAR},
  89. #{departname,jdbcType=CHAR}, #{admissdivname,jdbcType=CHAR}, #{medallergy,jdbcType=CHAR}
  90. )
  91. </insert>
  92. <insert id="insertSelective" parameterType="com.xinxin.topro.base.sqlservermodel.PatientInfo" >
  93. insert into v_patientinfo
  94. <trim prefix="(" suffix=")" suffixOverrides="," >
  95. <if test="visitzone != null" >
  96. VisitZone,
  97. </if>
  98. <if test="departno != null" >
  99. DepartNo,
  100. </if>
  101. <if test="visitno != null" >
  102. VisitNo,
  103. </if>
  104. <if test="chartno != null" >
  105. ChartNo,
  106. </if>
  107. <if test="ptname != null" >
  108. PtName,
  109. </if>
  110. <if test="gender != null" >
  111. Gender,
  112. </if>
  113. <if test="nursinglevel != null" >
  114. NursingLevel,
  115. </if>
  116. <if test="criticalpatient != null" >
  117. CriticalPatient,
  118. </if>
  119. <if test="foodcategory != null" >
  120. FoodCategory,
  121. </if>
  122. <if test="nameExp10 != null" >
  123. Name_exp_10,
  124. </if>
  125. <if test="birthday != null" >
  126. BirthDay,
  127. </if>
  128. <if test="divno != null" >
  129. DivNo,
  130. </if>
  131. <if test="bedno != null" >
  132. BedNo,
  133. </if>
  134. <if test="admittime != null" >
  135. AdmitTime,
  136. </if>
  137. <if test="predischargetime != null" >
  138. PreDischargeTime,
  139. </if>
  140. <if test="dischargetime != null" >
  141. DischargeTime,
  142. </if>
  143. <if test="ptweight != null" >
  144. PtWeight,
  145. </if>
  146. <if test="visitcardnum != null" >
  147. VisitCardNum,
  148. </if>
  149. <if test="idno != null" >
  150. IdNo,
  151. </if>
  152. <if test="phydoctor != null" >
  153. PhyDoctor,
  154. </if>
  155. <if test="nationalityname != null" >
  156. NationalityName,
  157. </if>
  158. <if test="nationname != null" >
  159. NationName,
  160. </if>
  161. <if test="homeaddress != null" >
  162. HomeAddress,
  163. </if>
  164. <if test="tel != null" >
  165. Tel,
  166. </if>
  167. <if test="conrelationshipname != null" >
  168. ConRelationshipName,
  169. </if>
  170. <if test="conname != null" >
  171. ConName,
  172. </if>
  173. <if test="contel != null" >
  174. ConTel,
  175. </if>
  176. <if test="cardno != null" >
  177. CardNo,
  178. </if>
  179. <if test="hisid != null" >
  180. HISID,
  181. </if>
  182. <if test="infantid != null" >
  183. InfantID,
  184. </if>
  185. <if test="admissdivno != null" >
  186. AdmissDivNo,
  187. </if>
  188. <if test="dischargedivno != null" >
  189. DischargeDivNo,
  190. </if>
  191. <if test="diagname != null" >
  192. DiagName,
  193. </if>
  194. <if test="inhospitalstatus != null" >
  195. InHospitalStatus,
  196. </if>
  197. <if test="residentdoctor != null" >
  198. ResidentDoctor,
  199. </if>
  200. <if test="chiefdoctor != null" >
  201. ChiefDoctor,
  202. </if>
  203. <if test="responsiblenurse != null" >
  204. ResponsibleNurse,
  205. </if>
  206. <if test="fileflag != null" >
  207. FileFlag,
  208. </if>
  209. <if test="jobtype != null" >
  210. JobType,
  211. </if>
  212. <if test="marriage != null" >
  213. Marriage,
  214. </if>
  215. <if test="nativename != null" >
  216. NativeName,
  217. </if>
  218. <if test="divname != null" >
  219. DivName,
  220. </if>
  221. <if test="departname != null" >
  222. DepartName,
  223. </if>
  224. <if test="admissdivname != null" >
  225. AdmissDivName,
  226. </if>
  227. <if test="medallergy != null" >
  228. MedAllergy,
  229. </if>
  230. </trim>
  231. <trim prefix="values (" suffix=")" suffixOverrides="," >
  232. <if test="visitzone != null" >
  233. #{visitzone,jdbcType=INTEGER},
  234. </if>
  235. <if test="departno != null" >
  236. #{departno,jdbcType=VARCHAR},
  237. </if>
  238. <if test="visitno != null" >
  239. #{visitno,jdbcType=VARCHAR},
  240. </if>
  241. <if test="chartno != null" >
  242. #{chartno,jdbcType=VARCHAR},
  243. </if>
  244. <if test="ptname != null" >
  245. #{ptname,jdbcType=VARCHAR},
  246. </if>
  247. <if test="gender != null" >
  248. #{gender,jdbcType=VARCHAR},
  249. </if>
  250. <if test="nursinglevel != null" >
  251. #{nursinglevel,jdbcType=CHAR},
  252. </if>
  253. <if test="criticalpatient != null" >
  254. #{criticalpatient,jdbcType=CHAR},
  255. </if>
  256. <if test="foodcategory != null" >
  257. #{foodcategory,jdbcType=CHAR},
  258. </if>
  259. <if test="nameExp10 != null" >
  260. #{nameExp10,jdbcType=BIGINT},
  261. </if>
  262. <if test="birthday != null" >
  263. #{birthday,jdbcType=DATE},
  264. </if>
  265. <if test="divno != null" >
  266. #{divno,jdbcType=VARCHAR},
  267. </if>
  268. <if test="bedno != null" >
  269. #{bedno,jdbcType=VARCHAR},
  270. </if>
  271. <if test="admittime != null" >
  272. #{admittime,jdbcType=TIMESTAMP},
  273. </if>
  274. <if test="predischargetime != null" >
  275. #{predischargetime,jdbcType=CHAR},
  276. </if>
  277. <if test="dischargetime != null" >
  278. #{dischargetime,jdbcType=CHAR},
  279. </if>
  280. <if test="ptweight != null" >
  281. #{ptweight,jdbcType=DOUBLE},
  282. </if>
  283. <if test="visitcardnum != null" >
  284. #{visitcardnum,jdbcType=CHAR},
  285. </if>
  286. <if test="idno != null" >
  287. #{idno,jdbcType=VARCHAR},
  288. </if>
  289. <if test="phydoctor != null" >
  290. #{phydoctor,jdbcType=VARCHAR},
  291. </if>
  292. <if test="nationalityname != null" >
  293. #{nationalityname,jdbcType=VARCHAR},
  294. </if>
  295. <if test="nationname != null" >
  296. #{nationname,jdbcType=VARCHAR},
  297. </if>
  298. <if test="homeaddress != null" >
  299. #{homeaddress,jdbcType=VARCHAR},
  300. </if>
  301. <if test="tel != null" >
  302. #{tel,jdbcType=VARCHAR},
  303. </if>
  304. <if test="conrelationshipname != null" >
  305. #{conrelationshipname,jdbcType=VARCHAR},
  306. </if>
  307. <if test="conname != null" >
  308. #{conname,jdbcType=VARCHAR},
  309. </if>
  310. <if test="contel != null" >
  311. #{contel,jdbcType=VARCHAR},
  312. </if>
  313. <if test="cardno != null" >
  314. #{cardno,jdbcType=VARCHAR},
  315. </if>
  316. <if test="hisid != null" >
  317. #{hisid,jdbcType=CHAR},
  318. </if>
  319. <if test="infantid != null" >
  320. #{infantid,jdbcType=INTEGER},
  321. </if>
  322. <if test="admissdivno != null" >
  323. #{admissdivno,jdbcType=VARCHAR},
  324. </if>
  325. <if test="dischargedivno != null" >
  326. #{dischargedivno,jdbcType=CHAR},
  327. </if>
  328. <if test="diagname != null" >
  329. #{diagname,jdbcType=VARCHAR},
  330. </if>
  331. <if test="inhospitalstatus != null" >
  332. #{inhospitalstatus,jdbcType=INTEGER},
  333. </if>
  334. <if test="residentdoctor != null" >
  335. #{residentdoctor,jdbcType=VARCHAR},
  336. </if>
  337. <if test="chiefdoctor != null" >
  338. #{chiefdoctor,jdbcType=CHAR},
  339. </if>
  340. <if test="responsiblenurse != null" >
  341. #{responsiblenurse,jdbcType=VARCHAR},
  342. </if>
  343. <if test="fileflag != null" >
  344. #{fileflag,jdbcType=INTEGER},
  345. </if>
  346. <if test="jobtype != null" >
  347. #{jobtype,jdbcType=CHAR},
  348. </if>
  349. <if test="marriage != null" >
  350. #{marriage,jdbcType=VARCHAR},
  351. </if>
  352. <if test="nativename != null" >
  353. #{nativename,jdbcType=CHAR},
  354. </if>
  355. <if test="divname != null" >
  356. #{divname,jdbcType=CHAR},
  357. </if>
  358. <if test="departname != null" >
  359. #{departname,jdbcType=CHAR},
  360. </if>
  361. <if test="admissdivname != null" >
  362. #{admissdivname,jdbcType=CHAR},
  363. </if>
  364. <if test="medallergy != null" >
  365. #{medallergy,jdbcType=CHAR},
  366. </if>
  367. </trim>
  368. </insert>
  369. </mapper>