LearnPlanStudyMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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.learn.mapper.LearnPlanStudyMapper">
  6. <resultMap type="LearnPlanStudy" id="LearnPlanStudyResult">
  7. <result property="id" column="id" />
  8. <result property="studentId" column="student_id" />
  9. <result property="planId" column="plan_id" />
  10. <result property="monthSeq" column="month_seq" />
  11. <result property="weekSeq" column="week_seq" />
  12. <result property="reportDate" column="report_date" />
  13. <result property="questionCount" column="question_count" />
  14. <result property="videoCount" column="video_count" />
  15. <result property="videoTime" column="video_time" />
  16. <result property="questionPlan" column="question_plan" />
  17. <result property="videoPlan" column="video_plan" />
  18. <result property="updateTime" column="update_time" />
  19. </resultMap>
  20. <sql id="selectLearnPlanStudyVo">
  21. select id, student_id, plan_id, month_seq, week_seq, report_date, question_count, video_count, video_time, question_plan, video_plan, update_time from learn_plan_study
  22. </sql>
  23. <select id="selectLearnPlanStudyList" parameterType="LearnPlanStudy" resultMap="LearnPlanStudyResult">
  24. <include refid="selectLearnPlanStudyVo"/>
  25. <where>
  26. <if test="studentId != null "> and student_id = #{studentId}</if>
  27. <if test="planId != null "> and plan_id = #{planId}</if>
  28. <if test="monthSeq != null "> and month_seq = #{monthSeq}</if>
  29. <if test="weekSeq != null "> and week_seq = #{weekSeq}</if>
  30. <if test="reportDate != null "> and report_date = #{reportDate}</if>
  31. <if test="questionCount != null "> and question_count = #{questionCount}</if>
  32. <if test="videoCount != null "> and video_count = #{videoCount}</if>
  33. <if test="videoTime != null "> and video_time = #{videoTime}</if>
  34. <if test="questionPlan != null "> and question_plan = #{questionPlan}</if>
  35. <if test="videoPlan != null "> and video_plan = #{videoPlan}</if>
  36. </where>
  37. </select>
  38. <select id="selectLearnPlanStudyById" parameterType="String" resultMap="LearnPlanStudyResult">
  39. <include refid="selectLearnPlanStudyVo"/>
  40. where id = #{id}
  41. </select>
  42. <insert id="insertLearnPlanStudy" parameterType="LearnPlanStudy" useGeneratedKeys="true" keyProperty="id">
  43. insert into learn_plan_study
  44. <trim prefix="(" suffix=")" suffixOverrides=",">
  45. <if test="studentId != null">student_id,</if>
  46. <if test="planId != null">plan_id,</if>
  47. <if test="monthSeq != null">month_seq,</if>
  48. <if test="weekSeq != null">week_seq,</if>
  49. <if test="reportDate != null">report_date,</if>
  50. <if test="questionCount != null">question_count,</if>
  51. <if test="videoCount != null">video_count,</if>
  52. <if test="videoTime != null">video_time,</if>
  53. <if test="questionPlan != null">question_plan,</if>
  54. <if test="videoPlan != null">video_plan,</if>
  55. <if test="updateTime != null">update_time,</if>
  56. </trim>
  57. <trim prefix="values (" suffix=")" suffixOverrides=",">
  58. <if test="studentId != null">#{studentId},</if>
  59. <if test="planId != null">#{planId},</if>
  60. <if test="monthSeq != null">#{monthSeq},</if>
  61. <if test="weekSeq != null">#{weekSeq},</if>
  62. <if test="reportDate != null">#{reportDate},</if>
  63. <if test="questionCount != null">#{questionCount},</if>
  64. <if test="videoCount != null">#{videoCount},</if>
  65. <if test="videoTime != null">#{videoTime},</if>
  66. <if test="questionPlan != null">#{questionPlan},</if>
  67. <if test="videoPlan != null">#{videoPlan},</if>
  68. <if test="updateTime != null">#{updateTime},</if>
  69. </trim>
  70. </insert>
  71. <update id="updateLearnPlanStudy" parameterType="LearnPlanStudy">
  72. update learn_plan_study
  73. <trim prefix="SET" suffixOverrides=",">
  74. <if test="studentId != null">student_id = #{studentId},</if>
  75. <if test="planId != null">plan_id = #{planId},</if>
  76. <if test="monthSeq != null">month_seq = #{monthSeq},</if>
  77. <if test="weekSeq != null">week_seq = #{weekSeq},</if>
  78. <if test="reportDate != null">report_date = #{reportDate},</if>
  79. <if test="questionCount != null">question_count = #{questionCount},</if>
  80. <if test="videoCount != null">video_count = #{videoCount},</if>
  81. <if test="videoTime != null">video_time = #{videoTime},</if>
  82. <if test="questionPlan != null">question_plan = #{questionPlan},</if>
  83. <if test="videoPlan != null">video_plan = #{videoPlan},</if>
  84. <if test="updateTime != null">update_time = #{updateTime},</if>
  85. </trim>
  86. where id = #{id}
  87. </update>
  88. <delete id="deleteLearnPlanStudyById" parameterType="String">
  89. delete from learn_plan_study where id = #{id}
  90. </delete>
  91. <delete id="deleteLearnPlanStudyByIds" parameterType="String">
  92. delete from learn_plan_study where id in
  93. <foreach item="id" collection="array" open="(" separator="," close=")">
  94. #{id}
  95. </foreach>
  96. </delete>
  97. </mapper>