|
|
@@ -716,12 +716,18 @@
|
|
|
</select>
|
|
|
|
|
|
<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 ,
|
|
|
+ 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, a.approval,
|
|
|
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 =1 and a.approval =1
|
|
|
+ on a.order_no=d.order_no where a.status in(1,2)
|
|
|
+ <if test="approval ==null">
|
|
|
+ and a.approval in(1,2)
|
|
|
+ </if>
|
|
|
+ <if test="approval != null">
|
|
|
+ and a.approval = #{approval,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
<if test="type !=null">
|
|
|
and a.type= #{type,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -746,7 +752,13 @@
|
|
|
<select id="approvalOrderInvoiceCount" resultType="java.lang.Integer">
|
|
|
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 =1 and a.approval =1
|
|
|
+ where a.status in(1,2)
|
|
|
+ <if test="approval ==null">
|
|
|
+ and a.approval in(1,2)
|
|
|
+ </if>
|
|
|
+ <if test="approval != null">
|
|
|
+ and a.approval = #{approval,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
<if test="type !=null">
|
|
|
and a.type= #{type,jdbcType=INTEGER}
|
|
|
</if>
|