|
|
@@ -446,16 +446,29 @@
|
|
|
select id, order_no orderNo, refund_status refundStatus, date_format(create_time,'%Y-%m-%d %H:%i:%S') createTimes , remarks,
|
|
|
date_format(audit_time,'%Y-%m-%d %H:%i:%S') auditTimes,attachment_url attachmentUrl, picture_url pictureUrl, amount,
|
|
|
company_name companyName ,unit_price unitPrice,unit_number unitNumber,outsource_remarks outsourceRemarks from t_order_outsource
|
|
|
- where order_no = #{orderNo}
|
|
|
+ where 1=1
|
|
|
+ <if test="orderNo != null">
|
|
|
+ and order_no = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="tid != null">
|
|
|
+ and tid = #{tid}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="orderOutsourceList" resultType="com.goafanti.order.bo.OrderOutsourceBo">
|
|
|
select a.order_no orderNo,b.contract_no contractNo,date_format(b.create_time,'%Y-%m-%d %H:%i:%S') createTime,a.type,a.tid,
|
|
|
date_format(b.sign_time,'%Y-%m-%d') signTime,c.nickname userName, e.name depName,b.total_amount totalAmount,
|
|
|
b.liquidation_status liquidationStatus,a.refund_status refundStatus,d.name adminName,g.name financeName
|
|
|
+ <if test="type == 1">
|
|
|
+ ,bc.cname,pa.name pname
|
|
|
+ </if>
|
|
|
from t_order_outsource a
|
|
|
left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
|
|
|
left join admin d on b.salesman_id=d.id left join department e on d.department_id=e.id
|
|
|
left join department f on b.order_dep=f.id left join admin g on f.finance_id=g.id
|
|
|
+ <if test="type == 1">
|
|
|
+ left join t_order_task h on a.tid=h.id left join business_project bp on h.commodity_id=bp.id
|
|
|
+ left join business_category bc on bp.cid=bc.id left join admin pa on h.task_receiver=pa.id
|
|
|
+ </if>
|
|
|
where b.approval in (0,2)
|
|
|
<if test="type != null">
|
|
|
and a.type = #{type}
|