| | |
| | | |
| | | public ServiceModel add(Server_state state) { |
| | | ServiceModel model = new ServiceModel(); |
| | | Boolean bl=mapper.add(state)>0; |
| | | Boolean bl= null; |
| | | try { |
| | | bl = mapper.add(state)>0; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | model.setMsg("添加失败!"); |
| | | return model; |
| | | } |
| | | if(bl){ |
| | | model.setCode(1); |
| | | model.setMsg("添加成功!"); |
| | |
| | | } |
| | | return model; |
| | | } |
| | | public ServiceModel serchByCondition(Server_state state){ |
| | | ServiceModel model = new ServiceModel(); |
| | | List list=mapper.serchByCondition(state); |
| | | for (Object object : list) { |
| | | System.out.println(object); |
| | | } |
| | | |
| | | if(list!=null && list.size()>0){ |
| | | |
| | | public ServiceModel serchByCondition(Server_state state) { |
| | | ServiceModel model = new ServiceModel(); |
| | | List list = mapper.serchByCondition(state); |
| | | // for (Object object : list) { |
| | | // System.out.println(object); |
| | | // } |
| | | |
| | | if (list != null && list.size() > 0) { |
| | | model.setCode(1); |
| | | model.setData(list); |
| | | } |
| | | System.out.println(model); |
| | | // System.out.println(model); |
| | | return model; |
| | | } |
| | | public ServiceModel searchAll(){ |