InpGuidanceResultMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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.InpGuidanceResultMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceResult" >
  5. <id column="IGR_ID" property="igrId" jdbcType="INTEGER" />
  6. <result column="IG_ID" property="igId" jdbcType="INTEGER" />
  7. <result column="IGR_Result_Code" property="igrResultCode" jdbcType="VARCHAR" />
  8. <result column="IGR_Result_Name" property="igrResultName" jdbcType="VARCHAR" />
  9. <result column="IGR_Iscomplete" property="igrIscomplete" jdbcType="INTEGER" />
  10. <result column="IGR_Recordor" property="igrRecordor" jdbcType="VARCHAR" />
  11. <result column="IGR_Record_Time" property="igrRecordTime" jdbcType="TIMESTAMP" />
  12. <result column="IGR_Del_Reason" property="igrDelReason" jdbcType="VARCHAR" />
  13. <result column="IGR_Operation_Time" property="igrOperationTime" jdbcType="TIMESTAMP" />
  14. <result column="IGR_Operator" property="igrOperator" jdbcType="VARCHAR" />
  15. <result column="IGR_IsDel" property="igrIsdel" jdbcType="INTEGER" />
  16. <result column="IGR_Indicator_Name" property="igrIndicatorName" jdbcType="VARCHAR" />
  17. <result column="IGR_Indicator_Code" property="igrIndicatorCode" jdbcType="VARCHAR" />
  18. <result column="IGR_Remark" property="igrRemark" jdbcType="VARCHAR" />
  19. </resultMap>
  20. <sql id="Base_Column_List" >
  21. IGR_ID, IG_ID, IGR_Result_Code, IGR_Result_Name, IGR_Iscomplete, IGR_Recordor, IGR_Record_Time,
  22. IGR_Del_Reason, IGR_Operation_Time, IGR_Operator, IGR_IsDel ,IGR_Indicator_Name, IGR_Indicator_Code, IGR_Remark
  23. </sql>
  24. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  25. select
  26. <include refid="Base_Column_List" />
  27. from inp_guidance_result
  28. where IGR_IsDel = 0 AND IGR_ID = #{igrId,jdbcType=INTEGER}
  29. </select>
  30. <select id="selectAll" resultMap="BaseResultMap">
  31. select
  32. <include refid="Base_Column_List" />
  33. from inp_guidance_result
  34. where IGR_IsDel = 0
  35. order by IGR_Operation_Time desc
  36. </select>
  37. <select id="selectByIgId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  38. select
  39. <include refid="Base_Column_List" />
  40. from inp_guidance_result
  41. where IGR_IsDel = 0 AND IG_ID = #{igId,jdbcType=INTEGER}
  42. order by IGR_Operation_Time desc
  43. </select>
  44. <select id="selectByIgIdsList" resultMap="BaseResultMap">
  45. select
  46. <include refid="Base_Column_List" />
  47. from inp_guidance_result
  48. where IGR_IsDel = 0 AND IG_ID in
  49. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  50. #{item,jdbcType=INTEGER}
  51. </foreach>
  52. order by IGR_Operation_Time desc
  53. </select>
  54. <select id="selectByIgIdComplete" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  55. select
  56. <include refid="Base_Column_List" />
  57. from inp_guidance_result
  58. where IGR_IsDel = 0 AND IGR_Iscomplete = 0
  59. AND IG_ID = #{igId,jdbcType=INTEGER}
  60. </select>
  61. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  62. delete from inp_guidance_result
  63. where IGR_ID = #{igrId,jdbcType=INTEGER}
  64. </delete>
  65. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceResult" >
  66. insert into inp_guidance_result (IGR_ID, IG_ID, IGR_Result_Code,
  67. IGR_Result_Name, IGR_Iscomplete, IGR_Recordor,
  68. IGR_Record_Time, IGR_Del_Reason, IGR_Operation_Time,
  69. IGR_Operator, IGR_IsDel ,IGR_Indicator_Name, IGR_Indicator_Code)
  70. values (#{igrId,jdbcType=INTEGER}, #{igId,jdbcType=INTEGER}, #{igrResultCode,jdbcType=VARCHAR},
  71. #{igrResultName,jdbcType=VARCHAR}, #{igrIscomplete,jdbcType=INTEGER}, #{igrRecordor,jdbcType=VARCHAR},
  72. #{igrRecordTime,jdbcType=TIMESTAMP}, #{igrDelReason,jdbcType=VARCHAR}, #{igrOperationTime,jdbcType=TIMESTAMP},
  73. #{igrOperator,jdbcType=VARCHAR}, #{igrIsdel,jdbcType=INTEGER}, #{igrIndicatorName,jdbcType=VARCHAR}, #{igrIndicatorCode,jdbcType=VARCHAR})
  74. </insert>
  75. <insert id="batchInsert" parameterType="java.util.List" >
  76. insert into inp_guidance_result (IG_ID, IGR_Result_Code,
  77. IGR_Result_Name, IGR_Iscomplete, IGR_Recordor,
  78. IGR_Record_Time, IGR_Operation_Time,
  79. IGR_Operator, IGR_Indicator_Name, IGR_Indicator_Code, IGR_Remark)
  80. values
  81. <foreach collection="list" item="item" separator="," index="index" >
  82. (#{item.igId,jdbcType=INTEGER}, #{item.igrResultCode,jdbcType=VARCHAR},
  83. #{item.igrResultName,jdbcType=VARCHAR}, #{item.igrIscomplete,jdbcType=INTEGER}, #{item.igrRecordor,jdbcType=VARCHAR},
  84. #{item.igrRecordTime,jdbcType=TIMESTAMP}, now(),
  85. #{item.igrOperator,jdbcType=VARCHAR}, #{item.igrIndicatorName,jdbcType=VARCHAR}, #{item.igrIndicatorCode,jdbcType=VARCHAR},#{item.igrRemark,jdbcType=VARCHAR})
  86. </foreach>
  87. </insert>
  88. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceResult" >
  89. insert into inp_guidance_result
  90. <trim prefix="(" suffix=")" suffixOverrides="," >
  91. <if test="igrId != null" >
  92. IGR_ID,
  93. </if>
  94. <if test="igId != null" >
  95. IG_ID,
  96. </if>
  97. <if test="igrResultCode != null" >
  98. IGR_Result_Code,
  99. </if>
  100. <if test="igrResultName != null" >
  101. IGR_Result_Name,
  102. </if>
  103. <if test="igrIscomplete != null" >
  104. IGR_Iscomplete,
  105. </if>
  106. <if test="igrRecordor != null" >
  107. IGR_Recordor,
  108. </if>
  109. <if test="igrRecordTime != null" >
  110. IGR_Record_Time,
  111. </if>
  112. <if test="igrDelReason != null" >
  113. IGR_Del_Reason,
  114. </if>
  115. <if test="igrOperationTime != null" >
  116. IGR_Operation_Time,
  117. </if>
  118. <if test="igrOperator != null" >
  119. IGR_Operator,
  120. </if>
  121. <if test="igrIsdel != null" >
  122. IGR_IsDel,
  123. </if>
  124. <if test="igrIndicatorName != null" >
  125. IGR_Indicator_Name,
  126. </if>
  127. <if test="igrIndicatorCode != null" >
  128. IGR_Indicator_Code,
  129. </if>
  130. <if test="igrRemark != null" >
  131. IGR_Remark,
  132. </if>
  133. </trim>
  134. <trim prefix="values (" suffix=")" suffixOverrides="," >
  135. <if test="igrId != null" >
  136. #{igrId,jdbcType=INTEGER},
  137. </if>
  138. <if test="igId != null" >
  139. #{igId,jdbcType=INTEGER},
  140. </if>
  141. <if test="igrResultCode != null" >
  142. #{igrResultCode,jdbcType=VARCHAR},
  143. </if>
  144. <if test="igrResultName != null" >
  145. #{igrResultName,jdbcType=VARCHAR},
  146. </if>
  147. <if test="igrIscomplete != null" >
  148. #{igrIscomplete,jdbcType=INTEGER},
  149. </if>
  150. <if test="igrRecordor != null" >
  151. #{igrRecordor,jdbcType=VARCHAR},
  152. </if>
  153. <if test="igrRecordTime != null" >
  154. #{igrRecordTime,jdbcType=TIMESTAMP},
  155. </if>
  156. <if test="igrDelReason != null" >
  157. #{igrDelReason,jdbcType=VARCHAR},
  158. </if>
  159. <if test="igrOperationTime != null" >
  160. #{igrOperationTime,jdbcType=TIMESTAMP},
  161. </if>
  162. <if test="igrOperator != null" >
  163. #{igrOperator,jdbcType=VARCHAR},
  164. </if>
  165. <if test="igrIsdel != null" >
  166. #{igrIsdel,jdbcType=INTEGER},
  167. </if>
  168. <if test="igrIndicatorName != null" >
  169. #{igrIndicatorName,jdbcType=VARCHAR},
  170. </if>
  171. <if test="igrIndicatorCode != null" >
  172. #{igrIndicatorCode,jdbcType=VARCHAR},
  173. </if>
  174. <if test="igrRemark != null" >
  175. #{igrRemark,jdbcType=VARCHAR},
  176. </if>
  177. </trim>
  178. </insert>
  179. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceResult" >
  180. update inp_guidance_result
  181. <set >
  182. <if test="igId != null" >
  183. IG_ID = #{igId,jdbcType=INTEGER},
  184. </if>
  185. <if test="igrResultCode != null" >
  186. IGR_Result_Code = #{igrResultCode,jdbcType=VARCHAR},
  187. </if>
  188. <if test="igrResultName != null" >
  189. IGR_Result_Name = #{igrResultName,jdbcType=VARCHAR},
  190. </if>
  191. <if test="igrIscomplete != null" >
  192. IGR_Iscomplete = #{igrIscomplete,jdbcType=INTEGER},
  193. </if>
  194. <if test="igrRecordor != null" >
  195. IGR_Recordor = #{igrRecordor,jdbcType=VARCHAR},
  196. </if>
  197. <if test="igrRecordTime != null" >
  198. IGR_Record_Time = #{igrRecordTime,jdbcType=TIMESTAMP},
  199. </if>
  200. <if test="igrDelReason != null" >
  201. IGR_Del_Reason = #{igrDelReason,jdbcType=VARCHAR},
  202. </if>
  203. <if test="igrOperationTime != null" >
  204. IGR_Operation_Time = #{igrOperationTime,jdbcType=TIMESTAMP},
  205. </if>
  206. <if test="igrOperator != null" >
  207. IGR_Operator = #{igrOperator,jdbcType=VARCHAR},
  208. </if>
  209. <if test="igrIsdel != null" >
  210. IGR_IsDel = #{igrIsdel,jdbcType=INTEGER},
  211. </if>
  212. <if test="igrIndicatorName != null" >
  213. IGR_Indicator_Name = #{igrIndicatorName,jdbcType=VARCHAR},
  214. </if>
  215. <if test="igrIndicatorCode != null" >
  216. IGR_Indicator_Code = #{igrIndicatorCode,jdbcType=VARCHAR},
  217. </if>
  218. <if test="igrRemark != null" >
  219. IGR_Remark = #{igrRemark,jdbcType=VARCHAR},
  220. </if>
  221. </set>
  222. where IGR_ID = #{igrId,jdbcType=INTEGER}
  223. </update>
  224. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpGuidanceResult" >
  225. update inp_guidance_result
  226. set IG_ID = #{igId,jdbcType=INTEGER},
  227. IGR_Result_Code = #{igrResultCode,jdbcType=VARCHAR},
  228. IGR_Result_Name = #{igrResultName,jdbcType=VARCHAR},
  229. IGR_Iscomplete = #{igrIscomplete,jdbcType=INTEGER},
  230. IGR_Recordor = #{igrRecordor,jdbcType=VARCHAR},
  231. IGR_Record_Time = #{igrRecordTime,jdbcType=TIMESTAMP},
  232. IGR_Del_Reason = #{igrDelReason,jdbcType=VARCHAR},
  233. IGR_Operation_Time = #{igrOperationTime,jdbcType=TIMESTAMP},
  234. IGR_Operator = #{igrOperator,jdbcType=VARCHAR},
  235. IGR_IsDel = #{igrIsdel,jdbcType=INTEGER},
  236. IGR_Indicator_Name = #{igrIndicatorName,jdbcType=VARCHAR},
  237. IGR_Indicator_Code = #{igrIndicatorCode,jdbcType=VARCHAR},
  238. IGR_Remark = #{igrRemark,jdbcType=VARCHAR}
  239. where IGR_ID = #{igrId,jdbcType=INTEGER}
  240. </update>
  241. <update id="batchUpdate" parameterType="java.util.List" >
  242. <foreach collection="list" item="item" separator=";" index="index" close="" open="">
  243. update inp_guidance_result
  244. set IG_ID = #{item.igId,jdbcType=INTEGER},
  245. IGR_Result_Code = #{item.igrResultCode,jdbcType=VARCHAR},
  246. IGR_Result_Name = #{item.igrResultName,jdbcType=VARCHAR},
  247. IGR_Iscomplete = #{item.igrIscomplete,jdbcType=INTEGER},
  248. IGR_Recordor = #{item.igrRecordor,jdbcType=VARCHAR},
  249. IGR_Record_Time = #{item.igrRecordTime,jdbcType=TIMESTAMP},
  250. IGR_Operation_Time = now(),
  251. IGR_Operator = #{item.igrOperator,jdbcType=VARCHAR},
  252. IGR_Remark = #{item.igrRemark,jdbcType=VARCHAR}
  253. where IGR_ID = #{item.igrId,jdbcType=INTEGER}
  254. </foreach>
  255. </update>
  256. <update id="batchUpdateReason" parameterType="java.util.List" >
  257. <foreach collection="list" item="item" separator=";" index="index" close="" open="">
  258. update inp_guidance_result
  259. set IGR_Result_Name = #{item.igrResultName,jdbcType=VARCHAR},
  260. IGR_Remark = #{item.igrRemark,jdbcType=VARCHAR},
  261. IGR_Iscomplete = 1
  262. where IGR_ID = #{item.igrId,jdbcType=INTEGER}
  263. </foreach>
  264. </update>
  265. <update id="updateStatus" parameterType="java.lang.Integer" >
  266. update inp_guidance_result
  267. set IGR_IsDel = -1
  268. where IGR_ID = #{igrId,jdbcType=INTEGER}
  269. </update>
  270. <select id="selectByIgIdAndIgrIndicatorCode" resultMap="BaseResultMap">
  271. select
  272. <include refid="Base_Column_List" />
  273. from inp_guidance_result
  274. where IGR_IsDel = 0 AND IG_ID = #{igFormerId,jdbcType=INTEGER} AND IGR_Indicator_Code = #{igrIndicatorCode,jdbcType=VARCHAR}
  275. </select>
  276. </mapper>