📄 filter.bas
字号:
Case "7"
strSelect(5) = "零或空值 "
strSelect(8) = " (" & strSelect(2) & " IS NULL OR " & strSelect(2) & " =0) "
Case "9"
strSelect(5) = "不等于 " & Trim(strSelect(6))
strSelect(8) = strSelect(2) & " <> " & Trim(strSelect(6))
End Select
Case "BOOLEAN"
strSelect(5) = ": " & IIf(rs!blnBoolean = 1, "是", "否")
strSelect(8) = strSelect(2) & " = " & rs!blnBoolean
Case "PERIOD"
strSelect(5) = Trim(rs!strDateOp)
Select Case strSelect(5)
Case "1"
strSelect(5) = "今天"
Case "2"
strSelect(5) = "本周"
Case "3"
strSelect(5) = "本周至今日"
Case "4"
strSelect(5) = "本期"
Case "5"
strSelect(5) = "本期至今日"
Case "6"
strSelect(5) = "本月"
Case "7"
strSelect(5) = "本月至今日"
Case "8"
strSelect(5) = "本季度"
Case "9"
strSelect(5) = "本季至今日"
Case "10"
strSelect(5) = "本年"
Case "11"
strSelect(5) = "本年至今日"
Case "12"
strSelect(5) = "上周"
Case "13"
strSelect(5) = "上期"
Case "14"
strSelect(5) = "上月"
Case "15"
strSelect(5) = "上季度"
Case "16"
strSelect(5) = "去年"
Case "17"
strSelect(5) = "自定义"
Case "18"
strSelect(5) = "所有"
End Select
If strSelect(5) = "自定义" Then
strSelect(6) = rs!dtmDate1
strSelect(7) = rs!dtmDate2
Else
gclsBase.GetBeginAndEndDate strSelect(5), gclsBase.BaseDate, D1, D2
strSelect(6) = Format(D1, "yyyy-mm-dd")
strSelect(7) = Format(D2, "yyyy-mm-dd")
End If
If blnPeriod = True And strSelect(10) = strPeriodName Then
strSelect(8) = strSelect(2) & " , " & strSelect(5) & " , " & strSelect(6) & " , " & strSelect(7)
Else
If InStr(UCase(strSelect(2)), "TO_DATE") > 0 Then
strSelect(8) = Trim(strSelect(2)) & " >= to_date('" & Trim(strSelect(6)) & "','" & "yyyy-mm-dd" & "'" & ") and " & strSelect(2) & " <= to_date('" & Trim(strSelect(7)) & "','" & "yyyy-mm-dd" & "')"
Else
strSelect(8) = Trim(strSelect(2)) & " >='" & Trim(strSelect(6)) & "' and " & strSelect(2) & " <= '" & Trim(strSelect(7)) & "'"
End If
End If
If strSelect(5) = "自定义" Then
strSelect(5) = "介于(" & Trim(strSelect(6)) & "," & Trim(strSelect(7)) & ")"
Else
strSelect(5) = ": " & strSelect(5)
End If
If InStr(strSelect(1), "分析期") > 0 Or InStr(strSelect(1), "对比期") > 0 Or InStr(strSelect(1), "比较期") > 0 Then
strSelect(8) = ""
End If
Case "DATE"
strSelect(5) = rs!dtmDate1
If blnPeriod = True And strSelect(10) = strPeriodName Then
strSelect(8) = strSelect(2) & " , " & strSelect(5) & ",,"
Else
If InStr(UCase(strSelect(2)), "TO_DATE") > 0 Then
strSelect(8) = Trim(strSelect(2)) & " = to_date('" & Trim(strSelect(5)) & "','yyyy-mm-dd')"
Else
strSelect(8) = Trim(strSelect(2)) & " = '" & Trim(strSelect(5)) & "'"
End If
End If
strSelect(5) = ": " & strSelect(5)
Case "CODE"
Dim strCodeKey As String
Dim strTempFind As String
Select Case lngType
Case 1
Set rsTempTable = gclsBase.BaseDB.OpenResultset(" select * from listmultiidcond where " & strkeyIdNumber & " =" & LngFilterID & " And strpath='" & strSelect(10) & "'", rdOpenStatic)
Case 2
Set rsTempTable = gclsBase.BaseDB.OpenResultset(" select * from reportmultiidcond where " & strkeyIdNumber & " =" & LngFilterID & " And strpath='" & strSelect(10) & "'", rdOpenStatic)
End Select
rsTempTable.MoveFirst
Do While Not rsTempTable.EOF
strSelect(6) = rsTempTable!strCodeID
strSelect(5) = ": " & rsTempTable!strKeyName
strCodeKey = rsTempTable!strKeyName
If strSelect(6) = "一级科目" Then
strSelect(8) = strSelect(4) & ".intLevel=1"
rsTempTable.Close
GoTo NextRoad
End If
If rsTempTable!bLNISCODETYPE = 1 Then
strSelect(8) = ""
If UCase(strSelect(2)) = "ACCOUNT" Then
Select Case strCodeKey
Case "现金"
strSelect(8) = strSelect(4) & ".lngAccountNatureID=1"
Case "银行"
strSelect(8) = strSelect(4) & ".lngAccountNatureID=2"
Case "应收"
strSelect(8) = strSelect(4) & ".lngAccountNatureID=3"
Case "应付"
strSelect(8) = strSelect(4) & ".lngAccountNatureID=4"
Case "存货"
strSelect(8) = strSelect(4) & ".lngAccountNatureID=5"
Case "其它"
strSelect(8) = strSelect(4) & ".lngAccountNatureID=0"
End Select
End If
If UCase(strSelect(2)) = "CUSTOMER" Then
Select Case strCodeKey
Case "客户"
strSelect(8) = strSelect(4) & ".strCategory='2'"
Case "供应商"
strSelect(8) = strSelect(4) & ".strCategory='1'"
Case "供销"
strSelect(8) = strSelect(4) & ".strCategory='3'"
Case "其它"
strSelect(8) = strSelect(4) & ".strCategory='0'"
End Select
End If
If strSelect(8) = "" Then
strSelect(8) = rsTempTable!strCodeID & " in ('" & rsTempTable!strKeyName & "')"
End If
rsTempTable.Close
GoTo NextRoad
End If
Exit Do
Loop
rsTempTable.Close
strCodeTemp = strSelect(6)
If Len(strCodeKey) > 0 Then
If rs!blnismulicond = 0 And strCodeKey <> "本位币" Then
strCodeKey = Left(strCodeKey, InStr(strCodeKey, " ") - 1)
End If
strTempFind = Trim(FindAllKeyID(Trim(strSelect(2)), strCodeKey))
strCodeTemp = IIf(strTempFind <> "", strTempFind & "," & strCodeTemp, strCodeTemp)
End If
Dim strKeyField As String
Select Case UCase(strSelect(2))
Case "CLASS1", "CLASS2", "CURRENCYS", "CUSTOM0", "CUSTOM1", "CUSTOM2", "CUSTOM3", "CUSTOM4", "CUSTOM5"
strKeyField = Left(strSelect(2), Len(strSelect(2)) - 1)
Case Else
strKeyField = strSelect(2)
End Select
strSelect(8) = Trim(strSelect(4)) & ".lng" & Trim(strKeyField) & "ID" & " in (" & Trim(strCodeTemp) & ")"
End Select
If Trim(strSelect(9)) <> "" Then
strSelect(8) = ModifyTableName(strSelect(8), strSelect(4) & ".", strSelect(9) & ".")
End If
NextRoad:
'生成中文条件
If InStr(strSelect(1), "报告期") > 0 Or InStr(strSelect(1), "分析期") > 0 Or InStr(strSelect(1), "对比期") > 0 Or InStr(strSelect(1), "比较期") > 0 Then
Else
If ChineseCond = "" Then
ChineseCond = strSelect(10) & " " & strSelect(5)
Else
ChineseCond = ChineseCond & " " & strSelect(10) & " " & strSelect(5)
End If
End If
' 生成特殊条件
If IntTag <> 0 Then
strTemp = strSelect(8)
strSelect(8) = ""
lngTemp = InStr(strSelect(10), "/")
If lngTemp > 0 Then
strSelect(10) = Left(strSelect(10), lngTemp - 1)
End If
Select Case Trim(strSelect(10))
Case "科目"
If blnAccount = True Then
strTagCond(1) = strTagCond(1) & " and " & strTemp
Else
strSelect(8) = strTemp
End If
Case "单位"
If blnCustomer = True Then
strTagCond(2) = strTagCond(2) & " and " & strTemp
Else
strSelect(8) = strTemp
End If
Case "部门"
If blnDepartment = True Then
strTagCond(3) = strTagCond(3) & " and " & strTemp
Else
strSelect(8) = strTemp
End If
Case "职员"
If blnEmployee = True Then
strTagCond(4) = strTagCond(4) & " and " & strTemp
Else
strSelect(8) = strTemp
End If
Case "工程"
If blnJob = True Then
strTagCond(5) = strTagCond(5) & " and " & strTemp
Else
strSelect(8) = strTemp
End If
Case "统计"
If blnClass1 = True Then
strTagCond(6) = strTagCond(6) & " and " & strTemp
Else
strSelect(8) = strTemp
End If
'对 '项目','货位' 和'商品' 特殊处理
Case "项目"
If blnClass2 = True Then
If strTagCond(9) <> "" Then
strTagCond(9) = strTagCond(9) & " and " & strTemp
Else
strTagCond(9) = strTemp
End If
Else
strSelect(8) = strTemp
End If
Case "商品"
If blnItem = True Then
If strTagCond(8) <> "" Then
strTagCond(8) = strTagCond(8) & " and " & strTemp
Else
strTagCond(8) = strTemp
End If
Else
strSelect(8) = strTemp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -