|
|
@@ -84,19 +84,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
left join lab_subject s on l.sub_id = s.id
|
|
|
left join lab_subject_access_record sar ON sar.subject_id = s.id
|
|
|
and sar.access_status = 1 AND sar.init_flag = 0
|
|
|
+ <where>
|
|
|
+ <if test="id != null "> and t.id = #{id}</if>
|
|
|
+ <if test="parentId != null "> and t.id = #{parentId}</if>
|
|
|
+ <if test="type != null "> and t.`type` = #{type}</if>
|
|
|
+ </where>
|
|
|
</if>
|
|
|
<if test="type == 3 ">
|
|
|
left join lab_build_floor_layout l on t.id = l.floor_id
|
|
|
left join lab_subject s on l.sub_id = s.id
|
|
|
left join lab_subject_access_record sar ON sar.subject_id = s.id
|
|
|
and sar.access_status = 1 AND sar.init_flag = 0
|
|
|
+ <where>
|
|
|
+ (s.admin_id = #{adminId} or find_in_set(#{adminId}, s.safe_user_id))
|
|
|
+ <if test="id != null "> and t.id = #{id}</if>
|
|
|
+ <if test="parentId != null "> and t.id = #{parentId}</if>
|
|
|
+ <if test="type != null "> and t.`type` = #{type}</if>
|
|
|
+ </where>
|
|
|
</if>
|
|
|
- <where>
|
|
|
- (s.admin_id = #{adminId} or find_in_set(#{adminId}, s.safe_user_id))
|
|
|
- <if test="id != null "> and t.id = #{id}</if>
|
|
|
- <if test="parentId != null "> and t.parent_id = #{parentId}</if>
|
|
|
- <if test="type != null "> and t.`type` = #{type}</if>
|
|
|
- </where>
|
|
|
+
|
|
|
GROUP BY t.id
|
|
|
</select>
|
|
|
|