Пример #1
0
 @Override
 public List<Rights> getLegalMenu(String id) {
   //	select * from t_rights tt where tt.rights_level = 2 and tt.p_rights_id = 1006000000000
   String hql =
       "from Rights where rightsLevel = 2 and rightsParamter like 'images%' and prightsId =" + id;
   return dataBaseDaoHelper.getResultListByHql(hql);
 }
Пример #2
0
 @Override
 public List<Rights> getlv2IdList(String id) {
   String hql =
       "from Rights ri where ri.rightsParamter like 'images/%' and   ri.prightsId =  " + id;
   //	String hql = "from Rights ri where ri.prightsId =  "+id;
   return dataBaseDaoHelper.getResultListByHql(hql);
 }
Пример #3
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);
  }
Пример #4
0
  @Override
  @Transactional(propagation = Propagation.REQUIRED)
  public void dropId(String id) {
    try {
      if (!"".equals(id) && null != id && !"没有可选择的菜单!".equals(id)) {
        String hql = "from Rights ri where ri.prightsId =  " + id;
        List<Rights> list = dataBaseDaoHelper.getResultListByHql(hql);
        if (list.size() == 0 || null == list) {
          String roleHql = "delete t_Role_Rights where Rights_Id =" + id;
          dataBaseDaoHelper.executeNativeSQL(roleHql);
          String reportHql = "delete t_report_data where Rights_Id =" + id;
          dataBaseDaoHelper.executeNativeSQL(reportHql);
          String rightsHql = "delete t_Rights where Rights_Id =" + id;
          dataBaseDaoHelper.executeNativeSQL(rightsHql);
        } else {
          for (int i = 0; i < list.size(); i++) {
            String temp = list.get(i).getRightsId();
            // 删除二级菜单下的三级菜单
            String roleHql1 = "delete t_Role_Rights where Rights_Id =" + temp;
            dataBaseDaoHelper.executeNativeSQL(roleHql1);
            String reportHql1 = "delete t_report_data where Rights_Id =" + temp;
            dataBaseDaoHelper.executeNativeSQL(reportHql1);
            String rightsHql1 = "delete t_Rights where Rights_Id =" + temp;
            dataBaseDaoHelper.executeNativeSQL(rightsHql1);
            // 删除空的二级菜单
            String idDelete = "delete t_Role_Rights where Rights_Id =" + id;
            dataBaseDaoHelper.executeNativeSQL(idDelete);
            String idDelete1 = "delete t_Rights where Rights_Id =" + id;
            dataBaseDaoHelper.executeNativeSQL(idDelete1);
          }
        }
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Пример #5
0
 @Override
 public List<Latitude> findAllLatitude() {
   String hql = "select la from Latitude la  ";
   return dataBaseDaoHelper.getResultListByHql(hql);
 }
Пример #6
0
 @Override
 public List<Rights> dropMenu(String id) {
   String hql = "from Rights ri where ri.prightsId =  " + id;
   return dataBaseDaoHelper.getResultListByHql(hql);
 }
Пример #7
0
 public List<Rights> getNameById(String id) {
   String hql = " from Rights where rightsId = " + id;
   return dataBaseDaoHelper.getResultListByHql(hql);
 }
Пример #8
0
 @Override
 public List<Rights> firstRights() {
   String hql =
       " from Rights  where rightsId in (1004000000000,1005000000000,1006000000000,1007000000000) ";
   return dataBaseDaoHelper.getResultListByHql(hql);
 }