|
|
@@ -596,14 +596,23 @@ from new_order_change a where 1=1
|
|
|
order by a.create_time desc
|
|
|
limit 1
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectById" resultType="com.goafanti.order.bo.NewOrderChangeBo">
|
|
|
+ select a.id,a.order_no orderNo,a.process_state processState,a.status,a.`type`,date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes, a.remarks,
|
|
|
+a.voucher_url voucherUrl,a.total_amount totalAmount,a.settlement_amount settlementAmount,a.change_amount changeAmount,a.applicant,a.dep_name depName,
|
|
|
+a.project_state projectState,a.zxs_cost zxsCost, a.zxs_remarks zxsRemarks,date_format(a.payment_time,'%Y-%m-%d')paymentTimes,
|
|
|
+a.payment_amount paymentAmount,date_format(a. invoice_time,'%Y-%m-%d') invoiceTimes,a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
|
|
|
+a.cw_cost cwCost,a.refundable_amount refundableAmount,a.cw_remarks cwRemarks
|
|
|
+from new_order_change a where 1=1 and a.id= #{id}
|
|
|
+ </select>
|
|
|
<select id="checkOderNo" resultType="java.lang.Integer">
|
|
|
select count(*) from new_order_change
|
|
|
where status != 4 and order_no= #{orderNo}
|
|
|
</select>
|
|
|
<select id="selectOrderChangeList" resultType="com.goafanti.order.bo.NewOderCahngeListBo">
|
|
|
- select a.order_no orderNo, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes,c.nickname,b.order_type orderType,
|
|
|
+ select a.id,a.order_no orderNo, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes,c.nickname,b.order_type orderType,
|
|
|
date_format(b.create_time,'%Y-%m-%d %H:%i:%S')establishTimes, b.order_status orderStatus,b.total_amount totalAmount,
|
|
|
- b.settlement_amount settlementAmount,(b.total_amount-b.settlement_amount) arrears,d.name salesmanName,e.name depName,
|
|
|
+ b.settlement_amount settlementAmount,(b.total_amount-b.settlement_amount) arrears,d.name salesmanName,e.name depName,a.`type` type,
|
|
|
a.process_state processState from new_order_change 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 b.order_dep=e.id
|
|
|
<if test="processState==2 or processState==3 ">
|
|
|
@@ -621,7 +630,7 @@ from new_order_change a where 1=1
|
|
|
</foreach>
|
|
|
</if>
|
|
|
<if test="processState==2 or processState==3 ">
|
|
|
- and f.aid=#{aid}
|
|
|
+ and f.aid=#{aid} and process_state >= 2
|
|
|
</if>
|
|
|
<if test="processState==5">
|
|
|
and b.finance_id =#{aid}
|