|
|
@@ -641,11 +641,14 @@
|
|
|
</select>
|
|
|
<select id="financeOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
|
|
|
select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
|
|
|
- ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%I:%S')as createTime ,a.status,
|
|
|
+ ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,a.status,
|
|
|
b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
|
|
|
left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
|
|
|
left join (select order_no,sum(amount)as sumAmount from t_order_invoice where status =2 group by order_no) d
|
|
|
- on a.order_no=d.order_no where a.status in (1,2) and a.approval in (0,2)
|
|
|
+ on a.order_no=d.order_no where a.status in (1,2) and a.approval in (0,2)
|
|
|
+ <if test="type !=null">
|
|
|
+ and a.`type`= #{type,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
<if test="financeId !=null">
|
|
|
and b.finance_id= #{financeId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -658,7 +661,7 @@
|
|
|
<if test="orderDep !=null">
|
|
|
and b.order_dep= #{orderDep,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- order by a.create_time desc
|
|
|
+ order by a.status ,a.create_time desc
|
|
|
<if test="page_sql!=null">
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
@@ -668,7 +671,10 @@
|
|
|
select count(*) from t_order_invoice a
|
|
|
left join t_order_new b on a.order_no=b.order_no
|
|
|
left join admin c on b.salesman_id=c.id
|
|
|
- where a.status in (1,2)
|
|
|
+ where a.status in (1,2) and a.approval in (0,2)
|
|
|
+ <if test="type !=null">
|
|
|
+ and a.`type`= #{type,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
<if test="financeId !=null">
|
|
|
and b.finance_id= #{financeId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -684,7 +690,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="salesmanOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
|
|
|
- select id ,order_no as orderNo,amount,date_format(create_time,'%Y-%m-%d %H:%I:%S') as createTime,
|
|
|
+ select id ,order_no as orderNo,amount,date_format(create_time,'%Y-%m-%d %H:%i:%S') as createTime,
|
|
|
reject_reason as rejectReason,status from t_order_invoice
|
|
|
where status !=4
|
|
|
<if test="orderNo !=null">
|
|
|
@@ -705,7 +711,7 @@
|
|
|
|
|
|
<select id="approvalOrderInvoiceList" resultType="com.goafanti.order.bo.TOrderInvoiceBo">
|
|
|
select a.id,a.unit_name as unitName,a.order_no as orderNo,c.name,b.project_status as projectStatus,a.amount,
|
|
|
- ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%I:%S')as createTime ,
|
|
|
+ ifnull(d.sumAmount,0) as sumAmount, date_format(a.create_time,'%Y-%m-%d %H:%i:%S')as createTime ,
|
|
|
b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a
|
|
|
left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
|
|
|
left join (select order_no,sum(amount)as sumAmount from t_order_invoice where status =2 group by order_no) d
|
|
|
@@ -750,7 +756,7 @@
|
|
|
select
|
|
|
a.id ,a.order_no as orderNo,a.`type`,a.status,a.reject_reason as rejectReason,a.remarks,a.invoice_type as invoiceType,a.unit_name as unitName,a.tax_number as taxNumber,a.amount,a.banks,a.content,
|
|
|
a.unit_address as unitAddress,a.invoice_remarks as invoiceRemarks,a.unit_mobile as unitMobile,a.voucher_url as voucherUrl ,a.post,a.addressee,a.addressee_area as addresseeArea,a.addressee_city as addresseeCity,
|
|
|
- a.addressee_province as addresseeProvince,a.addressee_mobile,a.reject_reason,a.create_time,a.update_time,a.approval,a.already_amount,b.contract_no as contractNo
|
|
|
+ a.addressee_province as addresseeProvince,a.addressee_mobile as addresseeMobile,a.recipient_address as recipientAddress,a.create_time,a.update_time,a.approval,a.already_amount,b.contract_no as contractNo
|
|
|
from t_order_invoice a left join t_order_new b on a.order_no=b.order_no
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|