|
|
@@ -1011,12 +1011,19 @@
|
|
|
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.liquidation_status as liquidationStatus,a.approval,c.name as salesmanName,d.name as financeName
|
|
|
+ <if test="specially == 4">
|
|
|
+ ,f.name as consultantName
|
|
|
+ </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 admin d on a.finance_id=d.id
|
|
|
+ <if test="specially == 4">
|
|
|
+ left join (select * from t_order_task where main=1) e on e.order_no=a.order_no
|
|
|
+ left join admin f on e.task_receiver=f.id
|
|
|
+ </if>
|
|
|
where a.delete_sign = 0
|
|
|
<if test="specially == 0">
|
|
|
- and a.order_status not in(3,5) and a.approval !=3
|
|
|
+ and a.order_status not in(3,5,6) and a.approval !=3
|
|
|
</if>
|
|
|
<if test="specially == 1">
|
|
|
and a.process_status =1 and a.order_status=1
|
|
|
@@ -1027,6 +1034,16 @@
|
|
|
<if test="specially == 3">
|
|
|
and a.approval = 1 and a.order_status=2
|
|
|
</if>
|
|
|
+ <if test="specially == 4">
|
|
|
+ and a.process_status in (4,5,6)
|
|
|
+ </if>
|
|
|
+ <if test="distribution == 1">
|
|
|
+ and a.process_status = 5
|
|
|
+ </if>
|
|
|
+ <if test="distribution == 2">
|
|
|
+ and a.process_status = 6
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="aid != null">
|
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1037,8 +1054,7 @@
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="starTime !=null and endTime !=null">
|
|
|
- and a.sign_time > #{starTime,jdbcType=VARCHAR}
|
|
|
- and a.sign_time < #{endTime,jdbcType=VARCHAR}
|
|
|
+ and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
order by a.sign_time desc
|
|
|
<if test="page_sql!=null">
|
|
|
@@ -1063,6 +1079,9 @@
|
|
|
<if test="specially == 3">
|
|
|
and a.approval = 1 and a.order_status=2
|
|
|
</if>
|
|
|
+ <if test="specially == 4">
|
|
|
+ and a.process_status in (4,5,6)
|
|
|
+ </if>
|
|
|
<if test="aid != null">
|
|
|
and a.salesman_id = #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1073,7 +1092,7 @@
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="starTime !=null and endTime !=null">
|
|
|
- and #{starTime,jdbcType=VARCHAR} < a.sign_time < #{endTime,jdbcType=VARCHAR}
|
|
|
+ and a.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
@@ -1094,8 +1113,7 @@
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="starTime !=null and endTime !=null">
|
|
|
- and b.sign_time > #{starTime,jdbcType=VARCHAR}
|
|
|
- and b.sign_time < #{endTime,jdbcType=VARCHAR}
|
|
|
+ and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
order by b.sign_time desc
|
|
|
<if test="page_sql!=null">
|
|
|
@@ -1116,8 +1134,7 @@
|
|
|
and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="starTime !=null and endTime !=null">
|
|
|
- and b.sign_time > #{starTime,jdbcType=VARCHAR}
|
|
|
- and b.sign_time < #{endTime,jdbcType=VARCHAR}
|
|
|
+ and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
@@ -1129,13 +1146,52 @@
|
|
|
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
|
|
|
- ,e.back_status as backStatus,f.name as initiateName,e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate
|
|
|
+ ,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 admin d on a.finance_id=d.id
|
|
|
- left join t_order_back e on a.order_no=e.order_no
|
|
|
+ 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
|
|
|
where a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectOrderRefundListByPage" resultType="com.goafanti.order.bo.TOrderRefundBo">
|
|
|
+ select a.id, date_format(a.create_time,'%Y-%m_%d') as createDate,a.order_no as orderNo,
|
|
|
+ c.nickname as userName,b.order_status as orderStatus,a.refund_status as refundStatus,
|
|
|
+ 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 and b.order_status = 6
|
|
|
+ <if test="name != null">
|
|
|
+ and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="starTime !=null and endTime !=null">
|
|
|
+ and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ order by a.create_time desc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectOrderRefundListCount" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ 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 and b.order_status = 6
|
|
|
+ <if test="name != null">
|
|
|
+ and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ and a.order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="starTime !=null and endTime !=null">
|
|
|
+ and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|