比如我有一句查询登录者所在部门项目的语句:select * from tbl_Project where tbl_Project.groupid = (select tbl_staff.groupid from tbl_staff where tbl_staff.username='${username}')
能否改成select * from tbl_Project where tbl_Project.groupid = '${groupid}'。如果按部门查直接给groupid赋值,如果按登录者查,再以(select tbl_staff.groupid from tbl_staff where tbl_staff.username='${username}')给groupid赋值?