|
@@ -530,6 +530,50 @@ FROM
|
|
|
ORDER BY
|
|
ORDER BY
|
|
|
m.id
|
|
m.id
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selBusinessOrder" resultType="org.springblade.purchase.sales.vo.SalesDetailsVo">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ BOI.id AS itemsId,
|
|
|
|
|
+ BO.id AS orderId,
|
|
|
|
|
+ BO.Corp_id AS corpid,
|
|
|
|
|
+ BCD.cname AS corpName,
|
|
|
|
|
+ BO.create_time AS careteTime,
|
|
|
|
|
+ BO.Sales_name AS salesName,
|
|
|
|
|
+ BGD.id AS commodityId,
|
|
|
|
|
+ BGD.code AS commodityCode,
|
|
|
|
|
+ BGD.Typeno AS typeno,
|
|
|
|
|
+ BGD.brand_item AS brandItem,
|
|
|
|
|
+ BOI.Actual_quantity AS quantity,
|
|
|
|
|
+ BOI.Amount AS amount,
|
|
|
|
|
+ BGD.Price AS price,
|
|
|
|
|
+ BO.Settlment_amount AS settlmentAmount,
|
|
|
|
|
+ BOF.Amount AS feesAmount,
|
|
|
|
|
+ BGD.Brand AS brand
|
|
|
|
|
+ FROM business_order_items AS BOI
|
|
|
|
|
+ LEFT JOIN business_order BO ON BOI.pid = BO.id
|
|
|
|
|
+ LEFT JOIN basic_goods_desc BGD ON BOI.Item_id = BGD.id
|
|
|
|
|
+ LEFT JOIN business_order_fees BOF ON BOF.pid = BO.id
|
|
|
|
|
+ LEFT JOIN basic_corps_desc BCD ON BO.Corp_id = BCD.id
|
|
|
|
|
+ <where>
|
|
|
|
|
+ BOI.is_deleted = 0
|
|
|
|
|
+ <if test="detailsVo.corpName != null and detailsVo.corpName != ''">
|
|
|
|
|
+ AND BCD.cname like concat('%', #{detailsVo.corpName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="detailsVo.brand != null and detailsVo.brand != ''">
|
|
|
|
|
+ AND BGD.Brand like concat('%', #{detailsVo.brand}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="detailsVo.salesName != null and detailsVo.salesName != ''">
|
|
|
|
|
+ AND BO.Sales_name like concat('%', #{detailsVo.salesName}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="detailsVo.beginCreateTime !=null and detailsVo.beginCreateTime != ''">
|
|
|
|
|
+ and BO.create_time >= #{detailsVo.beginCreateTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="detailsVo.endCreateTime !=null and detailsVo.endCreateTime != ''">
|
|
|
|
|
+ and BO.create_time <= #{detailsVo.endCreateTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
<select id="monthSales" resultType="BigDecimal">
|
|
<select id="monthSales" resultType="BigDecimal">
|
|
|
SELECT
|
|
SELECT
|
|
|
ROUND( IFNULL( SUM( bi.amount * bo.exchange_rate ), 0 ), 2 ) AS a
|
|
ROUND( IFNULL( SUM( bi.amount * bo.exchange_rate ), 0 ), 2 ) AS a
|