whyclj
2019-10-29 1c0469e45346d464e0c5672ee68f9ecd4fb6be7c
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
package com.fgkj.services;
 
import java.util.List;
 
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.BaseDAOFactory;
import com.fgkj.dao.impl.User_task_batt_checkImpl;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_task_batt_check;
import com.fgkj.dto.User_task_batt_template;
 
public class User_task_batt_checkService {
 
    private ServiceModel model;
    private BaseDAO dao;
    
    public User_task_batt_checkService() {
        model=new ServiceModel();
        dao=BaseDAOFactory.getBaseDAO(BaseDAO.USER_TASK_BATT_CHECK);
    }
    public ServiceModel add(Object obj) {
        Boolean bl=dao.add(obj);
        if(bl){
            model.setCode(1);
            model.setMsg("添加成功!");
        }
        else{
            model.setMsg("添加失败!");
        }
        return model;
        
    }
    //4.1提交,复查作业
    public ServiceModel update(Object obj) {
        Boolean bl=dao.update(obj);
        if(bl){
            model.setCode(1);
            model.setMsg("修改成功!");
        }
        else{
            model.setMsg("修改失败!");
        }
        return model;    
    }
    
    public ServiceModel delete(Object obj) {
        Boolean bl=dao.del(obj);
        if(bl){
            model.setCode(1);
            model.setMsg("删除成功!");
        }
        else{
            model.setMsg("删除失败!");
        }
        return model;    
    }
     public ServiceModel serchByCondition(Object obj){
        List list=dao.serchByCondition(obj);
//        for (Object object : list) {
//            System.out.println(object);
//        }
        
        if(list!=null && list.size()>0){
            model.setCode(1);
            model.setData(list);
        }
        //System.out.println(model);        
        return model;
    } 
    public ServiceModel searchAll(){
        List list=dao.searchAll();
//        for (Object object : list) {
//            System.out.println(object);
//        }
        //System.out.println(list);
        if(list!=null && list.size()>0){
            model.setCode(1);
            model.setData(list);
        }        
        return model;
    } 
    public static void main(String[] args) {
        User_task_batt_checkService us = new User_task_batt_checkService();
        User_task_batt_check u=new User_task_batt_check();
        u.setNum(10131);
        us.serchByCondition(u);
        //us.searchAll();
        
    }
}