DicIoPropertyMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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.DicIoPropertyMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.DicIoProperty" >
  5. <id column="DIP_ID" property="dipId" jdbcType="INTEGER" />
  6. <result column="DIO_ID" property="dioId" jdbcType="INTEGER" />
  7. <result column="DIP_PropCode" property="dicPropCode" jdbcType="VARCHAR" />
  8. <result column="DIP_PropName" property="dipPropName" jdbcType="VARCHAR" />
  9. <result column="DIP_Operation_Time" property="dipOperationTime" jdbcType="TIMESTAMP" />
  10. <result column="DIP_Operator" property="dipOperator" jdbcType="VARCHAR" />
  11. <result column="DIP_SupID" property="dipSupId" jdbcType="INTEGER" />
  12. <result column="DIP_IsDel" property="dipIsDel" jdbcType="INTEGER" />
  13. </resultMap>
  14. <sql id="Base_Column_List" >
  15. DIP_ID, DIO_ID, DIP_PropCode, DIP_PropName, DIP_Operation_Time, DIP_Operator, DIP_SupID, DIP_IsDel
  16. </sql>
  17. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  18. select
  19. <include refid="Base_Column_List" />
  20. from dic_io_property
  21. where DIP_IsDel = 0 and DIP_ID = #{dipId,jdbcType=INTEGER}
  22. </select>
  23. <select id="selectByCode" resultMap="BaseResultMap" parameterType="java.lang.String" >
  24. select
  25. <include refid="Base_Column_List" />
  26. from dic_io_property
  27. where DIP_IsDel = 0 and DIP_PropCode = #{code,jdbcType=VARCHAR}
  28. </select>
  29. <select id="selectByDio" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  30. select
  31. <include refid="Base_Column_List" />
  32. from dic_io_property
  33. where DIP_IsDel = 0 and DIP_SupID = 0 and DIO_ID = #{dioId,jdbcType=INTEGER}
  34. </select>
  35. <select id="selectByIds" resultMap="BaseResultMap" parameterType="List" >
  36. select
  37. <include refid="Base_Column_List" />
  38. from dic_io_property
  39. where DIP_IsDel = 0 and DIP_ID in
  40. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  41. #{item,jdbcType=INTEGER}
  42. </foreach>
  43. </select>
  44. <select id="selectBySupId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  45. select
  46. <include refid="Base_Column_List" />
  47. from dic_io_property
  48. where DIP_IsDel = 0 and DIP_SupID = #{id,jdbcType=INTEGER}
  49. </select>
  50. <select id="selectBySupList" resultMap="BaseResultMap">
  51. select
  52. <include refid="Base_Column_List" />
  53. from dic_io_property
  54. where DIP_IsDel = 0 and DIP_SupID in
  55. <foreach collection="list" item="item" separator="," index="index" open="(" close=")">
  56. #{item,jdbcType=INTEGER}
  57. </foreach>
  58. </select>
  59. <select id="selectAll" resultMap="BaseResultMap">
  60. select
  61. <include refid="Base_Column_List" />
  62. from dic_io_property
  63. where DIP_IsDel = 0
  64. </select>
  65. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  66. delete from dic_io_property
  67. where DIP_ID = #{dipId,jdbcType=INTEGER}
  68. </delete>
  69. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicIoProperty" >
  70. insert into dic_io_property
  71. <trim prefix="(" suffix=")" suffixOverrides="," >
  72. <if test="dipId != null" >
  73. DIP_ID,
  74. </if>
  75. <if test="dioId != null" >
  76. DIO_ID,
  77. </if>
  78. <if test="dipPropCode != null" >
  79. DIP_PropCode,
  80. </if>
  81. <if test="dipPropName != null" >
  82. DIP_PropName,
  83. </if>
  84. <if test="dipOperationTime != null" >
  85. DIP_Operation_Time,
  86. </if>
  87. <if test="dipOperator != null" >
  88. DIP_Operator,
  89. </if>
  90. <if test="dipSupId != null" >
  91. DIP_SupID,
  92. </if>
  93. <if test="dipIsDel != null" >
  94. DIP_IsDel,
  95. </if>
  96. </trim>
  97. <trim prefix="values (" suffix=")" suffixOverrides="," >
  98. <if test="dipId != null" >
  99. #{dipId,jdbcType=INTEGER},
  100. </if>
  101. <if test="dioId != null" >
  102. #{dioId,jdbcType=INTEGER},
  103. </if>
  104. <if test="dipPropCode != null" >
  105. #{dipPropCode,jdbcType=VARCHAR},
  106. </if>
  107. <if test="dipPropName != null" >
  108. #{dipPropName,jdbcType=VARCHAR},
  109. </if>
  110. <if test="dipOperationTime != null" >
  111. #{dipOperationTime,jdbcType=TIMESTAMP},
  112. </if>
  113. <if test="dipOperator != null" >
  114. #{dipOperator,jdbcType=VARCHAR},
  115. </if>
  116. <if test="dipSupId != null" >
  117. #{dipSupId,jdbcType=INTEGER},
  118. </if>
  119. <if test="dipIsDel != null" >
  120. #{dipIsDel,jdbcType=INTEGER},
  121. </if>
  122. </trim>
  123. </insert>
  124. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicIoProperty" >
  125. update dic_io_property
  126. <set >
  127. <if test="dioId != null" >
  128. DIO_ID = #{dioId,jdbcType=INTEGER},
  129. </if>
  130. <if test="dipPropCode != null" >
  131. DIP_PropCode = #{dipPropCode,jdbcType=VARCHAR},
  132. </if>
  133. <if test="dipPropName != null" >
  134. DIP_PropName = #{dipPropName,jdbcType=VARCHAR},
  135. </if>
  136. <if test="dipOperationTime != null" >
  137. DIP_Operation_Time = #{dipOperationTime,jdbcType=TIMESTAMP},
  138. </if>
  139. <if test="dipOperator != null" >
  140. DIP_Operator = #{dipOperator,jdbcType=VARCHAR},
  141. </if>
  142. <if test="dipSupId != null" >
  143. DIP_SupID = #{dipSupId,jdbcType=INTEGER},
  144. </if>
  145. <if test="dipIsDel != null" >
  146. DIP_IsDel = #{dipIsDel,jdbcType=INTEGER},
  147. </if>
  148. </set>
  149. where DIP_ID = #{dipId,jdbcType=INTEGER}
  150. </update>
  151. <select id="selectAllValueByHiId" resultMap="BaseResultMap">
  152. select <include refid="Base_Column_List"/>
  153. from dic_io_property ip
  154. where DIP_IsDel = 0
  155. and DIP_SupID != 0
  156. and DIP_PropCode is not null
  157. and exists(select 1 from dic_io di where di.DIO_ID = ip.DIO_ID and di.DIO_IsDel = 0 and (di.HI_ID = #{hiId,jdbcType=INTEGER} or di.HI_ID = 0))
  158. </select>
  159. </mapper>