lxw
2020-06-27 8aee9dfec05e1a9333abf03f1bd35dd7cfa9d352
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package com.fgkj.services;
 
import java.util.ArrayList;
import java.util.List;
 
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.BaseDAOFactory;
import com.fgkj.dao.DAOHelper;
import com.fgkj.dao.impl.User_battgroup_baojigroupImpl;
import com.fgkj.dao.impl.User_battgroup_baojigroup_battgroupImpl;
import com.fgkj.dao.impl.User_battgroup_baojigroup_usrImpl;
import com.fgkj.db.DBUtil;
import com.fgkj.db.IDatabaseName;
import com.fgkj.dto.User_battgroup_baojigroup;
import com.fgkj.dto.User_inf;
 
public class User_battgroup_baojigroupService {
    private ServiceModel model;
    private BaseDAO dao;
 
    public User_battgroup_baojigroupService() {
        model = new ServiceModel();
        dao = BaseDAOFactory.getBaseDAO(BaseDAO.USER_BATTGROUP_BAOJIGROUP);
    }
 
    // 5.3添加新包机组
    public ServiceModel add(Object obj) {
        Boolean bl = dao.add(obj);
        if (bl) {
            model.setCode(1);
            model.setMsg("添加包机组成功!");
        } else {
            model.setMsg("添加包机组失败!");
        }
        return model;
 
    }
    // 5.3删除包机组
    public ServiceModel del(Object obj) {
        Boolean bl = dao.del(obj);
        if (bl) {
            model.setCode(1);
            model.setMsg("删除包机组成功!");
        } else {
            model.setMsg("删除包机组失败!");
        }
        return model;
 
    }
    // 5.3修改包机组名
    public ServiceModel update(Object obj) {
        Boolean bl = dao.update(obj);
        if (bl) {
            model.setCode(1);
            model.setMsg("修改成功!");
        } else {
            model.setMsg("修改失败!");
        }
        return model;
    }
 
 
 
 
    //根据包机组id查询包机组下的对应设备
    public ServiceModel serchByInfo(Object obj) {
        List list = dao.serchByInfo(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
 
    // 5.3根据包机组id查包机组对应的用户
    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;
    }
 
    // 5.3查所有包机组
    public ServiceModel searchAll() {
        List list = dao.searchAll();
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
 
    public static void main(String[] args) {
        
    }
}