Example #1
0
  public List<Rights> findDailyByCondition(Rights rights, Integer firstResult, Integer maxResults) {
    String strHql = "SELECT d FROM Rights d WHERE 1=1";
    // 员工工号
    if (null != rights.getRightsName() && !"".equals(rights.getRightsName())) {
      strHql += " AND d.rightsName LIKE('%" + rights.getRightsName() + "%')";
    }

    strHql += " ORDER BY d.rightsId";

    System.out.println(strHql);
    return dataBaseDaoHelper.getResultListByHql(strHql, firstResult, maxResults);
  }
Example #2
0
  @Override
  public Long countDailyByCondition(Rights rights) {
    String strHql = "SELECT COUNT(d) FROM Rights d WHERE 1=1";

    // 员工工号
    if (null != rights.getRightsName() && !"".equals((rights.getRightsName()))) {
      strHql += " AND d.rightsName LIKE('%" + rights.getRightsName() + "%')";
    }

    strHql += " ORDER BY d.rightsId";

    System.out.println(strHql);
    return (Long) dataBaseDaoHelper.getSingleResultByHql(strHql);
  }