DicIoCatheterMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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.DicIoCatheterMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIoCatheter" >
  5. <id column="IOC_ID" property="iocId" jdbcType="INTEGER" />
  6. <result column="DIO_ID" property="dioId" jdbcType="INTEGER" />
  7. <result column="DC_ID" property="dcId" jdbcType="INTEGER" />
  8. <result column="DIU_Operation_Time" property="diuOperationTime" jdbcType="TIMESTAMP" />
  9. <result column="DIU_Operator" property="diuOperator" jdbcType="VARCHAR" />
  10. <result column="DIU_IsDel" property="diuIsdel" jdbcType="INTEGER" />
  11. </resultMap>
  12. <resultMap id="ListResultMap" extends="BaseResultMap" type="com.xinxin.topro.sysservice.vo.DicIoCatheterVO">
  13. <result column="DC_Catheter_Name" property="dcCategory" jdbcType="VARCHAR"/>
  14. <result column="DC_Category" property="dcCategory" jdbcType="VARCHAR"/>
  15. <result column="relationship" property="relationship" jdbcType="INTEGER"/>
  16. </resultMap>
  17. <sql id="Base_Column_List" >
  18. IOC_ID, DIO_ID, DC_ID, DIU_Operation_Time, DIU_Operator, DIU_IsDel
  19. </sql>
  20. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  21. select
  22. <include refid="Base_Column_List" />
  23. from dic_io_catheter
  24. where IOC_ID = #{iocId,jdbcType=INTEGER}
  25. </select>
  26. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  27. delete from dic_io_catheter
  28. where IOC_ID = #{iocId,jdbcType=INTEGER}
  29. </delete>
  30. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIoCatheter" >
  31. insert into dic_io_catheter (IOC_ID, DIO_ID, DC_ID,
  32. DIU_Operation_Time, DIU_Operator, DIU_IsDel
  33. )
  34. values (#{iocId,jdbcType=INTEGER}, #{dioId,jdbcType=INTEGER}, #{dcId,jdbcType=INTEGER},
  35. #{diuOperationTime,jdbcType=TIMESTAMP}, #{diuOperator,jdbcType=VARCHAR}, #{diuIsdel,jdbcType=INTEGER}
  36. )
  37. </insert>
  38. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIoCatheter" >
  39. insert into dic_io_catheter
  40. <trim prefix="(" suffix=")" suffixOverrides="," >
  41. <if test="iocId != null" >
  42. IOC_ID,
  43. </if>
  44. <if test="dioId != null" >
  45. DIO_ID,
  46. </if>
  47. <if test="dcId != null" >
  48. DC_ID,
  49. </if>
  50. <if test="diuOperationTime != null" >
  51. DIU_Operation_Time,
  52. </if>
  53. <if test="diuOperator != null" >
  54. DIU_Operator,
  55. </if>
  56. <if test="diuIsdel != null" >
  57. DIU_IsDel,
  58. </if>
  59. </trim>
  60. <trim prefix="values (" suffix=")" suffixOverrides="," >
  61. <if test="iocId != null" >
  62. #{iocId,jdbcType=INTEGER},
  63. </if>
  64. <if test="dioId != null" >
  65. #{dioId,jdbcType=INTEGER},
  66. </if>
  67. <if test="dcId != null" >
  68. #{dcId,jdbcType=INTEGER},
  69. </if>
  70. <if test="diuOperationTime != null" >
  71. #{diuOperationTime,jdbcType=TIMESTAMP},
  72. </if>
  73. <if test="diuOperator != null" >
  74. #{diuOperator,jdbcType=VARCHAR},
  75. </if>
  76. <if test="diuIsdel != null" >
  77. #{diuIsdel,jdbcType=INTEGER},
  78. </if>
  79. </trim>
  80. </insert>
  81. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIoCatheter" >
  82. update dic_io_catheter
  83. <set >
  84. <if test="dioId != null" >
  85. DIO_ID = #{dioId,jdbcType=INTEGER},
  86. </if>
  87. <if test="dcId != null" >
  88. DC_ID = #{dcId,jdbcType=INTEGER},
  89. </if>
  90. <if test="diuOperationTime != null" >
  91. DIU_Operation_Time = #{diuOperationTime,jdbcType=TIMESTAMP},
  92. </if>
  93. <if test="diuOperator != null" >
  94. DIU_Operator = #{diuOperator,jdbcType=VARCHAR},
  95. </if>
  96. <if test="diuIsdel != null" >
  97. DIU_IsDel = #{diuIsdel,jdbcType=INTEGER},
  98. </if>
  99. </set>
  100. where IOC_ID = #{iocId,jdbcType=INTEGER}
  101. </update>
  102. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicIoCatheter" >
  103. update dic_io_catheter
  104. set DIO_ID = #{dioId,jdbcType=INTEGER},
  105. DC_ID = #{dcId,jdbcType=INTEGER},
  106. DIU_Operation_Time = #{diuOperationTime,jdbcType=TIMESTAMP},
  107. DIU_Operator = #{diuOperator,jdbcType=VARCHAR},
  108. DIU_IsDel = #{diuIsdel,jdbcType=INTEGER}
  109. where IOC_ID = #{iocId,jdbcType=INTEGER}
  110. </update>
  111. <select id="getListWithCatheter" resultMap="ListResultMap" parameterType="java.lang.Integer">
  112. select
  113. a.DC_ID dcId,
  114. a.DC_Catheter_Name dcCatheterName,
  115. a.DC_Category dcCategory,
  116. (SELECT count(1) from dic_io_catheter b where b.DC_ID = a.DC_ID and b.DIU_IsDel=0 and b.DIO_ID =#{dioId,jdbcType=INTEGER}) relationship,
  117. (SELECT c.IOC_ID from dic_io_catheter c where c.DC_ID = a.DC_ID and c.DIU_IsDel=0 and c.DIO_ID =#{dioId,jdbcType=INTEGER}) iocId
  118. from dic_catheter a where a.DC_IsDel=0
  119. </select>
  120. <insert id="setDicIoCatheter">
  121. insert into dic_io_catheter (DIO_ID, DC_ID,
  122. DIU_Operation_Time, DIU_Operator, DIU_IsDel
  123. )
  124. values
  125. <foreach collection="list" item="item" separator=",">
  126. (#{item.dioId,jdbcType=INTEGER}, #{item.dcId,jdbcType=INTEGER},now(),
  127. #{item.diuOperator,jdbcType=VARCHAR}, #{item.diuIsdel,jdbcType=INTEGER})
  128. </foreach>
  129. </insert>
  130. <update id="delDicIoCatheter">
  131. <foreach item='item' index='index' collection='list' open='' separator=';' close=''>
  132. update dic_io_catheter
  133. set DIU_IsDel=-1
  134. where IOC_ID = #{item,jdbcType=INTEGER}
  135. </foreach>
  136. </update>
  137. <update id="delDicIoCatheterByDicId">
  138. update dic_io_catheter
  139. set DIU_IsDel=-1
  140. where DIO_ID = #{dioid,jdbcType=INTEGER} and DIU_IsDel = 0
  141. </update>
  142. </mapper>