DicCatheterModelMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.DicCatheterModelMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterModel" >
  5. <id column="DCM_ID" property="dcmId" jdbcType="INTEGER" />
  6. <result column="DC_ID" property="dcId" jdbcType="INTEGER" />
  7. <result column="DCM_Model" property="dcmModel" jdbcType="VARCHAR" />
  8. <result column="DCM_Operation_Time" property="dcmOperationTime" jdbcType="TIMESTAMP" />
  9. <result column="DCM_Operator" property="dcmOperator" jdbcType="VARCHAR" />
  10. <result column="DCM_IsDel" property="dcmIsdel" jdbcType="INTEGER" />
  11. </resultMap>
  12. <sql id="Base_Column_List" >
  13. DCM_ID, DC_ID, DCM_Model, DCM_Operation_Time, DCM_Operator, DCM_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_model
  19. where DCM_ID = #{dcmId,jdbcType=INTEGER}
  20. </select>
  21. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterModel" >
  22. insert into dic_catheter_model (DC_ID, DCM_Model,
  23. DCM_Operation_Time, DCM_Operator, DCM_IsDel
  24. )
  25. values (#{dcId,jdbcType=INTEGER}, #{dcmModel,jdbcType=VARCHAR},
  26. now(), #{dcmOperator,jdbcType=VARCHAR}, 0
  27. )
  28. </insert>
  29. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterModel" >
  30. insert into dic_catheter_model
  31. <trim prefix="(" suffix=")" suffixOverrides="," >
  32. <if test="dcmId != null" >
  33. DCM_ID,
  34. </if>
  35. <if test="dcId != null" >
  36. DC_ID,
  37. </if>
  38. <if test="dcmModel != null" >
  39. DCM_Model,
  40. </if>
  41. <if test="dcmOperationTime != null" >
  42. DCM_Operation_Time,
  43. </if>
  44. <if test="dcmOperator != null" >
  45. DCM_Operator,
  46. </if>
  47. <if test="dcmIsdel != null" >
  48. DCM_IsDel,
  49. </if>
  50. </trim>
  51. <trim prefix="values (" suffix=")" suffixOverrides="," >
  52. <if test="dcmId != null" >
  53. #{dcmId,jdbcType=INTEGER},
  54. </if>
  55. <if test="dcId != null" >
  56. #{dcId,jdbcType=INTEGER},
  57. </if>
  58. <if test="dcmModel != null" >
  59. #{dcmModel,jdbcType=VARCHAR},
  60. </if>
  61. <if test="dcmOperationTime != null" >
  62. #{dcmOperationTime,jdbcType=TIMESTAMP},
  63. </if>
  64. <if test="dcmOperator != null" >
  65. #{dcmOperator,jdbcType=VARCHAR},
  66. </if>
  67. <if test="dcmIsdel != null" >
  68. #{dcmIsdel,jdbcType=INTEGER},
  69. </if>
  70. </trim>
  71. </insert>
  72. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterModel" >
  73. update dic_catheter_model
  74. <set >
  75. <if test="dcmModel != null" >
  76. DCM_Model = #{dcmModel,jdbcType=VARCHAR},
  77. </if>
  78. <if test="dcmOperator != null" >
  79. DCM_Operator = #{dcmOperator,jdbcType=VARCHAR},
  80. </if>
  81. <if test="dcmIsdel != null" >
  82. DCM_IsDel = #{dcmIsdel,jdbcType=INTEGER},
  83. </if>
  84. DCM_Operation_Time = now()
  85. </set>
  86. where DCM_ID = #{dcmId,jdbcType=INTEGER}
  87. </update>
  88. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.DicCatheterModel" >
  89. update dic_catheter_model
  90. set DC_ID = #{dcId,jdbcType=INTEGER},
  91. DCM_Model = #{dcmModel,jdbcType=VARCHAR},
  92. DCM_Operation_Time = #{dcmOperationTime,jdbcType=TIMESTAMP},
  93. DCM_Operator = #{dcmOperator,jdbcType=VARCHAR},
  94. DCM_IsDel = #{dcmIsdel,jdbcType=INTEGER}
  95. where DCM_ID = #{dcmId,jdbcType=INTEGER}
  96. </update>
  97. <select id="selectByDcIdName" resultMap="BaseResultMap">
  98. select
  99. <include refid="Base_Column_List" />
  100. from dic_catheter_model
  101. where DC_ID = #{dcId,jdbcType=INTEGER}
  102. and DCM_IsDel = 0
  103. <if test="dcmModel != null and dcmModel != ''">
  104. and DCM_Model like concat('%',#{dcmModel,jdbcType=VARCHAR} ,'%')
  105. </if>
  106. </select>
  107. <select id="countByNameExcludeId" resultType="java.lang.Integer">
  108. select count(1)
  109. from dic_catheter_model dcm
  110. where dcm.DCM_IsDel = 0
  111. and dcm.DCM_Model = #{dcmModel,jdbcType=VARCHAR}
  112. and DC_ID = #{dcId,jdbcType=INTEGER}
  113. <if test="dcmId != null">
  114. and DCM_ID != #{dcmId,jdbcType=INTEGER}
  115. </if>
  116. </select>
  117. </mapper>