|
|
@@ -1195,21 +1195,18 @@ left join department d on o.order_dep = d.id left join t_order_mid a on o.orde
|
|
|
where order_no = #{_parameter,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
|
|
|
- select
|
|
|
- a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,a.contract_no as contractNo,
|
|
|
+ select a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,a.contract_no as contractNo,
|
|
|
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,dep.name as depName,g.name as financeName
|
|
|
+ a.liquidation_status as liquidationStatus,a.approval,c.salesman_name as salesmanName,dep.name as depName,c.finance_name as financeName,
|
|
|
+ c.invoice_amount invoiceAmount,a.settlement_amount settlementAmount
|
|
|
<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>
|
|
|
<if test="specially == 4">
|
|
|
,f.name as consultantName,a.settlement_amount as settlementAmount
|
|
|
</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
|
|
|
+ from t_order_new a left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
|
|
|
left join department dep on a.order_dep=dep.id
|
|
|
- left join admin g on dep.finance_id=g.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
|
|
|
left join admin f on e.initiate=f.id
|
|
|
@@ -1230,7 +1227,7 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
<if test="specially == 1">
|
|
|
and a.process_status = 1 and a.order_status = 1
|
|
|
<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
|
|
|
- and c.department_id in
|
|
|
+ and a.order_dep in
|
|
|
<foreach close=")" collection="deps" item="deps" open="(" separator=",">
|
|
|
#{deps.id}
|
|
|
</foreach>
|
|
|
@@ -1265,9 +1262,15 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
<if test="name != null">
|
|
|
and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
</if>
|
|
|
- <if test="orderNo != null">
|
|
|
+ <if test="orderNo != null">
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ <if test="contractNo != null">
|
|
|
+ and a.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="liquidationStatus != null">
|
|
|
+ and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
<if test="depId != null">
|
|
|
and dep.id = #{depId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1293,10 +1296,8 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
<select id="selectOrderNewListCount" resultType="java.lang.Integer">
|
|
|
select
|
|
|
count(*)
|
|
|
- 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
|
|
|
+ from t_order_new a left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
|
|
|
left join department dep on a.order_dep=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
|
|
|
left join admin f on e.initiate=f.id
|
|
|
@@ -1354,6 +1355,12 @@ where super_id is null ) e on e.order_no=a.order_no
|
|
|
<if test="orderNo != null">
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
+ <if test="contractNo != null">
|
|
|
+ and a.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="liquidationStatus != null">
|
|
|
+ and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
<if test="depId != null">
|
|
|
and dep.id = #{depId,jdbcType=VARCHAR}
|
|
|
</if>
|