whyclxw
2025-01-09 7ee4f88f4fe3f6b557041e26c95e26d9f55ec20d
区域管理员查看指定区域下的锁的状态修改
3个文件已修改
21 ■■■■ 已修改文件
src/main/java/com/whyc/mapper/LockInfMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/AreaInfService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LockInfMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/LockInfMapper.java
@@ -1,6 +1,7 @@
package com.whyc.mapper;
import com.whyc.pojo.db_area.LockInf;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -11,5 +12,6 @@
    //获取当前最大的锁
    List<LockInf> getAllLockInf(String lockName, Integer lockType, Integer lockState,List<Integer> areaList);
    //查看区域下所有的锁
    List<LockInf> selectAllLockById(@Param("areaList") List<Integer> areaList);
}
src/main/java/com/whyc/service/AreaInfService.java
@@ -309,9 +309,7 @@
        areaList.add(id);
        getAllAreaId(id,areaList);
        //查看区域下所有的锁
        QueryWrapper linfWrapper=new QueryWrapper();
        linfWrapper.in("area_id",areaList);
        linfs=linfMapper.selectList(linfWrapper);
        linfs=linfMapper.selectAllLockById(areaList);
        if(linfs!=null&&linfs.size()>0){
            map.put("sumLinf",linfs.size());
            Map<Integer, List<LockInf>> onlinemap = linfs.stream().collect(Collectors.groupingBy(LockInf::getLockOnline));
src/main/resources/mapper/LockInfMapper.xml
@@ -27,4 +27,17 @@
        </where>
        order by id asc
    </select>
    <select id="selectAllLockById" resultType="com.whyc.pojo.db_area.LockInf">
        select tb_lock_inf.*,tb_area_inf.area_name,tb_area_inf.area_path from db_area.tb_lock_inf,db_area.tb_area_inf
        <where>
            tb_lock_inf.area_id=tb_area_inf.id
            <if test="areaList!=null">
                and area_id in
                <foreach collection="areaList" item="id" open="(" separator="," close=")">
                    #{id}
                </foreach>
            </if>
        </where>
        order by id asc
    </select>
</mapper>