|
|
@@ -321,7 +321,7 @@
|
|
|
select o.order_type, date_format(DATE_ADD(NOW(),INTERVAL -1 MONTH),'%Y%m'),sum(o.total_amount), sum(o.proof_count), o.salesman_id
|
|
|
from t_order_new o
|
|
|
where 1 = 1
|
|
|
- and o.proof_status = 1
|
|
|
+ and o.proof_status = 1 and o.delete_sign = 0 and o.order_status <> 7
|
|
|
and PERIOD_DIFF( date_format( now( ) , '%Y%m' ) , date_format( o.sign_time, '%Y%m' ) ) = 1
|
|
|
group by o.salesman_id , o.order_type
|
|
|
</insert>
|
|
|
@@ -334,7 +334,8 @@
|
|
|
</insert>
|
|
|
<!-- 查看订单统计数据 -->
|
|
|
<select id="getOrderReportDataList" parameterType="Map" resultType="com.goafanti.order.bo.OrderReportBo">
|
|
|
- select @rowno:= @rowno+1 as id, d.name as deptName, a.name as saleName, m.`type`, sum(proof_count) as proofCount, sum(amount) as amount
|
|
|
+ select @rowno:= @rowno+1 as id, d.name as deptName, a.name as saleName, m.`type`, sum(proof_count) as proofCount, sum(amount) as amount,
|
|
|
+ m.id as mid
|
|
|
from t_order_month_report m
|
|
|
left join admin a on m.salemans_id = a.id
|
|
|
left join department d on d.id = a.department_id
|
|
|
@@ -358,6 +359,7 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="getOrderReportDataCount" parameterType="Map" resultType="java.lang.Integer">
|
|
|
+ select count(*) from (
|
|
|
select count(*)
|
|
|
from t_order_month_report m
|
|
|
left join admin a on m.salemans_id = a.id
|
|
|
@@ -374,6 +376,9 @@
|
|
|
<bind name="n" value=" '%' + r.saleName + '%'"/>
|
|
|
and a.name like #{n,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ group by
|
|
|
+ a.department_id, a.id, m.`type`
|
|
|
+ )ff
|
|
|
</select>
|
|
|
<!-- 导出月统计 -->
|
|
|
<select id="exportMonthData" parameterType="com.goafanti.order.bo.OrderReportBo" resultType="com.goafanti.order.bo.OrderReportBo">
|
|
|
@@ -466,7 +471,7 @@
|
|
|
select order_type, date_format( sign_time , '%Y%m' ), sum(total_amount) as amount, sum(proof_count) as proof_count, salesman_id
|
|
|
from t_order_new
|
|
|
where
|
|
|
- proof_status = 1
|
|
|
+ proof_status = 1 and o.delete_sign = 0 and o.order_status <> 7
|
|
|
and salesman_id = #{salesmanId,jdbcType=VARCHAR}
|
|
|
and order_type = #{orderType,jdbcType=INTEGER}
|
|
|
and date_format( sign_time , '%Y%m' ) = date_format( #{signTime,jdbcType=DATE}, '%Y%m' )
|
|
|
@@ -477,7 +482,7 @@
|
|
|
select o.order_type, #{month,jdbcType=INTEGER},sum(o.total_amount), sum(o.proof_count), o.salesman_id
|
|
|
from t_order_new o
|
|
|
where 1 = 1
|
|
|
- and o.proof_status = 1
|
|
|
+ and o.proof_status = 1 o.delete_sign = 0 and o.order_status <> 7
|
|
|
and date_format( o.sign_time, '%Y%m' ) = #{month,jdbcType=INTEGER}
|
|
|
group by o.salesman_id , o.order_type
|
|
|
</insert>
|