InpComplicationMeasureMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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.InpComplicationMeasureMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationMeasure" >
  5. <id column="ICM_ID" property="icmId" jdbcType="INTEGER" />
  6. <result column="ICOM_ID" property="icomId" jdbcType="INTEGER" />
  7. <result column="ICM_Code" property="icmCode" jdbcType="VARCHAR" />
  8. <result column="ICM_Name" property="icmName" jdbcType="VARCHAR" />
  9. <result column="ICM_Recordor" property="icmRecordor" jdbcType="VARCHAR" />
  10. <result column="ICM_Record_Time" property="icmRecordTime" jdbcType="TIMESTAMP" />
  11. <result column="ICM_IsDel" property="icmIsdel" jdbcType="INTEGER" />
  12. </resultMap>
  13. <sql id="Base_Column_List" >
  14. ICM_ID, ICOM_ID, ICM_Code, ICM_Name, ICM_Recordor, ICM_Record_Time, ICM_IsDel
  15. </sql>
  16. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  17. select
  18. <include refid="Base_Column_List" />
  19. from inp_complication_measure
  20. where ICM_ID = #{icmId,jdbcType=INTEGER}
  21. </select>
  22. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationMeasure" >
  23. insert into inp_complication_measure (ICM_ID, ICOM_ID, ICM_Code,
  24. ICM_Name, ICM_Recordor, ICM_Record_Time,
  25. ICM_IsDel)
  26. values (#{icmId,jdbcType=INTEGER}, #{icomId,jdbcType=INTEGER}, #{icmCode,jdbcType=VARCHAR},
  27. #{icmName,jdbcType=VARCHAR}, #{icmRecordor,jdbcType=VARCHAR}, #{icmRecordTime,jdbcType=TIMESTAMP},
  28. #{icmIsdel,jdbcType=INTEGER})
  29. </insert>
  30. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationMeasure" >
  31. insert into inp_complication_measure
  32. <trim prefix="(" suffix=")" suffixOverrides="," >
  33. <if test="icmId != null" >
  34. ICM_ID,
  35. </if>
  36. <if test="icomId != null" >
  37. ICOM_ID,
  38. </if>
  39. <if test="icmCode != null" >
  40. ICM_Code,
  41. </if>
  42. <if test="icmName != null" >
  43. ICM_Name,
  44. </if>
  45. <if test="icmRecordor != null" >
  46. ICM_Recordor,
  47. </if>
  48. <if test="icmRecordTime != null" >
  49. ICM_Record_Time,
  50. </if>
  51. <if test="icmIsdel != null" >
  52. ICM_IsDel,
  53. </if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides="," >
  56. <if test="icmId != null" >
  57. #{icmId,jdbcType=INTEGER},
  58. </if>
  59. <if test="icomId != null" >
  60. #{icomId,jdbcType=INTEGER},
  61. </if>
  62. <if test="icmCode != null" >
  63. #{icmCode,jdbcType=VARCHAR},
  64. </if>
  65. <if test="icmName != null" >
  66. #{icmName,jdbcType=VARCHAR},
  67. </if>
  68. <if test="icmRecordor != null" >
  69. #{icmRecordor,jdbcType=VARCHAR},
  70. </if>
  71. <if test="icmRecordTime != null" >
  72. #{icmRecordTime,jdbcType=TIMESTAMP},
  73. </if>
  74. <if test="icmIsdel != null" >
  75. #{icmIsdel,jdbcType=INTEGER},
  76. </if>
  77. </trim>
  78. </insert>
  79. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationMeasure" >
  80. update inp_complication_measure
  81. <set >
  82. <if test="icomId != null" >
  83. ICOM_ID = #{icomId,jdbcType=INTEGER},
  84. </if>
  85. <if test="icmCode != null" >
  86. ICM_Code = #{icmCode,jdbcType=VARCHAR},
  87. </if>
  88. <if test="icmName != null" >
  89. ICM_Name = #{icmName,jdbcType=VARCHAR},
  90. </if>
  91. <if test="icmRecordor != null" >
  92. ICM_Recordor = #{icmRecordor,jdbcType=VARCHAR},
  93. </if>
  94. <if test="icmRecordTime != null" >
  95. ICM_Record_Time = #{icmRecordTime,jdbcType=TIMESTAMP},
  96. </if>
  97. <if test="icmIsdel != null" >
  98. ICM_IsDel = #{icmIsdel,jdbcType=INTEGER},
  99. </if>
  100. </set>
  101. where ICM_ID = #{icmId,jdbcType=INTEGER}
  102. </update>
  103. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationMeasure" >
  104. update inp_complication_measure
  105. set ICOM_ID = #{icomId,jdbcType=INTEGER},
  106. ICM_Code = #{icmCode,jdbcType=VARCHAR},
  107. ICM_Name = #{icmName,jdbcType=VARCHAR},
  108. ICM_Recordor = #{icmRecordor,jdbcType=VARCHAR},
  109. ICM_Record_Time = #{icmRecordTime,jdbcType=TIMESTAMP},
  110. ICM_IsDel = #{icmIsdel,jdbcType=INTEGER}
  111. where ICM_ID = #{icmId,jdbcType=INTEGER}
  112. </update>
  113. <insert id="batchInsert">
  114. insert into inp_complication_measure (ICOM_ID, ICM_Code,
  115. ICM_Name, ICM_Recordor, ICM_Record_Time,
  116. ICM_IsDel)
  117. values
  118. <foreach collection="list" item="item" separator=",">
  119. (#{item.icomId,jdbcType=INTEGER}, #{item.icmCode,jdbcType=VARCHAR},
  120. #{item.icmName,jdbcType=VARCHAR}, #{item.icmRecordor,jdbcType=VARCHAR}, now(),
  121. 0)
  122. </foreach>
  123. </insert>
  124. <update id="delByIcomId">
  125. update inp_complication_measure
  126. set ICM_IsDel = -1,
  127. ICM_Recordor = #{icmRecordor,jdbcType=VARCHAR},
  128. ICM_Record_Time = now()
  129. where ICOM_ID = #{icomId,jdbcType=INTEGER}
  130. </update>
  131. <select id="selectDicIdByIcomId" resultType="java.lang.String">
  132. select ICM_Code from inp_complication_measure
  133. where ICOM_ID = #{icomId,jdbcType=INTEGER}
  134. and ICM_IsDel = 0
  135. </select>
  136. </mapper>