| | |
| | | <select id="pageOrderList" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerOrderPageVO"> |
| | | select id as orderId,order_no,store_id,`status`,pay_status,receiver_id,total_amount as |
| | | orderTotal,pay_amount,delivery_type,remark,create_at, logistics_company, logistics_no,receiving_time from com_shop_flower_order as cso |
| | | where cso.delete_status = 1 |
| | | where cso.delete_status = 1 and cso.`status` != 0 |
| | | <if test="comOrderListDTO.userId != null"> |
| | | and cso.user_id = #{comOrderListDTO.userId} |
| | | </if> |
| | |
| | | LEFT JOIN com_shop_flower_user_address uad ON sr.receiver_id = uad.id |
| | | LEFT JOIN com_convenient_merchants ss ON sr.store_id = ss.id |
| | | LEFT JOIN com_convenient_elevating_point ccep on ccep.id = sr.point_id |
| | | WHERE sr.delete_status = 1 |
| | | WHERE sr.delete_status = 1 and sr.`status` != 0 |
| | | <if test='pageComShopOrderSearchDTO.userId != null'> |
| | | AND sr.user_id = #{pageComShopOrderSearchDTO.userId} |
| | | </if> |
| | |
| | | com_shop_flower_order o |
| | | LEFT JOIN com_shop_flower_order_goods g ON o.id = g.order_id |
| | | LEFT JOIN com_shop_flower_user_address a ON a.id = o.receiver_id |
| | | WHERE 1=1 |
| | | WHERE 1=1 and o.`status` != 0 |
| | | <if test="comOrderListDTO.deliveryType != null"> |
| | | and o.delivery_type = #{comOrderListDTO.deliveryType} |
| | | </if> |
| | |
| | | com_shop_flower_order o |
| | | LEFT JOIN com_shop_flower_order_goods g ON o.id = g.order_id |
| | | LEFT JOIN com_shop_flower_user_address a ON a.id = o.receiver_id |
| | | WHERE 1=1 and o.delivery_type = 1 |
| | | WHERE 1=1 and o.delivery_type = 1 and o.`status` != 0 |
| | | <if test="comOrderListDTO.storeId != null"> |
| | | and o.store_id = #{comOrderListDTO.storeId} |
| | | </if> |
| | |
| | | </select> |
| | | <select id="selectCountByDeliveryType" |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderCountVO"> |
| | | SELECT count(1) amount , `status` FROM com_shop_flower_order WHERE delivery_type = #{deliveryType} and store_id = #{storeId} GROUP BY `status` |
| | | SELECT count(1) amount , `status` FROM com_shop_flower_order WHERE delivery_type = #{deliveryType} and store_id = #{storeId} and `status` != 0 GROUP BY `status` |
| | | </select> |
| | | <select id="selectCountByStoreId" |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO"> |
| | | |
| | | SELECT count(1) as count_num,'dayCount' as count_name FROM com_shop_flower_order WHERE TO_DAYS(create_at)=TO_DAYS(NOW()) |
| | | SELECT count(1) as count_num,'dayCount' as count_name FROM com_shop_flower_order WHERE TO_DAYS(create_at)=TO_DAYS(NOW()) and `status` != 0 |
| | | <if test="storeId != null"> |
| | | and store_id = #{storeId} |
| | | </if> |
| | |
| | | and delivery_type = #{deliveryType} |
| | | </if> |
| | | union all |
| | | SELECT count(1) as count_num,'monthCount' as count_name FROM com_shop_flower_order WHERE DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') |
| | | SELECT count(1) as count_num,'monthCount' as count_name FROM com_shop_flower_order WHERE DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and `status` != 0 |
| | | <if test="storeId != null"> |
| | | and store_id = #{storeId} |
| | | </if> |
| | |
| | | and delivery_type = #{deliveryType} |
| | | </if> |
| | | union all |
| | | SELECT count(1) as count_num,'yearCount' as count_name FROM com_shop_flower_order where YEAR(create_at) =YEAR(NOW()) |
| | | SELECT count(1) as count_num,'yearCount' as count_name FROM com_shop_flower_order where YEAR(create_at) =YEAR(NOW()) and `status` != 0 |
| | | <if test="storeId != null"> |
| | | and store_id = #{storeId} |
| | | </if> |
| | |
| | | and delivery_type = #{deliveryType} |
| | | </if> |
| | | union all |
| | | SELECT count(1) as count_num,'allCount' as count_name FROM com_shop_flower_order WHERE 1=1 |
| | | <if test="storeId != null"> |
| | | SELECT count(1) as count_num,'allCount' as count_name FROM com_shop_flower_order WHERE `status` != 0 |
| | | <if test="storeId != null"> |
| | | and store_id = #{storeId} |
| | | </if> |
| | | <if test="deliveryType != null"> |
| | |
| | | </select> |
| | | <select id="selectSumAmountByStoreId" |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> |
| | | SELECT IFNULL(sum(pay_amount),0) as count_num,'dayAmount' as count_name FROM com_shop_flower_order WHERE TO_DAYS(create_at)=TO_DAYS(NOW()) and `status` not in (6,7) |
| | | <if test="storeId != null"> |
| | | SELECT IFNULL(sum(pay_amount),0) as count_num,'dayAmount' as count_name FROM com_shop_flower_order WHERE TO_DAYS(create_at)=TO_DAYS(NOW()) and `status` not in (6,7) and `status` != 0 |
| | | <if test="storeId != null"> |
| | | and store_id = #{storeId} |
| | | </if> |
| | | union all |
| | | SELECT IFNULL(sum(pay_amount),0) as count_num,'monthAmount' as count_name FROM com_shop_flower_order WHERE DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and `status` not in (6,7) |
| | | <if test="storeId != null"> |
| | | SELECT IFNULL(sum(pay_amount),0) as count_num,'monthAmount' as count_name FROM com_shop_flower_order WHERE DATE_FORMAT(create_at,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m') and `status` not in (6,7) and `status` != 0 |
| | | <if test="storeId != null"> |
| | | and store_id = #{storeId} |
| | | </if> |
| | | union all |
| | | SELECT IFNULL(sum(pay_amount),0) as count_num,'yearAmount' as count_name FROM com_shop_flower_order where YEAR(create_at) =YEAR(NOW()) and `status` not in (6,7) |
| | | <if test="storeId != null"> |
| | | SELECT IFNULL(sum(pay_amount),0) as count_num,'yearAmount' as count_name FROM com_shop_flower_order where YEAR(create_at) =YEAR(NOW()) and `status` not in (6,7) and `status` != 0 |
| | | <if test="storeId != null"> |
| | | and store_id = #{storeId} |
| | | </if> |
| | | union all |
| | | SELECT IFNULL(sum(pay_amount),0) as count_num,'allAmount' as count_name FROM com_shop_flower_order WHERE `status` not in (6,7) |
| | | <if test="storeId != null"> |
| | | SELECT IFNULL(sum(pay_amount),0) as count_num,'allAmount' as count_name FROM com_shop_flower_order WHERE `status` not in (6,7) and `status` != 0 |
| | | <if test="storeId != null"> |
| | | and store_id = #{storeId} |
| | | </if> |
| | | </select> |
| | |
| | | </select> |
| | | <select id="selectSumOrderAndAmountByStoreId" |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> |
| | | SELECT count(1) count_num ,'pddd' as count_name FROM `com_shop_flower_order` WHERE delivery_type =1 and delete_status = 1 and pay_status = 2 and store_id = #{storeId} |
| | | SELECT count(1) count_num ,'pddd' as count_name FROM `com_shop_flower_order` WHERE delivery_type =1 and delete_status = 1 and pay_status = 2 and store_id = #{storeId} and `status` != 0 |
| | | union all |
| | | SELECT count(1) count_num ,'kddd' as count_name FROM `com_shop_flower_order` WHERE delivery_type =2 and delete_status = 1 and pay_status = 2 and store_id = #{storeId} |
| | | SELECT count(1) count_num ,'kddd' as count_name FROM `com_shop_flower_order` WHERE delivery_type =2 and delete_status = 1 and pay_status = 2 and store_id = #{storeId} and `status` != 0 |
| | | union all |
| | | SELECT count(1) count_num ,'tkdd' as count_name FROM `com_shop_flower_order` WHERE delete_status = 1 and pay_status = 2 and `status` in (6,7) and store_id = #{storeId} |
| | | SELECT count(1) count_num ,'tkdd' as count_name FROM `com_shop_flower_order` WHERE delete_status = 1 and pay_status = 2 and `status` in (6,7) and store_id = #{storeId} and `status` != 0 |
| | | union all |
| | | SELECT IFNULL(sum(pay_amount),0) count_num ,'yysr' as count_name FROM `com_shop_flower_order` WHERE `status` not in (6,7) and store_id = #{storeId} |
| | | SELECT IFNULL(sum(pay_amount),0) count_num ,'yysr' as count_name FROM `com_shop_flower_order` WHERE `status` not in (6,7) and store_id = #{storeId} and `status` != 0 |
| | | union all |
| | | SELECT IFNULL(sum(pay_amount),0) count_num ,'tkje' as count_name FROM `com_shop_flower_order` WHERE `status` in (6,7) and store_id = #{storeId} |
| | | SELECT IFNULL(sum(pay_amount),0) count_num ,'tkje' as count_name FROM `com_shop_flower_order` WHERE `status` in (6,7) and store_id = #{storeId} and `status` != 0 |
| | | union all |
| | | SELECT IFNULL(sum(pay_amount),0) count_num ,'ktxje' as count_name FROM `com_shop_flower_order` WHERE `status` in (4,5) and create_at <= date_sub(now(), INTERVAL 15 DAY) and store_id = #{storeId} |
| | | SELECT IFNULL(sum(pay_amount),0) count_num ,'ktxje' as count_name FROM `com_shop_flower_order` WHERE `status` in (4,5) and create_at <= date_sub(now(), INTERVAL 15 DAY) and store_id = #{storeId} and `status` != 0 |
| | | |
| | | |
| | | </select> |
| | |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO"> |
| | | SELECT count(1) count_num, date_format(create_at,'%Y-%m-%d') as count_name FROM com_shop_flower_order |
| | | WHERE date_format(create_at,'%Y-%m-%d') >= date_format(date_sub(now(), INTERVAL #{days} DAY),'%Y-%m-%d') |
| | | and store_id = #{storeId} |
| | | and store_id = #{storeId} and `status` != 0 |
| | | GROUP BY count_name |
| | | </select> |
| | | <select id="selectCountOrderMonthByStoreId" |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdCountVO"> |
| | | SELECT count(1) count_num, date_format(create_at,'%Y-%m') as count_name FROM com_shop_flower_order |
| | | WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} GROUP BY count_name |
| | | WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} and `status` != 0 GROUP BY count_name |
| | | </select> |
| | | <select id="selectOrderSumPayDayByStoreId" |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> |
| | | SELECT IFNULL(sum(pay_amount),0) count_num, date_format(create_at,'%Y-%m-%d') as count_name FROM com_shop_flower_order |
| | | WHERE date_format(create_at,'%Y-%m-%d') >= date_format(date_sub(now(), INTERVAL #{days} DAY),'%Y-%m-%d') |
| | | and store_id = #{storeId} and `status` not in (6,7) |
| | | and store_id = #{storeId} and `status` not in (6,7) and `status` != 0 |
| | | GROUP BY count_name |
| | | </select> |
| | | <select id="selectOrderSumMonthByStoreId" |
| | | resultType="com.panzhihua.common.model.vos.shop.ComShopOrderStoreIdNumVO"> |
| | | SELECT IFNULL(sum(pay_amount),0) count_num, date_format(create_at,'%Y-%m') as count_name FROM com_shop_flower_order |
| | | WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} and `status` not in (6,7) GROUP BY count_name |
| | | WHERE date_format(create_at,'%Y-%m') >= date_format(now(),'%Y-01') and store_id = #{storeId} and `status` not in (6,7) and `status` != 0 GROUP BY count_name |
| | | </select> |
| | | |
| | | |