//实体类: public class Result implements Serializable{ private static final long serialVersionUID = 1L; private String status; private String msg; private Object data; public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public Object getData() { return data; } public void setData(Object data) { this.data = data; } @Override public String toString() { return "Result [status=" + status + ", msg=" + msg + ", data=" + data + "]"; }
public class WarehouseNode { private String warehouse_node_id; private String warehouse_node_place; private double warehouse_node_Xcoordinates; private double warehouse_node_Ycoordinates; public String getWarehouse_node_id() { return warehouse_node_id; } //省略get set方法不写上来
//这是DAO里面的 public Result addWarehouseNode(WarehouseNode warehouseNode); //然后在service里面调用方法 public Result addWarehouseNode(WarehouseNode warehouseNode) { Result result=new Result(); List<WarehouseNode> list=warehouseDao.findeWarehouseNodeByPlace(); //判断id是否重复 if(list.get(1).equals(warehouseNode.getWarehouse_node_id())){ result.setStatus("1"); result.setMsg("这个仓库已被占用"); return result; } warehouseDao.addWarehouseNode(warehouseNode); result.setStatus("0"); result.setMsg("添加成功"); return result; } //这是Controller里面的 public Result addByWarehouseNode(WarehouseNode warehouseNode){ Result result= warehouseImpl.addWarehouseNode(warehouseNode); return result; } //运行的时候报这个错 /*Mapper method 'com.ninelue.dao.WarehouseNodeDAO.addWarehouseNode' has an unsupported return type: class com.ninelue.entity.Result*/
//DAO里面改成
public Result addWarehouseNode(WarehouseNode warehouseNode);