| 1234567891011121314151617181920212223242526272829303132333435 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.xjrsoft.module.room.mapper.RoomMapper">
- <select id="getPage" parameterType="com.xjrsoft.module.room.dto.RoomPageDto" resultType="com.xjrsoft.module.room.vo.RoomPageVo">
- SELECT t1.id,t1.sort_code,t2.name AS bulid_name,t1.floor_number,t1.room_name,t3.name AS check_in_status_cn,t4.name AS gender_cn,t1.bed_count,
- (SELECT GROUP_CONCAT(c2.name) FROM room_student_appoint c1
- LEFT JOIN xjr_user c2 ON c1.student_user_id = c2.id
- WHERE c1.delete_mark = 0 AND c1.room_id = t1.id) AS student_appoint_names,
- (SELECT GROUP_CONCAT(c2.name) FROM room_teacher_appoint c1
- LEFT JOIN xjr_user c2 ON c1.user_id = c2.id
- WHERE c1.delete_mark = 0 AND c1.room_id = t1.id) AS teacher_appoint_names,t1.is_max,t1.remark FROM room t1
- LEFT JOIN base_office_build t2 ON t1.office_build_id = t2.id
- LEFT JOIN xjr_dictionary_detail t3 ON t1.check_in_status = t3.code AND t3.item_id = 1739843696019435521
- LEFT JOIN xjr_dictionary_detail t4 ON t1.gender = t4.code AND t4.item_id = 2023000000000000004
- WHERE t1.delete_mark = 0
- <if test="dto.officeBuildId != null">
- and t1.office_build_id = #{dto.officeBuildId}
- </if>
- <if test="dto.floorNumber != null">
- and t1.floor_number = #{dto.floorNumber}
- </if>
- <if test="dto.checkInStatus != null and dto.checkInStatus != ''">
- and t1.check_in_status = #{dto.checkInStatus}
- </if>
- <if test="dto.gender != null and dto.gender != ''">
- and t1.gender = #{dto.gender}
- </if>
- ORDER BY t1.sort_code
- </select>
- <select id="getMaxSortCode" resultType="java.lang.Integer">
- SELECT IFNULL(MAX(sort_code),1) FROM room WHERE delete_mark = 0
- </select>
- </mapper>
|