InpRecureTreatRecordMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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.InpRecureTreatRecordMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecureTreatRecord" >
  5. <id column="irtr_id" property="irtrId" jdbcType="INTEGER" />
  6. <result column="irt_id" property="irtId" jdbcType="INTEGER" />
  7. <result column="irtr_time" property="irtrTime" jdbcType="TIMESTAMP" />
  8. <result column="irtr_therapist" property="irtrTherapist" jdbcType="VARCHAR" />
  9. <result column="irtr_recordor" property="irtrRecordor" jdbcType="VARCHAR" />
  10. <result column="irtr_record_time" property="irtrRecordTime" jdbcType="TIMESTAMP" />
  11. <result column="irtr_operation_time" property="irtrOperationTime" jdbcType="TIMESTAMP" />
  12. <result column="irtr_operator" property="irtrOperator" jdbcType="VARCHAR" />
  13. <result column="irtr_is_del" property="irtrIsDel" jdbcType="INTEGER" />
  14. </resultMap>
  15. <sql id="Base_Column_List" >
  16. irtr_id, irt_id, irtr_time, irtr_therapist, irtr_recordor, irtr_record_time, irtr_operation_time,
  17. irtr_operator, irtr_is_del
  18. </sql>
  19. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  20. select
  21. <include refid="Base_Column_List" />
  22. from inp_recure_treat_record
  23. where irtr_id = #{irtrId,jdbcType=INTEGER}
  24. and irtr_is_del = 0
  25. </select>
  26. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  27. delete from inp_recure_treat_record
  28. where irtr_id = #{irtrId,jdbcType=INTEGER}
  29. </delete>
  30. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecureTreatRecord" useGeneratedKeys="true" keyColumn="irtr_id" keyProperty="irtrId">
  31. insert into inp_recure_treat_record (irt_id, irtr_time,
  32. irtr_therapist, irtr_recordor, irtr_record_time,
  33. irtr_operation_time, irtr_operator, irtr_is_del
  34. )
  35. values (#{irtId,jdbcType=INTEGER}, #{irtrTime,jdbcType=TIMESTAMP},
  36. #{irtrTherapist,jdbcType=VARCHAR}, #{irtrRecordor,jdbcType=VARCHAR}, #{irtrRecordTime,jdbcType=TIMESTAMP},
  37. #{irtrOperationTime,jdbcType=TIMESTAMP}, #{irtrOperator,jdbcType=VARCHAR}, 0
  38. )
  39. </insert>
  40. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecureTreatRecord" >
  41. update inp_recure_treat_record
  42. <set >
  43. <if test="irtId != null" >
  44. irt_id = #{irtId,jdbcType=INTEGER},
  45. </if>
  46. <if test="irtrTime != null" >
  47. irtr_time = #{irtrTime,jdbcType=TIMESTAMP},
  48. </if>
  49. <if test="irtrTherapist != null" >
  50. irtr_therapist = #{irtrTherapist,jdbcType=VARCHAR},
  51. </if>
  52. <if test="irtrRecordor != null" >
  53. irtr_recordor = #{irtrRecordor,jdbcType=VARCHAR},
  54. </if>
  55. <if test="irtrRecordTime != null" >
  56. irtr_record_time = #{irtrRecordTime,jdbcType=TIMESTAMP},
  57. </if>
  58. <if test="irtrOperationTime != null" >
  59. irtr_operation_time = #{irtrOperationTime,jdbcType=TIMESTAMP},
  60. </if>
  61. <if test="irtrOperator != null" >
  62. irtr_operator = #{irtrOperator,jdbcType=VARCHAR},
  63. </if>
  64. <if test="irtrIsDel != null" >
  65. irtr_is_del = #{irtrIsDel,jdbcType=INTEGER},
  66. </if>
  67. </set>
  68. where irtr_id = #{irtrId,jdbcType=INTEGER}
  69. </update>
  70. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecureTreatRecord" >
  71. update inp_recure_treat_record
  72. set irt_id = #{irtId,jdbcType=INTEGER},
  73. irtr_time = #{irtrTime,jdbcType=TIMESTAMP},
  74. irtr_therapist = #{irtrTherapist,jdbcType=VARCHAR},
  75. irtr_recordor = #{irtrRecordor,jdbcType=VARCHAR},
  76. irtr_record_time = #{irtrRecordTime,jdbcType=TIMESTAMP},
  77. irtr_operation_time = #{irtrOperationTime,jdbcType=TIMESTAMP},
  78. irtr_operator = #{irtrOperator,jdbcType=VARCHAR},
  79. irtr_is_del = #{irtrIsDel,jdbcType=INTEGER}
  80. where irtr_id = #{irtrId,jdbcType=INTEGER}
  81. </update>
  82. <update id="updateIrtId">
  83. update inp_recure_treat_record
  84. set irt_id = #{irtId,jdbcType=INTEGER}
  85. where irt_id = #{oldIrtId,jdbcType=INTEGER}
  86. </update>
  87. <update id="delByIrtId">
  88. update inp_recure_treat_record
  89. set
  90. irtr_operation_time = #{irtrOperationTime,jdbcType=TIMESTAMP},
  91. irtr_operator = #{irtrOperator,jdbcType=VARCHAR},
  92. irtr_is_del = -1
  93. where irt_id = #{irtId,jdbcType=INTEGER}
  94. </update>
  95. <update id="delByIrtrId">
  96. update inp_recure_treat_record
  97. set
  98. irtr_operation_time = #{irtrOperationTime,jdbcType=TIMESTAMP},
  99. irtr_operator = #{irtrOperator,jdbcType=VARCHAR},
  100. irtr_is_del = -1
  101. where irtr_id = #{irtrId,jdbcType=INTEGER}
  102. </update>
  103. <resultMap id="ListResultMap" type="com.xinxin.topro.inpnurseservice.vo.RecureTreatRecordVO" extends="BaseResultMap">
  104. <result column="therapistName" property="therapistName" jdbcType="VARCHAR" />
  105. </resultMap>
  106. <select id="selectByIrtId" resultMap="ListResultMap">
  107. select <include refid="Base_Column_List"/>,
  108. (select su.UI_Name from sys_userinfo su where su.HI_ID = #{hiId,jdbcType=INTEGER} and su.SS_ISDel = 0 and ir.irtr_therapist = su.UI_Code limit 1) therapistName
  109. from inp_recure_treat_record ir
  110. where ir.irt_id = #{irtId,jdbcType=INTEGER}
  111. and ir.irtr_is_del = 0
  112. order by irtr_time, irtr_record_time
  113. </select>
  114. <select id="selectByIrtIds" resultMap="ListResultMap">
  115. select <include refid="Base_Column_List"/>,
  116. (select su.UI_Name from sys_userinfo su where su.HI_ID = #{hiId,jdbcType=INTEGER} and su.SS_ISDel = 0 and ir.irtr_therapist = su.UI_Code limit 1) therapistName
  117. from inp_recure_treat_record ir
  118. where ir.irt_id in
  119. <foreach collection="idList" item="item" open="(" close=")" separator=",">
  120. #{item,jdbcType=INTEGER}
  121. </foreach>
  122. and ir.irtr_is_del = 0
  123. order by irt_id, irtr_time, irtr_record_time
  124. </select>
  125. </mapper>