コード例 #1
0
  @Override
  public int insert(FunctionInfoBO t) {
    if (t == null) return 0;

    FunctionInfo info = convertToEntityFrom.convertTofuncFunctionInfo(t);
    int result = functionInfoMapper.insert(info);
    return result;
  }
コード例 #2
0
  @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;
  }
コード例 #3
0
  @Override
  public Long saveFunctionInfo(FunctionInfoBO t) {
    if (t == null) return 0L;

    FunctionInfo info = convertToEntityFrom.convertTofuncFunctionInfo(t);
    functionInfoMapper.insert(info);
    return info.getFunctionId();
  }
コード例 #4
0
 @Override
 public FunctionInfoBO findById(Long id) {
   if (id == null) {
     return null;
   }
   FunctionInfo info = functionInfoMapper.findById(id);
   FunctionInfoBO functionInfoBO = convertToEntityFrom.convertToFunctionInfoBO(info);
   return functionInfoBO;
 }
コード例 #5
0
  @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;
  }