我有一个sql stored procedure
,我想在CreateCriteria
转换它。我无法转换它。
SP在下面给出
BEGIN
SELECT *
FROM tSCProperty
WHERE fCompanyID = @CompanyID
ORDER BY fName
END
ELSE
BEGIN
SELECT @UserID = fUserID
FROM tUMUser
WHERE fUserName = @UserName
IF @UserID IS NULL
BEGIN
SELECT DISTINCT NULL FROM tSCProperty
END
ELSE
BEGIN
SELECT * FROM tSCProperty
WHERE fCompanyID = @CompanyID
AND fPropertyID IN (SELECT fPropertyID FROM tUMUser [user]
INNER JOIN tUMUserAccess ua ON [user].fUserID = ua.fUserID
INNER JOIN tUMPropertyAccess pa ON ua.fGroupID = pa.fGroupID
WHERE [user].fUserID = @UserID
AND fPropertyID IS NOT NULL)
ORDER BY fName
END
我是Nhibernate的新手。我被困在这个存储过程中。任何帮助将不胜感激。谢谢。