TeacherAwardItemMapper.xml 1.4 KB

123456789101112131415161718192021222324252627
  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.teacher.mapper.TeacherAwardItemMapper">
  6. <select id="getStatisticsPage" parameterType="com.xjrsoft.module.teacher.dto.TeacherAwardStatisticsPageDto" resultType="com.xjrsoft.module.teacher.vo.TeacherAwardStatisticsPageVo">
  7. SELECT t1.id, t1.user_name, t1.name,t1.code,t3.name AS gender_cn,t1.mobile,
  8. (SELECT SUM(a2.score) FROM teacher_award a1
  9. INNER JOIN teacher_award_item a2 ON a1.teacher_award_item_id = a2.id
  10. WHERE a1.status = 1 AND a1.delete_mark = 0 AND a2.delete_mark = 0
  11. AND a1.applicant_user_id = t1.id
  12. ) AS score FROM xjr_user t1
  13. INNER JOIN base_teacher t2 ON t1.id = t2.user_id
  14. left join xjr_user_dept_relation t4 on t4.user_id = t1.id
  15. LEFT JOIN xjr_dictionary_detail t3 ON t1.gender = t3.code
  16. WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
  17. <if test="dto.userName != null and dto.userName != '' ">
  18. and t1.user_name like concat('%', #{dto.userName}, '%')
  19. </if>
  20. <if test="dto.name != null and dto.name != '' ">
  21. and t1.name like concat('%', #{dto.name}, '%')
  22. </if>
  23. <if test="dto.deptId != null">
  24. and t4.dept_id = #{dto.deptId}
  25. </if>
  26. </select>
  27. </mapper>