| | |
| | | where status_backend = 'SEND' and partner_id is not null |
| | | </update> |
| | | |
| | | |
| | | <select id="getPartnerOrderReceive" resultType="com.mzl.flower.entity.payment.Order"> |
| | | select * from t_order t where status_backend = 'SEND' and partner_id is not null |
| | | </select> |
| | |
| | | <if test="condition.statusBackend != null and condition.statusBackend != ''"> |
| | | AND q.status_backend = #{condition.statusBackend} |
| | | </if> |
| | | <if test="condition.startDate != null"> |
| | | AND q.payment_time >= #{condition.startDate} |
| | | </if> |
| | | <if test="condition.endDate != null"> |
| | | AND q.payment_time <= #{condition.endDate} |
| | | </if> |
| | | <!-- <if test="condition.startDate != null">--> |
| | | <!-- AND q.payment_time >= #{condition.startDate}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="condition.endDate != null">--> |
| | | <!-- AND q.payment_time <= #{condition.endDate}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="condition.createStartDate != null">--> |
| | | <!-- AND q.create_time >= #{condition.createStartDate}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="condition.createEndDate != null">--> |
| | | <!-- AND q.create_time <= #{condition.createEndDate}--> |
| | | <!-- </if>--> |
| | | <if test="condition.createStartDate != null"> |
| | | AND q.create_time >= #{condition.createStartDate} |
| | | AND q.payment_time >= #{condition.createStartDate} |
| | | </if> |
| | | <if test="condition.createEndDate != null"> |
| | | AND q.create_time <= #{condition.createEndDate} |
| | | AND q.payment_time <= #{condition.createEndDate} |
| | | </if> |
| | | <if test="condition.partnerId != null"> |
| | | AND q.partner_id = #{condition.partnerId} |
| | |
| | | <if test="condition.statusBackend != null and condition.statusBackend != ''"> |
| | | AND q.status_backend = #{condition.statusBackend} |
| | | </if> |
| | | <if test="condition.startDate != null"> |
| | | AND q.payment_time >= #{condition.startDate} |
| | | </if> |
| | | <if test="condition.endDate != null"> |
| | | AND q.payment_time <= #{condition.endDate} |
| | | </if> |
| | | <!-- <if test="condition.startDate != null">--> |
| | | <!-- AND q.payment_time >= #{condition.startDate}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="condition.endDate != null">--> |
| | | <!-- AND q.payment_time <= #{condition.endDate}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="condition.createStartDate != null">--> |
| | | <!-- AND q.create_time >= #{condition.createStartDate}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="condition.createEndDate != null">--> |
| | | <!-- AND q.create_time <= #{condition.createEndDate}--> |
| | | <!-- </if>--> |
| | | <!-- 修改查询日期对应的的创建时间为支付时间 2024-10-12--> |
| | | <if test="condition.createStartDate != null"> |
| | | AND q.create_time >= #{condition.createStartDate} |
| | | AND q.payment_time >= #{condition.createStartDate} |
| | | </if> |
| | | <if test="condition.createEndDate != null"> |
| | | AND q.create_time <= #{condition.createEndDate} |
| | | AND q.payment_time <= #{condition.createEndDate} |
| | | </if> |
| | | <if test="condition.partnerId != null"> |
| | | AND q.partner_id = #{condition.partnerId} |
| | |
| | | <if test="condition.warehouseLocationCode != null and condition.warehouseLocationCode != ''"> |
| | | AND q.warehouse_location_code LIKE concat('%', #{condition.warehouseLocationCode},'%') |
| | | </if> |
| | | <if test="condition.createName != null and condition.createName != ''"> |
| | | AND u.nick_name LIKE concat('%', #{condition.createName},'%') |
| | | </if> |
| | | |
| | | ORDER BY q.create_time desc, q.payment_time desc |
| | | </select> |
| | |
| | | <if test="condition.statusBackend != null and condition.statusBackend != ''"> |
| | | AND q.status_backend = #{condition.statusBackend} |
| | | </if> |
| | | <if test="condition.startDate != null"> |
| | | AND q.payment_time >= #{condition.startDate} |
| | | </if> |
| | | <if test="condition.endDate != null"> |
| | | AND q.payment_time <= #{condition.endDate} |
| | | </if> |
| | | <if test="condition.createStartDate != null"> |
| | | AND q.create_time >= #{condition.createStartDate} |
| | | AND q.payment_time >= #{condition.createStartDate} |
| | | </if> |
| | | <if test="condition.createEndDate != null"> |
| | | AND q.create_time <= #{condition.createEndDate} |
| | | AND q.payment_time <= #{condition.createEndDate} |
| | | </if> |
| | | <!-- <if test="condition.createStartDate != null">--> |
| | | <!-- AND q.create_time >= #{condition.createStartDate}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="condition.createEndDate != null">--> |
| | | <!-- AND q.create_time <= #{condition.createEndDate}--> |
| | | <!-- </if>--> |
| | | <if test="condition.partnerId != null"> |
| | | AND q.partner_id = #{condition.partnerId} |
| | | </if> |
| | |
| | | code2.label as specialNeedsStr, |
| | | CONCAT(q.customer_province, q.customer_city,q.customer_region,q.customer_address) AS customerAddress, |
| | | (select Sum(COALESCE(oi.num, 0) * COALESCE(oi.supplier_price, 0)) |
| | | from t_order_item oi where order_id = q.id) supplierAmount |
| | | from t_order_item oi where order_id = q.id) supplierAmount, |
| | | (select Sum(oi.num) from t_order_item oi where order_id = q.id) saleNum |
| | | FROM t_order q |
| | | left join t_user u on q.create_by = u.id |
| | | LEFT JOIN (SELECT ct.label, ct.value from t_code_value ct where type_code = 'ORDER_STATUS_BACKEND') code ON q.status_backend = code.value |
| | |
| | | </if> |
| | | ORDER BY q.create_time desc, q.payment_time desc |
| | | </select> |
| | | |
| | | <select id="getOrderSaleAmount" resultType="java.math.BigDecimal"> |
| | | SELECT sum(o.payment_amount) |
| | | FROM t_order o |
| | | WHERE o.deleted=0 |
| | | and o.status_backend not in ('PENDING','CANCEL','REFUND') |
| | | <if test="startTime != null"> |
| | | and o.create_time > #{startTime} |
| | | </if> |
| | | <if test="endTime != null"> |
| | | and o.create_time <= #{endTime} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 获取所有的订单数据,以及时间数据--> |
| | | <select id="selectAllDateList" resultType="com.mzl.flower.entity.payment.Order"> |
| | | SELECT t.id,t.payment_time, |
| | | CASE |
| | | WHEN t.payment_time > DATE(t.payment_time) + INTERVAL 17 HOUR THEN DATE(t.payment_time) + INTERVAL 1 DAY |
| | | ELSE DATE(t.payment_time) |
| | | END AS payment_date, |
| | | t.create_time, |
| | | CASE |
| | | WHEN t.create_time > DATE(t.create_time) + INTERVAL 17 HOUR THEN DATE(t.create_time) + INTERVAL 1 DAY |
| | | ELSE DATE(t.create_time) |
| | | END AS create_date |
| | | FROM t_order t |
| | | order by t.create_time desc |
| | | </select> |
| | | |
| | | <update id="updatePaymentCreateDate"> |
| | | update t_order set payment_date_sta=#{order.paymentDate}, create_date_sta=#{order.createDate} where id=#{order.id} |
| | | </update> |
| | | </mapper> |