lxw
2020-06-29 90d3cd4b0b3a8067778b0d9ce8c7971a0717db0a
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package com.fgkj.services;
 
import java.util.List;
 
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.BaseDAOFactory;
import com.fgkj.dto.ServiceModel;
 
public class Batt_replaceService {
    private BaseDAO dao;
    private ServiceModel model;
    public Batt_replaceService() {
        super();
        dao = BaseDAOFactory.getBaseDAO(BaseDAO.BATT_REPLACE);
        model = new ServiceModel();
    }
    
    //添加机房电池更改记录
    public ServiceModel add(Object obj) {
        boolean bl=dao.add(obj);
        if(bl) {
            model.setCode(1);
            model.setMsg("添加成功!");
        }else {
            model.setCode(0);
            model.setMsg("添加失败!");
        }
        return model;
    }
     //修改机房电池更改记录
    public ServiceModel update(Object obj) {
        boolean bl=dao.update(obj);
        if(bl) {
            model.setCode(1);
            model.setMsg("修改成功!");
        }else {
            model.setCode(0);
            model.setMsg("修改失败!");
        }
        return model;
    }
    //删除机房电池更改记录(多条)
    public ServiceModel del(Object obj) {
        boolean bl=dao.del(obj);
        if(bl) {
            model.setCode(1);
            model.setMsg("删除成功!");
        }else {
            model.setCode(0);
            model.setMsg("删除失败!");
        }
        return model;
    }
    
    //机房电池更换管理查询
    public ServiceModel serchByCondition(Object obj) {
        List list=dao.serchByCondition(obj);
        if(list!=null&&list.size()>0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else {
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
 
 
}