AssessStoryTargetItemPointMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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.zhyc.xps.lylc.mapper.AssessStoryTargetItemPointMapper">
  4. <resultMap id="StoryItemPointDtoResultMap" type="com.zhyc.xps.lylc.dto.AssessStoryTargetItemPointDto">
  5. <result column="story_id" property="storyId" jdbcType="BIGINT" />
  6. <result column="target_id" property="targetId" jdbcType="BIGINT" />
  7. <result column="target_title" property="targetTitle" jdbcType="VARCHAR" />
  8. <result column="item_id" property="itemId" jdbcType="BIGINT" />
  9. <result column="item_title" property="itemTitle" jdbcType="VARCHAR" />
  10. <result column="point_id" property="pointId" jdbcType="BIGINT" />
  11. <result column="point_content" property="pointContent" jdbcType="VARCHAR" />
  12. <result column="point_code" property="pointCode" jdbcType="VARCHAR" />
  13. <result column="point_score" property="pointScore" jdbcType="DOUBLE" />
  14. <result column="score_criterion" property="scoreCriterion" jdbcType="VARCHAR" />
  15. <result column="point_desc" property="pointDesc" jdbcType="VARCHAR" />
  16. <result column="sort_no" property="sortNo" jdbcType="BIGINT" />
  17. </resultMap>
  18. <sql id="AssessStoryItemPointDto_Cols">
  19. A.story_id,
  20. A.target_id,
  21. B.target_title,
  22. A.item_id,
  23. C.item_title,
  24. A.point_id,
  25. A.point_content,
  26. A.point_code,
  27. A.point_score,
  28. A.score_criterion,
  29. A.point_desc,
  30. A.sort_no
  31. </sql>
  32. <!--基于ID查询-->
  33. <select id="getById" resultMap="StoryItemPointDtoResultMap">
  34. SELECT
  35. <include refid="AssessStoryItemPointDto_Cols"/>
  36. FROM assess_story_target_item_point AS A
  37. LEFT JOIN assess_story_target AS B ON (A.story_id = B.story_id AND A.target_id = B.target_id)
  38. LEFT JOIN assess_story_target_item AS C ON (A.story_id = C.story_id AND A.target_id = C.target_id AND A.item_id = C.item_id)
  39. WHERE A.deleted_flag = 0
  40. <if test="storyId != null">
  41. AND A.story_id = #{storyId ,jdbcType=BIGINT}
  42. </if>
  43. <if test="itemId != null">
  44. AND A.item_id = #{itemId ,jdbcType=BIGINT}
  45. </if>
  46. <if test="pointId != null">
  47. AND A.point_id = #{pointId,jdbcType=BIGINT}
  48. </if>
  49. </select>
  50. <!--分页查询-->
  51. <select id="getByPage" parameterType="java.util.Map" resultMap="StoryItemPointDtoResultMap">
  52. SELECT
  53. <include refid="AssessStoryItemPointDto_Cols"/>
  54. FROM assess_story_target_item_point AS A
  55. LEFT JOIN assess_story_target AS B ON (A.story_id = B.story_id AND A.target_id = B.target_id)
  56. LEFT JOIN assess_story_target_item AS C ON (A.story_id = C.story_id AND A.target_id = C.target_id AND A.item_id = C.item_id)
  57. WHERE A.deleted_flag = 0
  58. <if test="storyId != null">
  59. AND A.story_id = #{storyId ,jdbcType=BIGINT}
  60. </if>
  61. <if test="itemId != null">
  62. AND A.item_id = #{itemId ,jdbcType=BIGINT}
  63. </if>
  64. <if test="pointId != null">
  65. AND A.point_id = #{pointId,jdbcType=BIGINT}
  66. </if>
  67. <if test="keywords != null and keywords != ''">
  68. AND A.point_content like "%"#{keywords}"%"
  69. </if>
  70. ORDER BY A.story_id ASC, A.target_id ASC, A.item_id ASC, A.sort_no
  71. </select>
  72. <!--列表查询-->
  73. <select id="getByList" parameterType="java.util.Map" resultMap="StoryItemPointDtoResultMap" >
  74. SELECT
  75. <include refid="AssessStoryItemPointDto_Cols"/>
  76. FROM assess_story_target_item_point AS A
  77. LEFT JOIN assess_story_target AS B ON (A.story_id = B.story_id AND A.target_id = B.target_id)
  78. LEFT JOIN assess_story_target_item AS C ON (A.story_id = C.story_id AND A.target_id = C.target_id AND A.item_id = C.item_id)
  79. WHERE A.deleted_flag = 0
  80. <if test="storyId != null">
  81. AND A.story_id = #{storyId ,jdbcType=BIGINT}
  82. </if>
  83. <if test="itemId != null">
  84. AND A.item_id = #{itemId ,jdbcType=BIGINT}
  85. </if>
  86. <if test="pointId != null">
  87. AND A.point_id = #{pointId,jdbcType=BIGINT}
  88. </if>
  89. <if test="keywords != null and keywords != ''">
  90. AND A.point_content like "%"#{keywords}"%"
  91. </if>
  92. ORDER BY A.story_id ASC, A.target_id ASC, A.item_id ASC, A.sort_no
  93. </select>
  94. <insert id="create" parameterType="com.zhyc.xps.lylc.entity.AssessStoryTargetItemPoint">
  95. INSERT INTO assess_story_target_item_point
  96. <trim prefix="(" suffix=")" suffixOverrides=",">
  97. <if test="storyId != null">
  98. story_id,
  99. </if>
  100. <if test="targetId != null">
  101. target_id,
  102. </if>
  103. <if test="itemId != null">
  104. item_id,
  105. </if>
  106. <if test="pointId != null">
  107. point_id,
  108. </if>
  109. <if test="pointContent != null and pointContent != ''">
  110. point_content,
  111. </if>
  112. <if test="pointCode != null and pointCode != ''">
  113. point_code,
  114. </if>
  115. <if test="scoreCriterion != null and scoreCriterion != ''">
  116. score_criterion,
  117. </if>
  118. <if test="pointScore != null">
  119. point_score,
  120. </if>
  121. <if test="pointDesc != null and pointDesc != ''">
  122. point_desc,
  123. </if>
  124. <if test="sortNo != null">
  125. sort_no,
  126. </if>
  127. <if test="createdBy != null">
  128. created_by,
  129. </if>
  130. <if test="createdAt != null">
  131. created_at,
  132. </if>
  133. </trim>
  134. <trim prefix="values (" suffix=")" suffixOverrides=",">
  135. <if test="storyId != null">
  136. #{storyId ,jdbcType=BIGINT},
  137. </if>
  138. <if test="targetId != null">
  139. #{targetId ,jdbcType=BIGINT},
  140. </if>
  141. <if test="itemId != null">
  142. #{itemId ,jdbcType=BIGINT},
  143. </if>
  144. <if test="pointId != null">
  145. #{pointId ,jdbcType=BIGINT},
  146. </if>
  147. <if test="pointContent != null and pointContent != ''">
  148. #{pointContent ,jdbcType=VARCHAR},
  149. </if>
  150. <if test="pointCode != null and pointCode != ''">
  151. #{pointCode ,jdbcType=VARCHAR},
  152. </if>
  153. <if test="scoreCriterion != null and scoreCriterion != ''">
  154. #{scoreCriterion ,jdbcType=VARCHAR},
  155. </if>
  156. <if test="pointScore != null">
  157. #{pointScore ,jdbcType=DOUBLE},
  158. </if>
  159. <if test="pointDesc != null and pointDesc != ''">
  160. #{pointDesc ,jdbcType=VARCHAR},
  161. </if>
  162. <if test="sortNo != null">
  163. #{sortNo ,jdbcType=BIGINT},
  164. </if>
  165. <if test="createdBy != null">
  166. #{createdBy ,jdbcType=BIGINT},
  167. </if>
  168. <if test="createdAt != null">
  169. #{createdAt ,jdbcType=TIMESTAMP},
  170. </if>
  171. </trim>
  172. </insert>
  173. <!--更新-->
  174. <update id="update" parameterType="com.zhyc.xps.lylc.entity.AssessStoryTargetItemPoint">
  175. UPDATE assess_story_target_item_point
  176. <trim suffixOverrides=",">
  177. <set>
  178. <if test="pointContent != null and pointContent != ''">
  179. point_content = #{pointContent, jdbcType=VARCHAR},
  180. </if>
  181. <if test="pointCode != null and pointCode != ''">
  182. point_code = #{pointCode ,jdbcType=VARCHAR},
  183. </if>
  184. <if test="scoreCriterion != null and scoreCriterion != ''">
  185. score_criterion = #{scoreCriterion ,jdbcType=VARCHAR},
  186. </if>
  187. <if test="pointScore != null">
  188. point_score = #{pointScore ,jdbcType=DOUBLE},
  189. </if>
  190. <if test="pointDesc != null">
  191. point_desc = #{pointDesc, jdbcType=VARCHAR},
  192. </if>
  193. <if test="sortNo != null">
  194. sort_no = #{sortNo ,jdbcType=BIGINT},
  195. </if>
  196. <if test="updatedBy != null ">
  197. updated_by = #{updatedBy ,jdbcType=BIGINT},
  198. </if>
  199. <if test="updatedAt != null">
  200. updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
  201. </if>
  202. </set>
  203. </trim>
  204. WHERE story_id = #{storyId ,jdbcType=BIGINT}
  205. AND target_id = #{targetId ,jdbcType=BIGINT}
  206. AND item_id = #{itemId ,jdbcType=BIGINT}
  207. AND point_id = #{pointId ,jdbcType=BIGINT}
  208. </update>
  209. <!--删除-->
  210. <update id="delete" parameterType="java.util.Map">
  211. UPDATE assess_story_target_item_point
  212. <trim suffixOverrides=",">
  213. <set>
  214. <if test="deletedFlag != null">
  215. deleted_flag = #{deletedFlag,jdbcType=BIGINT},
  216. </if>
  217. <if test="deletedTime != null">
  218. deleted_time = #{deletedTime,jdbcType=TIMESTAMP},
  219. </if>
  220. <if test="deletedBy != null">
  221. deleted_by = #{deletedBy,jdbcType=BIGINT},
  222. </if>
  223. </set>
  224. </trim>
  225. WHERE story_id = #{storyId ,jdbcType=BIGINT}
  226. <if test="targetId != null">
  227. AND target_id = #{targetId ,jdbcType=BIGINT}
  228. </if>
  229. <if test="itemId != null">
  230. AND item_id = #{itemId ,jdbcType=BIGINT}
  231. </if>
  232. <if test="pointId != null">
  233. AND point_id = #{pointId ,jdbcType=BIGINT}
  234. </if>
  235. </update>
  236. </mapper>