TStFeedbackMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.project.training.spec.mapper.TStFeedbackMapper">
  6. <resultMap type="TStFeedback" id="TStFeedbackResult">
  7. <result property="id" column="id" />
  8. <result property="feedbackType" column="feedback_type" />
  9. <result property="mentorId" column="mentor_id" />
  10. <result property="mentorName" column="mentor_name" />
  11. <result property="successorId" column="successor_id" />
  12. <result property="successorName" column="successorName" />
  13. <result property="parentId" column="parent_id" />
  14. <result property="planId" column="plan_id" />
  15. <result property="feedbackYear" column="feedback_year" />
  16. <result property="feedbackSeason" column="feedback_season" />
  17. <result property="feedbackMonth" column="feedback_month" />
  18. <result property="successorFeedback" column="successor_feedback" />
  19. <result property="mentorFeedback" column="mentor_feedback" />
  20. <result property="feedbackScore" column="feedback_score" />
  21. <result property="overallScore" column="overall_score" />
  22. <result property="feedbackStatus" column="feedback_status" />
  23. <result property="meetingDate" column="meeting_date" />
  24. <result property="deptName" column="dept_name" />
  25. </resultMap>
  26. <sql id="selectTStFeedbackVo">
  27. select
  28. d.id,
  29. d.feedback_type,
  30. d.mentor_id,
  31. (select nick_name from sys_user t where t.staffid = d.mentor_id) as mentor_name,
  32. d.successor_id,
  33. u.nick_name as successor_name,
  34. d.parent_id,
  35. d.plan_id,
  36. d.feedback_year,
  37. d.feedback_season,
  38. d.feedback_month,
  39. d.successor_feedback,
  40. d.mentor_feedback,
  41. d.feedback_score,
  42. d.overall_score,
  43. d.feedback_status,
  44. d.meeting_date
  45. from
  46. t_st_feedback d
  47. left join sys_user u on d.successor_id = u.staffid
  48. </sql>
  49. <select id="selectInvitedSuccessorList" parameterType="TStFeedback" resultMap="TStFeedbackResult">
  50. <include refid="selectTStFeedbackVo"/>
  51. <where>
  52. <if test="mentorId != null and mentorId != ''"> and mentor_id = #{mentorId}</if>
  53. and parent_id is not null
  54. </where>
  55. </select>
  56. <select id="selectTStFeedbackList" parameterType="TStFeedback" resultMap="TStFeedbackResult">
  57. <include refid="selectTStFeedbackVo"/>
  58. <where>
  59. <if test="feedbackType != null "> and feedback_type = #{feedbackType}</if>
  60. <if test="mentorId != null and mentorId != ''"> and mentor_id = #{mentorId}</if>
  61. <if test="successorId != null and successorId != ''"> and successor_id = #{successorId}</if>
  62. <if test="parentId != null "> and parent_id = #{parentId}</if>
  63. <if test="planId != null "> and plan_id = #{planId}</if>
  64. <if test="feedbackYear != null and feedbackYear != ''"> and feedback_year = #{feedbackYear}</if>
  65. <if test="feedbackSeason != null and feedbackSeason != ''"> and feedback_season = #{feedbackSeason}</if>
  66. <if test="feedbackMonth != null and feedbackMonth != ''"> and feedback_month = #{feedbackMonth}</if>
  67. <if test="successorFeedback != null and successorFeedback != ''"> and successor_feedback = #{successorFeedback}</if>
  68. <if test="mentorFeedback != null and mentorFeedback != ''"> and mentor_feedback = #{mentorFeedback}</if>
  69. <if test="feedbackScore != null and feedbackScore != ''"> and feedback_score = #{feedbackScore}</if>
  70. <if test="feedbackStatus != null "> and feedback_status = #{feedbackStatus}</if>
  71. <if test="meetingDate != null "> and meeting_date = #{meetingDate}</if>
  72. </where>
  73. order by d.successor_id asc, d.feedback_year desc, d.feedback_season,
  74. to_number(replace(d.feedback_month,',','')) asc
  75. </select>
  76. <select id="selectTStFeedbackByParams" parameterType="TStFeedback" resultMap="TStFeedbackResult">
  77. <include refid="selectTStFeedbackVo"/>
  78. <where>
  79. <if test="feedbackType != null "> and feedback_type = #{feedbackType}</if>
  80. <if test="mentorId != null and mentorId != ''"> and mentor_id = #{mentorId}</if>
  81. <if test="successorId != null and successorId != ''"> and successor_id = #{successorId}</if>
  82. <if test="parentId != null "> and parent_id = #{parentId}</if>
  83. <if test="planId != null "> and plan_id = #{planId}</if>
  84. <if test="feedbackYear != null and feedbackYear != ''"> and feedback_year = #{feedbackYear}</if>
  85. <if test="feedbackSeason != null and feedbackSeason != ''"> and feedback_season = #{feedbackSeason}</if>
  86. <if test="feedbackMonth != null and feedbackMonth != ''"> and feedback_month = #{feedbackMonth}</if>
  87. <if test="successorFeedback != null and successorFeedback != ''"> and successor_feedback = #{successorFeedback}</if>
  88. <if test="mentorFeedback != null and mentorFeedback != ''"> and mentor_feedback = #{mentorFeedback}</if>
  89. <if test="feedbackScore != null and feedbackScore != ''"> and feedback_score = #{feedbackScore}</if>
  90. <if test="feedbackStatus != null "> and feedback_status = #{feedbackStatus}</if>
  91. <if test="meetingDate != null "> and meeting_date = #{meetingDate}</if>
  92. <if test="parentId != null and parentId !=''"> and parent_id = #{parentId} </if>
  93. <if test="parentId == null or parentId == ''"> and parent_id is null </if>
  94. </where>
  95. </select>
  96. <select id="selectTStFeedbackByPlanId" parameterType="Long" resultMap="TStFeedbackResult">
  97. <include refid="selectTStFeedbackVo"/>
  98. where plan_id = #{planId}
  99. </select>
  100. <select id="selectTStFeedbackById" parameterType="Long" resultMap="TStFeedbackResult">
  101. <include refid="selectTStFeedbackVo"/>
  102. where id = #{id}
  103. </select>
  104. <insert id="insertTStFeedback" parameterType="TStFeedback">
  105. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  106. SELECT seq_t_st_feedback.NEXTVAL as id FROM DUAL
  107. </selectKey>
  108. insert into t_st_feedback
  109. <trim prefix="(" suffix=")" suffixOverrides=",">
  110. <if test="id != null">id,</if>
  111. <if test="feedbackType != null">feedback_type,</if>
  112. <if test="mentorId != null">mentor_id,</if>
  113. <if test="successorId != null">successor_id,</if>
  114. <if test="parentId != null">parent_id,</if>
  115. <if test="planId != null">plan_id,</if>
  116. <if test="feedbackYear != null">feedback_year,</if>
  117. <if test="feedbackSeason != null">feedback_season,</if>
  118. <if test="feedbackMonth != null">feedback_month,</if>
  119. <if test="successorFeedback != null">successor_feedback,</if>
  120. <if test="mentorFeedback != null">mentor_feedback,</if>
  121. <if test="feedbackScore != null">feedback_score,</if>
  122. <if test="feedbackStatus != null">feedback_status,</if>
  123. <if test="meetingDate != null">meeting_date,</if>
  124. </trim>
  125. <trim prefix="values (" suffix=")" suffixOverrides=",">
  126. <if test="id != null">#{id},</if>
  127. <if test="feedbackType != null">#{feedbackType},</if>
  128. <if test="mentorId != null">#{mentorId},</if>
  129. <if test="successorId != null">#{successorId},</if>
  130. <if test="parentId != null">#{parentId},</if>
  131. <if test="planId != null">#{planId},</if>
  132. <if test="feedbackYear != null">#{feedbackYear},</if>
  133. <if test="feedbackSeason != null">#{feedbackSeason},</if>
  134. <if test="feedbackMonth != null">#{feedbackMonth},</if>
  135. <if test="successorFeedback != null">#{successorFeedback},</if>
  136. <if test="mentorFeedback != null">#{mentorFeedback},</if>
  137. <if test="feedbackScore != null">#{feedbackScore},</if>
  138. <if test="feedbackStatus != null">#{feedbackStatus},</if>
  139. <if test="meetingDate != null">#{meetingDate},</if>
  140. </trim>
  141. </insert>
  142. <update id="updateTStFeedback" parameterType="TStFeedback">
  143. update t_st_feedback
  144. <trim prefix="SET" suffixOverrides=",">
  145. <if test="feedbackType != null">feedback_type = #{feedbackType},</if>
  146. <if test="mentorId != null">mentor_id = #{mentorId},</if>
  147. <if test="successorId != null">successor_id = #{successorId},</if>
  148. <if test="parentId != null">parent_id = #{parentId},</if>
  149. <if test="planId != null">plan_id = #{planId},</if>
  150. <if test="feedbackYear != null">feedback_year = #{feedbackYear},</if>
  151. <if test="feedbackSeason != null">feedback_season = #{feedbackSeason},</if>
  152. <if test="feedbackMonth != null">feedback_month = #{feedbackMonth},</if>
  153. <if test="successorFeedback != null">successor_feedback = #{successorFeedback},</if>
  154. <if test="mentorFeedback != null">mentor_feedback = #{mentorFeedback},</if>
  155. <if test="feedbackScore != null">feedback_score = #{feedbackScore},</if>
  156. <if test="overallScore != null and overallScore != ''">overall_score = #{overallScore},</if>
  157. <if test="feedbackStatus != null">feedback_status = #{feedbackStatus},</if>
  158. <if test="meetingDate != null">meeting_date = #{meetingDate},</if>
  159. </trim>
  160. where id = #{id}
  161. </update>
  162. <update id="deleteTStFeedbackById" parameterType="Long">
  163. update t_st_feedback set del_flag = 2 where id = #{id}
  164. </update>
  165. <update id="deleteTStFeedbackByIds" parameterType="String">
  166. update t_st_feedback set del_flag = 2 where id in
  167. <foreach item="id" collection="array" open="(" separator="," close=")">
  168. #{id}
  169. </foreach>
  170. </update>
  171. </mapper>