| | |
| | | , ( <include refid="cur_mon_replace_num"></include> ) as cur_mon_replace_num |
| | | , ( <include refid="last_mon_replace_num"></include> ) as last_mon_replace_num |
| | | |
| | | , ( <include refid="all_supplier_flower_num"></include> ) as all_supplier_flower_num |
| | | , ( <include refid="cur_mon_after_sale_order_num"></include> ) as cur_mon_after_sale_order_num |
| | | , ( <include refid="cur_mon_after_sale_flower_num"></include> ) as cur_mon_after_sale_flower_num |
| | | |
| | | </select> |
| | | |
| | | <!--供应商总价款--> |
| | | <sql id="all_supplier_amount"> |
| | | select IFNULL(sum(oi.supplier_price*oi.num),0) as supplier_amount from t_order_item oi where oi.supplier_id=287 |
| | | select IFNULL(sum(oi.supplier_price*oi.num),0) as supplier_amount |
| | | from t_order_item oi |
| | | where oi.supplier_id= #{dto.supplierId} |
| | | </sql> |
| | | <!--本月成交:本月售卖的底价合计--> |
| | | <sql id="cur_mon_supplier_amount"> |
| | |
| | | and o.payment_time <= DATE_FORMAT(DATE_SUB(DATE_FORMAT(CURRENT_DATE(), '%Y-%m-01'), INTERVAL 1 DAY), '%Y-%m-%d 17:00:00') |
| | | </sql> |
| | | |
| | | <!-- 总成交扎数--> |
| | | <sql id="all_supplier_flower_num"> |
| | | select IFNULL(sum(oi.num),0) as all_supplier_flower_num |
| | | from t_order_item oi |
| | | where oi.supplier_id= #{dto.supplierId} |
| | | </sql> |
| | | |
| | | <!-- 本月售后订单--> |
| | | <sql id="cur_mon_after_sale_order_num"> |
| | | select IFNULL(count(distinct o.id),0) as cur_mon_after_sale_order_num |
| | | from t_order_item oi |
| | | left join t_order_item_sales ois |
| | | on oi.id=ois.order_item_id |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.deleted=0 and ois.DELETEd=0 and ois.STATUS='AGREED' |
| | | and oi.supplier_id=#{dto.supplierId} |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(LAST_DAY(CURRENT_DATE()), '%Y-%m-%d 17:00:00') |
| | | |
| | | </sql> |
| | | |
| | | <!-- 本月售后扎数--> |
| | | <sql id="cur_mon_after_sale_flower_num"> |
| | | select IFNULL(sum(ois.num),0) as cur_mon_after_sale_flower_num |
| | | from t_order_item oi |
| | | left join t_order_item_sales ois |
| | | on oi.id=ois.order_item_id |
| | | left join t_order o |
| | | on oi.order_id = o.id |
| | | where oi.deleted=0 and ois.DELETEd=0 and ois.STATUS='AGREED' |
| | | and oi.supplier_id=#{dto.supplierId} |
| | | and o.payment_time > DATE_FORMAT(LAST_DAY(DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH)), '%Y-%m-%d 17:00:00') |
| | | and o.payment_time <= DATE_FORMAT(LAST_DAY(CURRENT_DATE()), '%Y-%m-%d 17:00:00') |
| | | </sql> |
| | | </mapper> |