whycxzp
2025-03-26 7caa838a2252ffedbc7437de963f2495819fcb1a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.whyc.dto.Response;
import com.whyc.mapper.DfxtBmsStateMapper;
import com.whyc.pojo.DfxtBmsState;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
 
@Service
public class DfxtBmsStateService {
 
    @Resource
    private DfxtBmsStateMapper mapper;
 
    public Response<DfxtBmsState> getByDevId(Integer devId) {
        QueryWrapper<DfxtBmsState> query = Wrappers.query();
        query.eq("dev_id",devId);
        query.last(" limit 1");
        DfxtBmsState state = mapper.selectOne(query);
        return new Response<DfxtBmsState>().set(1,state);
    }
}