InpCatheterPartMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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.InpCatheterPartMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpCatheterPart" >
  5. <id column="ICP_ID" property="icpId" jdbcType="INTEGER" />
  6. <result column="IC_ID" property="icId" jdbcType="INTEGER" />
  7. <result column="ICP_Part" property="icpPart" jdbcType="VARCHAR" />
  8. <result column="ICP_Position" property="icpPosition" jdbcType="VARCHAR" />
  9. <result column="UI_ID" property="uiId" jdbcType="VARCHAR" />
  10. <result column="ICP_Update_Time" property="icpUpdateTime" jdbcType="TIMESTAMP" />
  11. <result column="ICP_IsDel" property="icpIsdel" jdbcType="INTEGER" />
  12. </resultMap>
  13. <sql id="Base_Column_List" >
  14. ICP_ID, IC_ID, ICP_Part, ICP_Position, UI_ID, ICP_Update_Time, ICP_IsDel
  15. </sql>
  16. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  17. select
  18. <include refid="Base_Column_List" />
  19. from inp_catheter_part
  20. where ICP_IsDel = 0 and ICP_ID = #{icpId,jdbcType=INTEGER}
  21. </select>
  22. <!-- 根据管路信息获取部位和位置 -->
  23. <select id="selectByICID" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  24. select
  25. <include refid="Base_Column_List" />
  26. from inp_catheter_part
  27. where ICP_IsDel = 0 and IC_ID = #{IC_ID,jdbcType=INTEGER}
  28. </select>
  29. <select id="selectByIcIds" resultMap="BaseResultMap" parameterType="List" >
  30. select
  31. <include refid="Base_Column_List" />
  32. from inp_catheter_part
  33. where ICP_IsDel = 0 and IC_ID in
  34. <foreach collection="list" item="item" separator="," index="index" open="(" close=")">
  35. #{item,jdbcType=INTEGER}
  36. </foreach>
  37. Order by ICP_ID desc
  38. </select>
  39. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  40. delete from inp_catheter_part
  41. where ICP_ID = #{icpId,jdbcType=INTEGER}
  42. </delete>
  43. <insert id="batchInsert" >
  44. insert into inp_catheter_part (
  45. IC_ID,
  46. ICP_Part,
  47. ICP_Position,
  48. UI_ID,
  49. ICP_Update_Time,
  50. ICP_IsDel)
  51. values
  52. <foreach collection="list" item="item" separator=",">
  53. (#{item.icId,jdbcType=INTEGER},
  54. #{item.icpPart,jdbcType=VARCHAR},
  55. #{item.icpPosition,jdbcType=VARCHAR},
  56. #{item.uiId,jdbcType=VARCHAR},
  57. #{item.icpUpdateTime,jdbcType=TIMESTAMP},
  58. 0)
  59. </foreach>
  60. </insert>
  61. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpCatheterPart">
  62. insert into inp_catheter_part
  63. <trim prefix="(" suffix=")" suffixOverrides="," >
  64. <if test="icpId != null" >
  65. ICP_ID,
  66. </if>
  67. <if test="icId != null" >
  68. IC_ID,
  69. </if>
  70. <if test="icpPart != null" >
  71. ICP_Part,
  72. </if>
  73. <if test="icpPosition != null" >
  74. ICP_Position,
  75. </if>
  76. <if test="uiId != null" >
  77. UI_ID,
  78. </if>
  79. <if test="icpUpdateTime != null" >
  80. ICP_Update_Time,
  81. </if>
  82. <if test="icpIsdel != null" >
  83. ICP_IsDel,
  84. </if>
  85. </trim>
  86. <trim prefix="values (" suffix=")" suffixOverrides="," >
  87. <if test="icpId != null" >
  88. #{icpId,jdbcType=INTEGER},
  89. </if>
  90. <if test="icId != null" >
  91. #{icId,jdbcType=INTEGER},
  92. </if>
  93. <if test="icpPart != null" >
  94. #{icpPart,jdbcType=VARCHAR},
  95. </if>
  96. <if test="icpPosition != null" >
  97. #{icpPosition,jdbcType=VARCHAR},
  98. </if>
  99. <if test="uiId != null" >
  100. #{uiId,jdbcType=VARCHAR},
  101. </if>
  102. <if test="icpUpdateTime != null" >
  103. #{icpUpdateTime,jdbcType=TIMESTAMP},
  104. </if>
  105. <if test="icpIsdel != null" >
  106. #{icpIsdel,jdbcType=INTEGER},
  107. </if>
  108. </trim>
  109. </insert>
  110. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpCatheterPart" >
  111. update inp_catheter_part
  112. <set >
  113. <if test="icId != null" >
  114. IC_ID = #{icId,jdbcType=INTEGER},
  115. </if>
  116. <if test="icpPart != null" >
  117. ICP_Part = #{icpPart,jdbcType=VARCHAR},
  118. </if>
  119. <if test="icpPosition != null" >
  120. ICP_Position = #{icpPosition,jdbcType=VARCHAR},
  121. </if>
  122. <if test="uiId != null" >
  123. UI_ID = #{uiId,jdbcType=VARCHAR},
  124. </if>
  125. <if test="icpUpdateTime != null" >
  126. ICP_Update_Time = #{icpUpdateTime,jdbcType=TIMESTAMP},
  127. </if>
  128. <if test="icpIsdel != null" >
  129. ICP_IsDel = #{icpIsdel,jdbcType=INTEGER},
  130. </if>
  131. </set>
  132. where ICP_ID = #{icpId,jdbcType=INTEGER}
  133. </update>
  134. <update id="updateByStatus" >
  135. update inp_catheter_part
  136. set ICP_IsDel = -1
  137. where IC_ID = #{icId,jdbcType=INTEGER}
  138. </update>
  139. <update id="batchDel">
  140. update inp_catheter_part
  141. set ICP_IsDel = -1
  142. where IC_ID in
  143. <foreach collection="list" item="item" open="(" close=")" separator=",">
  144. #{item,jdbcType=INTEGER}
  145. </foreach>
  146. </update>
  147. </mapper>