table=table.Where(tbname+".create_by in (select sys_user.user_id from sys_role_dept left join sys_user on sys_user.dept_id=sys_role_dept.dept_id where sys_role_dept.role_id = ?)",user.RoleId)
}
ifrole.DataScope=="3"{
table=table.Where(tbname+".create_by in (SELECT user_id from sys_user where dept_id = ? )",user.DeptId)
}
ifrole.DataScope=="4"{
table=table.Where(tbname+".create_by in (SELECT user_id from sys_user where sys_user.dept_id in(select dept_id from sys_dept where dept_path like ? ))","%"+tools.IntToString(user.DeptId)+"%")