|
|
@@ -850,7 +850,37 @@ ORDER BY
|
|
|
</where>
|
|
|
order by BO.create_time desc
|
|
|
</select>
|
|
|
-
|
|
|
+ <select id="selSalesProfit" resultType="org.springblade.purchase.sales.vo.SalesDetailsVo">
|
|
|
+ SELECT
|
|
|
+ BO.id AS orderId,
|
|
|
+ BO.order_no as orderNo,
|
|
|
+ BGD.Brand AS brand,
|
|
|
+ BCD.cname AS corpName,
|
|
|
+ BO.create_time AS careteTime,
|
|
|
+ BO.charge_member AS salesName,
|
|
|
+ BO.create_time AS careteTime,
|
|
|
+ BOI.order_quantity AS quantity
|
|
|
+ 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
|
|
|
+ AND BO.bill_type = 'XS'
|
|
|
+ AND BO.tenant_id = #{detailsVo.tenantId}
|
|
|
+ <if test="detailsVo.brand != null and detailsVo.brand != ''">
|
|
|
+ AND BGD.Brand like concat('%', #{detailsVo.brand}, '%')
|
|
|
+ </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>
|
|
|
+ order by BO.create_time desc
|
|
|
+ </select>
|
|
|
<update id="updateOrderMessage" parameterType="org.springblade.purchase.sales.entity.Order">
|
|
|
update business_order
|
|
|
<trim prefix="SET" suffixOverrides=",">
|