InpPatientMapper.xml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  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.inpnurseservice.mysqlmapper.InpPatientMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPatient" >
  5. <id column="IP_ID" property="ipId" jdbcType="INTEGER" />
  6. <result column="IP_PatientNo" property="ipPatientno" jdbcType="VARCHAR" />
  7. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  8. <result column="DD_DepDm" property="ddDepdm" jdbcType="VARCHAR" />
  9. <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
  10. <result column="DB_BedNo" property="dbBedno" jdbcType="VARCHAR" />
  11. <result column="IP_Visit_No" property="ipVisitNo" jdbcType="VARCHAR" />
  12. <result column="IP_Med_Rec" property="ipMedRec" jdbcType="VARCHAR" />
  13. <result column="IP_Height" property="ipHeight" jdbcType="DOUBLE" />
  14. <result column="IP_Weight" property="ipWeight" jdbcType="DOUBLE" />
  15. <result column="IP_Name" property="ipName" jdbcType="VARCHAR" />
  16. <result column="IP_Sex" property="ipSex" jdbcType="INTEGER" />
  17. <result column="IP_Birth" property="ipBirth" jdbcType="TIMESTAMP" />
  18. <result column="IP_ID_Number" property="ipIdNumber" jdbcType="VARCHAR" />
  19. <result column="IP_Citizenship" property="ipCitizenship" jdbcType="VARCHAR" />
  20. <result column="IP_IsMarried" property="ipIsmarried" jdbcType="INTEGER" />
  21. <result column="IP_Nationality" property="ipNationality" jdbcType="VARCHAR" />
  22. <result column="IP_Blood" property="ipBlood" jdbcType="VARCHAR" />
  23. <result column="IP_Home_Address" property="ipHomeAddress" jdbcType="VARCHAR" />
  24. <result column="IP_Telephone" property="ipTelephone" jdbcType="VARCHAR" />
  25. <result column="IP_Contact_Person" property="ipContactPerson" jdbcType="VARCHAR" />
  26. <result column="IP_Relationship" property="ipRelationship" jdbcType="VARCHAR" />
  27. <result column="IP_Contact_Tel" property="ipContactTel" jdbcType="VARCHAR" />
  28. <result column="IP_Medicare_Card" property="ipMedicareCard" jdbcType="VARCHAR" />
  29. <result column="IP_Attending_Doctor" property="ipAttendingDoctor" jdbcType="VARCHAR" />
  30. <result column="IP_Admit_Diagnosis" property="ipAdmitDiagnosis" jdbcType="VARCHAR" />
  31. <result column="IP_Resident_Doctor" property="ipResidentDoctor" jdbcType="VARCHAR" />
  32. <result column="IP_Outpatient_Doctor" property="ipOutpatientDoctor" jdbcType="VARCHAR" />
  33. <result column="IP_Duty_Nurse" property="ipDutyNurse" jdbcType="VARCHAR" />
  34. <result column="IP_Duty_Leader" property="ipDutyLeader" jdbcType="VARCHAR" />
  35. <result column="IP_Hospitalized_Times" property="ipHospitalizedTimes" jdbcType="INTEGER" />
  36. <result column="IP_Status" property="ipStatus" jdbcType="INTEGER" />
  37. <result column="IP_Admit_Time" property="ipAdmitTime" jdbcType="TIMESTAMP" />
  38. <result column="IP_Admit_Dep" property="ipAdmitDep" jdbcType="VARCHAR" />
  39. <result column="IP_Admit_Ward" property="ipAdmitWard" jdbcType="VARCHAR" />
  40. <result column="IP_Admit_Bed" property="ipAdmitBed" jdbcType="VARCHAR" />
  41. <result column="IP_Out_Direction" property="ipOutDirection" jdbcType="VARCHAR" />
  42. <result column="IP_IsInfant" property="ipIsinfant" jdbcType="INTEGER" />
  43. <result column="IP_IsFreeze" property="ipIsfreeze" jdbcType="INTEGER" />
  44. <result column="IP_IsFile" property="ipIsfile" jdbcType="INTEGER" />
  45. <result column="IP_Recall_Reason" property="ipRecallReason" jdbcType="INTEGER" />
  46. <result column="IP_IsArrears" property="ipIsarrears" jdbcType="INTEGER" />
  47. <result column="IP_IsPressure" property="ipIspressure" jdbcType="INTEGER" />
  48. <result column="IP_IsFall" property="ipIsfall" jdbcType="INTEGER" />
  49. <result column="IP_IsConstraint" property="ipIsconstraint" jdbcType="INTEGER" />
  50. <result column="IP_IsInhibition" property="ipIsinhibition" jdbcType="INTEGER" />
  51. <result column="IP_IsFragile" property="ipIsfragile" jdbcType="INTEGER" />
  52. <result column="IP_IsAllergy" property="ipIsallergy" jdbcType="INTEGER" />
  53. <result column="IP_IsPostoperative" property="ipIspostoperative" jdbcType="INTEGER" />
  54. <result column="IP_Operation_Time" property="ipOperationTime" jdbcType="TIMESTAMP" />
  55. <result column="IP_Operator" property="ipOperator" jdbcType="VARCHAR" />
  56. <result column="IP_IsDel" property="ipIsdel" jdbcType="INTEGER" />
  57. <result column="IP_Discharge_Time" property="ipDischargeTime" jdbcType="TIMESTAMP" />
  58. <result column="IP_PreDischarge_Time" property="ipPredischargeTime" jdbcType="TIMESTAMP" />
  59. <result column="IP_Patient_Type" property="ipPatientType" jdbcType="VARCHAR" />
  60. <result column="IP_Nursing_Level" property="ipNursingLevel" jdbcType="VARCHAR" />
  61. <result column="IP_Isolate" property="ipIsolate" jdbcType="INTEGER" />
  62. </resultMap>
  63. <sql id="Base_Column_List" >
  64. IP_ID, IP_PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IP_Visit_No, IP_Med_Rec,
  65. IP_Height, IP_Weight, IP_Name, IP_Sex, IP_Birth, IP_ID_Number, IP_Citizenship, IP_IsMarried,
  66. IP_Nationality, IP_Blood, IP_Home_Address, IP_Telephone, IP_Contact_Person, IP_Relationship,
  67. IP_Contact_Tel, IP_Medicare_Card, IP_Attending_Doctor, IP_Admit_Diagnosis, IP_Resident_Doctor,
  68. IP_Outpatient_Doctor, IP_Duty_Nurse, IP_Duty_Leader, IP_Hospitalized_Times, IP_Status,
  69. IP_Admit_Time, IP_Admit_Dep, IP_Admit_Ward, IP_Admit_Bed, IP_Out_Direction, IP_IsInfant,
  70. IP_IsFreeze, IP_IsFile, IP_Recall_Reason, IP_IsArrears, IP_IsPressure, IP_IsFall,
  71. IP_IsConstraint, IP_IsInhibition, IP_IsFragile, IP_IsAllergy, IP_IsPostoperative,
  72. IP_Operation_Time, IP_Operator, IP_IsDel, IP_Discharge_Time, IP_PreDischarge_Time,
  73. IP_Patient_Type, IP_Nursing_Level, IP_Isolate
  74. </sql>
  75. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  76. select
  77. <include refid="Base_Column_List" />
  78. from inp_patient
  79. where IP_ID = #{ipId,jdbcType=INTEGER}
  80. </select>
  81. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  82. delete from inp_patient
  83. where IP_ID = #{ipId,jdbcType=INTEGER}
  84. </delete>
  85. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPatient" >
  86. insert into inp_patient (IP_ID, IP_PatientNo, HI_ID,
  87. DD_DepDm, DW_WardDm, DB_BedNo,
  88. IP_Visit_No, IP_Med_Rec, IP_Height,
  89. IP_Weight, IP_Name, IP_Sex,
  90. IP_Birth, IP_ID_Number, IP_Citizenship,
  91. IP_IsMarried, IP_Nationality, IP_Blood,
  92. IP_Home_Address, IP_Telephone, IP_Contact_Person,
  93. IP_Relationship, IP_Contact_Tel, IP_Medicare_Card,
  94. IP_Attending_Doctor, IP_Admit_Diagnosis, IP_Resident_Doctor,
  95. IP_Outpatient_Doctor, IP_Duty_Nurse, IP_Duty_Leader,
  96. IP_Hospitalized_Times, IP_Status, IP_Admit_Time,
  97. IP_Admit_Dep, IP_Admit_Ward, IP_Admit_Bed,
  98. IP_Out_Direction, IP_IsInfant, IP_IsFreeze,
  99. IP_IsFile, IP_Recall_Reason, IP_IsArrears,
  100. IP_IsPressure, IP_IsFall, IP_IsConstraint,
  101. IP_IsInhibition, IP_IsFragile, IP_IsAllergy,
  102. IP_IsPostoperative, IP_Operation_Time, IP_Operator,
  103. IP_IsDel, IP_Discharge_Time, IP_PreDischarge_Time,
  104. IP_Patient_Type, IP_Nursing_Level, IP_Isolate
  105. )
  106. values (#{ipId,jdbcType=INTEGER}, #{ipPatientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  107. #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
  108. #{ipVisitNo,jdbcType=VARCHAR}, #{ipMedRec,jdbcType=VARCHAR}, #{ipHeight,jdbcType=DOUBLE},
  109. #{ipWeight,jdbcType=DOUBLE}, #{ipName,jdbcType=VARCHAR}, #{ipSex,jdbcType=INTEGER},
  110. #{ipBirth,jdbcType=TIMESTAMP}, #{ipIdNumber,jdbcType=VARCHAR}, #{ipCitizenship,jdbcType=VARCHAR},
  111. #{ipIsmarried,jdbcType=INTEGER}, #{ipNationality,jdbcType=VARCHAR}, #{ipBlood,jdbcType=VARCHAR},
  112. #{ipHomeAddress,jdbcType=VARCHAR}, #{ipTelephone,jdbcType=VARCHAR}, #{ipContactPerson,jdbcType=VARCHAR},
  113. #{ipRelationship,jdbcType=VARCHAR}, #{ipContactTel,jdbcType=VARCHAR}, #{ipMedicareCard,jdbcType=VARCHAR},
  114. #{ipAttendingDoctor,jdbcType=VARCHAR}, #{ipAdmitDiagnosis,jdbcType=VARCHAR}, #{ipResidentDoctor,jdbcType=VARCHAR},
  115. #{ipOutpatientDoctor,jdbcType=VARCHAR}, #{ipDutyNurse,jdbcType=VARCHAR}, #{ipDutyLeader,jdbcType=VARCHAR},
  116. #{ipHospitalizedTimes,jdbcType=INTEGER}, #{ipStatus,jdbcType=INTEGER}, #{ipAdmitTime,jdbcType=TIMESTAMP},
  117. #{ipAdmitDep,jdbcType=VARCHAR}, #{ipAdmitWard,jdbcType=VARCHAR}, #{ipAdmitBed,jdbcType=VARCHAR},
  118. #{ipOutDirection,jdbcType=VARCHAR}, #{ipIsinfant,jdbcType=INTEGER}, #{ipIsfreeze,jdbcType=INTEGER},
  119. #{ipIsfile,jdbcType=INTEGER}, #{ipRecallReason,jdbcType=INTEGER}, #{ipIsarrears,jdbcType=INTEGER},
  120. #{ipIspressure,jdbcType=INTEGER}, #{ipIsfall,jdbcType=INTEGER}, #{ipIsconstraint,jdbcType=INTEGER},
  121. #{ipIsinhibition,jdbcType=INTEGER}, #{ipIsfragile,jdbcType=INTEGER}, #{ipIsallergy,jdbcType=INTEGER},
  122. #{ipIspostoperative,jdbcType=INTEGER}, #{ipOperationTime,jdbcType=TIMESTAMP}, #{ipOperator,jdbcType=VARCHAR},
  123. #{ipIsdel,jdbcType=INTEGER}, #{ipDischargeTime,jdbcType=TIMESTAMP}, #{ipPredischargeTime,jdbcType=TIMESTAMP},
  124. #{ipPatientType,jdbcType=VARCHAR}, #{ipNursingLevel,jdbcType=VARCHAR}, #{ipIsolate,jdbcType=INTEGER}
  125. )
  126. </insert>
  127. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPatient" >
  128. insert into inp_patient
  129. <trim prefix="(" suffix=")" suffixOverrides="," >
  130. <if test="ipId != null" >
  131. IP_ID,
  132. </if>
  133. <if test="ipPatientno != null" >
  134. IP_PatientNo,
  135. </if>
  136. <if test="hiId != null" >
  137. HI_ID,
  138. </if>
  139. <if test="ddDepdm != null" >
  140. DD_DepDm,
  141. </if>
  142. <if test="dwWarddm != null" >
  143. DW_WardDm,
  144. </if>
  145. <if test="dbBedno != null" >
  146. DB_BedNo,
  147. </if>
  148. <if test="ipVisitNo != null" >
  149. IP_Visit_No,
  150. </if>
  151. <if test="ipMedRec != null" >
  152. IP_Med_Rec,
  153. </if>
  154. <if test="ipHeight != null" >
  155. IP_Height,
  156. </if>
  157. <if test="ipWeight != null" >
  158. IP_Weight,
  159. </if>
  160. <if test="ipName != null" >
  161. IP_Name,
  162. </if>
  163. <if test="ipSex != null" >
  164. IP_Sex,
  165. </if>
  166. <if test="ipBirth != null" >
  167. IP_Birth,
  168. </if>
  169. <if test="ipIdNumber != null" >
  170. IP_ID_Number,
  171. </if>
  172. <if test="ipCitizenship != null" >
  173. IP_Citizenship,
  174. </if>
  175. <if test="ipIsmarried != null" >
  176. IP_IsMarried,
  177. </if>
  178. <if test="ipNationality != null" >
  179. IP_Nationality,
  180. </if>
  181. <if test="ipBlood != null" >
  182. IP_Blood,
  183. </if>
  184. <if test="ipHomeAddress != null" >
  185. IP_Home_Address,
  186. </if>
  187. <if test="ipTelephone != null" >
  188. IP_Telephone,
  189. </if>
  190. <if test="ipContactPerson != null" >
  191. IP_Contact_Person,
  192. </if>
  193. <if test="ipRelationship != null" >
  194. IP_Relationship,
  195. </if>
  196. <if test="ipContactTel != null" >
  197. IP_Contact_Tel,
  198. </if>
  199. <if test="ipMedicareCard != null" >
  200. IP_Medicare_Card,
  201. </if>
  202. <if test="ipAttendingDoctor != null" >
  203. IP_Attending_Doctor,
  204. </if>
  205. <if test="ipAdmitDiagnosis != null" >
  206. IP_Admit_Diagnosis,
  207. </if>
  208. <if test="ipResidentDoctor != null" >
  209. IP_Resident_Doctor,
  210. </if>
  211. <if test="ipOutpatientDoctor != null" >
  212. IP_Outpatient_Doctor,
  213. </if>
  214. <if test="ipDutyNurse != null" >
  215. IP_Duty_Nurse,
  216. </if>
  217. <if test="ipDutyLeader != null" >
  218. IP_Duty_Leader,
  219. </if>
  220. <if test="ipHospitalizedTimes != null" >
  221. IP_Hospitalized_Times,
  222. </if>
  223. <if test="ipStatus != null" >
  224. IP_Status,
  225. </if>
  226. <if test="ipAdmitTime != null" >
  227. IP_Admit_Time,
  228. </if>
  229. <if test="ipAdmitDep != null" >
  230. IP_Admit_Dep,
  231. </if>
  232. <if test="ipAdmitWard != null" >
  233. IP_Admit_Ward,
  234. </if>
  235. <if test="ipAdmitBed != null" >
  236. IP_Admit_Bed,
  237. </if>
  238. <if test="ipOutDirection != null" >
  239. IP_Out_Direction,
  240. </if>
  241. <if test="ipIsinfant != null" >
  242. IP_IsInfant,
  243. </if>
  244. <if test="ipIsfreeze != null" >
  245. IP_IsFreeze,
  246. </if>
  247. <if test="ipIsfile != null" >
  248. IP_IsFile,
  249. </if>
  250. <if test="ipRecallReason != null" >
  251. IP_Recall_Reason,
  252. </if>
  253. <if test="ipIsarrears != null" >
  254. IP_IsArrears,
  255. </if>
  256. <if test="ipIspressure != null" >
  257. IP_IsPressure,
  258. </if>
  259. <if test="ipIsfall != null" >
  260. IP_IsFall,
  261. </if>
  262. <if test="ipIsconstraint != null" >
  263. IP_IsConstraint,
  264. </if>
  265. <if test="ipIsinhibition != null" >
  266. IP_IsInhibition,
  267. </if>
  268. <if test="ipIsfragile != null" >
  269. IP_IsFragile,
  270. </if>
  271. <if test="ipIsallergy != null" >
  272. IP_IsAllergy,
  273. </if>
  274. <if test="ipIspostoperative != null" >
  275. IP_IsPostoperative,
  276. </if>
  277. <if test="ipOperationTime != null" >
  278. IP_Operation_Time,
  279. </if>
  280. <if test="ipOperator != null" >
  281. IP_Operator,
  282. </if>
  283. <if test="ipIsdel != null" >
  284. IP_IsDel,
  285. </if>
  286. <if test="ipDischargeTime != null" >
  287. IP_Discharge_Time,
  288. </if>
  289. <if test="ipPredischargeTime != null" >
  290. IP_PreDischarge_Time,
  291. </if>
  292. <if test="ipPatientType != null" >
  293. IP_Patient_Type,
  294. </if>
  295. <if test="ipNursingLevel != null" >
  296. IP_Nursing_Level,
  297. </if>
  298. <if test="ipIsolate != null" >
  299. IP_Isolate,
  300. </if>
  301. </trim>
  302. <trim prefix="values (" suffix=")" suffixOverrides="," >
  303. <if test="ipId != null" >
  304. #{ipId,jdbcType=INTEGER},
  305. </if>
  306. <if test="ipPatientno != null" >
  307. #{ipPatientno,jdbcType=VARCHAR},
  308. </if>
  309. <if test="hiId != null" >
  310. #{hiId,jdbcType=INTEGER},
  311. </if>
  312. <if test="ddDepdm != null" >
  313. #{ddDepdm,jdbcType=VARCHAR},
  314. </if>
  315. <if test="dwWarddm != null" >
  316. #{dwWarddm,jdbcType=VARCHAR},
  317. </if>
  318. <if test="dbBedno != null" >
  319. #{dbBedno,jdbcType=VARCHAR},
  320. </if>
  321. <if test="ipVisitNo != null" >
  322. #{ipVisitNo,jdbcType=VARCHAR},
  323. </if>
  324. <if test="ipMedRec != null" >
  325. #{ipMedRec,jdbcType=VARCHAR},
  326. </if>
  327. <if test="ipHeight != null" >
  328. #{ipHeight,jdbcType=DOUBLE},
  329. </if>
  330. <if test="ipWeight != null" >
  331. #{ipWeight,jdbcType=DOUBLE},
  332. </if>
  333. <if test="ipName != null" >
  334. #{ipName,jdbcType=VARCHAR},
  335. </if>
  336. <if test="ipSex != null" >
  337. #{ipSex,jdbcType=INTEGER},
  338. </if>
  339. <if test="ipBirth != null" >
  340. #{ipBirth,jdbcType=TIMESTAMP},
  341. </if>
  342. <if test="ipIdNumber != null" >
  343. #{ipIdNumber,jdbcType=VARCHAR},
  344. </if>
  345. <if test="ipCitizenship != null" >
  346. #{ipCitizenship,jdbcType=VARCHAR},
  347. </if>
  348. <if test="ipIsmarried != null" >
  349. #{ipIsmarried,jdbcType=INTEGER},
  350. </if>
  351. <if test="ipNationality != null" >
  352. #{ipNationality,jdbcType=VARCHAR},
  353. </if>
  354. <if test="ipBlood != null" >
  355. #{ipBlood,jdbcType=VARCHAR},
  356. </if>
  357. <if test="ipHomeAddress != null" >
  358. #{ipHomeAddress,jdbcType=VARCHAR},
  359. </if>
  360. <if test="ipTelephone != null" >
  361. #{ipTelephone,jdbcType=VARCHAR},
  362. </if>
  363. <if test="ipContactPerson != null" >
  364. #{ipContactPerson,jdbcType=VARCHAR},
  365. </if>
  366. <if test="ipRelationship != null" >
  367. #{ipRelationship,jdbcType=VARCHAR},
  368. </if>
  369. <if test="ipContactTel != null" >
  370. #{ipContactTel,jdbcType=VARCHAR},
  371. </if>
  372. <if test="ipMedicareCard != null" >
  373. #{ipMedicareCard,jdbcType=VARCHAR},
  374. </if>
  375. <if test="ipAttendingDoctor != null" >
  376. #{ipAttendingDoctor,jdbcType=VARCHAR},
  377. </if>
  378. <if test="ipAdmitDiagnosis != null" >
  379. #{ipAdmitDiagnosis,jdbcType=VARCHAR},
  380. </if>
  381. <if test="ipResidentDoctor != null" >
  382. #{ipResidentDoctor,jdbcType=VARCHAR},
  383. </if>
  384. <if test="ipOutpatientDoctor != null" >
  385. #{ipOutpatientDoctor,jdbcType=VARCHAR},
  386. </if>
  387. <if test="ipDutyNurse != null" >
  388. #{ipDutyNurse,jdbcType=VARCHAR},
  389. </if>
  390. <if test="ipDutyLeader != null" >
  391. #{ipDutyLeader,jdbcType=VARCHAR},
  392. </if>
  393. <if test="ipHospitalizedTimes != null" >
  394. #{ipHospitalizedTimes,jdbcType=INTEGER},
  395. </if>
  396. <if test="ipStatus != null" >
  397. #{ipStatus,jdbcType=INTEGER},
  398. </if>
  399. <if test="ipAdmitTime != null" >
  400. #{ipAdmitTime,jdbcType=TIMESTAMP},
  401. </if>
  402. <if test="ipAdmitDep != null" >
  403. #{ipAdmitDep,jdbcType=VARCHAR},
  404. </if>
  405. <if test="ipAdmitWard != null" >
  406. #{ipAdmitWard,jdbcType=VARCHAR},
  407. </if>
  408. <if test="ipAdmitBed != null" >
  409. #{ipAdmitBed,jdbcType=VARCHAR},
  410. </if>
  411. <if test="ipOutDirection != null" >
  412. #{ipOutDirection,jdbcType=VARCHAR},
  413. </if>
  414. <if test="ipIsinfant != null" >
  415. #{ipIsinfant,jdbcType=INTEGER},
  416. </if>
  417. <if test="ipIsfreeze != null" >
  418. #{ipIsfreeze,jdbcType=INTEGER},
  419. </if>
  420. <if test="ipIsfile != null" >
  421. #{ipIsfile,jdbcType=INTEGER},
  422. </if>
  423. <if test="ipRecallReason != null" >
  424. #{ipRecallReason,jdbcType=INTEGER},
  425. </if>
  426. <if test="ipIsarrears != null" >
  427. #{ipIsarrears,jdbcType=INTEGER},
  428. </if>
  429. <if test="ipIspressure != null" >
  430. #{ipIspressure,jdbcType=INTEGER},
  431. </if>
  432. <if test="ipIsfall != null" >
  433. #{ipIsfall,jdbcType=INTEGER},
  434. </if>
  435. <if test="ipIsconstraint != null" >
  436. #{ipIsconstraint,jdbcType=INTEGER},
  437. </if>
  438. <if test="ipIsinhibition != null" >
  439. #{ipIsinhibition,jdbcType=INTEGER},
  440. </if>
  441. <if test="ipIsfragile != null" >
  442. #{ipIsfragile,jdbcType=INTEGER},
  443. </if>
  444. <if test="ipIsallergy != null" >
  445. #{ipIsallergy,jdbcType=INTEGER},
  446. </if>
  447. <if test="ipIspostoperative != null" >
  448. #{ipIspostoperative,jdbcType=INTEGER},
  449. </if>
  450. <if test="ipOperationTime != null" >
  451. #{ipOperationTime,jdbcType=TIMESTAMP},
  452. </if>
  453. <if test="ipOperator != null" >
  454. #{ipOperator,jdbcType=VARCHAR},
  455. </if>
  456. <if test="ipIsdel != null" >
  457. #{ipIsdel,jdbcType=INTEGER},
  458. </if>
  459. <if test="ipDischargeTime != null" >
  460. #{ipDischargeTime,jdbcType=TIMESTAMP},
  461. </if>
  462. <if test="ipPredischargeTime != null" >
  463. #{ipPredischargeTime,jdbcType=TIMESTAMP},
  464. </if>
  465. <if test="ipPatientType != null" >
  466. #{ipPatientType,jdbcType=VARCHAR},
  467. </if>
  468. <if test="ipNursingLevel != null" >
  469. #{ipNursingLevel,jdbcType=VARCHAR},
  470. </if>
  471. <if test="ipIsolate != null" >
  472. #{ipIsolate,jdbcType=INTEGER},
  473. </if>
  474. </trim>
  475. </insert>
  476. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPatient" >
  477. update inp_patient
  478. <set >
  479. <if test="ipPatientno != null" >
  480. IP_PatientNo = #{ipPatientno,jdbcType=VARCHAR},
  481. </if>
  482. <if test="hiId != null" >
  483. HI_ID = #{hiId,jdbcType=INTEGER},
  484. </if>
  485. <if test="ddDepdm != null" >
  486. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  487. </if>
  488. <if test="dwWarddm != null" >
  489. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  490. </if>
  491. <if test="dbBedno != null" >
  492. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  493. </if>
  494. <if test="ipVisitNo != null" >
  495. IP_Visit_No = #{ipVisitNo,jdbcType=VARCHAR},
  496. </if>
  497. <if test="ipMedRec != null" >
  498. IP_Med_Rec = #{ipMedRec,jdbcType=VARCHAR},
  499. </if>
  500. <if test="ipHeight != null" >
  501. IP_Height = #{ipHeight,jdbcType=DOUBLE},
  502. </if>
  503. <if test="ipWeight != null" >
  504. IP_Weight = #{ipWeight,jdbcType=DOUBLE},
  505. </if>
  506. <if test="ipName != null" >
  507. IP_Name = #{ipName,jdbcType=VARCHAR},
  508. </if>
  509. <if test="ipSex != null" >
  510. IP_Sex = #{ipSex,jdbcType=INTEGER},
  511. </if>
  512. <if test="ipBirth != null" >
  513. IP_Birth = #{ipBirth,jdbcType=TIMESTAMP},
  514. </if>
  515. <if test="ipIdNumber != null" >
  516. IP_ID_Number = #{ipIdNumber,jdbcType=VARCHAR},
  517. </if>
  518. <if test="ipCitizenship != null" >
  519. IP_Citizenship = #{ipCitizenship,jdbcType=VARCHAR},
  520. </if>
  521. <if test="ipIsmarried != null" >
  522. IP_IsMarried = #{ipIsmarried,jdbcType=INTEGER},
  523. </if>
  524. <if test="ipNationality != null" >
  525. IP_Nationality = #{ipNationality,jdbcType=VARCHAR},
  526. </if>
  527. <if test="ipBlood != null" >
  528. IP_Blood = #{ipBlood,jdbcType=VARCHAR},
  529. </if>
  530. <if test="ipHomeAddress != null" >
  531. IP_Home_Address = #{ipHomeAddress,jdbcType=VARCHAR},
  532. </if>
  533. <if test="ipTelephone != null" >
  534. IP_Telephone = #{ipTelephone,jdbcType=VARCHAR},
  535. </if>
  536. <if test="ipContactPerson != null" >
  537. IP_Contact_Person = #{ipContactPerson,jdbcType=VARCHAR},
  538. </if>
  539. <if test="ipRelationship != null" >
  540. IP_Relationship = #{ipRelationship,jdbcType=VARCHAR},
  541. </if>
  542. <if test="ipContactTel != null" >
  543. IP_Contact_Tel = #{ipContactTel,jdbcType=VARCHAR},
  544. </if>
  545. <if test="ipMedicareCard != null" >
  546. IP_Medicare_Card = #{ipMedicareCard,jdbcType=VARCHAR},
  547. </if>
  548. <if test="ipAttendingDoctor != null" >
  549. IP_Attending_Doctor = #{ipAttendingDoctor,jdbcType=VARCHAR},
  550. </if>
  551. <if test="ipAdmitDiagnosis != null" >
  552. IP_Admit_Diagnosis = #{ipAdmitDiagnosis,jdbcType=VARCHAR},
  553. </if>
  554. <if test="ipResidentDoctor != null" >
  555. IP_Resident_Doctor = #{ipResidentDoctor,jdbcType=VARCHAR},
  556. </if>
  557. <if test="ipOutpatientDoctor != null" >
  558. IP_Outpatient_Doctor = #{ipOutpatientDoctor,jdbcType=VARCHAR},
  559. </if>
  560. <if test="ipDutyNurse != null" >
  561. IP_Duty_Nurse = #{ipDutyNurse,jdbcType=VARCHAR},
  562. </if>
  563. <if test="ipDutyLeader != null" >
  564. IP_Duty_Leader = #{ipDutyLeader,jdbcType=VARCHAR},
  565. </if>
  566. <if test="ipHospitalizedTimes != null" >
  567. IP_Hospitalized_Times = #{ipHospitalizedTimes,jdbcType=INTEGER},
  568. </if>
  569. <if test="ipStatus != null" >
  570. IP_Status = #{ipStatus,jdbcType=INTEGER},
  571. </if>
  572. <if test="ipAdmitTime != null" >
  573. IP_Admit_Time = #{ipAdmitTime,jdbcType=TIMESTAMP},
  574. </if>
  575. <if test="ipAdmitDep != null" >
  576. IP_Admit_Dep = #{ipAdmitDep,jdbcType=VARCHAR},
  577. </if>
  578. <if test="ipAdmitWard != null" >
  579. IP_Admit_Ward = #{ipAdmitWard,jdbcType=VARCHAR},
  580. </if>
  581. <if test="ipAdmitBed != null" >
  582. IP_Admit_Bed = #{ipAdmitBed,jdbcType=VARCHAR},
  583. </if>
  584. <if test="ipOutDirection != null" >
  585. IP_Out_Direction = #{ipOutDirection,jdbcType=VARCHAR},
  586. </if>
  587. <if test="ipIsinfant != null" >
  588. IP_IsInfant = #{ipIsinfant,jdbcType=INTEGER},
  589. </if>
  590. <if test="ipIsfreeze != null" >
  591. IP_IsFreeze = #{ipIsfreeze,jdbcType=INTEGER},
  592. </if>
  593. <if test="ipIsfile != null" >
  594. IP_IsFile = #{ipIsfile,jdbcType=INTEGER},
  595. </if>
  596. <if test="ipRecallReason != null" >
  597. IP_Recall_Reason = #{ipRecallReason,jdbcType=INTEGER},
  598. </if>
  599. <if test="ipIsarrears != null" >
  600. IP_IsArrears = #{ipIsarrears,jdbcType=INTEGER},
  601. </if>
  602. <if test="ipIspressure != null" >
  603. IP_IsPressure = #{ipIspressure,jdbcType=INTEGER},
  604. </if>
  605. <if test="ipIsfall != null" >
  606. IP_IsFall = #{ipIsfall,jdbcType=INTEGER},
  607. </if>
  608. <if test="ipIsconstraint != null" >
  609. IP_IsConstraint = #{ipIsconstraint,jdbcType=INTEGER},
  610. </if>
  611. <if test="ipIsinhibition != null" >
  612. IP_IsInhibition = #{ipIsinhibition,jdbcType=INTEGER},
  613. </if>
  614. <if test="ipIsfragile != null" >
  615. IP_IsFragile = #{ipIsfragile,jdbcType=INTEGER},
  616. </if>
  617. <if test="ipIsallergy != null" >
  618. IP_IsAllergy = #{ipIsallergy,jdbcType=INTEGER},
  619. </if>
  620. <if test="ipIspostoperative != null" >
  621. IP_IsPostoperative = #{ipIspostoperative,jdbcType=INTEGER},
  622. </if>
  623. <if test="ipOperationTime != null" >
  624. IP_Operation_Time = #{ipOperationTime,jdbcType=TIMESTAMP},
  625. </if>
  626. <if test="ipOperator != null" >
  627. IP_Operator = #{ipOperator,jdbcType=VARCHAR},
  628. </if>
  629. <if test="ipIsdel != null" >
  630. IP_IsDel = #{ipIsdel,jdbcType=INTEGER},
  631. </if>
  632. <if test="ipDischargeTime != null" >
  633. IP_Discharge_Time = #{ipDischargeTime,jdbcType=TIMESTAMP},
  634. </if>
  635. <if test="ipPredischargeTime != null" >
  636. IP_PreDischarge_Time = #{ipPredischargeTime,jdbcType=TIMESTAMP},
  637. </if>
  638. <if test="ipPatientType != null" >
  639. IP_Patient_Type = #{ipPatientType,jdbcType=VARCHAR},
  640. </if>
  641. <if test="ipNursingLevel != null" >
  642. IP_Nursing_Level = #{ipNursingLevel,jdbcType=VARCHAR},
  643. </if>
  644. <if test="ipIsolate != null" >
  645. IP_Isolate = #{ipIsolate,jdbcType=INTEGER},
  646. </if>
  647. </set>
  648. where IP_ID = #{ipId,jdbcType=INTEGER}
  649. </update>
  650. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPatient" >
  651. update inp_patient
  652. set IP_PatientNo = #{ipPatientno,jdbcType=VARCHAR},
  653. HI_ID = #{hiId,jdbcType=INTEGER},
  654. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  655. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  656. DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
  657. IP_Visit_No = #{ipVisitNo,jdbcType=VARCHAR},
  658. IP_Med_Rec = #{ipMedRec,jdbcType=VARCHAR},
  659. IP_Height = #{ipHeight,jdbcType=DOUBLE},
  660. IP_Weight = #{ipWeight,jdbcType=DOUBLE},
  661. IP_Name = #{ipName,jdbcType=VARCHAR},
  662. IP_Sex = #{ipSex,jdbcType=INTEGER},
  663. IP_Birth = #{ipBirth,jdbcType=TIMESTAMP},
  664. IP_ID_Number = #{ipIdNumber,jdbcType=VARCHAR},
  665. IP_Citizenship = #{ipCitizenship,jdbcType=VARCHAR},
  666. IP_IsMarried = #{ipIsmarried,jdbcType=INTEGER},
  667. IP_Nationality = #{ipNationality,jdbcType=VARCHAR},
  668. IP_Blood = #{ipBlood,jdbcType=VARCHAR},
  669. IP_Home_Address = #{ipHomeAddress,jdbcType=VARCHAR},
  670. IP_Telephone = #{ipTelephone,jdbcType=VARCHAR},
  671. IP_Contact_Person = #{ipContactPerson,jdbcType=VARCHAR},
  672. IP_Relationship = #{ipRelationship,jdbcType=VARCHAR},
  673. IP_Contact_Tel = #{ipContactTel,jdbcType=VARCHAR},
  674. IP_Medicare_Card = #{ipMedicareCard,jdbcType=VARCHAR},
  675. IP_Attending_Doctor = #{ipAttendingDoctor,jdbcType=VARCHAR},
  676. IP_Admit_Diagnosis = #{ipAdmitDiagnosis,jdbcType=VARCHAR},
  677. IP_Resident_Doctor = #{ipResidentDoctor,jdbcType=VARCHAR},
  678. IP_Outpatient_Doctor = #{ipOutpatientDoctor,jdbcType=VARCHAR},
  679. IP_Duty_Nurse = #{ipDutyNurse,jdbcType=VARCHAR},
  680. IP_Duty_Leader = #{ipDutyLeader,jdbcType=VARCHAR},
  681. IP_Hospitalized_Times = #{ipHospitalizedTimes,jdbcType=INTEGER},
  682. IP_Status = #{ipStatus,jdbcType=INTEGER},
  683. IP_Admit_Time = #{ipAdmitTime,jdbcType=TIMESTAMP},
  684. IP_Admit_Dep = #{ipAdmitDep,jdbcType=VARCHAR},
  685. IP_Admit_Ward = #{ipAdmitWard,jdbcType=VARCHAR},
  686. IP_Admit_Bed = #{ipAdmitBed,jdbcType=VARCHAR},
  687. IP_Out_Direction = #{ipOutDirection,jdbcType=VARCHAR},
  688. IP_IsInfant = #{ipIsinfant,jdbcType=INTEGER},
  689. IP_IsFreeze = #{ipIsfreeze,jdbcType=INTEGER},
  690. IP_IsFile = #{ipIsfile,jdbcType=INTEGER},
  691. IP_Recall_Reason = #{ipRecallReason,jdbcType=INTEGER},
  692. IP_IsArrears = #{ipIsarrears,jdbcType=INTEGER},
  693. IP_IsPressure = #{ipIspressure,jdbcType=INTEGER},
  694. IP_IsFall = #{ipIsfall,jdbcType=INTEGER},
  695. IP_IsConstraint = #{ipIsconstraint,jdbcType=INTEGER},
  696. IP_IsInhibition = #{ipIsinhibition,jdbcType=INTEGER},
  697. IP_IsFragile = #{ipIsfragile,jdbcType=INTEGER},
  698. IP_IsAllergy = #{ipIsallergy,jdbcType=INTEGER},
  699. IP_IsPostoperative = #{ipIspostoperative,jdbcType=INTEGER},
  700. IP_Operation_Time = #{ipOperationTime,jdbcType=TIMESTAMP},
  701. IP_Operator = #{ipOperator,jdbcType=VARCHAR},
  702. IP_IsDel = #{ipIsdel,jdbcType=INTEGER},
  703. IP_Discharge_Time = #{ipDischargeTime,jdbcType=TIMESTAMP},
  704. IP_PreDischarge_Time = #{ipPredischargeTime,jdbcType=TIMESTAMP},
  705. IP_Patient_Type = #{ipPatientType,jdbcType=VARCHAR},
  706. IP_Nursing_Level = #{ipNursingLevel,jdbcType=VARCHAR},
  707. IP_Isolate = #{ipIsolate,jdbcType=INTEGER}
  708. where IP_ID = #{ipId,jdbcType=INTEGER}
  709. </update>
  710. <select id="selectByNoHiId" resultMap="BaseResultMap">
  711. select IP_Admit_Time, IP_Status,IP_Discharge_Time,DB_BedNo
  712. from inp_patient
  713. where IP_IsDel = 0
  714. and IP_PatientNo = #{ipPatientno,jdbcType=VARCHAR}
  715. and HI_ID = #{hiId,jdbcType=INTEGER}
  716. limit 1
  717. </select>
  718. <select id="selectPatientInfoByStatusAndWardDm" resultMap="BaseResultMap">
  719. SELECT
  720. <include refid="Base_Column_List" />
  721. FROM inp_patient
  722. WHERE IP_IsDel = 0
  723. and DW_WardDm = #{wardDm,jdbcType=VARCHAR}
  724. AND IP_Status in <foreach item='item' index='index' collection='ipStatus' open='(' separator=',' close=')'> #{item} </foreach>
  725. </select>
  726. <select id="selectByIpPatientNo" resultMap="BaseResultMap">
  727. select <include refid="Base_Column_List" />
  728. from inp_patient
  729. where IP_IsDel = 0
  730. and IP_PatientNo = #{ipPatientno,jdbcType=VARCHAR}
  731. and HI_ID = #{hiId,jdbcType=INTEGER}
  732. limit 1
  733. </select>
  734. <select id="selectPatientInfoListByStatus" resultMap="BaseResultMap">
  735. SELECT
  736. <include refid="Base_Column_List" />
  737. FROM inp_patient
  738. WHERE IP_IsDel = 0
  739. AND IP_Status = #{ipStatus,jdbcType=INTEGER}
  740. </select>
  741. <select id="selectPatientInfoList" resultType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPatient">
  742. SELECT
  743. IP_PatientNo ipPatientno,
  744. DD_DepDm ddDepdm,
  745. DW_WardDm dwWarddm,
  746. DB_BedNo dbBedno,
  747. IP_Med_Rec ipMedRec,
  748. IP_Name ipName,
  749. IP_Sex ipSex,
  750. IP_Birth ipBirth,
  751. IP_Status ipStatus,
  752. IP_Admit_Time ipAdmitTime
  753. FROM inp_patient
  754. WHERE IP_IsDel = 0
  755. <if test="ipStatus != null" >
  756. AND IP_Status = #{ipStatus,jdbcType=INTEGER}
  757. </if>
  758. <if test="dwWardDm != null" >
  759. AND DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
  760. </if>
  761. <if test="end != null" >
  762. AND IP_Admit_Time <![CDATA[<]]> #{end,jdbcType=TIMESTAMP}
  763. </if>
  764. <if test="begin != null" >
  765. AND (IP_Discharge_Time <![CDATA[>=]]> #{begin,jdbcType=TIMESTAMP} or IP_Discharge_Time is null)
  766. </if>
  767. </select>
  768. <select id="selectAllList" resultMap="BaseResultMap">
  769. SELECT
  770. <include refid="Base_Column_List" />
  771. FROM inp_patient
  772. WHERE IP_IsDel = 0
  773. and HI_ID = #{hiId,jdbcType=INTEGER}
  774. and IP_PatientNo in
  775. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  776. #{item,jdbcType=VARCHAR}
  777. </foreach>
  778. </select>
  779. <select id="selectPatientInfoNewList" resultType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPatient">
  780. SELECT
  781. IP_PatientNo ipPatientno,
  782. DD_DepDm ddDepdm,
  783. DW_WardDm dwWarddm,
  784. DB_BedNo dbBedno,
  785. IP_Med_Rec ipMedRec,
  786. IP_Name ipName,
  787. IP_Sex ipSex,
  788. IP_Birth ipBirth,
  789. IP_Status ipStatus,
  790. IP_Admit_Time ipAdmitTime
  791. FROM inp_patient
  792. WHERE IP_IsDel = 0
  793. and HI_ID = #{hiId,jdbcType=INTEGER}
  794. and IP_PatientNo in
  795. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  796. #{item,jdbcType=VARCHAR}
  797. </foreach>
  798. </select>
  799. <select id="selectLNBAllPatientInfo" resultMap="BaseResultMap">
  800. SELECT
  801. IP_ID, IP_PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo,IP_Admit_Time
  802. FROM inp_patient
  803. WHERE IP_IsDel = 0
  804. AND IP_Status = 0
  805. AND hi_id = 1
  806. </select>
  807. <select id="selectByPatientNos" resultMap="BaseResultMap">
  808. SELECT
  809. <include refid="Base_Column_List" />
  810. FROM inp_patient
  811. WHERE IP_IsDel = 0
  812. and IP_PatientNo in
  813. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  814. #{item,jdbcType=VARCHAR}
  815. </foreach>
  816. </select>
  817. <select id="selectByDwWardDm" resultMap="BaseResultMap">
  818. SELECT
  819. <include refid="Base_Column_List" />
  820. FROM inp_patient
  821. WHERE IP_IsDel = 0
  822. AND IP_Status = #{ipStatus,jdbcType=INTEGER}
  823. AND DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
  824. </select>
  825. <select id="selectByWardSyncOpen" resultMap="BaseResultMap">
  826. select <include refid="Base_Column_List"/>
  827. from inp_patient ip
  828. where ip.IP_IsDel = 0
  829. and #{pointDate,jdbcType=TIMESTAMP} >= ip.IP_Admit_Time
  830. and (ip.IP_PreDischarge_Time > #{pointDate,jdbcType=TIMESTAMP} or ip.IP_PreDischarge_Time is null)
  831. and ip.DW_WardDm in
  832. <foreach collection="wards" open="(" close=")" item="item" separator=",">
  833. #{item,jdbcType=VARCHAR}
  834. </foreach>
  835. and HI_ID = #{hiId,jdbcType=INTEGER}
  836. and exists(select 1 from inp_icu_sync_patient sp where ip.IP_PatientNo = sp.PatientNo and ip.HI_ID = sp.HI_ID
  837. and sp.isp_is_del = 0
  838. <!--and DATE_FORMAT(sp.isp_record_time,'%Y-%m-%d %H:00:00') != #{pointDate,jdbcType=TIMESTAMP} -->
  839. and #{pointDate,jdbcType=TIMESTAMP} > sp.isp_record_time
  840. )
  841. </select>
  842. <select id="selectByStatus" resultMap="BaseResultMap">
  843. SELECT
  844. <include refid="Base_Column_List" />
  845. FROM inp_patient
  846. WHERE IP_IsDel = 0
  847. AND IP_Status = #{ipStatus,jdbcType=INTEGER}
  848. </select>
  849. </mapper>