原創作品,允許轉載,轉載時請務必以超鏈接形式標明文章
原始出處 、作者信息和本聲明。否則將追究法律責任。
http://zorro.blog.51cto.com/2139862/821777
<
resultMap
id
="usermoduleprivilege"
class ="com.webex.webapp.l10n.common.pojo.UserModulePrivilege" >
< result property ="projectId" column ="projectid" nullValue="" />
< result property ="userId" column ="userid" nullValue ="0" />
< result property ="userName" column ="username" nullValue="" />
< result property ="firstName" column ="firstname" nullValue="" />
< result property ="lastName" column ="lastname" nullValue="" />
< result property ="modulePrivilege"
column ="{userId=userid, projectId=projectid}"
select ="findassignedusermoduleprivilege" />
</ resultMap >
class ="com.webex.webapp.l10n.common.pojo.UserModulePrivilege" >
< result property ="projectId" column ="projectid" nullValue="" />
< result property ="userId" column ="userid" nullValue ="0" />
< result property ="userName" column ="username" nullValue="" />
< result property ="firstName" column ="firstname" nullValue="" />
< result property ="lastName" column ="lastname" nullValue="" />
< result property ="modulePrivilege"
column ="{userId=userid, projectId=projectid}"
select ="findassignedusermoduleprivilege" />
</ resultMap >
<
select
id
="findassignedusermoduleprivilege"
resultMap ="moduleprivilege" cacheModel ="Project-cache" >
select t.projectid,m.moduleid,m.modulename,t.status,t.privilege from
wbxl10nprojectprivilege t,wbxl10nmodule m where
t.moduleid=m.moduleid and t.userid=#userId# and
t.projectid=#projectId#
</ select >
resultMap ="moduleprivilege" cacheModel ="Project-cache" >
select t.projectid,m.moduleid,m.modulename,t.status,t.privilege from
wbxl10nprojectprivilege t,wbxl10nmodule m where
t.moduleid=m.moduleid and t.userid=#userId# and
t.projectid=#projectId#
</ select >
<
select
id
="findassigneduserprivilege"
resultMap ="usermoduleprivilege" >
select
distinct(u.userid),p.projectid,u.username,u.firstName,u.lastName
from wbxl10nproject p ,wbxl10nprojectprivilege t,wbxl10nuser u
where t.userid=u.userid and t.projectid=p.projectid and
t.projectid=#projectId#
</ select >
resultMap ="usermoduleprivilege" >
select
distinct(u.userid),p.projectid,u.username,u.firstName,u.lastName
from wbxl10nproject p ,wbxl10nprojectprivilege t,wbxl10nuser u
where t.userid=u.userid and t.projectid=p.projectid and
t.projectid=#projectId#
</ select >
column ="{userId=userid, projectId=projectid}"
select ="findassignedusermoduleprivilege" /> 將column指定的一項或多項作為參數( userId=userid, projectId=projectid),傳入並執行指定的select語句( findassignedusermoduleprivilege),並將查詢結果賦給 property ="modulePrivilege"
本文出自 “左羅CTO” 博客,請務必保留此出處http://zorro.blog.51cto.com/2139862/821777
