📄 inlistmaster.asp
字号:
<%
'/
'/挔昜娗棟婡擻
'/挔昜婎杮僥乕僽儖傾僋僙僗僋儔僗
'/
Class InListMaster
'/*******************************************************
'/* 挔昜堦棗夋柺偵昞帵偡傞儗僐乕僪傪拪弌偡傞
'/* param丗l_dbaccess(DBAccess) DB傾僋僙僗
'/* l_sysid(String) 僔僗僥儉ID
'/* l_coid(String) 夛幮ID
'/* l_secId(String) 晹栧ID
'/* l_menuAuth(String) 儊僯儏乕尃尷乮挔昜娗棟尃尷)
'/* l_indata(Scripting.Dictionary) 夋柺擖椡抣
'/* return ADODB.Recordset 専嶕寢壥
'/*******************************************************
Public Function SearchListBase(l_dbaccess, l_sysId, l_coId, l_indata)
Dim l_strsql 'String
'SQL暥嶌惉
'SELECT
l_strsql = "SELECT L_B.COMPANY_ID," &_
"O_T.LIST_CD," &_
"O_T.LIST_EDA," &_
"L_B.LIST_NAME," &_
"D_T.DELIVERY_NUM," &_
"D_T.STORE_NUM," &_
"C_M.COMPANY_NAME," &_
"O_T.ORDER_STATUS," &_
"(SELECT NAME " &_
" FROM CODE_M " &_
" WHERE SYSTEM_ID = O_T.SYSTEM_ID " &_
" AND CLASSIFIED_CODE = '" & CD_ORDER_STATUS & "' " &_
" AND CODE = O_T.ORDER_STATUS) AS ORDER_STATUS_NAME," &_
"(SELECT NAME " &_
" FROM CODE_M " &_
" WHERE SYSTEM_ID = O_T.SYSTEM_ID " &_
" AND CLASSIFIED_CODE = '" & CD_LIST_UNIT & "' " &_
" AND CODE = L_B.LIST_UNIT) AS LIST_UNIT," &_
"TO_CHAR(D_T.DELIVERY_YMD,'yyyy/mm/dd') AS DELIVERY_YMD," &_
"TO_CHAR(D_T.ACCEPT_YMD,'yyyy/mm/dd') AS ACCEPT_YMD"
'FROM
l_strsql = l_strsql & " FROM LISTBASE_T L_B, COMPANY_M C_M, ORDER_T O_T, DELIVERYINFO_T D_T"
'WHERE
l_strsql = l_strsql & " WHERE O_T.SYSTEM_ID = '" & l_sysId & "' " &_
" AND O_T.DEL_FLG = '0'" &_
" AND O_T.SYSTEM_ID = L_B.SYSTEM_ID " &_
" AND O_T.LIST_CD = L_B.LIST_CD " &_
" AND O_T.LIST_EDA = L_B.LIST_EDA " &_
" AND O_T.DEL_FLG = L_B.DEL_FLG" &_
" AND O_T.SYSTEM_ID = D_T.SYSTEM_ID " &_
" AND O_T.DELIVERY_INFO = D_T.DELIVERY_INFO" &_
" AND D_T.DELIVERY_PLACE = '" & l_coId & "' " &_
" AND O_T.DEL_FLG = D_T.DEL_FLG" &_
" AND O_T.SYSTEM_ID = C_M.SYSTEM_ID " &_
" AND C_M.COMPANY_ID = '" & l_coId & "' " &_
" AND O_T.DEL_FLG = C_M.DEL_FLG"
'夋柺擖椡偟偨撪梕傪愝掕
If IsObject(l_indata) Then
'AND 儊僯儏乕挔昜斣崋
If l_indata.Item("menulistcd") <> "" Then
l_strsql = l_strsql & " AND O_T.LIST_CD=" & "'" & l_indata.Item("menulistcd") & "'"
End If
'AND 挔昜斣崋
If l_indata.Item("listcd") <> "" Then
l_strsql = l_strsql & " AND O_T.LIST_CD=" & "'" & l_indata.Item("listcd") & "'"
End If
'AND 挔昜斣崋巬斣
If l_indata.Item("listeda") <> "" Then
l_strsql = l_strsql & " AND O_T.LIST_EDA=" & "'" & l_indata.Item("listeda") & "'"
End If
'AND 挔昜柤 2006/1/11 慜曽堦抳廋惓
If l_indata.Item("listname") <> "" Then
l_strsql = l_strsql & " AND L_B.LIST_NAME LIKE('" & l_ilm.l_cutil.chg_HantoZen(l_indata.Item("listname")) & "%')"
End If
'AND 挔昜僗僥乕僞僗
l_strsql = l_strsql & " AND O_T.ORDER_STATUS IN ("
If l_indata.Item("checkbox") <> "" Then
Dim l_ArrayStatus
Dim l_element
l_ArrayStatus = Split(l_indata.Item("checkbox"),",")
l_strsql = l_strsql & "'" & l_ArrayStatus(0) & "'"
For l_element = 1 to UBound(l_ArrayStatus)
l_strsql = l_strsql & ",'" & Trim(l_ArrayStatus(l_element)) & "'"
Next
Else
l_strsql = l_strsql & "'" & OSTS_ORDER &_
"','" & OSTS_DELIVERY_INST &_
"','" & OSTS_DELIVERY &_
"','" & OSTS_DELIVERY_CONF &_
"','" & OSTS_PAYMENT_CONF &_
"','" & OSTS_PAYMENT_FIN & "'"
End If
l_strsql = l_strsql & ")"
'AND 擖屔梊掕擔(FROM)乣(TO)
If l_indata.Item("pdimday") = "2" Then
Dim l_fromymd
Dim l_toymd
l_fromymd = Trim(l_indata.Item("pdimfmfromyear") & l_indata.Item("pdimfmfrommonth") & l_indata.Item("pdimfmfromday"))
l_toymd = Trim(l_indata.Item("pdimfmtoyear") & l_indata.Item("pdimfmtomonth") & l_indata.Item("pdimfmtoday"))
If l_fromymd <> "" and l_toymd <> "" Then 'REG_YMD BETWEEN l_fromymd AND l_toymd
l_strsql = l_strsql & " AND TO_CHAR(D_T.DELIVERY_YMD, 'yyyymmdd') BETWEEN '" & l_fromymd & _
"' AND '" & l_toymd & "'"
ElseIf l_fromymd <> "" Then 'REG_YMD = fromymd
l_strsql = l_strsql & " AND TO_CHAR(D_T.DELIVERY_YMD, 'yyyymmdd') >= '" & l_fromymd & "'"
ElseIf l_toymd <> "" Then 'REG_YMD = toymd
l_strsql = l_strsql & " AND TO_CHAR(D_T.DELIVERY_YMD, 'yyyymmdd') <= '" & l_toymd & "'"
End If
Else
l_strsql = l_strsql & " AND TO_CHAR(D_T.DELIVERY_YMD,'yyyymmdd') = TO_CHAR(SYSDATE,'yyyymmdd')"
End If
'僨僼僅儖僩帪
Else
l_strsql = l_strsql & " AND O_T.ORDER_STATUS IN ('" & OSTS_ORDER &_
"','" & OSTS_DELIVERY_INST &_
"','" & OSTS_DELIVERY &_
"','" & OSTS_DELIVERY_CONF &_
"','" & OSTS_PAYMENT_CONF &_
"','" & OSTS_PAYMENT_FIN & "')"
'摉擔
l_strsql = l_strsql & " AND TO_CHAR(D_T.DELIVERY_YMD,'yyyymmdd') = TO_CHAR(SYSDATE,'yyyymmdd')"
End If
'ORDER BY
If IsObject(l_indata) Then
'ORDER BY
l_strsql = l_strsql & " ORDER BY " & GetOrderByStr(l_indata.Item("sortkey"),l_indata.Item("sortdesc"))
Else
'ORDER BY (擖椡抣偑側偄応崌偼僨僼僅儖僩偺僜乕僩弴愝掕)
l_strsql = l_strsql & " ORDER BY D_T.DELIVERY_YMD DESC,O_T.ORDER_AMOUNT DESC"
End If
'Response.Write l_strsql
debug_t(l_strsql)
'DB傛傝堦棗傪庢摼偟偰曉偡(1儁乕僕亖10峴傪愝掕)
Set SearchListBase = l_dbaccess.ProcRecordset(l_strsql,30,0)
End Function
'/*******************************************************
'/* 僜乕僩暥庢摼
'/* param丗l_sortkey(String) 僜乕僩僉乕
'/* return String 僜乕僩暥
'/*******************************************************
Private Function GetOrderByStr(l_sortkey, l_sortdesc)
Dim l_retStr 'String
Dim l_seq 'String
'僜乕僩弴愝掕
If l_sortdesc = FLG_ON Then
l_seq = " DESC"
End If
'僜乕僩暥嶌惉
If l_sortkey = SORT_KEY1 Then '僨僼僅儖僩(嶌惉擔(崀弴)亄挔昜斣崋(崀弴))
l_retStr = "D_T.DELIVERY_YMD DESC,O_T.ORDER_AMOUNT DESC"
ElseIf l_sortkey = SORT_KEY2 Then '挔昜斣崋弴
l_retStr = "O_T.LIST_CD" & l_seq & ",O_T.LIST_EDA" & l_seq
ElseIf l_sortkey = SORT_KEY3 Then '挔昜柤弴
l_retStr = "L_B.LIST_NAME" & l_seq
ElseIf l_sortkey = SORT_KEY4 Then '擺昳梊掕擔弴
l_retStr = "D_T.DELIVERY_YMD" & l_seq
ElseIf l_sortkey = SORT_KEY5 Then '梊掕悢
l_retStr = "D_T.DELIVERY_NUM" & l_seq
ElseIf l_sortkey = SORT_KEY6 Then '忬嫷
l_retStr = "O_T.ORDER_STATUS" & l_seq
ElseIf l_sortkey = SORT_KEY7 Then '擺昳悢
l_retStr = "D_T.STORE_NUM" & l_seq
End If
GetOrderByStr = l_retStr
End Function
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -