|
|
@@ -1094,7 +1094,7 @@
|
|
|
select
|
|
|
a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,
|
|
|
b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,a.order_status as orderStatus,
|
|
|
- a.liquidation_status as liquidationStatus,a.approval,c.name as salesmanName,d.name as financeName
|
|
|
+ a.liquidation_status as liquidationStatus,a.approval,c.name as salesmanName,dep.name as depName,d.name as financeName
|
|
|
<if test="specially == 2">
|
|
|
,f.name as initiateName ,e.reason ,date_format(e.create_time,'%Y-%m-%d' ) as backDate,e.id as backId
|
|
|
</if>
|
|
|
@@ -1103,6 +1103,7 @@
|
|
|
</if>
|
|
|
from t_order_new a left join `user` b on a.buyer_id=b.id
|
|
|
left join admin c on a.salesman_id=c.id
|
|
|
+ left join department dep on c.department_id=dep.id
|
|
|
left join admin d on a.finance_id=d.id
|
|
|
<if test="specially == 2">
|
|
|
left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
|
|
|
@@ -1133,7 +1134,7 @@
|
|
|
and a.approval = 1 and a.order_status=2
|
|
|
</if>
|
|
|
<if test="specially == 4">
|
|
|
- and a.process_status in (4,5,6)
|
|
|
+ and a.process_status in (4,5,6,99)
|
|
|
and a.order_status not in(5,7)
|
|
|
</if>
|
|
|
<if test="specially == 5">
|
|
|
@@ -1157,6 +1158,9 @@
|
|
|
<if test="orderNo != null">
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ <if test="depId != null">
|
|
|
+ and dep.id = #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
<if test="starTime !=null and endTime !=null">
|
|
|
and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1242,17 +1246,26 @@
|
|
|
c.nickname as userName,b.order_status as orderStatus,b.total_amount as totalAmount,
|
|
|
b.project_status as projectStatus,b.liquidation_status as liquidationStatus,
|
|
|
b.settlement_amount as settlementAmount,d.name as salesmanName,a.dun_subject as dunSubject,
|
|
|
- date_format(a.start_time, '%Y-%m-%d') as startDate
|
|
|
+ date_format(a.start_time, '%Y-%m-%d') as startDate,dep.name as depName,
|
|
|
+ a.money as accountsReceivable,(a.money-b.settlement_amount) as uncollectedAmount
|
|
|
from t_order_dun 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 dep on d.department_id=dep.id
|
|
|
where a.start_time is not null and b.delete_sign = 0
|
|
|
<if test="name != null">
|
|
|
and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
</if>
|
|
|
+ <if test="adminName != null">
|
|
|
+ and d.name like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="orderNo != null">
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ <if test="depId != null">
|
|
|
+ and dep.id= #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
<if test="starTime !=null and endTime !=null">
|
|
|
and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1271,6 +1284,12 @@
|
|
|
<if test="name != null">
|
|
|
and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
</if>
|
|
|
+ <if test="adminName != null">
|
|
|
+ and d.name like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="depId != null">
|
|
|
+ and dep.id= #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
<if test="orderNo != null">
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1286,11 +1305,12 @@
|
|
|
a.project_status as projectStatus, a.approval, a.order_remarks as orderRemarks, a.delete_sign as deleteSign, a.salesman_id as salesmanId, finance_id as financeId, technician_id as technicianId,
|
|
|
a.sign_time as signTime, a.settlement_time as settlementTime, a.contract_no as contractNo, a.contract_type as contractType, a.contacts, a.contact_mobile as contactMobile,
|
|
|
a.legal_person as legalPerson, a.legal_person_tel as legalPersonTel, a.proof_count as proofCount, a.proof_aid as proofAid,contract_picture_url as contractPictureUrl,
|
|
|
- c.name as salesmanName,d.name as financeName,c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName
|
|
|
+ c.name as salesmanName,dep.name as depName,d.name as financeName,c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName
|
|
|
,e.back_status as backStatus,f.name as initiateName,e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate,a.buyer_id as uid
|
|
|
from t_order_new a
|
|
|
left join `user` b on a.buyer_id=b.id
|
|
|
left join admin c on a.salesman_id=c.id
|
|
|
+ left join department dep on c.department_id=dep.id
|
|
|
left join admin d on a.finance_id=d.id
|
|
|
left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
|
|
|
left join admin f on e.initiate=f.id
|