InpPatientAuthorizeMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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.pubservice.mysqlmapper.InpPatientAuthorizeMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.pubservice.mysqlModel.InpPatientAuthorize" >
  5. <id column="IPA_ID" property="ipaId" jdbcType="INTEGER" />
  6. <result column="PatientNo" property="patientno" jdbcType="VARCHAR" />
  7. <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
  8. <result column="IPA_Recordor" property="ipaRecordor" jdbcType="VARCHAR" />
  9. <result column="IPA_Record_Time" property="ipaRecordTime" jdbcType="TIMESTAMP" />
  10. <result column="IPA_Type" property="ipaType" jdbcType="INTEGER" />
  11. <result column="IPA_Status" property="ipaStatus" jdbcType="INTEGER" />
  12. <result column="IPA_Remark" property="ipaRemark" jdbcType="VARCHAR" />
  13. <result column="IPA_EndTime" property="ipaEndtime" jdbcType="TIMESTAMP" />
  14. <result column="IPA_StarTime" property="ipaStartime" jdbcType="TIMESTAMP" />
  15. <result column="IPA_From_WardDm" property="ipaFromWarddm" jdbcType="VARCHAR" />
  16. <result column="IPA_To_WardDm" property="ipaToWarddm" jdbcType="VARCHAR" />
  17. <result column="IPA_To_User" property="ipaToUser" jdbcType="VARCHAR" />
  18. <result column="IPA_Operation_Time" property="ipaOperationTime" jdbcType="TIMESTAMP" />
  19. <result column="IPA_Operator" property="ipaOperator" jdbcType="VARCHAR" />
  20. <result column="IPA_IsDel" property="ipaIsdel" jdbcType="INTEGER" />
  21. <result column="IPA_Function" property="ipaFunction" jdbcType="VARCHAR" />
  22. </resultMap>
  23. <sql id="Base_Column_List" >
  24. IPA_ID, PatientNo, HI_ID, IPA_Recordor, IPA_Record_Time, IPA_Type, IPA_Status, IPA_Remark,
  25. IPA_EndTime, IPA_StarTime, IPA_From_WardDm, IPA_To_WardDm, IPA_To_User, IPA_Operation_Time,
  26. IPA_Operator, IPA_IsDel, IPA_Function
  27. </sql>
  28. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  29. select
  30. <include refid="Base_Column_List" />
  31. from inp_patien_authorize
  32. where IPA_IsDel =0 and IPA_ID = #{ipaId,jdbcType=INTEGER}
  33. </select>
  34. <select id="selectTimeAll" resultMap="BaseResultMap" parameterType="com.xinxin.topro.pubservice.request.InpSignatureRequest">
  35. select
  36. <include refid="Base_Column_List" />
  37. from inp_patien_authorize
  38. where IPA_IsDel = 0
  39. <if test="beginTime != null" >
  40. and IPA_StarTime <![CDATA[>=]]> #{beginTime}
  41. </if>
  42. <if test="endTime != null" >
  43. and IPA_StarTime <![CDATA[<=]]>#{endTime}
  44. </if>
  45. order by IPA_StarTime desc
  46. </select>
  47. <select id="selectPatient" resultMap="BaseResultMap">
  48. select
  49. <include refid="Base_Column_List" />
  50. from inp_patien_authorize
  51. where IPA_IsDel = 0
  52. and PatientNo = #{patientNo,jdbcType=VARCHAR}
  53. and HI_ID = #{hiId,jdbcType=INTEGER}
  54. order by IPA_StarTime desc
  55. </select>
  56. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  57. delete from inp_patien_authorize
  58. where IPA_ID = #{ipaId,jdbcType=INTEGER}
  59. </delete>
  60. <insert id="insert" parameterType="com.xinxin.topro.pubservice.mysqlModel.InpPatientAuthorize" >
  61. insert into inp_patien_authorize (IPA_ID, PatientNo, HI_ID,
  62. IPA_Recordor, IPA_Record_Time, IPA_Type,
  63. IPA_Status, IPA_Remark, IPA_EndTime,
  64. IPA_StarTime, IPA_From_WardDm, IPA_To_WardDm,
  65. IPA_To_User, IPA_Operation_Time, IPA_Operator,
  66. IPA_IsDel, IPA_Function)
  67. values (#{ipaId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
  68. #{ipaRecordor,jdbcType=VARCHAR}, #{ipaRecordTime,jdbcType=TIMESTAMP}, #{ipaType,jdbcType=INTEGER},
  69. #{ipaStatus,jdbcType=INTEGER}, #{ipaRemark,jdbcType=VARCHAR}, #{ipaEndtime,jdbcType=TIMESTAMP},
  70. #{ipaStartime,jdbcType=TIMESTAMP}, #{ipaFromWarddm,jdbcType=VARCHAR}, #{ipaToWarddm,jdbcType=VARCHAR},
  71. #{ipaToUser,jdbcType=VARCHAR}, #{ipaOperationTime,jdbcType=TIMESTAMP}, #{ipaOperator,jdbcType=VARCHAR},
  72. #{ipaIsdel,jdbcType=INTEGER}, #{ipaFunction,jdbcType=VARCHAR})
  73. </insert>
  74. <insert id="insertSelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.InpPatientAuthorize" >
  75. insert into inp_patien_authorize
  76. <trim prefix="(" suffix=")" suffixOverrides="," >
  77. <if test="ipaId != null" >
  78. IPA_ID,
  79. </if>
  80. <if test="patientno != null" >
  81. PatientNo,
  82. </if>
  83. <if test="hiId != null" >
  84. HI_ID,
  85. </if>
  86. <if test="ipaRecordor != null" >
  87. IPA_Recordor,
  88. </if>
  89. <if test="ipaRecordTime != null" >
  90. IPA_Record_Time,
  91. </if>
  92. <if test="ipaType != null" >
  93. IPA_Type,
  94. </if>
  95. <if test="ipaStatus != null" >
  96. IPA_Status,
  97. </if>
  98. <if test="ipaRemark != null" >
  99. IPA_Remark,
  100. </if>
  101. <if test="ipaEndtime != null" >
  102. IPA_EndTime,
  103. </if>
  104. <if test="ipaStartime != null" >
  105. IPA_StarTime,
  106. </if>
  107. <if test="ipaFromWarddm != null" >
  108. IPA_From_WardDm,
  109. </if>
  110. <if test="ipaToWarddm != null" >
  111. IPA_To_WardDm,
  112. </if>
  113. <if test="ipaToUser != null" >
  114. IPA_To_User,
  115. </if>
  116. <if test="ipaOperationTime != null" >
  117. IPA_Operation_Time,
  118. </if>
  119. <if test="ipaOperator != null" >
  120. IPA_Operator,
  121. </if>
  122. <if test="ipaIsdel != null" >
  123. IPA_IsDel,
  124. </if>
  125. <if test="ipaFunction != null" >
  126. IPA_Function,
  127. </if>
  128. </trim>
  129. <trim prefix="values (" suffix=")" suffixOverrides="," >
  130. <if test="ipaId != null" >
  131. #{ipaId,jdbcType=INTEGER},
  132. </if>
  133. <if test="patientno != null" >
  134. #{patientno,jdbcType=VARCHAR},
  135. </if>
  136. <if test="hiId != null" >
  137. #{hiId,jdbcType=INTEGER},
  138. </if>
  139. <if test="ipaRecordor != null" >
  140. #{ipaRecordor,jdbcType=VARCHAR},
  141. </if>
  142. <if test="ipaRecordTime != null" >
  143. #{ipaRecordTime,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="ipaType != null" >
  146. #{ipaType,jdbcType=INTEGER},
  147. </if>
  148. <if test="ipaStatus != null" >
  149. #{ipaStatus,jdbcType=INTEGER},
  150. </if>
  151. <if test="ipaRemark != null" >
  152. #{ipaRemark,jdbcType=VARCHAR},
  153. </if>
  154. <if test="ipaEndtime != null" >
  155. #{ipaEndtime,jdbcType=TIMESTAMP},
  156. </if>
  157. <if test="ipaStartime != null" >
  158. #{ipaStartime,jdbcType=TIMESTAMP},
  159. </if>
  160. <if test="ipaFromWarddm != null" >
  161. #{ipaFromWarddm,jdbcType=VARCHAR},
  162. </if>
  163. <if test="ipaToWarddm != null" >
  164. #{ipaToWarddm,jdbcType=VARCHAR},
  165. </if>
  166. <if test="ipaToUser != null" >
  167. #{ipaToUser,jdbcType=VARCHAR},
  168. </if>
  169. <if test="ipaOperationTime != null" >
  170. #{ipaOperationTime,jdbcType=TIMESTAMP},
  171. </if>
  172. <if test="ipaOperator != null" >
  173. #{ipaOperator,jdbcType=VARCHAR},
  174. </if>
  175. <if test="ipaIsdel != null" >
  176. #{ipaIsdel,jdbcType=INTEGER},
  177. </if>
  178. <if test="ipaFunction != null" >
  179. #{ipaFunction,jdbcType=VARCHAR},
  180. </if>
  181. </trim>
  182. </insert>
  183. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.InpPatientAuthorize" >
  184. update inp_patien_authorize
  185. <set >
  186. <if test="patientno != null" >
  187. PatientNo = #{patientno,jdbcType=VARCHAR},
  188. </if>
  189. <if test="hiId != null" >
  190. HI_ID = #{hiId,jdbcType=INTEGER},
  191. </if>
  192. <if test="ipaRecordor != null" >
  193. IPA_Recordor = #{ipaRecordor,jdbcType=VARCHAR},
  194. </if>
  195. <if test="ipaRecordTime != null" >
  196. IPA_Record_Time = #{ipaRecordTime,jdbcType=TIMESTAMP},
  197. </if>
  198. <if test="ipaType != null" >
  199. IPA_Type = #{ipaType,jdbcType=INTEGER},
  200. </if>
  201. <if test="ipaStatus != null" >
  202. IPA_Status = #{ipaStatus,jdbcType=INTEGER},
  203. </if>
  204. <if test="ipaRemark != null" >
  205. IPA_Remark = #{ipaRemark,jdbcType=VARCHAR},
  206. </if>
  207. <if test="ipaEndtime != null" >
  208. IPA_EndTime = #{ipaEndtime,jdbcType=TIMESTAMP},
  209. </if>
  210. <if test="ipaStartime != null" >
  211. IPA_StarTime = #{ipaStartime,jdbcType=TIMESTAMP},
  212. </if>
  213. <if test="ipaFromWarddm != null" >
  214. IPA_From_WardDm = #{ipaFromWarddm,jdbcType=VARCHAR},
  215. </if>
  216. <if test="ipaToWarddm != null" >
  217. IPA_To_WardDm = #{ipaToWarddm,jdbcType=VARCHAR},
  218. </if>
  219. <if test="ipaToUser != null" >
  220. IPA_To_User = #{ipaToUser,jdbcType=VARCHAR},
  221. </if>
  222. <if test="ipaOperationTime != null" >
  223. IPA_Operation_Time = #{ipaOperationTime,jdbcType=TIMESTAMP},
  224. </if>
  225. <if test="ipaOperator != null" >
  226. IPA_Operator = #{ipaOperator,jdbcType=VARCHAR},
  227. </if>
  228. <if test="ipaIsdel != null" >
  229. IPA_IsDel = #{ipaIsdel,jdbcType=INTEGER},
  230. </if>
  231. <if test="ipaFunction != null" >
  232. IPA_Function = #{ipaFunction,jdbcType=VARCHAR},
  233. </if>
  234. </set>
  235. where IPA_ID = #{ipaId,jdbcType=INTEGER}
  236. </update>
  237. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.pubservice.mysqlModel.InpPatientAuthorize" >
  238. update inp_patien_authorize
  239. set PatientNo = #{patientno,jdbcType=VARCHAR},
  240. HI_ID = #{hiId,jdbcType=INTEGER},
  241. IPA_Recordor = #{ipaRecordor,jdbcType=VARCHAR},
  242. IPA_Record_Time = #{ipaRecordTime,jdbcType=TIMESTAMP},
  243. IPA_Type = #{ipaType,jdbcType=INTEGER},
  244. IPA_Status = #{ipaStatus,jdbcType=INTEGER},
  245. IPA_Remark = #{ipaRemark,jdbcType=VARCHAR},
  246. IPA_EndTime = #{ipaEndtime,jdbcType=TIMESTAMP},
  247. IPA_StarTime = #{ipaStartime,jdbcType=TIMESTAMP},
  248. IPA_From_WardDm = #{ipaFromWarddm,jdbcType=VARCHAR},
  249. IPA_To_WardDm = #{ipaToWarddm,jdbcType=VARCHAR},
  250. IPA_To_User = #{ipaToUser,jdbcType=VARCHAR},
  251. IPA_Operation_Time = #{ipaOperationTime,jdbcType=TIMESTAMP},
  252. IPA_Operator = #{ipaOperator,jdbcType=VARCHAR},
  253. IPA_IsDel = #{ipaIsdel,jdbcType=INTEGER},
  254. IPA_Function = #{ipaFunction,jdbcType=VARCHAR}
  255. where IPA_ID = #{ipaId,jdbcType=INTEGER}
  256. </update>
  257. <update id="updateIpaStatus" parameterType="com.xinxin.topro.pubservice.mysqlModel.InpPatientAuthorize" >
  258. update inp_patien_authorize
  259. set IPA_Status = 1,
  260. IPA_Operation_Time = #{time,jdbcType=TIMESTAMP},
  261. IPA_Operator = #{uiCode,jdbcType=VARCHAR}
  262. where IPA_ID = #{ipaId,jdbcType=INTEGER}
  263. </update>
  264. <update id="updateIsDel" parameterType="com.xinxin.topro.pubservice.mysqlModel.InpPatientAuthorize" >
  265. update inp_patien_authorize
  266. set IPA_Status = 2,
  267. IPA_Operation_Time = #{time,jdbcType=TIMESTAMP},
  268. IPA_Operator = #{uiCode,jdbcType=VARCHAR}
  269. where IPA_ID = #{ipaId,jdbcType=INTEGER}
  270. </update>
  271. </mapper>