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);
|
}
|
}
|