whycxzp
2025-06-10 cd7f83d5b2c9a36ad571e016d743ab61824dbfe5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whyc.dto.BattDTO;
import com.whyc.dto.Response;
import com.whyc.mapper.RtStateMapper;
import com.whyc.pojo.db_real_batt.RtState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
/**
 * packageName com.whyc.service
 *
 * @author lxw
 * @version JDK 8
 * @className RtStateService (此处以class为例)
 * @date 2024/6/15
 * @description
 */
@Service
public class RtStateService {
    @Autowired(required = false)
    private RtStateMapper mapper;
 
    //在用电池模块实时推送组端信息
    public Response getResRtState(int binfId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("binf_id",binfId);
        wrapper.last("limit 1");
        RtState rtState=mapper.selectOne(wrapper);
        if(rtState!=null){
            rtState.setBattStateName(BattDTO.getBattState(rtState.getBattState()));
        }
        return new Response().setII(1,rtState!=null,rtState,"在用电池模块实时推送组端信息");
    }
}