DicCatheterPartMapper.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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.DicCatheterPartMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterPart" >
  5. <id column="DCP_ID" property="dcpId" jdbcType="INTEGER" />
  6. <result column="DC_ID" property="dcId" jdbcType="INTEGER" />
  7. <result column="DCP_Part" property="dcpPart" jdbcType="VARCHAR" />
  8. <result column="DIP_Operation_Time" property="dipOperationTime" jdbcType="TIMESTAMP" />
  9. <result column="DIP_Operator" property="dipOperator" jdbcType="VARCHAR" />
  10. <result column="DIP_IsDel" property="dipIsdel" jdbcType="INTEGER" />
  11. </resultMap>
  12. <sql id="Base_Column_List" >
  13. DCP_ID, DC_ID, DCP_Part, DIP_Operation_Time, DIP_Operator, DIP_IsDel
  14. </sql>
  15. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  16. select
  17. <include refid="Base_Column_List" />
  18. from dic_catheter_part
  19. where DCP_ID = #{dcpId,jdbcType=INTEGER}
  20. </select>
  21. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  22. delete from dic_catheter_part
  23. where DCP_ID = #{dcpId,jdbcType=INTEGER}
  24. </delete>
  25. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterPart" >
  26. insert into dic_catheter_part (DCP_ID, DC_ID, DCP_Part,
  27. DIP_Operation_Time, DIP_Operator, DIP_IsDel
  28. )
  29. values (#{dcpId,jdbcType=INTEGER}, #{dcId,jdbcType=INTEGER}, #{dcpPart,jdbcType=VARCHAR},
  30. now(), #{dipOperator,jdbcType=VARCHAR}, #{dipIsdel,jdbcType=INTEGER}
  31. )
  32. </insert>
  33. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterPart" >
  34. insert into dic_catheter_part
  35. <trim prefix="(" suffix=")" suffixOverrides="," >
  36. <if test="dcpId != null" >
  37. DCP_ID,
  38. </if>
  39. <if test="dcId != null" >
  40. DC_ID,
  41. </if>
  42. <if test="dcpPart != null" >
  43. DCP_Part,
  44. </if>
  45. <if test="dipOperationTime != null" >
  46. DIP_Operation_Time,
  47. </if>
  48. <if test="dipOperator != null" >
  49. DIP_Operator,
  50. </if>
  51. <if test="dipIsdel != null" >
  52. DIP_IsDel,
  53. </if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides="," >
  56. <if test="dcpId != null" >
  57. #{dcpId,jdbcType=INTEGER},
  58. </if>
  59. <if test="dcId != null" >
  60. #{dcId,jdbcType=INTEGER},
  61. </if>
  62. <if test="dcpPart != null" >
  63. #{dcpPart,jdbcType=VARCHAR},
  64. </if>
  65. <if test="dipOperationTime != null" >
  66. #{dipOperationTime,jdbcType=TIMESTAMP},
  67. </if>
  68. <if test="dipOperator != null" >
  69. #{dipOperator,jdbcType=VARCHAR},
  70. </if>
  71. <if test="dipIsdel != null" >
  72. #{dipIsdel,jdbcType=INTEGER},
  73. </if>
  74. </trim>
  75. </insert>
  76. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterPart" >
  77. update dic_catheter_part
  78. <set >
  79. <if test="dcId != null" >
  80. DC_ID = #{dcId,jdbcType=INTEGER},
  81. </if>
  82. <if test="dcpPart != null" >
  83. DCP_Part = #{dcpPart,jdbcType=VARCHAR},
  84. </if>
  85. <if test="dipOperator != null" >
  86. DIP_Operator = #{dipOperator,jdbcType=VARCHAR},
  87. </if>
  88. <if test="dipIsdel != null" >
  89. DIP_IsDel = #{dipIsdel,jdbcType=INTEGER},
  90. </if>
  91. now(),
  92. </set>
  93. where DCP_ID = #{dcpId,jdbcType=INTEGER}
  94. </update>
  95. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterPart" >
  96. update dic_catheter_part
  97. set
  98. DIP_Operation_Time = now(),
  99. DIP_Operator = #{dipOperator,jdbcType=VARCHAR},
  100. DIP_IsDel = #{dipIsdel,jdbcType=INTEGER}
  101. where DCP_ID = #{dcpId,jdbcType=INTEGER}
  102. </update>
  103. <insert id="batchInsertPart" parameterType="java.util.List">
  104. insert into dic_catheter_part (DC_ID, DCP_Part,
  105. DIP_Operation_Time, DIP_Operator, DIP_IsDel)
  106. values
  107. <foreach collection="list" separator="," item="item">
  108. (#{item.dcId,jdbcType=INTEGER}, #{item.dcpPart,jdbcType=VARCHAR},
  109. now(), #{item.dipOperator,jdbcType=VARCHAR}, #{item.dipIsdel,jdbcType=INTEGER}
  110. )
  111. </foreach>
  112. </insert>
  113. <select id="selectByIds" resultMap="BaseResultMap" parameterType="java.util.List">
  114. select <include refid="Base_Column_List"/>
  115. from dic_catheter_part
  116. where DIP_IsDel = 0
  117. and DCP_Part IN
  118. <foreach collection="list" separator="," open="(" close=")" item="item">
  119. #{item}
  120. </foreach>
  121. </select>
  122. <update id="deleteById">
  123. update dic_catheter_part
  124. set DIP_IsDel = -1,
  125. DIP_Operator = #{dipOperator,jdbcType=VARCHAR},
  126. DIP_Operation_Time = now()
  127. where DC_ID = #{dcId,jdbcType=INTEGER}
  128. </update>
  129. </mapper>