@Override public int insert(FunctionInfoBO t) { if (t == null) return 0; FunctionInfo info = convertToEntityFrom.convertTofuncFunctionInfo(t); int result = functionInfoMapper.insert(info); return result; }
@Override public int update(FunctionInfoBO t) { if (t == null || t.getFunctionId() == null || "".equals(t.getFunctionId())) return 0; FunctionInfo info = convertToEntityFrom.convertTofuncFunctionInfo(t); int result = functionInfoMapper.update(info); return result; }
@Override public Long saveFunctionInfo(FunctionInfoBO t) { if (t == null) return 0L; FunctionInfo info = convertToEntityFrom.convertTofuncFunctionInfo(t); functionInfoMapper.insert(info); return info.getFunctionId(); }
@Override public FunctionInfoBO findById(Long id) { if (id == null) { return null; } FunctionInfo info = functionInfoMapper.findById(id); FunctionInfoBO functionInfoBO = convertToEntityFrom.convertToFunctionInfoBO(info); return functionInfoBO; }
@Override public EUDGPagination getFunctionPage(Map<String, Object> params, int pageNo, int pageSize) { pageNo = pageNo < 1 ? 1 : pageNo; pageSize = pageSize < 1 ? 10 : pageSize; int count = functionInfoMapper.findCountByCriteria(params); RowBounds rowBounds = new RowBounds((pageNo - 1) * pageSize, pageSize); List<FunctionInfo> list = functionInfoMapper.findPageListByCriteria(params, rowBounds); List<FunctionInfoBO> boList = new ArrayList<FunctionInfoBO>(); for (FunctionInfo info : list) { FunctionInfoBO bo = convertToEntityFrom.convertToFunctionInfoBO(info); boList.add(bo); } EUDGPagination page = new EUDGPagination(count, boList); return page; }