whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
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
37
38
package com.fgkj.services;
 
import com.fgkj.dto.BadBatt_mon_flag;
import com.fgkj.dto.ServiceModel;
import com.fgkj.mapper.impl.BadBatt_mon_flagMapper;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
@Service
public class BadBatt_mon_flagService {
 
    @Resource
    private BadBatt_mon_flagMapper mapper;;
 
    //往标识表中插入一笔数据
    public ServiceModel add(BadBatt_mon_flag monFlag) {
        ServiceModel model = new ServiceModel();
        Boolean bl= null;
        try {
            bl = mapper.add(monFlag)>0;
        } catch (Exception e) {
            e.printStackTrace();
            model.setCode(0);
            model.setMsg("添加失败!");
            return model;
        }
        if(bl){
            model.setCode(1);
            model.setMsg("添加成功!");
        }
        else{
            model.setCode(0);
            model.setMsg("添加失败!");
        }
        return model;
    }
    
}