📄 seldatabas.bas
字号:
Attribute VB_Name = "SelDataBas"
Option Explicit
Public meObj As New SelLogonPrecept.BaseCls
Public Query As String
Public Const TitleStr = "登录方案"
'//
Public Function getClassSql(ByVal inParentID As Long) As String
Dim RetValue As String
RetValue = "select Js_LogonPreceptID as FItemID,Js_LogonPreceptDesc as FName,Js_LogonPreceptParentID as FParentID, Js_LogonPreceptLevel as FLevel,Js_LogonPreceptDetail as FDetail,Js_LogonPreceptUseSign as FUseSign,Js_LogonPreceptUserID as FUserID from Js_LogonPrecept where Js_LogonPreceptParentID=" & inParentID & " and Js_LogonPreceptDetail=0"
getClassSql = RetValue
End Function
Public Function getListSql(ByVal inParentID As Long) As String
Dim RetValue As String
Dim FParentIDs As String
FParentIDs = GetNextParID(inParentID)
If Trim(FParentIDs) <> "" Then
FParentIDs = "(" & inParentID & "," & Right(FParentIDs, Len(FParentIDs) - 1) & ")"
Else
FParentIDs = "(" & inParentID & ")"
End If
RetValue = "select a.Js_LogonPreceptID as FItemID,a.Js_LogonPreceptDesc as FName,d.FItemClassName as FCName,a.Js_LogonPreceptValue as FDesc,b.Js_LogonPreceptDesc as FPName,"
RetValue = RetValue & " FDateil=case a.Js_LogonPreceptDetail when 0 then '方案目录' when 1 then '登录方案' end,"
RetValue = RetValue & " FUseSign=case a.Js_LogonPreceptUseSign when 0 then '禁止' when 1 then '启用' end,"
RetValue = RetValue & " c.Js_UserName as FUName"
RetValue = RetValue & " from Js_LogonPrecept a"
RetValue = RetValue & " left join Js_LogonPrecept b on b.Js_LogonPreceptID=a.Js_LogonPreceptParentID"
RetValue = RetValue & " left join Js_User c on c.Js_UserID=a.Js_LogonPreceptUserID"
RetValue = RetValue & " inner join Js_LogonPreceptClass d on d.FItemClassID=a.Js_LogonPreceptType"
RetValue = RetValue & " where a.Js_LogonPreceptDetail=1 and a.Js_LogonPreceptParentID in " & FParentIDs
getListSql = RetValue
End Function
Public Function GetNextParID(ByVal inParentID As Long) As String
Dim RetStrValue As String
Dim RetIntValue As Long
Dim daCn As New ADODB.Connection
Dim daRs As New ADODB.Recordset
Dim Sql As String
'//
Sql = "select Js_LogonPreceptID from Js_LogonPrecept where Js_LogonPreceptParentID=" & inParentID & " and Js_LogonPreceptDetail=0"
daCn.ConnectionString = meObj.BaseInfo.getConStr
daCn.Open
daRs.CursorLocation = adUseClient
daRs.Open Sql, daCn, adOpenStatic, adLockReadOnly
If Not daRs.EOF Then
While Not daRs.EOF
If Not IsNull(daRs(0)) Then
RetIntValue = daRs(0)
RetStrValue = RetStrValue & "," & RetIntValue
RetStrValue = RetStrValue & GetNextParID(RetIntValue)
End If
daRs.MoveNext
Wend
End If
daRs.Close
daCn.Close
Set daRs = Nothing
Set daCn = Nothing
GetNextParID = RetStrValue
End Function
Public Function getListTitle() As String
Dim RetValue As String
RetValue = "方案内码|方案名称|方案类型|方案描述|上级名称|方案类型|方案状态|添加用户|"
getListTitle = RetValue
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -