DicIoMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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.DicIoMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.DicIo" >
  5. <id column="DIO_ID" property="dioId" jdbcType="INTEGER" />
  6. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  7. <result column="DW_WardDm" property="dwWardDm" jdbcType="VARCHAR" />
  8. <result column="DIO_IO_Code" property="dioIoCode" jdbcType="VARCHAR"/>
  9. <result column="DIO_Type" property="dioType" jdbcType="INTEGER" />
  10. <result column="DIO_IOName" property="dioIoname" jdbcType="VARCHAR" />
  11. <result column="DIO_IsAdvice" property="dioIsadvice" jdbcType="INTEGER" />
  12. <result column="DIO_Operation_Time" property="dioOperationTime" jdbcType="TIMESTAMP" />
  13. <result column="DIO_Operator" property="dioOperator" jdbcType="VARCHAR" />
  14. <result column="DIO_PinyinCode" property="dioPinyinCode" jdbcType="VARCHAR"/>
  15. <result column="DIO_WubiCode" property="dioWubiCode" jdbcType="VARCHAR"/>
  16. <result column="DIO_OtherCode" property="dioOtherCode" jdbcType="VARCHAR"/>
  17. <result column="DIO_IsDel" property="dioIsdel" jdbcType="INTEGER" />
  18. <result column="DIO_Sort" property="dioSort" jdbcType="INTEGER"/>
  19. <result column="DIO_Color" property="dioColor" jdbcType="VARCHAR" />
  20. </resultMap>
  21. <sql id="Base_Column_List" >
  22. DIO_ID, HI_ID, DW_WardDm, DIO_IO_Code,DIO_Type, DIO_IOName, DIO_IsAdvice, DIO_Operation_Time,
  23. DIO_Operator,DIO_PinyinCode,DIO_WubiCode,DIO_OtherCode, DIO_IsDel,DIO_Sort, DIO_Color
  24. </sql>
  25. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  26. select
  27. <include refid="Base_Column_List" />
  28. from dic_io
  29. where DIO_IsDel = 0 AND DIO_ID = #{dioId,jdbcType=INTEGER}
  30. </select>
  31. <select id="selectIds" resultMap="BaseResultMap" parameterType="List" >
  32. select
  33. <include refid="Base_Column_List" />
  34. from dic_io
  35. where DIO_IsDel = 0 AND DIO_ID in
  36. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  37. #{item,jdbcType=INTEGER}
  38. </foreach>
  39. order by DIO_Sort asc
  40. </select>
  41. <select id="selectByType" resultMap="BaseResultMap" parameterType="com.xinxin.topro.inpnurseservice.request.DicIoSearchRequest" >
  42. select
  43. <include refid="Base_Column_List" />
  44. from dic_io
  45. where DIO_IsDel = 0
  46. <if test="type != null" >
  47. AND DIO_Type = #{type,jdbcType=INTEGER}
  48. </if>
  49. <if test="hiId != null" >
  50. AND HI_ID = #{hiId,jdbcType=INTEGER}
  51. </if>
  52. <if test="dwWardDm != null" >
  53. AND DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
  54. </if>
  55. <if test="dioIoCode != null" >
  56. AND DIO_IO_Code = #{dioIoCode,jdbcType=VARCHAR}
  57. </if>
  58. order by DIO_Sort asc
  59. </select>
  60. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  61. delete from dic_io
  62. where DIO_ID = #{dioId,jdbcType=INTEGER}
  63. </delete>
  64. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicIo" >
  65. insert into dic_io
  66. <trim prefix="(" suffix=")" suffixOverrides="," >
  67. <if test="dioId != null" >
  68. DIO_ID,
  69. </if>
  70. <if test="hiId != null" >
  71. HI_ID,
  72. </if>
  73. <if test="dwWarddm != null" >
  74. DW_WardDm,
  75. </if>
  76. <if test="dioCode != null" >
  77. DIO_IO_Code,
  78. </if>
  79. <if test="dioType != null" >
  80. DIO_Type,
  81. </if>
  82. <if test="dioIoname != null" >
  83. DIO_IOName,
  84. </if>
  85. <if test="dioIsadvice != null" >
  86. DIO_IsAdvice,
  87. </if>
  88. <if test="dioOperationTime != null" >
  89. DIO_Operation_Time,
  90. </if>
  91. <if test="dioOperator != null" >
  92. DIO_Operator,
  93. </if>
  94. <if test="dioPinyinCode != null" >
  95. DIO_PinyinCode,
  96. </if>
  97. <if test="dioWubiCode != null" >
  98. DIO_WubiCode,
  99. </if>
  100. <if test="dioOtherCode != null" >
  101. DIO_OtherCode,
  102. </if>
  103. <if test="dioIsdel != null" >
  104. DIO_IsDel,
  105. </if>
  106. <if test="dioSort != null">
  107. DIO_Sort,
  108. </if>
  109. <if test="dioColor != null">
  110. DIO_Color,
  111. </if>
  112. </trim>
  113. <trim prefix="values (" suffix=")" suffixOverrides="," >
  114. <if test="dioId != null" >
  115. #{dioId,jdbcType=INTEGER},
  116. </if>
  117. <if test="hiId != null" >
  118. #{hiId,jdbcType=INTEGER},
  119. </if>
  120. <if test="dwWarddm != null" >
  121. #{dwWarddm,jdbcType=VARCHAR},
  122. </if>
  123. <if test="dioCode != null" >
  124. #{dioCode,jdbcType=VARCHAR},
  125. </if>
  126. <if test="dioType != null" >
  127. #{dioType,jdbcType=INTEGER},
  128. </if>
  129. <if test="dioIoname != null" >
  130. #{dioIoname,jdbcType=VARCHAR},
  131. </if>
  132. <if test="dioIsadvice != null" >
  133. #{dioIsadvice,jdbcType=INTEGER},
  134. </if>
  135. <if test="dioOperationTime != null" >
  136. #{dioOperationTime,jdbcType=TIMESTAMP},
  137. </if>
  138. <if test="dioOperator != null" >
  139. #{dioOperator,jdbcType=VARCHAR},
  140. </if>
  141. <if test="dioPinyinCode != null" >
  142. #{dioPinyinCode,jdbcType=VARCHAR},
  143. </if>
  144. <if test="dioWubiCode != null" >
  145. #{dioWubiCode,jdbcType=VARCHAR},
  146. </if>
  147. <if test="dioOtherCode != null" >
  148. #{dioOtherCode,jdbcType=VARCHAR},
  149. </if>
  150. <if test="dioIsdel != null" >
  151. #{dioIsdel,jdbcType=INTEGER},
  152. </if>
  153. <if test="dioSort =null">
  154. #{dioSort,jdbcTpye=INTEGER},
  155. </if>
  156. <if test="dioColor != null" >
  157. #{dioColor,jdbcType=VARCHAR},
  158. </if>
  159. </trim>
  160. </insert>
  161. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicIo" >
  162. update dic_io
  163. <set >
  164. <if test="hiId != null" >
  165. HI_ID = #{hiId,jdbcType=INTEGER},
  166. </if>
  167. <if test="dwWarddm != null" >
  168. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  169. </if>
  170. <if test="dioCode != null" >
  171. DIO_IO_Code = #{dioCode,jdbcType=VARCHAR},
  172. </if>
  173. <if test="dioType != null" >
  174. DIO_Type = #{dioType,jdbcType=INTEGER},
  175. </if>
  176. <if test="dioIoname != null" >
  177. DIO_IOName = #{dioIoname,jdbcType=VARCHAR},
  178. </if>
  179. <if test="dioIsadvice != null" >
  180. DIO_IsAdvice = #{dioIsadvice,jdbcType=INTEGER},
  181. </if>
  182. <if test="dioOperationTime != null" >
  183. DIO_Operation_Time = #{dioOperationTime,jdbcType=TIMESTAMP},
  184. </if>
  185. <if test="dioOperator != null" >
  186. DIO_Operator = #{dioOperator,jdbcType=VARCHAR},
  187. </if>
  188. <if test="dioPinyinCode != null" >
  189. DIO_PinyinCode = #{dioPinyinCode,jdbcType=VARCHAR},
  190. </if>
  191. <if test="dioWubiCode != null" >
  192. DIO_WubiCode = #{dioWubiCode,jdbcType=VARCHAR},
  193. </if>
  194. <if test="dioOtherCode != null" >
  195. DIO_OtherCode = #{dioOtherCode,jdbcType=VARCHAR},
  196. </if>
  197. <if test="dioIsdel != null" >
  198. DIO_IsDel = #{dioIsdel,jdbcType=INTEGER},
  199. </if>
  200. <if test="dioSort != null" >
  201. DIO_Sort = #{dioSort,jdbcType=INTEGER},
  202. </if>
  203. <if test="dioColor != null" >
  204. DIO_Color = #{dioColor,jdbcType=VARCHAR},
  205. </if>
  206. </set>
  207. where DIO_ID = #{dioId,jdbcType=INTEGER}
  208. </update>
  209. <select id="selectAll" resultMap="BaseResultMap" >
  210. select
  211. <include refid="Base_Column_List" />
  212. from dic_io
  213. where DIO_IsDel = 0
  214. <if test="hiId != null" >
  215. AND (HI_ID = #{hiId,jdbcType=INTEGER} OR HI_ID = 0)
  216. </if>
  217. <if test="dwWardDm != null" >
  218. AND DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
  219. </if>
  220. order by DIO_Sort asc
  221. </select>
  222. <select id="selectByHiId" resultType="com.xinxin.topro.inpnurseservice.response.InpIoFullResponse">
  223. SELECT
  224. di.DIO_ID AS dioId,
  225. DIO_IO_Code AS dioIoCode,
  226. DIO_IOName AS dioIoName,
  227. dip.DIP_ID AS dipId,
  228. dip.DIP_PropCode AS dipPropCode,
  229. dip.DIP_PropName AS dipPropName,
  230. dip.DIP_SupID AS dipSupId,
  231. di.DIO_Type AS dioType
  232. FROM
  233. dic_io di
  234. LEFT JOIN dic_io_property dip ON di.DIO_ID = dip.DIO_ID
  235. WHERE
  236. di.DIO_IsDel = 0
  237. AND dip.DIP_IsDel = 0
  238. AND di.HI_ID = #{hiId,jdbcType=INTEGER}
  239. GROUP BY dip.DIP_ID
  240. </select>
  241. </mapper>