DicAssessmentPropMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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.DicAssessmentPropMapper">
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.DicAssessmentProp">
  5. <id column="DAP_ID" property="dapId" jdbcType="INTEGER" />
  6. <result column="DA_ID" property="daId" jdbcType="INTEGER" />
  7. <result column="DAP_Level_Code" property="dapLevelCode" jdbcType="VARCHAR" />
  8. <result column="DAP_Level_Name" property="dapLevelName" jdbcType="VARCHAR" />
  9. <result column="DAP_Color" property="dapColor" jdbcType="VARCHAR" />
  10. <result column="DAP_Min_Score" property="dapMinScore" jdbcType="DOUBLE" />
  11. <result column="DAP_Max_Score" property="dapMaxScore" jdbcType="DOUBLE" />
  12. <result column="DAP_IsDel" property="dapIsdel" jdbcType="INTEGER" />
  13. <result column="DAP_Operation_Time" property="dapOperationTime" jdbcType="TIMESTAMP" />
  14. <result column="DAP_Operator" property="dapOperator" jdbcType="VARCHAR" />
  15. </resultMap>
  16. <sql id="Base_Column_List" >
  17. DAP_ID, DA_ID, DAP_Level_Code, DAP_Level_Name, DAP_Color, DAP_Min_Score, DAP_Max_Score,
  18. DAP_IsDel, DAP_Operation_Time, DAP_Operator
  19. </sql>
  20. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  21. select
  22. <include refid="Base_Column_List" />
  23. from dic_assessment_prop
  24. where DAP_ID = #{dapId,jdbcType=INTEGER}
  25. </select>
  26. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  27. delete from dic_assessment_prop
  28. where DAP_ID = #{dapId,jdbcType=INTEGER}
  29. </delete>
  30. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicAssessmentProp" >
  31. insert into dic_assessment_prop (DAP_ID, DA_ID, DAP_Level_Code,
  32. DAP_Level_Name, DAP_Color, DAP_Min_Score,
  33. DAP_Max_Score, DAP_IsDel, DAP_Operation_Time,
  34. DAP_Operator)
  35. values (#{dapId,jdbcType=INTEGER}, #{daId,jdbcType=INTEGER}, #{dapLevelCode,jdbcType=VARCHAR},
  36. #{dapLevelName,jdbcType=VARCHAR}, #{dapColor,jdbcType=VARCHAR}, #{dapMinScore,jdbcType=DOUBLE},
  37. #{dapMaxScore,jdbcType=DOUBLE}, #{dapIsdel,jdbcType=INTEGER}, #{dapOperationTime,jdbcType=TIMESTAMP},
  38. #{dapOperator,jdbcType=VARCHAR})
  39. </insert>
  40. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicAssessmentProp" >
  41. insert into dic_assessment_prop
  42. <trim prefix="(" suffix=")" suffixOverrides="," >
  43. <if test="dapId != null" >
  44. DAP_ID,
  45. </if>
  46. <if test="daId != null" >
  47. DA_ID,
  48. </if>
  49. <if test="dapLevelCode != null" >
  50. DAP_Level_Code,
  51. </if>
  52. <if test="dapLevelName != null" >
  53. DAP_Level_Name,
  54. </if>
  55. <if test="dapColor != null" >
  56. DAP_Color,
  57. </if>
  58. <if test="dapMinScore != null" >
  59. DAP_Min_Score,
  60. </if>
  61. <if test="dapMaxScore != null" >
  62. DAP_Max_Score,
  63. </if>
  64. <if test="dapIsdel != null" >
  65. DAP_IsDel,
  66. </if>
  67. <if test="dapOperationTime != null" >
  68. DAP_Operation_Time,
  69. </if>
  70. <if test="dapOperator != null" >
  71. DAP_Operator,
  72. </if>
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides="," >
  75. <if test="dapId != null" >
  76. #{dapId,jdbcType=INTEGER},
  77. </if>
  78. <if test="daId != null" >
  79. #{daId,jdbcType=INTEGER},
  80. </if>
  81. <if test="dapLevelCode != null" >
  82. #{dapLevelCode,jdbcType=VARCHAR},
  83. </if>
  84. <if test="dapLevelName != null" >
  85. #{dapLevelName,jdbcType=VARCHAR},
  86. </if>
  87. <if test="dapColor != null" >
  88. #{dapColor,jdbcType=VARCHAR},
  89. </if>
  90. <if test="dapMinScore != null" >
  91. #{dapMinScore,jdbcType=DOUBLE},
  92. </if>
  93. <if test="dapMaxScore != null" >
  94. #{dapMaxScore,jdbcType=DOUBLE},
  95. </if>
  96. <if test="dapIsdel != null" >
  97. #{dapIsdel,jdbcType=INTEGER},
  98. </if>
  99. <if test="dapOperationTime != null" >
  100. #{dapOperationTime,jdbcType=TIMESTAMP},
  101. </if>
  102. <if test="dapOperator != null" >
  103. #{dapOperator,jdbcType=VARCHAR},
  104. </if>
  105. </trim>
  106. </insert>
  107. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicAssessmentProp" >
  108. update dic_assessment_prop
  109. <set >
  110. <if test="daId != null" >
  111. DA_ID = #{daId,jdbcType=INTEGER},
  112. </if>
  113. <if test="dapLevelCode != null" >
  114. DAP_Level_Code = #{dapLevelCode,jdbcType=VARCHAR},
  115. </if>
  116. <if test="dapLevelName != null" >
  117. DAP_Level_Name = #{dapLevelName,jdbcType=VARCHAR},
  118. </if>
  119. <if test="dapColor != null" >
  120. DAP_Color = #{dapColor,jdbcType=VARCHAR},
  121. </if>
  122. <if test="dapMinScore != null" >
  123. DAP_Min_Score = #{dapMinScore,jdbcType=DOUBLE},
  124. </if>
  125. <if test="dapMaxScore != null" >
  126. DAP_Max_Score = #{dapMaxScore,jdbcType=DOUBLE},
  127. </if>
  128. <if test="dapIsdel != null" >
  129. DAP_IsDel = #{dapIsdel,jdbcType=INTEGER},
  130. </if>
  131. <if test="dapOperationTime != null" >
  132. DAP_Operation_Time = #{dapOperationTime,jdbcType=TIMESTAMP},
  133. </if>
  134. <if test="dapOperator != null" >
  135. DAP_Operator = #{dapOperator,jdbcType=VARCHAR},
  136. </if>
  137. </set>
  138. where DAP_ID = #{dapId,jdbcType=INTEGER}
  139. </update>
  140. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicAssessmentProp" >
  141. update dic_assessment_prop
  142. set DA_ID = #{daId,jdbcType=INTEGER},
  143. DAP_Level_Code = #{dapLevelCode,jdbcType=VARCHAR},
  144. DAP_Level_Name = #{dapLevelName,jdbcType=VARCHAR},
  145. DAP_Color = #{dapColor,jdbcType=VARCHAR},
  146. DAP_Min_Score = #{dapMinScore,jdbcType=DOUBLE},
  147. DAP_Max_Score = #{dapMaxScore,jdbcType=DOUBLE},
  148. DAP_IsDel = #{dapIsdel,jdbcType=INTEGER},
  149. DAP_Operation_Time = #{dapOperationTime,jdbcType=TIMESTAMP},
  150. DAP_Operator = #{dapOperator,jdbcType=VARCHAR}
  151. where DAP_ID = #{dapId,jdbcType=INTEGER}
  152. </update>
  153. <update id="batchDeleteDicAssessmentProp">
  154. UPDATE dic_assessment_prop
  155. SET DAP_IsDel = -1,
  156. DAP_Operation_Time = #{date,jdbcType=TIMESTAMP},
  157. DAP_Operator = #{dapOperator,jdbcType=VARCHAR}
  158. WHERE
  159. DAP_ID IN
  160. <foreach collection="idList" separator="," open="(" close=")" item="item">
  161. #{item,jdbcType=INTEGER}
  162. </foreach>
  163. </update>
  164. <select id="getDicAssessmentPropListByDaId" resultMap="BaseResultMap">
  165. SELECT
  166. <include refid="Base_Column_List"/>
  167. FROM
  168. dic_assessment_prop
  169. WHERE
  170. DA_ID = #{daId,jdbcType=INTEGER}
  171. AND
  172. DAP_IsDel = 0
  173. </select>
  174. <select id="getDicAssessmentPropIdListByDaId" resultType="java.lang.Integer">
  175. SELECT
  176. DAP_ID
  177. FROM
  178. dic_assessment_prop
  179. WHERE
  180. DA_ID = #{daId,jdbcType=INTEGER}
  181. AND
  182. DAP_IsDel = 0
  183. </select>
  184. <select id="getDicAssessmentPropByCodes" resultMap="BaseResultMap">
  185. SELECT dap.* FROM dic_assessment da
  186. INNER JOIN dic_assessment_prop dap ON da.DA_ID = dap.DA_ID
  187. WHERE da.DA_Code IN
  188. <foreach collection="daCodes" separator="," open="(" close=")" item="item">
  189. #{item,jdbcType=VARCHAR}
  190. </foreach>
  191. </select>
  192. </mapper>