ClassHonorsMapper.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.xjrsoft.module.student.mapper.ClassHonorsMapper">
  6. <select id="getPagePC" parameterType="com.xjrsoft.module.student.dto.ClassHonorsPageDto" resultType="com.xjrsoft.module.student.vo.ClassHonorsPageVo">
  7. SELECT
  8. t.id,
  9. t.sort_code,
  10. t1.name AS honorsLevelCN,
  11. t2.name AS honorsGradeCN,
  12. t.name,
  13. t.award_date
  14. FROM class_honors t
  15. LEFT JOIN xjr_dictionary_detail t1 ON t1.code = t.honors_level
  16. LEFT JOIN xjr_dictionary_detail t2 ON t2.code = t.honors_grade
  17. WHERE
  18. t.delete_mark = 0
  19. <if test="dto.honorsLevel != null and dto.honorsLevel != ''">
  20. and t.honors_level = #{dto.honorsLevel}
  21. </if>
  22. <if test="dto.honorsGrade != null and dto.honorsGrade != ''">
  23. and t.honors_grade = #{dto.honorsGrade}
  24. </if>
  25. <if test="dto.awardDate != null and dto.awardDate != ''">
  26. and t.award_date = #{dto.awardDate}
  27. </if>
  28. <if test="dto.name != null and dto.name != ''">
  29. and t.name like concat('%',#{dto.name},'%')
  30. </if>
  31. ORDER BY
  32. t.id DESC;
  33. </select>
  34. <select id="getInfoById"
  35. resultType="com.xjrsoft.module.student.vo.ClassHonorsVo">
  36. SELECT
  37. t.*,
  38. t1.name AS honorsLevelCN,
  39. t2.name AS honorsGradeCN,
  40. t3.name AS baseSemesterIdCN,
  41. t4.name AS classIdCN,
  42. FROM class_honors t
  43. LEFT JOIN xjr_dictionary_detail t1 ON t1.code = t.honors_level
  44. LEFT JOIN xjr_dictionary_detail t2 ON t2.code = t.honors_grade
  45. LEFT JOIN base_semester t3 ON t3.id = t.base_semester_id
  46. LEFT JOIN base_class t4 ON t4.id = t.class_id
  47. WHERE
  48. t.id = #{id} AND t.delete_mark = 0;
  49. </select>
  50. </mapper>