public WhereBuilder RoleAddSQL() { string userid = ""; string strSql = "select a.* from SEC_ROLE a left join SEC_USER_ROLE b on a.ROLE_ID=b.ROLE_ID"; ligerGrid.HasKey("id", ref userid); strSql += " and [USER_ID]='" + userid + "' where b.ROLE_ID IS NULL"; if (!string.IsNullOrEmpty(systemName)) { strSql += " and a.system_name='" + systemName + "' "; } WhereBuilder wb = new WhereBuilder(strSql); return(wb); }
public WhereBuilder GetUserRoleSQL() { string sql = "select * from (select b.USER_ROLE_ID,b.USER_ID ,a.role_id,a.role_name,a.role_type,case a.role_type when 0 then '系统管理' when 1 then '普通用户' end as role_type_name,a.remark "; sql += " from sec_role a left join SEC_USER_ROLE b on a.role_id=b.ROLE_ID "; string userid = ""; ligerGrid.HasKey("id", ref userid); if (!string.IsNullOrEmpty(userid)) { sql += "and b.USER_ID='" + userid + "'"; } sql += " where 1=1 "; if (!string.IsNullOrEmpty(systemName)) { sql += " and a.system_name='" + systemName + "' "; } sql += ")tb"; WhereBuilder wb = new WhereBuilder(sql); return(wb); }