DicIntellectMattressMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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.DicIntellectMattressMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIntellectMattress" >
  5. <id column="DIM_ID" property="dimId" jdbcType="INTEGER" />
  6. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  7. <result column="DD_DepDm" property="ddDepdm" jdbcType="VARCHAR" />
  8. <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
  9. <result column="DIM_BED" property="dimBed" jdbcType="VARCHAR" />
  10. <result column="DIM_MATTRESS" property="dimMattress" jdbcType="VARCHAR" />
  11. <result column="DIM_Operation_Time" property="dimOperationTime" jdbcType="TIMESTAMP" />
  12. <result column="DIM_Operator" property="dimOperator" jdbcType="VARCHAR" />
  13. <result column="DIM_IsDel" property="dimIsdel" jdbcType="INTEGER" />
  14. </resultMap>
  15. <sql id="Base_Column_List" >
  16. DIM_ID, HI_ID, DD_DepDm, DW_WardDm, DIM_BED, DIM_MATTRESS, DIM_Operation_Time, DIM_Operator,
  17. DIM_IsDel
  18. </sql>
  19. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  20. select
  21. <include refid="Base_Column_List" />
  22. from dic_intellect_mattress
  23. where DIM_IsDel = 0 and DIM_ID = #{dimId,jdbcType=INTEGER}
  24. </select>
  25. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  26. delete from dic_intellect_mattress
  27. where DIM_ID = #{dimId,jdbcType=INTEGER}
  28. </delete>
  29. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIntellectMattress" >
  30. insert into dic_intellect_mattress (DIM_ID, HI_ID, DD_DepDm,
  31. DW_WardDm, DIM_BED, DIM_MATTRESS,
  32. DIM_Operation_Time, DIM_Operator, DIM_IsDel
  33. )
  34. values (#{dimId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{ddDepdm,jdbcType=VARCHAR},
  35. #{dwWarddm,jdbcType=VARCHAR}, #{dimBed,jdbcType=VARCHAR}, #{dimMattress,jdbcType=VARCHAR},
  36. #{dimOperationTime,jdbcType=TIMESTAMP}, #{dimOperator,jdbcType=VARCHAR}, #{dimIsdel,jdbcType=INTEGER}
  37. )
  38. </insert>
  39. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIntellectMattress" >
  40. insert into dic_intellect_mattress
  41. <trim prefix="(" suffix=")" suffixOverrides="," >
  42. <if test="dimId != null" >
  43. DIM_ID,
  44. </if>
  45. <if test="hiId != null" >
  46. HI_ID,
  47. </if>
  48. <if test="ddDepdm != null" >
  49. DD_DepDm,
  50. </if>
  51. <if test="dwWarddm != null" >
  52. DW_WardDm,
  53. </if>
  54. <if test="dimBed != null" >
  55. DIM_BED,
  56. </if>
  57. <if test="dimMattress != null" >
  58. DIM_MATTRESS,
  59. </if>
  60. <if test="dimOperationTime != null" >
  61. DIM_Operation_Time,
  62. </if>
  63. <if test="dimOperator != null" >
  64. DIM_Operator,
  65. </if>
  66. <if test="dimIsdel != null" >
  67. DIM_IsDel,
  68. </if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides="," >
  71. <if test="dimId != null" >
  72. #{dimId,jdbcType=INTEGER},
  73. </if>
  74. <if test="hiId != null" >
  75. #{hiId,jdbcType=INTEGER},
  76. </if>
  77. <if test="ddDepdm != null" >
  78. #{ddDepdm,jdbcType=VARCHAR},
  79. </if>
  80. <if test="dwWarddm != null" >
  81. #{dwWarddm,jdbcType=VARCHAR},
  82. </if>
  83. <if test="dimBed != null" >
  84. #{dimBed,jdbcType=VARCHAR},
  85. </if>
  86. <if test="dimMattress != null" >
  87. #{dimMattress,jdbcType=VARCHAR},
  88. </if>
  89. <if test="dimOperationTime != null" >
  90. #{dimOperationTime,jdbcType=TIMESTAMP},
  91. </if>
  92. <if test="dimOperator != null" >
  93. #{dimOperator,jdbcType=VARCHAR},
  94. </if>
  95. <if test="dimIsdel != null" >
  96. #{dimIsdel,jdbcType=INTEGER},
  97. </if>
  98. </trim>
  99. </insert>
  100. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIntellectMattress" >
  101. update dic_intellect_mattress
  102. <set >
  103. <if test="hiId != null" >
  104. HI_ID = #{hiId,jdbcType=INTEGER},
  105. </if>
  106. <if test="ddDepdm != null" >
  107. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  108. </if>
  109. <if test="dwWarddm != null" >
  110. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  111. </if>
  112. <if test="dimBed != null" >
  113. DIM_BED = #{dimBed,jdbcType=VARCHAR},
  114. </if>
  115. <if test="dimMattress != null" >
  116. DIM_MATTRESS = #{dimMattress,jdbcType=VARCHAR},
  117. </if>
  118. <if test="dimOperationTime != null" >
  119. DIM_Operation_Time = #{dimOperationTime,jdbcType=TIMESTAMP},
  120. </if>
  121. <if test="dimOperator != null" >
  122. DIM_Operator = #{dimOperator,jdbcType=VARCHAR},
  123. </if>
  124. <if test="dimIsdel != null" >
  125. DIM_IsDel = #{dimIsdel,jdbcType=INTEGER},
  126. </if>
  127. </set>
  128. where DIM_ID = #{dimId,jdbcType=INTEGER}
  129. </update>
  130. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIntellectMattress" >
  131. update dic_intellect_mattress
  132. set HI_ID = #{hiId,jdbcType=INTEGER},
  133. DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
  134. DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
  135. DIM_BED = #{dimBed,jdbcType=VARCHAR},
  136. DIM_MATTRESS = #{dimMattress,jdbcType=VARCHAR},
  137. DIM_Operation_Time = #{dimOperationTime,jdbcType=TIMESTAMP},
  138. DIM_Operator = #{dimOperator,jdbcType=VARCHAR},
  139. DIM_IsDel = #{dimIsdel,jdbcType=INTEGER}
  140. where DIM_ID = #{dimId,jdbcType=INTEGER}
  141. </update>
  142. <select id="selectByHIid" resultMap="BaseResultMap">
  143. select
  144. <include refid="Base_Column_List" />
  145. from dic_intellect_mattress
  146. where DIM_IsDel = 0
  147. and HI_ID in
  148. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  149. #{item,jdbcType=INTEGER}
  150. </foreach>
  151. <if test="name != null" >
  152. and (DIM_BED like concat('%',#{name},'%') or DIM_MATTRESS like concat('%',#{name},'%'))
  153. </if>
  154. order by DIM_Operation_Time desc
  155. </select>
  156. <update id="updateStatus">
  157. update dic_intellect_mattress
  158. set
  159. DIM_Operation_Time = #{time,jdbcType=TIMESTAMP},
  160. DIM_Operator = #{uiCode,jdbcType=VARCHAR},
  161. DIM_IsDel = -1
  162. where DIM_ID = #{dimId,jdbcType=INTEGER}
  163. </update>
  164. </mapper>