whyclxw
2024-08-31 da72e8d6976e8a9159b8f9dadf7e51019d557b60
新获取左侧列表
5个文件已修改
29 ■■■■ 已修改文件
src/main/java/com/whyc/controller/DevInfController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/DevInfMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/DevInfService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/webSocket/DevLineSocket.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/DevInfMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/DevInfController.java
@@ -43,7 +43,7 @@
    @ApiOperation(value = "新获取左侧列表")
    @GetMapping("getLine")
    public Response getLine(){
        return service.getLine(101);
        return service.getDevType(101);
    }
src/main/java/com/whyc/mapper/DevInfMapper.java
@@ -15,4 +15,7 @@
    Integer getMaxDevId(Integer devType);
    //获取左侧泪飙
    List<DevInf> getLine(@Param("uid") Integer uid);
    //获取左侧泪飙
    List<DevInf> getDevType(@Param("uid") Integer uid,@Param("devType") Integer devType);
}
src/main/java/com/whyc/service/DevInfService.java
@@ -117,9 +117,9 @@
        return new Response().setII(1,list!=null,list,"获取左侧列表");
    }
   //获取左侧泪飙
    public Response getLine(int uid) {
    public Response getDevType(int uid) {
        Map<String, Object> allMap = new HashMap<>();
        List<DevInf> a200List=mapper.getLine(uid);
        List<DevInf> a200List=mapper.getDevType(uid,1);
        for (DevInf a200:a200List) {
            QueryWrapper a200wrapper= Wrappers.query();
            a200wrapper.eq("dev_id",a200.getDevId());
@@ -127,7 +127,7 @@
            A200Realstate a200state=a200Mapper.selectOne(a200wrapper);
            a200.setA200sTate(a200state);
        }
        List<DevInf> actmList=mapper.getLine(uid);
        List<DevInf> actmList=mapper.getDevType(uid,2);
        for (DevInf actm:actmList) {
            QueryWrapper actmwrapper= Wrappers.query();
            actmwrapper.eq("dev_id",actm.getDevId());
src/main/java/com/whyc/webSocket/DevLineSocket.java
@@ -44,7 +44,7 @@
            public void run() {
                try {
                    while (!currentThread().isInterrupted()) {
                        Response res = dinfService.getLine(userId);
                        Response res = dinfService.getDevType(userId);
                        session.getBasicRemote().sendObject(res);
                        sleep(4000);
                    }
src/main/resources/mapper/DevInfMapper.xml
@@ -43,6 +43,22 @@
            </if>
        </where>
        )
        </where>
    </select>
    <select id="getDevType" resultType="com.whyc.pojo.db_lithium_ram_db.DevInf">
        select * from db_lithium_ram_db.tb_dev_inf
        <where>
            dev_type=#{devType}
            and dev_id in (
            SELECT distinct dev_id from db_user.tb_battgroup_baojigroup,db_user.tb_battgroup_usr
            <where>
                tb_battgroup_baojigroup.baoji_group_id=tb_battgroup_usr.baoji_group_id
                <if test="uid!=null">
                    and uid=#{uid}
                </if>
            </where>
            )
        </where>
    </select>