|
|
@@ -718,37 +718,37 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="selectStatisticsOrderProjectList" resultType="com.goafanti.order.bo.OutOrderProject">
|
|
|
- SELECT a.order_no as orderNo, a.order_type orderType,a.sales_type as salesType,b.service_type AS serviceType,
|
|
|
- a.liquidation_status as liquidationStatus,b2.big_customer as bigCustomer, b.dun_node_content as dunNodeContent,
|
|
|
- b.project_type as projectType, a.total_amount as totalAmount,a.approval ,a.sign_time as signTime,
|
|
|
- a.create_time as createTime,b.buyer_name as buyerName,a.contract_no as contractNo, d2.cname htlx,
|
|
|
+ SELECT a.order_no as orderNo, a.order_type orderType,a.sales_type as salesType, b.service_type AS serviceType,
|
|
|
+ a.liquidation_status as liquidationStatus,b2.big_customer as bigCustomer,b.project_type as projectType,
|
|
|
+ a.total_amount as totalAmount,a.approval ,a.sign_time as signTime,a.create_time as createTime,
|
|
|
+ b.buyer_name as buyerName,a.contract_no as contractNo, c.cname htlx,b.province_name province ,b.dep_name depName,
|
|
|
b.order_receivables orderReceivables,a.refund_amount refundAmount,a.settlement_amount as settlementAmount,
|
|
|
b.invoice_amount as invicueAmount, b.cost_amount as costAmount,b.payment_amount as paymentAmount,
|
|
|
- b.finance_name as financeName,b.salesman_name as salesmanName, e.commodity_name as commodityName,ttm.service_year as serviceYear,
|
|
|
- ttm.service_life as serviceLife,ttm.year_sum as yearSum,e.task_distribution_time as taskDistributionTime ,e.commodity_quantity as commodityQuantity,
|
|
|
+ b.finance_name as financeName,b.salesman_name as salesmanName,
|
|
|
+ e.commodity_name as commodityName,ttm.service_year as serviceYear,ttm.service_life as serviceLife,ttm.year_sum as yearSum,
|
|
|
+ e.task_distribution_time as taskDistributionTime ,e.commodity_quantity as commodityQuantity,
|
|
|
e3.cost_amount as costAmount,e.project_status as projectStatus,e.task_start_time as taskStartTime,e.task_end_time as taskEndTime,
|
|
|
- e.receiver_name as receiverName ,'技术组' jsz,t1.cb restatement,a.order_status orderStatus,e.satisfaction_degree satisfactionDegree,
|
|
|
- e.task_comment taskComment,'核算比例' hsbl,a.order_status orderStatus,t1.counts changeType,t1.tdtk refundType,a3.name depName,a4.name as province
|
|
|
- from t_order_new a left join t_order_mid b on a.order_no =b.order_no
|
|
|
- left join admin a2 on a.salesman_id=a2.id left join department a3 on a2.department_id=a3.id
|
|
|
- left join district_glossory a4 on a3.province=a4.id left join user_mid b2 on a.buyer_id=b2.uid
|
|
|
+ e.receiver_name as receiverName ,'技术组' jsz,a.order_status orderStatus,e.satisfaction_degree satisfactionDegree,
|
|
|
+ e.task_comment taskComment,'核算比例' hsbl,a.order_status orderStatus,
|
|
|
+ b.change_count changeCount, b.restatement_count restatementCount,b.refund_count refundCount
|
|
|
+ from t_order_new a
|
|
|
+ left join t_order_mid b on a.order_no =b.order_no
|
|
|
left join t_order_task c on a.order_no =c.order_no and c.main =1
|
|
|
- left join business_project d on c.commodity_id =d.id left join business_category d2 on d.cid =d2.id
|
|
|
+ left join user_mid b2 on a.buyer_id=b2.uid
|
|
|
left join t_order_task e on a.order_no =e.order_no and e.split_status in (0,2)
|
|
|
- left join admin e2 on e.task_receiver=e2.id left join t_task_mid e3 on e.id=e3.tid
|
|
|
+ left join t_task_mid e3 on e.id=e3.tid
|
|
|
left join t_task_member ttm on e.id =ttm.tid
|
|
|
- left join (SELECT order_no ,count(*)counts,sum(if(`type`=0,1,0))tdtk,sum(if(`type`=4,1,0))cb
|
|
|
- from new_order_change group by order_no ) t1 on a.order_no =t1.order_no
|
|
|
+ <if test="dunType !=null">
|
|
|
+ left join new_order_dun nod on e.id=nod.tid
|
|
|
+ </if>
|
|
|
+ where a.process_status >6 and a.delete_sign in (0,2)
|
|
|
<include refid="selectStatisticsOrderProjectSql"/>
|
|
|
<if test="page_sql!=null">
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
</select>
|
|
|
<sql id="selectStatisticsOrderProjectSql">
|
|
|
- <if test="dunType !=null">
|
|
|
- left join new_order_dun nod on e.id=nod.tid
|
|
|
- </if>
|
|
|
- where a.process_status >6 and a.delete_sign in (0,2)
|
|
|
+
|
|
|
<if test="orderNo !=null">
|
|
|
and a.order_no like CONCAT('%',#{orderNo},'%')
|
|
|
</if>
|
|
|
@@ -884,16 +884,24 @@
|
|
|
</sql>
|
|
|
<select id="selectStatisticsOrderProjectCount" resultType="java.lang.Integer">
|
|
|
SELECT count(*)
|
|
|
- from t_order_new a left join t_order_mid b on a.order_no =b.order_no
|
|
|
- left join admin a2 on a.salesman_id=a2.id left join department a3 on a2.department_id=a3.id
|
|
|
- left join district_glossory a4 on a3.province=a4.id left join user_mid b2 on a.buyer_id=b2.uid
|
|
|
+ from t_order_new a
|
|
|
+ left join t_order_mid b on a.order_no =b.order_no
|
|
|
+ left join t_order_task e on a.order_no =e.order_no and e.split_status in (0,2)
|
|
|
+ left join user_mid b2 on a.buyer_id=b2.uid
|
|
|
+ left join admin a2 on a.salesman_id=a2.id
|
|
|
+ left join department a3 on a2.department_id=a3.id
|
|
|
+ left join district_glossory a4 on a3.province=a4.id
|
|
|
left join t_order_task c on a.order_no =c.order_no and c.main =1
|
|
|
left join business_project d on c.commodity_id =d.id left join business_category d2 on d.cid =d2.id
|
|
|
- left join t_order_task e on a.order_no =e.order_no and e.split_status in (0,2)
|
|
|
- left join admin e2 on e.task_receiver=e2.id left join t_task_mid e3 on e.id=e3.tid
|
|
|
- left join t_task_member ttm on e.id =ttm.tid
|
|
|
- left join (SELECT order_no ,count(*)counts,sum(if(`type`=0,1,0))tdtk,sum(if(`type`=4,1,0))cb
|
|
|
- from new_order_change group by order_no ) t1 on a.order_no =t1.order_no
|
|
|
+ left join admin e2 on e.task_receiver=e2.id
|
|
|
+ <if test="refundType !=null or changeType !=null">
|
|
|
+ left join (SELECT order_no ,count(*)counts,sum(if(`type`=0,1,0))tdtk,sum(if(`type`=4,1,0))cb
|
|
|
+ from new_order_change group by order_no ) t1 on a.order_no =t1.order_no
|
|
|
+ </if>
|
|
|
+ <if test="dunType !=null">
|
|
|
+ left join new_order_dun nod on e.id=nod.tid
|
|
|
+ </if>
|
|
|
+ where a.process_status >1 and a.delete_sign in (0,2)
|
|
|
<include refid="selectStatisticsOrderProjectSql"/>
|
|
|
</select>
|
|
|
</mapper>
|