| | |
| | | package com.fgkj.services; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.mapper.BaseDAO; |
| | | import com.fgkj.mapper.BaseDAOFactory; |
| | | import com.fgkj.dto.ServiceModel; |
| | | |
| | | public class Batt_devdischarge_paramService { |
| | | |
| | | private ServiceModel model; |
| | | |
| | | |
| | | private Impl mapper;; |
| | | public Batt_devdischarge_paramService() { |
| | | model = new ServiceModel();; |
| | | dao =BaseDAOFactory.getBaseDAO(BaseDAO.BATT_DEVDISCHARGE_PARAM); |
| | | } |
| | | 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 searchAll(){ |
| | | List list=dao.searchAll(); |
| | | if(list!=null&&list.size()>0){ |
| | | model.setCode(1); |
| | | model.setMsg("查询成功!"); |
| | | model.setData(list); |
| | | }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.setMsg("查询成功!"); |
| | | model.setData(list); |
| | | }else{ |
| | | model.setCode(0); |
| | | model.setMsg("查询失败!"); |
| | | } |
| | | return model; |
| | | } |
| | | } |
| | | // package com.fgkj.services; |
| | | // |
| | | // import java.util.List; |
| | | // |
| | | // import com.fgkj.mapper.BaseDAO; |
| | | // import com.fgkj.mapper.BaseDAOFactory; |
| | | // import com.fgkj.dto.ServiceModel; |
| | | // |
| | | // public class Batt_devdischarge_paramService { |
| | | // |
| | | // ServiceModel model = new ServiceModel(); |
| | | // |
| | | // |
| | | // private Impl mapper;; |
| | | // public Batt_devdischarge_paramService() { |
| | | // model = new ServiceModel();; |
| | | // dao =BaseDAOFactory.getBaseDAO(BaseDAO.BATT_DEVDISCHARGE_PARAM); |
| | | // } |
| | | // 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 searchAll(){ |
| | | // List list=dao.searchAll(); |
| | | // if(list!=null&&list.size()>0){ |
| | | // model.setCode(1); |
| | | // model.setMsg("查询成功!"); |
| | | // model.setData(list); |
| | | // }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.setMsg("查询成功!"); |
| | | // model.setData(list); |
| | | // }else{ |
| | | // model.setCode(0); |
| | | // model.setMsg("查询失败!"); |
| | | // } |
| | | // return model; |
| | | // } |
| | | // } |