|
|
@@ -366,8 +366,17 @@
|
|
|
select a.order_no orderNo,a.contract_no contractNo,b.buyer_name buyerName,b.salesman_name salesmanName,b.dep_name depName,
|
|
|
a.total_amount totalAmount ,a.settlement_amount settlementAmount ,b.order_receivables orderReceivables,b.legal_affairs legalAffairs,
|
|
|
b.order_arrears orderArrears,b.dun_start_time dunStartTime,date_format(b.dun_start_time,'%Y-%m-%d %H:%i:%S')dunStartTimes
|
|
|
+ <if test="type==1 or type==2 or type==3">
|
|
|
+ ,c.operation_time operationTime,c.`type`
|
|
|
+ </if>
|
|
|
from t_order_new a left join t_order_mid b on a.order_no =b.order_no
|
|
|
- where b.order_receivables >0
|
|
|
+ <if test="type==1 or type==2 or type==3">
|
|
|
+ left join t_order_legal_affairs c on c.order_no =b.order_no
|
|
|
+ where b.legal_affairs =1
|
|
|
+ </if>
|
|
|
+ <if test="type==0">
|
|
|
+ where b.order_receivables >0
|
|
|
+ </if>
|
|
|
<if test="userName != null">
|
|
|
and b.buyer_name like concat('%',#{userName},'%')
|
|
|
</if>
|
|
|
@@ -383,8 +392,15 @@
|
|
|
<if test="depId != null">
|
|
|
and a.order_dep = #{depId}
|
|
|
</if>
|
|
|
- <if test="startTime != null and endTime != null">
|
|
|
- and b.dun_start_time between #{startTime} and #{endTime}
|
|
|
+ <if test="type==0">
|
|
|
+ <if test="startTime != null and endTime != null">
|
|
|
+ and b.dun_start_time between #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="type==1 or type==2 or type==3">
|
|
|
+ <if test="startTime != null and endTime != null">
|
|
|
+ and c.operation_time between #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
</if>
|
|
|
order by b.dun_start_time desc
|
|
|
<if test="page_sql != null">
|
|
|
@@ -394,7 +410,13 @@
|
|
|
<select id="legalAffairsOrderCount" resultType="integer">
|
|
|
select count(*)
|
|
|
from t_order_new a left join t_order_mid b on a.order_no =b.order_no
|
|
|
- where b.order_receivables >0
|
|
|
+ <if test="type==1 or type==2 or type==3">
|
|
|
+ left join t_order_legal_affairs c on c.order_no =b.order_no
|
|
|
+ where b.legal_affairs =1
|
|
|
+ </if>
|
|
|
+ <if test="type==0">
|
|
|
+ where b.order_receivables >0
|
|
|
+ </if>
|
|
|
<if test="userName != null">
|
|
|
and b.buyer_name like concat('%',#{userName},'%')
|
|
|
</if>
|
|
|
@@ -410,8 +432,15 @@
|
|
|
<if test="depId != null">
|
|
|
and a.order_dep = #{depId}
|
|
|
</if>
|
|
|
- <if test="startTime != null and endTime != null">
|
|
|
- and b.dun_start_time between #{startTime} and #{endTime}
|
|
|
+ <if test="type==0">
|
|
|
+ <if test="startTime != null and endTime != null">
|
|
|
+ and b.dun_start_time between #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="type==1 or type==2 or type==3">
|
|
|
+ <if test="startTime != null and endTime != null">
|
|
|
+ and c.operation_time between #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
</if>
|
|
|
</select>
|
|
|
<update id="updateByList">
|