|
|
@@ -927,7 +927,7 @@
|
|
|
,liquidation_status,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName,e.name as outsourceName
|
|
|
from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
|
|
|
left join department d on o.order_dep=d.id left join (select order_no,max(name)as name from outsource_organization group by order_no) e
|
|
|
- on o.order_no=e.order_no left join t_order_outsource f on f.order_no=o.order_no where delete_sign = 0
|
|
|
+ on o.order_no=e.order_no left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1
|
|
|
and approval in (0,2)
|
|
|
<if test="o.outsource != null">
|
|
|
and o.outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
@@ -972,7 +972,7 @@
|
|
|
</select>
|
|
|
<select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
|
|
|
select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
|
|
|
- left join t_order_outsource f on f.order_no=o.order_no where delete_sign = 0 and approval in (0,2)
|
|
|
+ left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1 and approval in (0,2)
|
|
|
<if test="o.outsource != null">
|
|
|
and o.outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -1089,7 +1089,7 @@
|
|
|
on o.order_dep=d.id left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id left join
|
|
|
(select sum(transaction_amount) as amount ,order_no from t_order_bill_new group by order_no ) b on b.order_no = o.order_no
|
|
|
left join (select order_no,max(name) as name from outsource_organization group by order_no) e
|
|
|
- on o.order_no=e.order_no where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
+ on o.order_no=e.order_no where delete_sign != 1 and outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
<if test="o.processStatus == 3">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -1136,7 +1136,7 @@
|
|
|
left join admin a on o.salesman_id = a.id
|
|
|
left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
|
|
|
group by order_no ) b on b.order_no = o.order_no
|
|
|
- where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
+ where delete_sign != 1 and outsource=#{o.outsource,jdbcType=INTEGER}
|
|
|
<if test="o.processStatus == 3">
|
|
|
and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -1202,7 +1202,7 @@
|
|
|
where super_id is null ) e on e.order_no=a.order_no
|
|
|
left join admin f on e.task_receiver=f.id
|
|
|
</if>
|
|
|
- where a.delete_sign != 1
|
|
|
+ where a.delete_sign !=1
|
|
|
<if test="outsource != null">
|
|
|
and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -1289,7 +1289,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
where super_id is null ) e on e.order_no=a.order_no
|
|
|
left join admin f on e.task_receiver=f.id
|
|
|
</if>
|
|
|
- where a.delete_sign = 0
|
|
|
+ where a.delete_sign != 1
|
|
|
<if test="outsource != null">
|
|
|
and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -1356,7 +1356,7 @@ where super_id is null ) e on e.order_no=a.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
|
|
|
+ where a.start_time is not null and b.delete_sign != 1
|
|
|
<if test="name != null">
|
|
|
and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
</if>
|
|
|
@@ -1387,7 +1387,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
count(*)
|
|
|
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
|
|
|
- where a.start_time is not null and b.delete_sign = 0
|
|
|
+ where a.start_time is not null and b.delete_sign != 1
|
|
|
<if test="name != null">
|
|
|
and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
</if>
|
|
|
@@ -1409,15 +1409,17 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
</select>
|
|
|
|
|
|
<select id="getOrderNewDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
|
|
|
- select
|
|
|
- a.order_no as orderNo, a.order_type as orderType, a.creater, a.create_time as createTime,a.update_time as updateTime, a.buyer_id as buyerId, a.first_amount as firstAmount,
|
|
|
- a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus, a.liquidation_status as liquidationStatus, a.process_status as processStatus,
|
|
|
- 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,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,a.order_dep as orderDep,
|
|
|
- g.location_province as locationProvince,g.location_city as locationCity,g.location_area locationArea,g.postal_address postalAddress,outsource
|
|
|
+ select
|
|
|
+ a.order_no as orderNo, a.order_type as orderType, a.creater, a.create_time as createTime,a.update_time as updateTime, a.buyer_id as buyerId,
|
|
|
+ a.first_amount as firstAmount,a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus,
|
|
|
+ a.liquidation_status as liquidationStatus, a.process_status as processStatus, 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,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,a.order_dep as orderDep, g.location_province as locationProvince,
|
|
|
+ g.location_city as locationCity,g.location_area locationArea,g.postal_address postalAddress,outsource,a.primary_order primaryOrder,a.additional_order additionalOrder
|
|
|
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 a.order_dep=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
|
|
|
@@ -1431,7 +1433,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
a.reason,b.liquidation_status as liquidationStatus
|
|
|
from t_order_refund a left join t_order_new b on a.order_no=b.order_no
|
|
|
left join `user` c on b.buyer_id=c.id
|
|
|
- where b.delete_sign = 0
|
|
|
+ where b.delete_sign != 1
|
|
|
<if test="name != null">
|
|
|
and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
</if>
|
|
|
@@ -1455,7 +1457,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
count(*)
|
|
|
from t_order_refund a left join t_order_new b on a.order_no=b.order_no
|
|
|
left join `user` c on b.buyer_id=c.id
|
|
|
- where b.delete_sign = 0
|
|
|
+ where b.delete_sign != 1
|
|
|
<if test="name != null">
|
|
|
and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
</if>
|