InpComplicationResultMapper.xml 5.2 KB

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