lxw
2020-07-11 9db52f2f2dd3665fe9da1ae5657e0167c3a34d40
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
package com.fgkj.services;
 
import java.text.ParseException;
import java.util.List;
 
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.BaseDAOFactory;
import com.fgkj.dao.DAOHelper;
import com.fgkj.db.DBUtil;
import com.fgkj.dto.Fbsdev_Statechange_inf;
import com.fgkj.dto.Page;
import com.fgkj.dto.ServiceModel;
 
public class Fbsdev_Statechange_infService {
    private BaseDAO dao;
    private ServiceModel model;
    
    public Fbsdev_Statechange_infService() {
        this.model = new ServiceModel();
        this.dao = BaseDAOFactory.getBaseDAO(BaseDAO.FBSDEV_STATECHANGE_INF);
    }
    //根据设备id,时间等条件筛选设备
    public ServiceModel serchByCondition(Object obj){
        List list=dao.serchByCondition(obj);
        
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setMsg("查询成功!");
            model.setData(list);
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
       
    public static void main(String[] args) throws ParseException {
        Fbsdev_Statechange_infService fservice=new Fbsdev_Statechange_infService();
        Fbsdev_Statechange_inf state_inf=new Fbsdev_Statechange_inf();
        state_inf.setDev_id(910000011);
        state_inf.setRec_time(DAOHelper.sdf.parse("2018-01-01 00:00:00"));
        state_inf.setRec_time1(DAOHelper.sdf.parse("2018-12-31 00:00:00"));
        Page p=new Page();
        p.setPageCurr(1);
        p.setPageSize(10);
        state_inf.setPage(p);
        ServiceModel model=fservice.serchByCondition(state_inf);
    }
}