Exemplo n.º 1
0
 public List<NodeBean> getNodeQuery(int initPageNum, int perPageNum) {
   int num = (initPageNum - 1) * perPageNum; // 要被排除的行数
   String sql = "";
   if (ruleValue == null) {
     if (userBean.getLevel() == 0) {
       sql = "SELECT * FROM t_node limit " + num + "," + perPageNum + "";
     } else {
       sql =
           "SELECT * FROM t_node WHERE userId='"
               + userBean.getId()
               + "' limit "
               + num
               + ","
               + perPageNum
               + "";
     }
   } else {
     if (userBean.getLevel() == 0) {
       sql =
           "SELECT * FROM t_node WHERE caseNodeId='"
               + ruleValue
               + "' limit "
               + num
               + ","
               + perPageNum
               + "";
     } else {
       sql =
           "SELECT * FROM t_node WHERE caseNodeId='"
               + ruleValue
               + "' AND userId='"
               + userBean.getId()
               + "' limit "
               + num
               + ","
               + perPageNum
               + "";
     }
   }
   return super.getBatchNode(sql);
 }
Exemplo n.º 2
0
 public int getNodeTotalRow() {
   String sql = "";
   if (ruleValue == null) {
     if (userBean.getLevel() == 0) {
       sql = "SELECT COUNT(*) FROM t_node";
     } else {
       sql = "SELECT COUNT(*) FROM t_node WHERE userId='" + userBean.getId() + "'";
     }
   } else {
     if (userBean.getLevel() == 0) {
       sql = "SELECT COUNT(*) FROM t_node WHERE caseNodeId='" + ruleValue + "'";
     } else {
       sql =
           "SELECT COUNT(*) FROM t_node WHERE caseNodeId='"
               + ruleValue
               + "' AND userId='"
               + userBean.getId()
               + "'";
     }
   }
   return getVersion(sql);
 }