BedMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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.sqlservermapper.BedMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.pubservice.sqlservermodel.Bed" >
  5. <id column="BedNo" property="bedno" jdbcType="VARCHAR" />
  6. <result column="RoomBed" property="roombed" jdbcType="VARCHAR" />
  7. <result column="Ward" property="ward" jdbcType="VARCHAR" />
  8. <result column="Zone" property="zone" jdbcType="VARCHAR" />
  9. <result column="DepartNo" property="departno" jdbcType="VARCHAR" />
  10. <result column="StockLoc" property="stockloc" jdbcType="VARCHAR" />
  11. <result column="OwnDivNo" property="owndivno" jdbcType="VARCHAR" />
  12. <result column="BedLevel" property="bedlevel" jdbcType="SMALLINT" />
  13. <result column="BedType" property="bedtype" jdbcType="CHAR" />
  14. <result column="LocArea" property="locarea" jdbcType="VARCHAR" />
  15. <result column="SexCtrl" property="sexctrl" jdbcType="VARCHAR" />
  16. <result column="IsQuery" property="isquery" jdbcType="BIT" />
  17. <result column="IsTaint" property="istaint" jdbcType="BIT" />
  18. <result column="IsICU" property="isicu" jdbcType="BIT" />
  19. <result column="ChartNo" property="chartno" jdbcType="VARCHAR" />
  20. <result column="PtName" property="ptname" jdbcType="VARCHAR" />
  21. <result column="VisitNo" property="visitno" jdbcType="VARCHAR" />
  22. <result column="UDDTime" property="uddtime" jdbcType="TIMESTAMP" />
  23. <result column="ExpandStatus" property="expandstatus" jdbcType="VARCHAR" />
  24. <result column="ReserveNo" property="reserveno" jdbcType="VARCHAR" />
  25. <result column="BedStatue" property="bedstatue" jdbcType="VARCHAR" />
  26. <result column="Printer1" property="printer1" jdbcType="VARCHAR" />
  27. <result column="Printer2" property="printer2" jdbcType="VARCHAR" />
  28. <result column="BedItemCode" property="beditemcode" jdbcType="VARCHAR" />
  29. <result column="AddItemCode" property="additemcode" jdbcType="VARCHAR" />
  30. <result column="InpItemCode" property="inpitemcode" jdbcType="VARCHAR" />
  31. <result column="NurseItemCode" property="nurseitemcode" jdbcType="VARCHAR" />
  32. <result column="DrugItemCode" property="drugitemcode" jdbcType="VARCHAR" />
  33. <result column="IsDelete" property="isdelete" jdbcType="BIT" />
  34. <result column="UpdateUser" property="updateuser" jdbcType="VARCHAR" />
  35. <result column="UpdateTime" property="updatetime" jdbcType="TIMESTAMP" />
  36. <result column="PatientType" property="patienttype" jdbcType="INTEGER" />
  37. <result column="RoomNo" property="roomno" jdbcType="VARCHAR" />
  38. <result column="BedUseStatus" property="bedusestatus" jdbcType="INTEGER" />
  39. </resultMap>
  40. <sql id="Base_Column_List" >
  41. BedNo, RoomBed, Ward, Zone, DepartNo, StockLoc, OwnDivNo, BedLevel, BedType, LocArea,
  42. SexCtrl, IsQuery, IsTaint, IsICU, ChartNo, PtName, VisitNo, UDDTime, ExpandStatus,
  43. ReserveNo, BedStatue, Printer1, Printer2, BedItemCode, AddItemCode, InpItemCode,
  44. NurseItemCode, DrugItemCode, IsDelete, UpdateUser, UpdateTime, PatientType, RoomNo,
  45. BedUseStatus
  46. </sql>
  47. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  48. select
  49. <include refid="Base_Column_List" />
  50. from Bed
  51. where BedNo = #{bedno,jdbcType=VARCHAR}
  52. </select>
  53. <select id="selectByDepartNo" resultMap="BaseResultMap" parameterType="java.lang.String" >
  54. select
  55. <include refid="Base_Column_List" />
  56. from Bed
  57. where DepartNo = #{departNo,jdbcType=VARCHAR} and isdelete = 0 and bedusestatus = 0
  58. </select>
  59. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  60. delete from Bed
  61. where BedNo = #{bedno,jdbcType=VARCHAR}
  62. </delete>
  63. <insert id="insert" parameterType="com.xinxin.topro.pubservice.sqlservermodel.Bed" >
  64. insert into Bed (BedNo, RoomBed, Ward,
  65. Zone, DepartNo, StockLoc,
  66. OwnDivNo, BedLevel, BedType,
  67. LocArea, SexCtrl, IsQuery,
  68. IsTaint, IsICU, ChartNo, PtName,
  69. VisitNo, UDDTime, ExpandStatus,
  70. ReserveNo, BedStatue, Printer1,
  71. Printer2, BedItemCode, AddItemCode,
  72. InpItemCode, NurseItemCode, DrugItemCode,
  73. IsDelete, UpdateUser, UpdateTime,
  74. PatientType, RoomNo, BedUseStatus
  75. )
  76. values (#{bedno,jdbcType=VARCHAR}, #{roombed,jdbcType=VARCHAR}, #{ward,jdbcType=VARCHAR},
  77. #{zone,jdbcType=VARCHAR}, #{departno,jdbcType=VARCHAR}, #{stockloc,jdbcType=VARCHAR},
  78. #{owndivno,jdbcType=VARCHAR}, #{bedlevel,jdbcType=SMALLINT}, #{bedtype,jdbcType=CHAR},
  79. #{locarea,jdbcType=VARCHAR}, #{sexctrl,jdbcType=VARCHAR}, #{isquery,jdbcType=BIT},
  80. #{istaint,jdbcType=BIT}, #{isicu,jdbcType=BIT}, #{chartno,jdbcType=VARCHAR}, #{ptname,jdbcType=VARCHAR},
  81. #{visitno,jdbcType=VARCHAR}, #{uddtime,jdbcType=TIMESTAMP}, #{expandstatus,jdbcType=VARCHAR},
  82. #{reserveno,jdbcType=VARCHAR}, #{bedstatue,jdbcType=VARCHAR}, #{printer1,jdbcType=VARCHAR},
  83. #{printer2,jdbcType=VARCHAR}, #{beditemcode,jdbcType=VARCHAR}, #{additemcode,jdbcType=VARCHAR},
  84. #{inpitemcode,jdbcType=VARCHAR}, #{nurseitemcode,jdbcType=VARCHAR}, #{drugitemcode,jdbcType=VARCHAR},
  85. #{isdelete,jdbcType=BIT}, #{updateuser,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP},
  86. #{patienttype,jdbcType=INTEGER}, #{roomno,jdbcType=VARCHAR}, #{bedusestatus,jdbcType=INTEGER}
  87. )
  88. </insert>
  89. <insert id="insertSelective" parameterType="com.xinxin.topro.pubservice.sqlservermodel.Bed" >
  90. insert into Bed
  91. <trim prefix="(" suffix=")" suffixOverrides="," >
  92. <if test="bedno != null" >
  93. BedNo,
  94. </if>
  95. <if test="roombed != null" >
  96. RoomBed,
  97. </if>
  98. <if test="ward != null" >
  99. Ward,
  100. </if>
  101. <if test="zone != null" >
  102. Zone,
  103. </if>
  104. <if test="departno != null" >
  105. DepartNo,
  106. </if>
  107. <if test="stockloc != null" >
  108. StockLoc,
  109. </if>
  110. <if test="owndivno != null" >
  111. OwnDivNo,
  112. </if>
  113. <if test="bedlevel != null" >
  114. BedLevel,
  115. </if>
  116. <if test="bedtype != null" >
  117. BedType,
  118. </if>
  119. <if test="locarea != null" >
  120. LocArea,
  121. </if>
  122. <if test="sexctrl != null" >
  123. SexCtrl,
  124. </if>
  125. <if test="isquery != null" >
  126. IsQuery,
  127. </if>
  128. <if test="istaint != null" >
  129. IsTaint,
  130. </if>
  131. <if test="isicu != null" >
  132. IsICU,
  133. </if>
  134. <if test="chartno != null" >
  135. ChartNo,
  136. </if>
  137. <if test="ptname != null" >
  138. PtName,
  139. </if>
  140. <if test="visitno != null" >
  141. VisitNo,
  142. </if>
  143. <if test="uddtime != null" >
  144. UDDTime,
  145. </if>
  146. <if test="expandstatus != null" >
  147. ExpandStatus,
  148. </if>
  149. <if test="reserveno != null" >
  150. ReserveNo,
  151. </if>
  152. <if test="bedstatue != null" >
  153. BedStatue,
  154. </if>
  155. <if test="printer1 != null" >
  156. Printer1,
  157. </if>
  158. <if test="printer2 != null" >
  159. Printer2,
  160. </if>
  161. <if test="beditemcode != null" >
  162. BedItemCode,
  163. </if>
  164. <if test="additemcode != null" >
  165. AddItemCode,
  166. </if>
  167. <if test="inpitemcode != null" >
  168. InpItemCode,
  169. </if>
  170. <if test="nurseitemcode != null" >
  171. NurseItemCode,
  172. </if>
  173. <if test="drugitemcode != null" >
  174. DrugItemCode,
  175. </if>
  176. <if test="isdelete != null" >
  177. IsDelete,
  178. </if>
  179. <if test="updateuser != null" >
  180. UpdateUser,
  181. </if>
  182. <if test="updatetime != null" >
  183. UpdateTime,
  184. </if>
  185. <if test="patienttype != null" >
  186. PatientType,
  187. </if>
  188. <if test="roomno != null" >
  189. RoomNo,
  190. </if>
  191. <if test="bedusestatus != null" >
  192. BedUseStatus,
  193. </if>
  194. </trim>
  195. <trim prefix="values (" suffix=")" suffixOverrides="," >
  196. <if test="bedno != null" >
  197. #{bedno,jdbcType=VARCHAR},
  198. </if>
  199. <if test="roombed != null" >
  200. #{roombed,jdbcType=VARCHAR},
  201. </if>
  202. <if test="ward != null" >
  203. #{ward,jdbcType=VARCHAR},
  204. </if>
  205. <if test="zone != null" >
  206. #{zone,jdbcType=VARCHAR},
  207. </if>
  208. <if test="departno != null" >
  209. #{departno,jdbcType=VARCHAR},
  210. </if>
  211. <if test="stockloc != null" >
  212. #{stockloc,jdbcType=VARCHAR},
  213. </if>
  214. <if test="owndivno != null" >
  215. #{owndivno,jdbcType=VARCHAR},
  216. </if>
  217. <if test="bedlevel != null" >
  218. #{bedlevel,jdbcType=SMALLINT},
  219. </if>
  220. <if test="bedtype != null" >
  221. #{bedtype,jdbcType=CHAR},
  222. </if>
  223. <if test="locarea != null" >
  224. #{locarea,jdbcType=VARCHAR},
  225. </if>
  226. <if test="sexctrl != null" >
  227. #{sexctrl,jdbcType=VARCHAR},
  228. </if>
  229. <if test="isquery != null" >
  230. #{isquery,jdbcType=BIT},
  231. </if>
  232. <if test="istaint != null" >
  233. #{istaint,jdbcType=BIT},
  234. </if>
  235. <if test="isicu != null" >
  236. #{isicu,jdbcType=BIT},
  237. </if>
  238. <if test="chartno != null" >
  239. #{chartno,jdbcType=VARCHAR},
  240. </if>
  241. <if test="ptname != null" >
  242. #{ptname,jdbcType=VARCHAR},
  243. </if>
  244. <if test="visitno != null" >
  245. #{visitno,jdbcType=VARCHAR},
  246. </if>
  247. <if test="uddtime != null" >
  248. #{uddtime,jdbcType=TIMESTAMP},
  249. </if>
  250. <if test="expandstatus != null" >
  251. #{expandstatus,jdbcType=VARCHAR},
  252. </if>
  253. <if test="reserveno != null" >
  254. #{reserveno,jdbcType=VARCHAR},
  255. </if>
  256. <if test="bedstatue != null" >
  257. #{bedstatue,jdbcType=VARCHAR},
  258. </if>
  259. <if test="printer1 != null" >
  260. #{printer1,jdbcType=VARCHAR},
  261. </if>
  262. <if test="printer2 != null" >
  263. #{printer2,jdbcType=VARCHAR},
  264. </if>
  265. <if test="beditemcode != null" >
  266. #{beditemcode,jdbcType=VARCHAR},
  267. </if>
  268. <if test="additemcode != null" >
  269. #{additemcode,jdbcType=VARCHAR},
  270. </if>
  271. <if test="inpitemcode != null" >
  272. #{inpitemcode,jdbcType=VARCHAR},
  273. </if>
  274. <if test="nurseitemcode != null" >
  275. #{nurseitemcode,jdbcType=VARCHAR},
  276. </if>
  277. <if test="drugitemcode != null" >
  278. #{drugitemcode,jdbcType=VARCHAR},
  279. </if>
  280. <if test="isdelete != null" >
  281. #{isdelete,jdbcType=BIT},
  282. </if>
  283. <if test="updateuser != null" >
  284. #{updateuser,jdbcType=VARCHAR},
  285. </if>
  286. <if test="updatetime != null" >
  287. #{updatetime,jdbcType=TIMESTAMP},
  288. </if>
  289. <if test="patienttype != null" >
  290. #{patienttype,jdbcType=INTEGER},
  291. </if>
  292. <if test="roomno != null" >
  293. #{roomno,jdbcType=VARCHAR},
  294. </if>
  295. <if test="bedusestatus != null" >
  296. #{bedusestatus,jdbcType=INTEGER},
  297. </if>
  298. </trim>
  299. </insert>
  300. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.pubservice.sqlservermodel.Bed" >
  301. update Bed
  302. <set >
  303. <if test="roombed != null" >
  304. RoomBed = #{roombed,jdbcType=VARCHAR},
  305. </if>
  306. <if test="ward != null" >
  307. Ward = #{ward,jdbcType=VARCHAR},
  308. </if>
  309. <if test="zone != null" >
  310. Zone = #{zone,jdbcType=VARCHAR},
  311. </if>
  312. <if test="departno != null" >
  313. DepartNo = #{departno,jdbcType=VARCHAR},
  314. </if>
  315. <if test="stockloc != null" >
  316. StockLoc = #{stockloc,jdbcType=VARCHAR},
  317. </if>
  318. <if test="owndivno != null" >
  319. OwnDivNo = #{owndivno,jdbcType=VARCHAR},
  320. </if>
  321. <if test="bedlevel != null" >
  322. BedLevel = #{bedlevel,jdbcType=SMALLINT},
  323. </if>
  324. <if test="bedtype != null" >
  325. BedType = #{bedtype,jdbcType=CHAR},
  326. </if>
  327. <if test="locarea != null" >
  328. LocArea = #{locarea,jdbcType=VARCHAR},
  329. </if>
  330. <if test="sexctrl != null" >
  331. SexCtrl = #{sexctrl,jdbcType=VARCHAR},
  332. </if>
  333. <if test="isquery != null" >
  334. IsQuery = #{isquery,jdbcType=BIT},
  335. </if>
  336. <if test="istaint != null" >
  337. IsTaint = #{istaint,jdbcType=BIT},
  338. </if>
  339. <if test="isicu != null" >
  340. IsICU = #{isicu,jdbcType=BIT},
  341. </if>
  342. <if test="chartno != null" >
  343. ChartNo = #{chartno,jdbcType=VARCHAR},
  344. </if>
  345. <if test="ptname != null" >
  346. PtName = #{ptname,jdbcType=VARCHAR},
  347. </if>
  348. <if test="visitno != null" >
  349. VisitNo = #{visitno,jdbcType=VARCHAR},
  350. </if>
  351. <if test="uddtime != null" >
  352. UDDTime = #{uddtime,jdbcType=TIMESTAMP},
  353. </if>
  354. <if test="expandstatus != null" >
  355. ExpandStatus = #{expandstatus,jdbcType=VARCHAR},
  356. </if>
  357. <if test="reserveno != null" >
  358. ReserveNo = #{reserveno,jdbcType=VARCHAR},
  359. </if>
  360. <if test="bedstatue != null" >
  361. BedStatue = #{bedstatue,jdbcType=VARCHAR},
  362. </if>
  363. <if test="printer1 != null" >
  364. Printer1 = #{printer1,jdbcType=VARCHAR},
  365. </if>
  366. <if test="printer2 != null" >
  367. Printer2 = #{printer2,jdbcType=VARCHAR},
  368. </if>
  369. <if test="beditemcode != null" >
  370. BedItemCode = #{beditemcode,jdbcType=VARCHAR},
  371. </if>
  372. <if test="additemcode != null" >
  373. AddItemCode = #{additemcode,jdbcType=VARCHAR},
  374. </if>
  375. <if test="inpitemcode != null" >
  376. InpItemCode = #{inpitemcode,jdbcType=VARCHAR},
  377. </if>
  378. <if test="nurseitemcode != null" >
  379. NurseItemCode = #{nurseitemcode,jdbcType=VARCHAR},
  380. </if>
  381. <if test="drugitemcode != null" >
  382. DrugItemCode = #{drugitemcode,jdbcType=VARCHAR},
  383. </if>
  384. <if test="isdelete != null" >
  385. IsDelete = #{isdelete,jdbcType=BIT},
  386. </if>
  387. <if test="updateuser != null" >
  388. UpdateUser = #{updateuser,jdbcType=VARCHAR},
  389. </if>
  390. <if test="updatetime != null" >
  391. UpdateTime = #{updatetime,jdbcType=TIMESTAMP},
  392. </if>
  393. <if test="patienttype != null" >
  394. PatientType = #{patienttype,jdbcType=INTEGER},
  395. </if>
  396. <if test="roomno != null" >
  397. RoomNo = #{roomno,jdbcType=VARCHAR},
  398. </if>
  399. <if test="bedusestatus != null" >
  400. BedUseStatus = #{bedusestatus,jdbcType=INTEGER},
  401. </if>
  402. </set>
  403. where BedNo = #{bedno,jdbcType=VARCHAR}
  404. </update>
  405. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.pubservice.sqlservermodel.Bed" >
  406. update Bed
  407. set RoomBed = #{roombed,jdbcType=VARCHAR},
  408. Ward = #{ward,jdbcType=VARCHAR},
  409. Zone = #{zone,jdbcType=VARCHAR},
  410. DepartNo = #{departno,jdbcType=VARCHAR},
  411. StockLoc = #{stockloc,jdbcType=VARCHAR},
  412. OwnDivNo = #{owndivno,jdbcType=VARCHAR},
  413. BedLevel = #{bedlevel,jdbcType=SMALLINT},
  414. BedType = #{bedtype,jdbcType=CHAR},
  415. LocArea = #{locarea,jdbcType=VARCHAR},
  416. SexCtrl = #{sexctrl,jdbcType=VARCHAR},
  417. IsQuery = #{isquery,jdbcType=BIT},
  418. IsTaint = #{istaint,jdbcType=BIT},
  419. IsICU = #{isicu,jdbcType=BIT},
  420. ChartNo = #{chartno,jdbcType=VARCHAR},
  421. PtName = #{ptname,jdbcType=VARCHAR},
  422. VisitNo = #{visitno,jdbcType=VARCHAR},
  423. UDDTime = #{uddtime,jdbcType=TIMESTAMP},
  424. ExpandStatus = #{expandstatus,jdbcType=VARCHAR},
  425. ReserveNo = #{reserveno,jdbcType=VARCHAR},
  426. BedStatue = #{bedstatue,jdbcType=VARCHAR},
  427. Printer1 = #{printer1,jdbcType=VARCHAR},
  428. Printer2 = #{printer2,jdbcType=VARCHAR},
  429. BedItemCode = #{beditemcode,jdbcType=VARCHAR},
  430. AddItemCode = #{additemcode,jdbcType=VARCHAR},
  431. InpItemCode = #{inpitemcode,jdbcType=VARCHAR},
  432. NurseItemCode = #{nurseitemcode,jdbcType=VARCHAR},
  433. DrugItemCode = #{drugitemcode,jdbcType=VARCHAR},
  434. IsDelete = #{isdelete,jdbcType=BIT},
  435. UpdateUser = #{updateuser,jdbcType=VARCHAR},
  436. UpdateTime = #{updatetime,jdbcType=TIMESTAMP},
  437. PatientType = #{patienttype,jdbcType=INTEGER},
  438. RoomNo = #{roomno,jdbcType=VARCHAR},
  439. BedUseStatus = #{bedusestatus,jdbcType=INTEGER}
  440. where BedNo = #{bedno,jdbcType=VARCHAR}
  441. </update>
  442. </mapper>