|
|
@@ -1839,6 +1839,40 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
from t_order_new where delete_sign in (0,2) and buyer_id = #{uid}
|
|
|
order by create_time desc
|
|
|
</select>
|
|
|
+ <select id="orderSalesSourceAmount" resultType="com.goafanti.order.bo.outStatistics.OutOrderSalesSourceAmount">
|
|
|
+ select y.province,dg.name ,y.total_amount totalAmount,y.counts,y.dhxkf,
|
|
|
+ y.dhxkf/y.total_amount dhxkfl, y.dhzdzy,y.dhzdzy/y.total_amount dhzdzyl,y.wl,y.wl/y.total_amount wll,
|
|
|
+ y.qd,y.qd/y.total_amount qdl,y.zjs,y.zjs/y.total_amount zjsl,y.qt,y.qt/y.total_amount qtl,
|
|
|
+ y.gxfg,y.gxfg/y.total_amount gxfgl,y.qtfg,y.qtfg/y.total_amount qtfgl
|
|
|
+ from (select x.province,sum(x.total_amount)total_amount,sum(x.counts)counts,
|
|
|
+ sum(x.dhxkf)dhxkf,sum(x.dhzdzy)dhzdzy,sum(x.wl)wl,sum(x.qd)qd, sum(x.zjs)zjs, sum(x.qt)qt,
|
|
|
+ sum(x.gxfg)gxfg, sum(x.qtfg)qtfg
|
|
|
+ from ( select b.province ,1 counts,a.total_amount,a.sales_type ,
|
|
|
+ case a.sales_type when 0 then a.total_amount else 0 end dhxkf,
|
|
|
+ case a.sales_type when 1 then a.total_amount else 0 end dhzdzy,
|
|
|
+ case a.sales_type when 2 then a.total_amount else 0 end wl,
|
|
|
+ case a.sales_type when 3 then a.total_amount else 0 end qd,
|
|
|
+ case a.sales_type when 4 then a.total_amount else 0 end zjs,
|
|
|
+ case a.sales_type when 5 then a.total_amount else 0 end qt,
|
|
|
+ case a.sales_type when 6 then a.total_amount else 0 end gxfg,
|
|
|
+ case a.sales_type when 7 then a.total_amount else 0 end qtfg
|
|
|
+ from t_order_new a left join department b on a.order_dep =b.id
|
|
|
+ where a.delete_sign in (0,2) and a.process_status > 0 and a.approval in (0,1,2)
|
|
|
+ <if test=" startDate !=null and endDate != null">
|
|
|
+ and a.create_time between #{startDate} and #{endDate}
|
|
|
+ </if>
|
|
|
+ <if test=" deps !=null">
|
|
|
+ and a.order_dep in
|
|
|
+ <foreach close=")" collection="listDep" item="depId" open="(" separator=",">
|
|
|
+ #{depId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test=" province !=null">
|
|
|
+ and b.province = #{province}
|
|
|
+ </if>
|
|
|
+ )x group by x.province)y left join district_glossory dg on y.province=dg.id
|
|
|
+ order by y.total_amount desc
|
|
|
+ </select>
|
|
|
<select id="orderSalesSource" resultType="com.goafanti.order.bo.OutOrderSalesSource">
|
|
|
select y.province,dg.name ,y.total_amount totalAmount,y.counts,y.dhxkf,y.dhxkf/y.counts dhxkfl,
|
|
|
y.dhzdzy,y.dhzdzy/y.counts dhzdzyl,y.wl,y.wl/y.counts wll,
|
|
|
@@ -1871,12 +1905,7 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
and b.province = #{province}
|
|
|
</if>
|
|
|
)x group by x.province)y left join district_glossory dg on y.province=dg.id
|
|
|
- <if test=" sort ==0">
|
|
|
- order by y.total_amount desc
|
|
|
- </if>
|
|
|
- <if test=" sort ==1">
|
|
|
- order by y.counts desc
|
|
|
- </if>
|
|
|
+ order by y.counts desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectstatisticsOrderListPage" resultType="com.goafanti.order.bo.TOrderNewBo">
|