2024-09-20 17:28:15 +08:00
|
|
|
SELECT
|
|
|
|
*
|
|
|
|
FROM dm.v_ag_sal_eorder
|
2024-11-17 22:55:05 +08:00
|
|
|
-- 订单时间
|
|
|
|
WHERE order_time >= '${sStart_date}'
|
|
|
|
AND order_time <= '${sEnd_date}'
|
|
|
|
-- 商品 eproduct_code 、eproduct_name
|
|
|
|
${if(len(sEproduct_code) == 0,"","and eproduct_name in ('" + sEproduct_code + "')")}
|
2024-09-20 17:28:15 +08:00
|
|
|
|
2024-11-17 22:55:05 +08:00
|
|
|
-- 单据号
|
|
|
|
${if(len(sBill) == 0,"","and order_code in ('" + sBill + "')")}
|
|
|
|
|
|
|
|
-- 是否有对照关系 is_refer
|
|
|
|
${if(len(sIs_refer) == 0,"","and is_refer in ('" + sIs_refer + "')")}
|
|
|
|
|
|
|
|
-- 城市单元 sCu
|
|
|
|
${if(len(sCu) == 0,"","and city_unit_code in ('" + sCu + "')")}
|
|
|
|
|
|
|
|
-- 退款标识 is_refund "0","无退款","含退款"
|
|
|
|
${if(len(sIs_refund) == 0,"","and is_refund in ('" + sIs_refund + "')")}
|
|
|
|
|
|
|
|
-- 订单状态 Order_status
|
|
|
|
${if(len(sOrder_status) == 0,"","and order_status in ('" + sOrder_status + "')")}
|
|
|
|
|
|
|
|
-- 品项 sPi
|
|
|
|
${if(len(sPi_name) == 0,"","and pi_name in ('" + sPi_name + "')")}
|
|
|
|
|
|
|
|
-- 产品 sProd
|
|
|
|
${if(len(sProd) == 0,"","and product_code in ('" + sProd + "')")}
|
|
|
|
|
|
|
|
-- 金额区间
|
2024-09-20 17:28:15 +08:00
|
|
|
|