|
楼主 |
发表于 2014-7-14 17:04:14
|
显示全部楼层
//根据角色id找到对应sa_oporg 中的人
public static Table personsByroleAndDept(String roleid,String orgsid){
String oracle ="SELECT SA_OPOrg.SID,SA_OPOrg.SPERSONID,SA_OPOrg.SNAME FROM SA_OPORG SA_OPOrg WHERE SA_OPOrg.SPERSONID IS NOT NULL ";
if(roleid != null && !("").equals(roleid)){
oracle += " AND SA_OPOrg.SFID IN (SELECT R.SORGFID FROM SA_OPAUTHORIZE R WHERE R.SAUTHORIZEROLEID='"+roleid+"' ) ";
}
if(orgsid != null && !("").equals(orgsid)){
oracle += " AND SA_OPOrg.SPARENT='"+orgsid+"' ";
}
System.out.println(oracle);
HashMap<String,String> sqlMap = new HashMap<String,String>();
sqlMap.put(DatabaseProduct.DB2.name(),oracle);
sqlMap.put(DatabaseProduct.ORACLE.name(),oracle);
sqlMap.put(DatabaseProduct.DB2.name(),oracle);
sqlMap.put(DatabaseProduct.KINGBASE.name(),oracle);
Table table = SQL.select(sqlMap,null,"/system/data");
table.getProperties().put(Table.PROP_NAME_ROWID, "SID");
return table;
}
我写的Action查询的 |
|