| | |
| | | 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> |
| | |
| | | <select id="getOrderStatusCount" resultType="com.mzl.flower.dto.response.payment.OrderStatusCountDTO"> |
| | | SELECT q.status_backend value, count(1) orderCount |
| | | FROM t_order q |
| | | left join t_user u on q.create_by = u.id |
| | | WHERE q.deleted = 0 |
| | | <if test="condition.orderNo != null and condition.orderNo != ''"> |
| | | AND q.order_no LIKE concat('%', #{condition.orderNo},'%') |
| | |
| | | AND q.payment_time >= #{condition.createStartDate} |
| | | </if> |
| | | <if test="condition.createEndDate != null"> |
| | | AND q.payment_time <= #{condition.createEndDate} |
| | | AND q.payment_time < #{condition.createEndDate} |
| | | </if> |
| | | <if test="condition.partnerId != null"> |
| | | AND q.partner_id = #{condition.partnerId} |
| | |
| | | AND exists( |
| | | select 1 from t_order_item oi |
| | | where oi.order_id = q.id |
| | | and oi.status = 'reduce' |
| | | and (oi.status = 'reduce' or oi.status = 'abnormal') |
| | | ) |
| | | and q.transfer_id is null |
| | | and q.status in ('COLLECTION', 'SEND') |
| | | </if> |
| | | <if test="condition.billId != null and condition.billId != ''"> |
| | | AND q.bill_id = #{condition.billId} |
| | |
| | | where oi.order_id = q.id |
| | | and oi.flower_name LIKE concat('%', #{condition.flowerName},'%') |
| | | ) |
| | | </if> |
| | | |
| | | <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> |
| | | <if test="condition.province != null and condition.province != ''"> |
| | | AND q.customer_province LIKE concat('%', #{condition.province},'%') |
| | | </if> |
| | | <if test="condition.city != null and condition.city != ''"> |
| | | AND q.customer_city LIKE concat('%', #{condition.city},'%') |
| | | </if> |
| | | <if test="condition.region != null and condition.region != ''"> |
| | | AND q.customer_region LIKE concat('%', #{condition.region},'%') |
| | | </if> |
| | | GROUP BY q.status_backend |
| | | </select> |
| | |
| | | WHERE q.deleted = 0 |
| | | <if test="condition.orderNo != null and condition.orderNo != ''"> |
| | | AND q.order_no LIKE concat('%', #{condition.orderNo},'%') |
| | | </if> |
| | | <if test="condition.province != null and condition.province != ''"> |
| | | AND q.customer_province LIKE concat('%', #{condition.province},'%') |
| | | </if> |
| | | <if test="condition.city != null and condition.city != ''"> |
| | | AND q.customer_city LIKE concat('%', #{condition.city},'%') |
| | | </if> |
| | | <if test="condition.region != null and condition.region != ''"> |
| | | AND q.customer_region LIKE concat('%', #{condition.region},'%') |
| | | </if> |
| | | <if test="condition.customerAddress != null and condition.customerAddress != ''"> |
| | | AND q.customer_address LIKE concat('%', #{condition.customerAddress},'%') |
| | |
| | | AND q.payment_time >= #{condition.createStartDate} |
| | | </if> |
| | | <if test="condition.createEndDate != null"> |
| | | AND q.payment_time <= #{condition.createEndDate} |
| | | AND q.payment_time < #{condition.createEndDate} |
| | | </if> |
| | | <if test="condition.partnerId != null"> |
| | | AND q.partner_id = #{condition.partnerId} |
| | |
| | | </if> |
| | | <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 |
| | |
| | | AND q.payment_time >= #{condition.createStartDate} |
| | | </if> |
| | | <if test="condition.createEndDate != null"> |
| | | AND q.payment_time <= #{condition.createEndDate} |
| | | AND q.payment_time < #{condition.createEndDate} |
| | | </if> |
| | | <!-- <if test="condition.createStartDate != null">--> |
| | | <!-- AND q.create_time >= #{condition.createStartDate}--> |
| | |
| | | AND q.payment_time >= #{condition.startDate} |
| | | </if> |
| | | <if test="condition.endDate != null"> |
| | | AND q.payment_time <= #{condition.endDate} |
| | | AND q.payment_time < #{condition.endDate} |
| | | </if> |
| | | <if test="condition.createStartDate != null"> |
| | | AND q.create_time >= #{condition.createStartDate} |
| | |
| | | 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> |