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.DynamicLoadStateMapper; import com.whyc.pojo.DynamicLoadStateRt; import org.springframework.stereotype.Service; import javax.annotation.Resource; @Service public class DynamicLoadStateService { @Resource private DynamicLoadStateMapper mapper; public Response get(Integer deviceId){ QueryWrapper wrapper = Wrappers.query(); wrapper.eq("dev_id",deviceId).last("limit 1"); DynamicLoadStateRt dynamicLoadStateRt = mapper.selectOne(wrapper); return new Response().set(1,dynamicLoadStateRt); } }