Example #1
0
 @Override
 public void dropRights(String name) {
   String sql = "delete t_rights  t where t.rights_name ='" + name + "'";
   String rightsId = "select s.rightsId from Rights s where s.rightsName = '" + name + "'";
   rightsId = dataBaseDaoHelper.getSingleResultByHql(rightsId).toString();
   String roleRightsId = "delete  t_role_rights r where r.rights_Id =  '" + rightsId + "'";
   String dropReport = "delete t_report_data trd where trd.rights_id ='" + rightsId + "'";
   dataBaseDaoHelper.executeNativeSQL(roleRightsId);
   dataBaseDaoHelper.executeNativeSQL(dropReport);
   dataBaseDaoHelper.executeNativeSQL(sql);
 }
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);
  }
Example #3
0
 @Override
 public String getRightsParams(String name) {
   String hql = "select rightsParamter from Rights where rightsName = '" + name + "'";
   return dataBaseDaoHelper.getSingleResultByHql(hql).toString();
 }
Example #4
0
 public Long getlv3IdByLv2Name(String name) {
   String hql = " from Rights where rightsName =" + name;
   return (Long) dataBaseDaoHelper.getSingleResultByHql(hql);
 }