TStFeedbackMMapper.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.TStFeedbackMMapper">
  6. <resultMap type="TStFeedbackM" id="TStFeedbackMResult">
  7. <result property="id" column="id" />
  8. <result property="monthlyFeedbackId" column="monthly_feedback_id" />
  9. <result property="overallComment" column="overall_comment" />
  10. <result property="deptName" column="dept_name" />
  11. </resultMap>
  12. <sql id="selectTStFeedbackMVo">
  13. select d.id, d.MENTOR_ID, d.overall_comment ,s.dept_name from t_st_feedback_m d
  14. left join sys_dept s on s.dept_id = d.dept_id
  15. </sql>
  16. <select id="selectTStFeedbackMList" parameterType="TStFeedbackM" resultMap="TStFeedbackMResult">
  17. <include refid="selectTStFeedbackMVo"/>
  18. <where>
  19. <if test="monthlyFeedbackId != null "> and monthly_feedback_id = #{monthlyFeedbackId}</if>
  20. <if test="overallComment != null and overallComment != ''"> and overall_comment = #{overallComment}</if>
  21. and d.del_flag = 0
  22. </where>
  23. <!-- 数据范围过滤 -->
  24. ${params.dataScope}
  25. </select>
  26. <select id="selectTStFeedbackMById" parameterType="Long" resultMap="TStFeedbackMResult">
  27. <include refid="selectTStFeedbackMVo"/>
  28. where id = #{id}
  29. </select>
  30. <insert id="insertTStFeedbackM" parameterType="TStFeedbackM">
  31. insert into t_st_feedback_m
  32. <trim prefix="(" suffix=")" suffixOverrides=",">
  33. <if test="id != null">id,</if>
  34. <if test="monthlyFeedbackId != null">monthly_feedback_id,</if>
  35. <if test="overallComment != null">overall_comment,</if>
  36. </trim>
  37. <trim prefix="values (" suffix=")" suffixOverrides=",">
  38. <if test="id != null">#{id},</if>
  39. <if test="monthlyFeedbackId != null">#{monthlyFeedbackId},</if>
  40. <if test="overallComment != null">#{overallComment},</if>
  41. </trim>
  42. </insert>
  43. <update id="updateTStFeedbackM" parameterType="TStFeedbackM">
  44. update t_st_feedback_m
  45. <trim prefix="SET" suffixOverrides=",">
  46. <if test="monthlyFeedbackId != null">monthly_feedback_id = #{monthlyFeedbackId},</if>
  47. <if test="overallComment != null">overall_comment = #{overallComment},</if>
  48. </trim>
  49. where id = #{id}
  50. </update>
  51. <update id="deleteTStFeedbackMById" parameterType="Long">
  52. update t_st_feedback_m set del_flag = 2 where id = #{id}
  53. </update>
  54. <update id="deleteTStFeedbackMByIds" parameterType="String">
  55. update t_st_feedback_m set del_flag = 2 where id in
  56. <foreach item="id" collection="array" open="(" separator="," close=")">
  57. #{id}
  58. </foreach>
  59. </update>
  60. </mapper>