whyclxw
2024-02-28 3149e65af02e3a090662b0321c1759b4337e1fa7
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
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.whyc.dto.Response;
import com.whyc.mapper.NjHomeStationMapper;
import com.whyc.pojo.NjHomeStation;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
 
@Service
public class NjHomeStationService {
    @Resource
    private NjHomeStationMapper mapper;
    //获取首页机房配置信息
    public NjHomeStation getStation() {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.last("limit 1");
        wrapper.orderByAsc("num");
        NjHomeStation njHomeStation=mapper.selectOne(wrapper);
        return njHomeStation;
    }
    //获取首页机房配置信息
    public Response getStationConfig() {
        NjHomeStation njHomeStation=getStation();
        return new Response().setII(1,njHomeStation!=null,njHomeStation,"获取首页机房配置信息");
    }
   //编辑首页机房配置信息
    public Response updateStationConfig(NjHomeStation njHomeConfig) {
        mapper.update(njHomeConfig, null);
        return new Response().set(1,true);
    }
}