whyclxw
2022-01-18 70795424b3fe4bfb175e74c5fa99d0d255b6772b
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
package com.whyc.service;
 
import com.whyc.dto.Response;
import com.whyc.mapper.DisplayConfigMapper;
import com.whyc.pojo.DisplayConfig;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
 
@Service
public class DisplayConfigService {
    @Resource
    private DisplayConfigMapper mapper;
 
    //新增或者更新电源图形显示
    public Response addOrUpdate(DisplayConfig config) {
        boolean bl=false;
        if(config.getId()==null){
            bl=mapper.addDisplay(config);
        }else{
            bl=mapper.updateDisplay(config);
        }
        return new Response().set(1,bl,bl==true?"新增或者更新电源图形显示成功!":"新增或者更新电源图形显示失败!");
    }
}