请教一下,过滤条件的费用项目是否可以多选?
--SQL
--费用报销
(SELECT
e0.FID,e0.FExpenseDeptID,e0.FDate 申请日期,
e1.FReimbNotPayAmount 报销未付款金额,e1.FBorrowAmount 冲借款金额,e1.FOffsetAmount 冲销金额,
e1.FTaxSubmitAmt 费用金额,e1.FExpID,e1.FRequestAmount 申请退付款金额,e1.FPayedAmount 已付金额,
e2.FName 费用承担部门,
e3.FName 费用项目
FROM
(SELECT
r.FID AS FID,r.FEXPENSEDEPTID AS FExpenseDeptID,r.FDate AS FDate
FROM t_ER_ExpenseReimb r WHERE r.FFORMID = 'ER_ExpReimbursement') e0
INNER JOIN
(SELECT
r.FID AS FID,re.FREIMBNOTPAYAMOUNT AS FReimbNotPayAmount,re.FBORROWAMOUNT AS FBorrowAmount,
re.FOFFSETAMOUNT AS FOffsetAmount, re.FTAXSUBMITAMT AS FTaxSubmitAmt,re.FEXPID AS FExpID,
re.FREQUESTAMOUNT AS FRequestAmount,re.FPAYEDAMOUNT AS FPayedAmount
FROM t_ER_ExpenseReimb r LEFT JOIN t_ER_ExpenseReimbEntry re ON (r.FID = re.FID ) WHERE r.FDOCUMENTSTATUS='C'
AND r.FFORMID = 'ER_ExpReimbursement') e1 on e0.FID = e1.FID
INNER JOIN
(SELECT
t0.FDEPTID AS FDEPTID,t0_L.FNAME AS FName
FROM T_BD_DEPARTMENT t0 LEFT JOIN T_BD_DEPARTMENT_L t0_L ON (t0.FDEPTID=t0_L.FDEPTID
AND t0_L.FLocaleId=2052)) e2 ON e0.FExpenseDeptID = e2.FDEPTID
INNER JOIN
(SELECT
t0.FEXPID AS FEXPID,t0_l.FName AS FName
FROM t_bd_expense t0 LEFT JOIN t_bd_expense_l t0_l ON (t0.FEXPID=t0_l.FEXPID) AND t0_L.FLocaleId=2052)
e3 ON e1.FEXPID=e3.FEXPID
WHERE (e0.FDate>='#FBDate#' AND e0.FDate<='#FEDate#') AND (e2.FName in ('#Dep#') OR e3.FName in ('#Fexp#') ))
UNION ALL
--差旅费报销
(SELECT
e0.FID,e0.FExpenseDeptID,e0.FDate 申请日期,
e1.FReimbNotPayAmount 报销未付款金额,e1.FBorrowAmount 冲借款金额,e1.FOffsetAmount 冲销金额,
e1.FTaxSubmitAmt 费用金额,e1.FExpID,e1.FRequestAmount 申请退付款金额,e1.FPayedAmount 已付金额,
e2.FName 费用承担部门,
e3.FName 费用项目
FROM
(SELECT
t0.FID AS FID,t0.FEXPENSEDEPTID AS FExpenseDeptID,t0.FDATE AS FDate
FROM t_ER_ExpenseReimb t0 WHERE t0.FFORMID = 'ER_ExpReimbursement_Travel') e0
INNER JOIN
(SELECT
t0.FID AS FID,t1.FREIMBNOTPAYAMOUNT AS FReimbNotPayAmount,t1.FBORROWAMOUNT AS FBorrowAmount,
t1.FOFFSETAMOUNT AS FOffsetAmount,t1.FTAXSUBMITAMT AS FTaxSubmitAmt,t1.FEXPID AS FExpID,
t1.FPAYEDAMOUNT AS FPayedAmount,t1.FRequestAmount AS FRequestAmount
FROM t_ER_ExpenseReimb t0 LEFT JOIN t_ER_ExpenseReimbEntry t1 ON (t0.FID = t1.FID )
WHERE t0.FDOCUMENTSTATUS='C' AND t0.FFORMID = 'ER_ExpReimbursement_Travel') e1 ON e0.FID = e1.FID
INNER JOIN
(SELECT
t0.FDEPTID AS FDEPTID,t0_L.FNAME AS FName FROM T_BD_DEPARTMENT t0 LEFT JOIN
T_BD_DEPARTMENT_L t0_L ON (t0.FDEPTID=t0_L.FDEPTID AND t0_L.FLocaleId=2052)) e2 ON e0.FExpenseDeptID = e2.FDEPTID
INNER JOIN
(SELECT t0.FEXPID AS FEXPID,t0_l.FName AS FName
FROM t_bd_expense t0 LEFT JOIN t_bd_expense_l t0_l ON (t0.FEXPID=t0_l.FEXPID) AND t0_L.FLocaleId=2052)
e3 ON e1.FEXPID=e3.FEXPID
WHERE (e0.FDate>='#FBDate#' AND e0.FDate<='#FEDate#') AND (e2.FName in ('#Dep#') OR e3.FName in ('#Fexp#') ))
推荐阅读