|
|
@@ -795,4 +795,139 @@
|
|
|
proof_aid = #{proofAid,jdbcType=VARCHAR}
|
|
|
where order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
+
|
|
|
+ <!-- 查看所有待财务管理员分配的订单数据 -->
|
|
|
+ <select id="getAllUnassignedListOrder" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
|
|
|
+ select o.order_no as orderNo, o.order_type orderType, o.create_time as createTime, o.process_status as processStatus
|
|
|
+ o.sign_time as signTime, u.nickname as buyerName,o.total_amount signTotalAmount, o.approval , a.name sellerName
|
|
|
+ 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
|
|
|
+ where delete_sign = 0
|
|
|
+ and order_status = 2
|
|
|
+ <if test="o.processStatus != null">
|
|
|
+ and process_status = #{o.processStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.financeId != null and o.financeId != ""'>
|
|
|
+ and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ and o.sign_time between #{a,jdbcType=VARCHAR} and #{a,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="ob = 1">
|
|
|
+ order by o.sign_time
|
|
|
+ </if>
|
|
|
+ <if test="ob = 2">
|
|
|
+ order by o.liquidation_status,o.sign_time
|
|
|
+ </if>
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </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
|
|
|
+ where delete_sign = 0
|
|
|
+ and order_status = 2
|
|
|
+ <if test="o.processStatus != null">
|
|
|
+ and process_status = #{o.processStatus,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.orderNo != null and o.orderNo != ""'>
|
|
|
+ and o.order_no = #{o.orderNo,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='financeId != null and financeId != ""'>
|
|
|
+ and o.finance_id = #{o.financeId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.buyerName != null and o.buyerName != ""'>
|
|
|
+ <bind name="n" value="'%' + o.buyerName + '%'"/>
|
|
|
+ and u.nickname like #{n,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test='o.startTime != null and o.startTime != "" and o.endTime != null and o.endTime != ""'>
|
|
|
+ <bind name="a" value="o.startTime + ' 00:00:00'"/>
|
|
|
+ <bind name="b" value="o.endTime + ' 23:59:59'"/>
|
|
|
+ and o.sign_time between #{a,jdbcType=VARCHAR} and #{a,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!-- 查看某订单状态是否符合要求 -->
|
|
|
+ <select id="getCountByIdAndStatus" parameterType="com.goafanti.common.model.TOrderNew" resultType="java.lang.Integer">
|
|
|
+ select count(*) from t_order_new
|
|
|
+ where order_no = #{orderNo,jdbcType=VARCHAR}
|
|
|
+ <if test="orderType != null">
|
|
|
+ and order_type = #{orderType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="creater != null">
|
|
|
+ and creater = #{creater,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="buyerId != null">
|
|
|
+ and buyer_id = #{buyerId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="firstAmount != null">
|
|
|
+ and first_amount = #{firstAmount,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="totalAmount != null">
|
|
|
+ and total_amount = #{totalAmount,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="settlementAmount != null">
|
|
|
+ and settlement_amount = #{settlementAmount,jdbcType=DECIMAL}
|
|
|
+ </if>
|
|
|
+ <if test="orderStatus != null">
|
|
|
+ and order_status = #{orderStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="liquidationStatus == 1">
|
|
|
+ and liquidation_status between 1 and 2
|
|
|
+ </if>
|
|
|
+ <if test="processStatus != null">
|
|
|
+ and process_status = #{processStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="projectStatus != null">
|
|
|
+ and project_status = #{projectStatus,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="approval != null">
|
|
|
+ and approval = #{approval,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="orderRemarks != null">
|
|
|
+ and order_remarks = #{orderRemarks,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="deleteSign != null">
|
|
|
+ and delete_sign = #{deleteSign,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="salesmanId != null">
|
|
|
+ and salesman_id = #{salesmanId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="financeId != null">
|
|
|
+ and finance_id = #{financeId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="technicianId != null">
|
|
|
+ and technician_id = #{technicianId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="contractNo != null">
|
|
|
+ and contract_no = #{contractNo,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="contractType != null">
|
|
|
+ and contract_type = #{contractType,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="contacts != null">
|
|
|
+ and contacts = #{contacts,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="contactMobile != null">
|
|
|
+ and contact_mobile = #{contactMobile,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="legalPerson != null">
|
|
|
+ and legal_person = #{legalPerson,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="legalPersonTel != null">
|
|
|
+ and legal_person_tel = #{legalPersonTel,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|