/** 还款情况 */ public static void repaymentSituation(int currPage, long bidId) { if (0 == bidId) render(); ErrorInfo error = new ErrorInfo(); PageBean<v_bill_loan> pageBean = new PageBean<v_bill_loan>(); pageBean.currPage = currPage; pageBean.page = Bill.queryMyLoanBills(pageBean, -1, bidId, error); render(pageBean); }
/** 投标记录 */ public static void bidRecord(int currPage, long bidId) { if (0 == bidId) render(); ErrorInfo error = new ErrorInfo(); PageBean<v_invest_records> pageBean = new PageBean<v_invest_records>(); pageBean.currPage = currPage; pageBean.page = Invest.bidInvestRecord(pageBean, bidId, error); render(pageBean); }
/** 举报记录 */ public static void reportRecord(int currPage, String signUserId) { ErrorInfo error = new ErrorInfo(); long userId = Security.checkSign(signUserId, Constants.USER_ID_SIGN, Constants.VALID_TIME, error); if (userId < 1) renderText(error.msg); PageBean<t_user_report_users> pageBean = new PageBean<t_user_report_users>(); pageBean.currPage = currPage; pageBean.page = User.queryBidRecordByUser(pageBean, userId, error); render(pageBean); }
/** * 获取 参数值 * * @param pageBean 当前模板PageBean * @return String [] 参数值 */ public static String[] getParameter(PageBean pageBean, String userId) { String currPage = params.get("currPage"); // 当前页 String pageSize = params.get("pageSize"); // 分页行数 String condition = params.get("condition"); // 条件 String keyword = params.get("keyword"); // 关键词 String startDate = params.get("startDate"); // 开始时间 String endDate = params.get("endDate"); // 结束时间 String orderIndex = params.get("orderIndex"); // 排序索引 String orderStatus = params.get("orderStatus"); // 升降标示 pageBean.currPage = NumberUtil.isNumericInt(currPage) ? Integer.parseInt(currPage) : 1; pageBean.pageSize = NumberUtil.isNumericInt(pageSize) ? Integer.parseInt(pageSize) : 10; /* ""/null:标示非用户ID查询 */ return new String[] {userId, condition, keyword, startDate, endDate, orderIndex, orderStatus}; }
/** * 查询数据库操作记录 * * @param error * @return */ public static PageBean<v_db_operations> queryOperations( int currPage, int pageSize, ErrorInfo error) { error.clear(); if (currPage < 1) { currPage = 1; } if (pageSize < 1) { pageSize = 10; } StringBuffer sql = new StringBuffer(""); sql.append(SQLTempletes.PAGE_SELECT); sql.append(SQLTempletes.V_DB_OPERATIONS); List<v_db_operations> page = null; int count = 0; try { EntityManager em = JPA.em(); Query query = em.createNativeQuery(sql.toString(), v_db_operations.class); query.setFirstResult((currPage - 1) * pageSize); query.setMaxResults(pageSize); page = query.getResultList(); count = QueryUtil.getQueryCount(em); } catch (Exception e) { Logger.error(e.getMessage()); error.code = -1; error.msg = "数据库异常"; return null; } PageBean<v_db_operations> bean = new PageBean<v_db_operations>(); bean.pageSize = pageSize; bean.currPage = currPage; bean.page = page; bean.totalCount = count; error.code = 0; return bean; }