RoomStudentAppointMapper.xml 1.2 KB

1234567891011121314151617181920212223242526272829
  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.room.mapper.RoomStudentAppointMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.room.dto.RoomStudentAppointPageDto" resultType="com.xjrsoft.module.room.vo.HeadTeaRoomCadreAppointPageVo">
  7. select
  8. t.id as roomId,
  9. t4.name as genderCn,
  10. t.room_name as roomName,
  11. t.is_max as isMax
  12. from room t
  13. left join room_bed t1 on t1.room_id = t.id
  14. left join base_student_school_roll t2 on t2.user_id = t1.student_user_id
  15. left join base_class t3 on t3.id = t2.class_id
  16. left join xjr_dictionary_detail t4 on t4.code = t.gender
  17. where t.delete_mark = 0
  18. and t1.delete_mark = 0
  19. and t2.delete_mark = 0
  20. and t3.teacher_id = #{dto.teacherId}
  21. <if test="dto.gender != null and dto.gender != ''">
  22. and t.gender = #{dto.gender}
  23. </if>
  24. <if test="dto.roomId != null and dto.roomId > 0">
  25. and t.id = #{dto.roomId}
  26. </if>
  27. group by t.id,t4.name
  28. </select>
  29. </mapper>