WebAiCourseProgressMapper.xml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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="cn.iocoder.byzs.module.web.dal.mysql.aiCourseProgress.WebAiCourseProgressMapper">
  4. <select id="selectProgres" parameterType="cn.iocoder.byzs.module.web.controller.admin.aiCourseProgress.vo.WebAiCourseProgressDO"
  5. resultType="cn.iocoder.byzs.module.web.controller.admin.aiCourseProgress.vo.WebAiCourseProgressDTO">
  6. SELECT
  7. u.nickname as userName,
  8. CONCAT(LPAD(fl.ct_type_sort, 2, '0'), ' ', fl.ct_type) as kcflName,
  9. c.course_name as courseName,
  10. rp.arp_progress as progress,
  11. rp.arp_type as progressType
  12. FROM ai_report_progress rpt_id =fl.id
  13. LEFT JOIN ai_course c ON rp.arp_course_i
  14. LEFT JOIN ai_course_type fl ON rp.arp_cd = c.id
  15. LEFT JOIN system_users u ON rp.arp_user_id = u.id
  16. <where>
  17. <if test="brpUserId != null">
  18. and rp.arp_user_id = #{brpUserId}
  19. </if>
  20. <if test="brpZtId != null">
  21. AND rp.arp_zt_id = #{brpZtId}
  22. </if>
  23. </where>
  24. </select>
  25. <select id="getAiCourseProgressByTypeId"
  26. parameterType="cn.iocoder.byzs.module.web.controller.admin.aiCourseProgress.vo.WebAiCourseProgressDO"
  27. resultType="cn.iocoder.byzs.module.web.controller.admin.aiCourseProgress.vo.WebAiCourseProgressDO">
  28. SELECT
  29. arp_course_id AS arpCourseId,
  30. COALESCE(arp_progress / 100, 0) AS arpProgress
  31. FROM ai_report_progress
  32. WHERE
  33. arp_ct_id = #{arpCtId}
  34. AND arp_user_id = #{arpUserId}
  35. AND arp_course_config_id IS NULL
  36. </select>
  37. <select id="getAiCourseProgressByThemeId"
  38. parameterType="cn.iocoder.byzs.module.web.controller.admin.aiCourseProgress.vo.WebAiCourseProgressDO"
  39. resultType="cn.iocoder.byzs.module.web.controller.admin.aiCourseProgress.vo.WebAiCourseProgressDO">
  40. SELECT
  41. arp_ct_id AS arpCtId,
  42. COALESCE(SUM(arp_progress) / 100, 0) AS arpProgress
  43. FROM ai_report_progress
  44. WHERE
  45. arp_zt_id = #{arpZtId}
  46. AND arp_user_id = #{arpUserId}
  47. AND arp_course_config_id IS NULL
  48. GROUP BY arp_ct_id
  49. </select>
  50. </mapper>