InpGuidanceProjectMapper.xml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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.InpGuidanceProjectMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceProject" >
  5. <id column="IGP_ID" property="igpId" jdbcType="INTEGER" />
  6. <result column="IG_ID" property="igId" jdbcType="INTEGER" />
  7. <result column="IGP_Project_Code" property="igpProjectCode" jdbcType="INTEGER" />
  8. <result column="IGP_Project_Name" property="igpProjectName" jdbcType="VARCHAR" />
  9. <result column="IGP_Recordor" property="igpRecordor" jdbcType="VARCHAR" />
  10. <result column="IGP_Record_Time" property="igpRecordTime" jdbcType="TIMESTAMP" />
  11. <result column="IGP_Del_Reason" property="igpDelReason" jdbcType="VARCHAR" />
  12. <result column="IGP_Operation_Time" property="igpOperationTime" jdbcType="TIMESTAMP" />
  13. <result column="IGP_Operator" property="igpOperator" jdbcType="VARCHAR" />
  14. <result column="IGP_Nurse_Record" property="igpNurseRecord" jdbcType="VARCHAR" />
  15. <result column="IGP_IsRecord" property="igpIsrecord" jdbcType="INTEGER" />
  16. <result column="IGP_IsDel" property="igpIsdel" jdbcType="INTEGER" />
  17. </resultMap>
  18. <sql id="Base_Column_List" >
  19. IGP_ID, IG_ID, IGP_Project_Code, IGP_Project_Name, IGP_Recordor, IGP_Record_Time,
  20. IGP_Del_Reason, IGP_Operation_Time, IGP_Operator, IGP_Nurse_Record, IGP_IsRecord,
  21. IGP_IsDel
  22. </sql>
  23. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  24. select
  25. <include refid="Base_Column_List" />
  26. from inp_guidance_project
  27. where IGP_IsDel = 0 AND IGP_ID = #{igpId,jdbcType=INTEGER}
  28. </select>
  29. <select id="selectByIgId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  30. select
  31. <include refid="Base_Column_List" />
  32. from inp_guidance_project
  33. where IGP_IsDel = 0 AND IG_ID = #{igId,jdbcType=INTEGER}
  34. </select>
  35. <select id="selectByIgIdList" resultMap="BaseResultMap">
  36. select
  37. <include refid="Base_Column_List" />
  38. from inp_guidance_project
  39. where IGP_IsDel = 0 AND IG_ID in
  40. <foreach collection="list" item="item" separator="," index="index" open="(" close=")">
  41. #{item,jdbcType=INTEGER}
  42. </foreach>
  43. </select>
  44. <select id="selectAll" resultMap="BaseResultMap">
  45. select
  46. <include refid="Base_Column_List" />
  47. from inp_guidance_project
  48. where IGP_IsDel = 0
  49. </select>
  50. <select id="selectIsComplete" resultMap="BaseResultMap">
  51. select
  52. igp.*
  53. from inp_guidance_project igp
  54. inner join inp_guidance ig on igp.IG_ID = ig.IG_ID
  55. where igp.IGP_IsDel = 0 AND ig.IG_IsDel = 0 AND ig.PatientNo = #{patientNo,jdbcType=VARCHAR}
  56. AND ig.IG_Iscomplete = #{status,jdbcType=INTEGER}
  57. </select>
  58. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  59. delete from inp_guidance_project
  60. where IGP_ID = #{igpId,jdbcType=INTEGER}
  61. </delete>
  62. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceProject" >
  63. insert into inp_guidance_project (IGP_ID, IG_ID, IGP_Project_Code,
  64. IGP_Project_Name, IGP_Recordor, IGP_Record_Time,
  65. IGP_Del_Reason, IGP_Operation_Time, IGP_Operator,
  66. IGP_Nurse_Record, IGP_IsRecord, IGP_IsDel
  67. )
  68. values (#{igpId,jdbcType=INTEGER}, #{igId,jdbcType=INTEGER}, #{igpProjectCode,jdbcType=INTEGER},
  69. #{igpProjectName,jdbcType=VARCHAR}, #{igpRecordor,jdbcType=VARCHAR}, #{igpRecordTime,jdbcType=TIMESTAMP},
  70. #{igpDelReason,jdbcType=VARCHAR}, #{igpOperationTime,jdbcType=TIMESTAMP}, #{igpOperator,jdbcType=VARCHAR},
  71. #{igpNurseRecord,jdbcType=VARCHAR}, #{igpIsrecord,jdbcType=INTEGER}, #{igpIsdel,jdbcType=INTEGER}
  72. )
  73. </insert>
  74. <insert id="batchInsert" parameterType="java.util.List" >
  75. insert into inp_guidance_project (IG_ID, IGP_Project_Code,
  76. IGP_Project_Name, IGP_Recordor, IGP_Record_Time,
  77. IGP_Operation_Time, IGP_Operator,
  78. IGP_Nurse_Record, IGP_IsRecord
  79. )
  80. values
  81. <foreach collection="list" item="item" separator=",">
  82. (#{item.igId,jdbcType=INTEGER}, #{item.igpProjectCode,jdbcType=INTEGER},
  83. #{item.igpProjectName,jdbcType=VARCHAR}, #{item.igpRecordor,jdbcType=VARCHAR}, #{item.igpRecordTime,jdbcType=TIMESTAMP},
  84. now(), #{item.igpOperator,jdbcType=VARCHAR},
  85. #{item.igpNurseRecord,jdbcType=VARCHAR}, 0)
  86. </foreach>
  87. </insert>
  88. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceProject" >
  89. insert into inp_guidance_project
  90. <trim prefix="(" suffix=")" suffixOverrides="," >
  91. <if test="igpId != null" >
  92. IGP_ID,
  93. </if>
  94. <if test="igId != null" >
  95. IG_ID,
  96. </if>
  97. <if test="igpProjectCode != null" >
  98. IGP_Project_Code,
  99. </if>
  100. <if test="igpProjectName != null" >
  101. IGP_Project_Name,
  102. </if>
  103. <if test="igpRecordor != null" >
  104. IGP_Recordor,
  105. </if>
  106. <if test="igpRecordTime != null" >
  107. IGP_Record_Time,
  108. </if>
  109. <if test="igpDelReason != null" >
  110. IGP_Del_Reason,
  111. </if>
  112. <if test="igpOperationTime != null" >
  113. IGP_Operation_Time,
  114. </if>
  115. <if test="igpOperator != null" >
  116. IGP_Operator,
  117. </if>
  118. <if test="igpNurseRecord != null" >
  119. IGP_Nurse_Record,
  120. </if>
  121. <if test="igpIsrecord != null" >
  122. IGP_IsRecord,
  123. </if>
  124. <if test="igpIsdel != null" >
  125. IGP_IsDel,
  126. </if>
  127. </trim>
  128. <trim prefix="values (" suffix=")" suffixOverrides="," >
  129. <if test="igpId != null" >
  130. #{igpId,jdbcType=INTEGER},
  131. </if>
  132. <if test="igId != null" >
  133. #{igId,jdbcType=INTEGER},
  134. </if>
  135. <if test="igpProjectCode != null" >
  136. #{igpProjectCode,jdbcType=INTEGER},
  137. </if>
  138. <if test="igpProjectName != null" >
  139. #{igpProjectName,jdbcType=VARCHAR},
  140. </if>
  141. <if test="igpRecordor != null" >
  142. #{igpRecordor,jdbcType=VARCHAR},
  143. </if>
  144. <if test="igpRecordTime != null" >
  145. #{igpRecordTime,jdbcType=TIMESTAMP},
  146. </if>
  147. <if test="igpDelReason != null" >
  148. #{igpDelReason,jdbcType=VARCHAR},
  149. </if>
  150. <if test="igpOperationTime != null" >
  151. #{igpOperationTime,jdbcType=TIMESTAMP},
  152. </if>
  153. <if test="igpOperator != null" >
  154. #{igpOperator,jdbcType=VARCHAR},
  155. </if>
  156. <if test="igpNurseRecord != null" >
  157. #{igpNurseRecord,jdbcType=VARCHAR},
  158. </if>
  159. <if test="igpIsrecord != null" >
  160. #{igpIsrecord,jdbcType=INTEGER},
  161. </if>
  162. <if test="igpIsdel != null" >
  163. #{igpIsdel,jdbcType=INTEGER},
  164. </if>
  165. </trim>
  166. </insert>
  167. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceProject" >
  168. update inp_guidance_project
  169. <set >
  170. <if test="igId != null" >
  171. IG_ID = #{igId,jdbcType=INTEGER},
  172. </if>
  173. <if test="igpProjectCode != null" >
  174. IGP_Project_Code = #{igpProjectCode,jdbcType=INTEGER},
  175. </if>
  176. <if test="igpProjectName != null" >
  177. IGP_Project_Name = #{igpProjectName,jdbcType=VARCHAR},
  178. </if>
  179. <if test="igpRecordor != null" >
  180. IGP_Recordor = #{igpRecordor,jdbcType=VARCHAR},
  181. </if>
  182. <if test="igpRecordTime != null" >
  183. IGP_Record_Time = #{igpRecordTime,jdbcType=TIMESTAMP},
  184. </if>
  185. <if test="igpDelReason != null" >
  186. IGP_Del_Reason = #{igpDelReason,jdbcType=VARCHAR},
  187. </if>
  188. <if test="igpOperationTime != null" >
  189. IGP_Operation_Time = #{igpOperationTime,jdbcType=TIMESTAMP},
  190. </if>
  191. <if test="igpOperator != null" >
  192. IGP_Operator = #{igpOperator,jdbcType=VARCHAR},
  193. </if>
  194. <if test="igpNurseRecord != null" >
  195. IGP_Nurse_Record = #{igpNurseRecord,jdbcType=VARCHAR},
  196. </if>
  197. <if test="igpIsrecord != null" >
  198. IGP_IsRecord = #{igpIsrecord,jdbcType=INTEGER},
  199. </if>
  200. <if test="igpIsdel != null" >
  201. IGP_IsDel = #{igpIsdel,jdbcType=INTEGER},
  202. </if>
  203. </set>
  204. where IGP_ID = #{igpId,jdbcType=INTEGER}
  205. </update>
  206. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceProject" >
  207. update inp_guidance_project
  208. set IG_ID = #{igId,jdbcType=INTEGER},
  209. IGP_Project_Code = #{igpProjectCode,jdbcType=INTEGER},
  210. IGP_Project_Name = #{igpProjectName,jdbcType=VARCHAR},
  211. IGP_Recordor = #{igpRecordor,jdbcType=VARCHAR},
  212. IGP_Record_Time = #{igpRecordTime,jdbcType=TIMESTAMP},
  213. IGP_Del_Reason = #{igpDelReason,jdbcType=VARCHAR},
  214. IGP_Operation_Time = #{igpOperationTime,jdbcType=TIMESTAMP},
  215. IGP_Operator = #{igpOperator,jdbcType=VARCHAR},
  216. IGP_Nurse_Record = #{igpNurseRecord,jdbcType=VARCHAR},
  217. IGP_IsRecord = #{igpIsrecord,jdbcType=INTEGER},
  218. IGP_IsDel = #{igpIsdel,jdbcType=INTEGER}
  219. where IGP_ID = #{igpId,jdbcType=INTEGER}
  220. </update>
  221. <update id="updateStatus" parameterType="java.lang.Integer" >
  222. update inp_guidance_project
  223. set
  224. IGP_IsDel = -1
  225. where IG_ID = #{igId,jdbcType=INTEGER}
  226. </update>
  227. </mapper>