DicCatheterMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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.sysservice.dao.mysqlmapper.DicCatheterMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheter" >
  5. <id column="DC_ID" property="dcId" jdbcType="INTEGER" />
  6. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  7. <result column="DC_Catheter_Name" property="dcCatheterName" jdbcType="VARCHAR" />
  8. <result column="DC_PinyinCode" property="dcPinyincode" jdbcType="VARCHAR" />
  9. <result column="DC_WubiCode" property="dcWubicode" jdbcType="VARCHAR" />
  10. <result column="DC_OtherCode" property="dcOthercode" jdbcType="VARCHAR" />
  11. <result column="DC_Sort" property="dcSort" jdbcType="INTEGER" />
  12. <result column="DC_Material" property="dcMaterial" jdbcType="VARCHAR" />
  13. <result column="DC_Way" property="dcWay" jdbcType="VARCHAR" />
  14. <result column="DC_Category" property="dcCategory" jdbcType="VARCHAR" />
  15. <result column="DC_Valid_Time" property="dcValidTime" jdbcType="INTEGER" />
  16. <result column="DC_IsDel" property="dcIsdel" jdbcType="INTEGER" />
  17. <result column="DC_IsVein" property="dcIsVein" jdbcType="INTEGER" />
  18. <result column="DC_Crisis" property="dcCrisis" jdbcType="INTEGER" />
  19. </resultMap>
  20. <resultMap id="HashMap" type="com.xinxin.topro.sysservice.vo.DicPartVO" extends="BaseResultMap">
  21. <result column="SDD_ID" property="sddId" jdbcType="INTEGER" />
  22. <result column="SD_ID" property="sdId" jdbcType="INTEGER" />
  23. <result column="SDD_Detail_Code" property="sddDetailCode" jdbcType="VARCHAR" />
  24. <result column="SDD_Detail_Name" property="sddDetailName" jdbcType="VARCHAR" />
  25. <result column="SDD_PinyinCode" property="sddPinyincode" jdbcType="VARCHAR" />
  26. <result column="SDD_WubiCode" property="sddWubicode" jdbcType="VARCHAR" />
  27. <result column="SDD_OtherCode" property="sddOthercode" jdbcType="VARCHAR" />
  28. <result column="SDD_Sort" property="sddSort" jdbcType="INTEGER" />
  29. <result column="UI_ID" property="uiId" jdbcType="VARCHAR" />
  30. <result column="SDD_Update_Time" property="sddUpdateTime" jdbcType="TIMESTAMP" />
  31. <result column="DCP_ID" property="dcpId" jdbcType="INTEGER" />
  32. <result column="DC_ID" property="dcId" jdbcType="INTEGER" />
  33. <result column="DCP_Part" property="dcpPart" jdbcType="VARCHAR" />
  34. <result column="DIP_Operation_Time" property="dipOperationTime" jdbcType="TIMESTAMP" />
  35. <result column="DIP_Operator" property="dipOperator" jdbcType="VARCHAR" />
  36. <result column="DIP_IsDel" property="dipIsdel" jdbcType="INTEGER" />
  37. </resultMap>
  38. <sql id="Base_Column_List" >
  39. DC_ID, HI_ID,DC_Catheter_Name, DC_PinyinCode, DC_WubiCode, DC_OtherCode,
  40. DC_Sort, DC_Material, DC_Way, DC_Category, DC_Valid_Time, DC_IsDel, DC_IsVein, DC_Crisis
  41. </sql>
  42. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  43. select
  44. <include refid="Base_Column_List" />
  45. from dic_catheter
  46. where DC_ID = #{dcId,jdbcType=INTEGER}
  47. </select>
  48. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  49. delete from dic_catheter
  50. where DC_ID = #{dcId,jdbcType=INTEGER}
  51. </delete>
  52. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheter" >
  53. insert into dic_catheter (DC_ID, HI_ID,
  54. DC_Catheter_Name, DC_PinyinCode, DC_WubiCode,
  55. DC_OtherCode, DC_Sort, DC_Material,
  56. DC_Way, DC_Category, DC_Valid_Time,
  57. DC_IsDel, DC_IsVein, DC_Crisis)
  58. values (#{dcId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER},
  59. #{dcCatheterName,jdbcType=VARCHAR}, #{dcPinyincode,jdbcType=VARCHAR}, #{dcWubicode,jdbcType=VARCHAR},
  60. #{dcOthercode,jdbcType=VARCHAR}, #{dcSort,jdbcType=INTEGER}, #{dcMaterial,jdbcType=VARCHAR},
  61. #{dcWay,jdbcType=VARCHAR}, #{dcCategory,jdbcType=VARCHAR}, #{dcValidTime,jdbcType=INTEGER},
  62. #{dcIsdel,jdbcType=INTEGER},#{dcIsVein,jdbcType=INTEGER},#{dcCrisis,jdbcType=INTEGER} )
  63. </insert>
  64. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheter" >
  65. insert into dic_catheter
  66. <trim prefix="(" suffix=")" suffixOverrides="," >
  67. <if test="dcId != null" >
  68. DC_ID,
  69. </if>
  70. <if test="hiId != null" >
  71. HI_ID,
  72. </if>
  73. <if test="dcCatheterName != null" >
  74. DC_Catheter_Name,
  75. </if>
  76. <if test="dcPinyincode != null" >
  77. DC_PinyinCode,
  78. </if>
  79. <if test="dcWubicode != null" >
  80. DC_WubiCode,
  81. </if>
  82. <if test="dcOthercode != null" >
  83. DC_OtherCode,
  84. </if>
  85. <if test="dcSort != null" >
  86. DC_Sort,
  87. </if>
  88. <if test="dcMaterial != null" >
  89. DC_Material,
  90. </if>
  91. <if test="dcWay != null" >
  92. DC_Way,
  93. </if>
  94. <if test="dcCategory != null" >
  95. DC_Category,
  96. </if>
  97. <if test="dcValidTime != null" >
  98. DC_Valid_Time,
  99. </if>
  100. <if test="dcIsdel != null" >
  101. DC_IsDel,
  102. </if>
  103. <if test="dcIsVein != null" >
  104. DC_IsVein,
  105. </if>
  106. <if test="dcCrisis != null" >
  107. DC_Crisis,
  108. </if>
  109. </trim>
  110. <trim prefix="values (" suffix=")" suffixOverrides="," >
  111. <if test="dcId != null" >
  112. #{dcId,jdbcType=INTEGER},
  113. </if>
  114. <if test="hiId != null" >
  115. #{hiId,jdbcType=INTEGER},
  116. </if>
  117. <if test="dcCatheterName != null" >
  118. #{dcCatheterName,jdbcType=VARCHAR},
  119. </if>
  120. <if test="dcPinyincode != null" >
  121. #{dcPinyincode,jdbcType=VARCHAR},
  122. </if>
  123. <if test="dcWubicode != null" >
  124. #{dcWubicode,jdbcType=VARCHAR},
  125. </if>
  126. <if test="dcOthercode != null" >
  127. #{dcOthercode,jdbcType=VARCHAR},
  128. </if>
  129. <if test="dcSort != null" >
  130. #{dcSort,jdbcType=INTEGER},
  131. </if>
  132. <if test="dcMaterial != null" >
  133. #{dcMaterial,jdbcType=VARCHAR},
  134. </if>
  135. <if test="dcWay != null" >
  136. #{dcWay,jdbcType=VARCHAR},
  137. </if>
  138. <if test="dcCategory != null" >
  139. #{dcCategory,jdbcType=VARCHAR},
  140. </if>
  141. <if test="dcValidTime != null" >
  142. #{dcValidTime,jdbcType=INTEGER},
  143. </if>
  144. <if test="dcIsdel != null" >
  145. #{dcIsdel,jdbcType=INTEGER},
  146. </if>
  147. <if test="dcIsVein != null" >
  148. #{dcIsVein,jdbcType=INTEGER},
  149. </if>
  150. <if test="dcCrisis != null" >
  151. #{dcCrisis,jdbcType=INTEGER},
  152. </if>
  153. </trim>
  154. </insert>
  155. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheter" >
  156. update dic_catheter
  157. <set >
  158. <if test="hiId != null" >
  159. HI_ID = #{hiId,jdbcType=INTEGER},
  160. </if>
  161. <if test="dcCatheterName != null" >
  162. DC_Catheter_Name = #{dcCatheterName,jdbcType=VARCHAR},
  163. </if>
  164. <if test="dcPinyincode != null" >
  165. DC_PinyinCode = #{dcPinyincode,jdbcType=VARCHAR},
  166. </if>
  167. <if test="dcWubicode != null" >
  168. DC_WubiCode = #{dcWubicode,jdbcType=VARCHAR},
  169. </if>
  170. <if test="dcOthercode != null" >
  171. DC_OtherCode = #{dcOthercode,jdbcType=VARCHAR},
  172. </if>
  173. <if test="dcSort != null" >
  174. DC_Sort = #{dcSort,jdbcType=INTEGER},
  175. </if>
  176. <if test="dcMaterial != null" >
  177. DC_Material = #{dcMaterial,jdbcType=VARCHAR},
  178. </if>
  179. <if test="dcWay != null" >
  180. DC_Way = #{dcWay,jdbcType=VARCHAR},
  181. </if>
  182. <if test="dcCategory != null" >
  183. DC_Category = #{dcCategory,jdbcType=VARCHAR},
  184. </if>
  185. <if test="dcValidTime != null" >
  186. DC_Valid_Time = #{dcValidTime,jdbcType=INTEGER},
  187. </if>
  188. <if test="dcIsdel != null" >
  189. DC_IsDel = #{dcIsdel,jdbcType=INTEGER},
  190. </if>
  191. <if test="dcIsVein != null" >
  192. DC_IsVein = #{dcIsVein,jdbcType=INTEGER}
  193. </if>
  194. <if test="dcCrisis != null" >
  195. DC_Crisis = #{dcCrisis,jdbcType=INTEGER},
  196. </if>
  197. </set>
  198. where DC_ID = #{dcId,jdbcType=INTEGER}
  199. </update>
  200. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheter" >
  201. update dic_catheter
  202. set
  203. DC_Catheter_Name = #{dcCatheterName,jdbcType=VARCHAR},
  204. DC_PinyinCode = #{dcPinyincode,jdbcType=VARCHAR},
  205. DC_WubiCode = #{dcWubicode,jdbcType=VARCHAR},
  206. DC_Sort = #{dcSort,jdbcType=INTEGER},
  207. DC_Material = #{dcMaterial,jdbcType=VARCHAR},
  208. DC_Way = #{dcWay,jdbcType=VARCHAR},
  209. DC_Category = #{dcCategory,jdbcType=VARCHAR},
  210. DC_Valid_Time = #{dcValidTime,jdbcType=INTEGER},
  211. DC_IsVein = #{dcIsVein,jdbcType=INTEGER},
  212. DC_Crisis = #{dcCrisis,jdbcType=INTEGER}
  213. where DC_ID = #{dcId,jdbcType=INTEGER}
  214. </update>
  215. <select id="selectDetailList" resultMap="BaseResultMap">
  216. SELECT
  217. <include refid="Base_Column_List" />
  218. FROM
  219. dic_catheter
  220. WHERE
  221. DC_IsDel = 0
  222. and (HI_ID = #{hiId,jdbcType=INTEGER} or HI_ID = 0)
  223. <if test="dcCatheterName != null and dcCatheterName != '' ">
  224. and (DC_Catheter_Name like concat('%',#{dcCatheterName,jdbcType=VARCHAR},'%')
  225. or DC_PinyinCode like concat('%',#{dcCatheterName,jdbcType=VARCHAR},'%')
  226. or DC_WubiCode like concat('%',#{dcCatheterName,jdbcType=VARCHAR},'%'))
  227. </if>
  228. </select>
  229. <select id="selectPartName" resultMap="HashMap">
  230. SELECT
  231. sdd.SDD_Detail_Name,
  232. sdd.SDD_Detail_Code,
  233. dcp.DCP_Part,
  234. dc.DC_ID,
  235. sdd.SD_ID,
  236. dcp.DCP_ID,
  237. sdd.SDD_ID
  238. FROM
  239. dic_catheter_part dcp,
  240. dic_catheter dc,
  241. sys_dictionary_detail sdd
  242. WHERE
  243. dc.DC_ID = dcp.DC_ID
  244. and sdd.SDD_Detail_Code = dcp.DCP_Part
  245. and dc.DC_ID = #{dcId,jdbcType=INTEGER}
  246. and (dc.HI_ID = #{hiId,jdbcType=INTEGER} or dc.HI_ID = 0)
  247. and dc.DC_IsDel = 0
  248. and sdd.SDD_IsDel = 0
  249. and dcp.DIP_IsDel = 0
  250. <if test="sddDetailName != null and sddDetailName != '' ">
  251. and (SDD_Detail_Name like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
  252. or SDD_Detail_Code like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
  253. or SDD_PinyinCode like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%')
  254. or SDD_WubiCode like concat('%',#{sddDetailName,jdbcType=VARCHAR},'%'))
  255. </if>
  256. ORDER BY sdd.SDD_Sort
  257. </select>
  258. <update id="updateDel" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheter" >
  259. update dic_catheter
  260. set
  261. DC_IsDel = #{dcIsdel,jdbcType=INTEGER}
  262. where DC_ID = #{dcId,jdbcType=INTEGER}
  263. </update>
  264. </mapper>