Commit 811de315 authored by zhengyi's avatar zhengyi

订单统计sql修正

parent 63e5f9e1
......@@ -6861,7 +6861,7 @@
op.`create_time` between #{query.beginPickUpTime} and #{query.endPickUpTime})
</if>
<if test="query.beginWarehouseInTime != null and query.endWarehouseInTime != null ">
AND o.order_id in(select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and
AND o.order_id in (select distinct wi.order_id from ecw_order_warehouse_in wi where wi.deleted = 0 and
wi.`update_time` between #{query.beginWarehouseInTime} and #{query.endWarehouseInTime})
</if>
<if test="query.salesmanId != null ">
......@@ -7405,10 +7405,10 @@
left join ecw_order_consignee nee on nee.order_id = o.order_id and nee.deleted = 0
left join ecw_channel channel on channel.channel_id = o.channel_id
<if test="query.beginWarehouseInTime != null and query.endWarehouseInTime != null ">
left join ecw_order_warehouse_in wi ON wi.order_id = o.order_id and wi.deleted = 0
left join ecw_order_warehouse_in wi ON wi.order_item_id = it.order_item_id and wi.deleted = 0
</if>
<if test="query.beginRucangTime != null and query.endRucangTime != null ">
left join ecw_order_warehouse_in wi ON wi.order_id = o.order_id and wi.deleted = 0
left join ecw_order_warehouse_in wi ON wi.order_item_id = it.order_item_id and wi.deleted = 0
</if>
where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10
<if test = "query.deptId != null ">
......@@ -7466,22 +7466,22 @@
left join ecw_order_consignee nee on nee.order_id = o.order_id
left join ecw_channel channel on channel.channel_id = o.channel_id
<if test="query.beginWarehouseInTime != null and query.endWarehouseInTime != null ">
left join ecw_order_warehouse_in wi ON wi.order_id = o.order_id and wi.deleted = 0
left join ecw_order_warehouse_in wi ON wi.order_item_id = it.order_item_id and wi.deleted = 0
</if>
<if test="query.beginRucangTime != null and query.endRucangTime != null ">
left join ecw_order_warehouse_in wi ON wi.order_id = o.order_id and wi.deleted = 0
left join ecw_order_warehouse_in wi ON wi.order_item_id = it.order_item_id and wi.deleted = 0
</if>
where o.deleted = 0 and o.in_warehouse_state != 211 and o.in_warehouse_state != 208 and o.status != 10
<if test = "query.deptId != null ">
AND o.dept_id = #{query.deptId}
</if>
<if test = "query.deptIdList != null and query.deptIdList.size() > 0">
AND (o.dept_id IN
<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>
or
(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN
<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>)
</if>
<if test = "query.deptId != null ">
AND o.dept_id = #{query.deptId}
</if>
<if test = "query.deptIdList != null and query.deptIdList.size() > 0">
AND (o.dept_id IN
<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>
or
(SELECT u.dept_id FROM system_user u WHERE u.id = o.creator) IN
<foreach item='deptId' collection='query.deptIdList' open='(' close=')' separator=','> #{deptId} </foreach>)
</if>
<include refid="orderQuery"/>
</select>
<select id="statisticsWarehouseIn" resultType="cn.iocoder.yudao.module.order.vo.order.StatisticsOrderVO">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment