InpIcuSyncPatientMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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.InpIcuSyncPatientMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpIcuSyncPatient" >
  5. <id column="isp_id" property="ispId" jdbcType="INTEGER" />
  6. <result column="PatientNo" property="patientno" jdbcType="VARCHAR" />
  7. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  8. <result column="isp_recorder" property="ispRecorder" jdbcType="VARCHAR" />
  9. <result column="isp_record_time" property="ispRecordTime" jdbcType="TIMESTAMP" />
  10. <result column="isp_operator" property="ispOperator" jdbcType="VARCHAR" />
  11. <result column="isp_operate_time" property="ispOperateTime" jdbcType="TIMESTAMP" />
  12. <result column="isp_is_del" property="ispIsDel" jdbcType="INTEGER" />
  13. </resultMap>
  14. <sql id="Base_Column_List" >
  15. isp_id, PatientNo, HI_ID, isp_recorder, isp_record_time, isp_operator, isp_operate_time,
  16. isp_is_del
  17. </sql>
  18. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  19. select
  20. <include refid="Base_Column_List" />
  21. from inp_icu_sync_patient
  22. where isp_id = #{ispId,jdbcType=INTEGER}
  23. </select>
  24. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  25. delete from inp_icu_sync_patient
  26. where isp_id = #{ispId,jdbcType=INTEGER}
  27. </delete>
  28. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpIcuSyncPatient" >
  29. insert into inp_icu_sync_patient (PatientNo, HI_ID,
  30. isp_recorder, isp_record_time, isp_operator,
  31. isp_operate_time, isp_is_del)
  32. values (#{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  33. #{ispRecorder,jdbcType=VARCHAR}, #{ispRecordTime,jdbcType=TIMESTAMP}, #{ispOperator,jdbcType=VARCHAR},
  34. now(), 0)
  35. </insert>
  36. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpIcuSyncPatient" >
  37. insert into inp_icu_sync_patient
  38. <trim prefix="(" suffix=")" suffixOverrides="," >
  39. <if test="ispId != null" >
  40. isp_id,
  41. </if>
  42. <if test="patientno != null" >
  43. PatientNo,
  44. </if>
  45. <if test="hiId != null" >
  46. HI_ID,
  47. </if>
  48. <if test="ispRecorder != null" >
  49. isp_recorder,
  50. </if>
  51. <if test="ispRecordTime != null" >
  52. isp_record_time,
  53. </if>
  54. <if test="ispOperator != null" >
  55. isp_operator,
  56. </if>
  57. <if test="ispOperateTime != null" >
  58. isp_operate_time,
  59. </if>
  60. <if test="ispIsDel != null" >
  61. isp_is_del,
  62. </if>
  63. </trim>
  64. <trim prefix="values (" suffix=")" suffixOverrides="," >
  65. <if test="ispId != null" >
  66. #{ispId,jdbcType=INTEGER},
  67. </if>
  68. <if test="patientno != null" >
  69. #{patientno,jdbcType=VARCHAR},
  70. </if>
  71. <if test="hiId != null" >
  72. #{hiId,jdbcType=INTEGER},
  73. </if>
  74. <if test="ispRecorder != null" >
  75. #{ispRecorder,jdbcType=VARCHAR},
  76. </if>
  77. <if test="ispRecordTime != null" >
  78. #{ispRecordTime,jdbcType=TIMESTAMP},
  79. </if>
  80. <if test="ispOperator != null" >
  81. #{ispOperator,jdbcType=VARCHAR},
  82. </if>
  83. <if test="ispOperateTime != null" >
  84. #{ispOperateTime,jdbcType=TIMESTAMP},
  85. </if>
  86. <if test="ispIsDel != null" >
  87. #{ispIsDel,jdbcType=INTEGER},
  88. </if>
  89. </trim>
  90. </insert>
  91. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpIcuSyncPatient" >
  92. update inp_icu_sync_patient
  93. <set >
  94. <if test="patientno != null" >
  95. PatientNo = #{patientno,jdbcType=VARCHAR},
  96. </if>
  97. <if test="hiId != null" >
  98. HI_ID = #{hiId,jdbcType=INTEGER},
  99. </if>
  100. <if test="ispRecorder != null" >
  101. isp_recorder = #{ispRecorder,jdbcType=VARCHAR},
  102. </if>
  103. <if test="ispRecordTime != null" >
  104. isp_record_time = #{ispRecordTime,jdbcType=TIMESTAMP},
  105. </if>
  106. <if test="ispOperator != null" >
  107. isp_operator = #{ispOperator,jdbcType=VARCHAR},
  108. </if>
  109. <if test="ispOperateTime != null" >
  110. isp_operate_time = #{ispOperateTime,jdbcType=TIMESTAMP},
  111. </if>
  112. <if test="ispIsDel != null" >
  113. isp_is_del = #{ispIsDel,jdbcType=INTEGER},
  114. </if>
  115. </set>
  116. where isp_id = #{ispId,jdbcType=INTEGER}
  117. </update>
  118. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpIcuSyncPatient" >
  119. update inp_icu_sync_patient
  120. set PatientNo = #{patientno,jdbcType=VARCHAR},
  121. HI_ID = #{hiId,jdbcType=INTEGER},
  122. isp_recorder = #{ispRecorder,jdbcType=VARCHAR},
  123. isp_record_time = #{ispRecordTime,jdbcType=TIMESTAMP},
  124. isp_operator = #{ispOperator,jdbcType=VARCHAR},
  125. isp_operate_time = #{ispOperateTime,jdbcType=TIMESTAMP},
  126. isp_is_del = #{ispIsDel,jdbcType=INTEGER}
  127. where isp_id = #{ispId,jdbcType=INTEGER}
  128. </update>
  129. <select id="selectByPatient" resultMap="BaseResultMap">
  130. select <include refid="Base_Column_List"/>
  131. from inp_icu_sync_patient
  132. where PatientNo = #{patientNo,jdbcType=VARCHAR}
  133. and isp_is_del = 0
  134. and HI_ID = #{hiId,jdbcType=INTEGER}
  135. </select>
  136. <update id="batchDel">
  137. update inp_icu_sync_patient
  138. set isp_is_del = -1,
  139. isp_operator = #{ispOperator,jdbcType=VARCHAR},
  140. isp_operate_time = now()
  141. where
  142. isp_id in
  143. <foreach collection="list" separator="," open="(" close=")" item="item">
  144. #{item,jdbcType=INTEGER}
  145. </foreach>
  146. </update>
  147. </mapper>