" (select st.store_name from high_merchant_store st where st.id = a.goods_id) merchantName,"+
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType,"+
" b.id orderId, "+
" a.goods_name goodsName, "+
" a.goods_type goodsTypeId,"+
" case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType,"+
" b.order_no orderNo,"+
" b.mem_name memName,"+
" b.mem_phone memPhone,"+
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, "+
" case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' end payType,"+
" b.pay_serial_no paySerialNo,"+
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice,"+
" b.mem_discount_name memDiscountName,"+
" b.deduction_price deductionPrice,"+
" case a.giveaway_type when 0 then case when b.pay_gold is null then 0 else pay_gold end when 1 then 0 end payGold,"+
" case a.giveaway_type when 0 then b.pay_price when 1 then 0 end payPrice,"+
" case a.giveaway_type when 0 then case when b.pay_gold is not null then convert(b.pay_gold / 100,decimal(10,2)) else b.pay_real_price end when 1 then 0 end payRealPrice,"+
" case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' when 6 then '退款中' when 7 then '退款失败' end orderStatus, "+
" b.order_status orderStatusId,"+
" b.create_time createTime,"+
" b.pay_time payTime,"+
" b.cancel_time cancelTime,"+
" b.refund_time refundTime,"+
" b.refund_content refundContent,"+
" b.refusal_refund_content refusalRefundContent"+
" FROM"+
" high_child_order a,"+
" high_order b"+
" WHERE"+
" a.order_id = b.id"+
" and a.goods_type = 4"+
" and a.giveaway_type = 0"+
" and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id "+
" (select st.store_name from high_merchant_store st where st.id = a.goods_id) merchantName,"+
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType,"+
" b.id orderId, "+
" a.goods_name goodsName, "+
" a.goods_type goodsTypeId,"+
" case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType,"+
" b.order_no orderNo,"+
" b.mem_name memName,"+
" b.mem_phone memPhone,"+
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, "+
" case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' end payType,"+
" b.pay_serial_no paySerialNo,"+
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice,"+
" b.mem_discount_name memDiscountName,"+
" b.deduction_price deductionPrice,"+
" case a.giveaway_type when 0 then case when b.pay_gold is null then 0 else pay_gold end when 1 then 0 end payGold,"+
" case a.giveaway_type when 0 then b.pay_price when 1 then 0 end payPrice,"+
" case a.giveaway_type when 0 then case when b.pay_gold is not null then convert(b.pay_gold / 100,decimal(10,2)) else b.pay_real_price end when 1 then 0 end payRealPrice,"+
" case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' when 6 then '退款中' when 7 then '退款失败' end orderStatus, "+
" b.order_status orderStatusId,"+
" b.create_time createTime,"+
" b.pay_time payTime,"+
" b.cancel_time cancelTime,"+
" b.refund_time refundTime,"+
" b.refund_content refundContent,"+
" b.refusal_refund_content refusalRefundContent"+
" FROM"+
" high_child_order a,"+
" high_order b"+
" WHERE"+
" a.order_id = b.id"+
" and a.goods_type = 5"+
" and a.giveaway_type = 0"+
" and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id "+
@Select({"select a.id orderId,b.id childOrderId from high_order a,high_child_order b where a.id = b.order_id and b.goods_type = 3 and a.order_status = 2 and TIMESTAMPDIFF(MINUTE,a.pay_time,SYSDATE()) > 60*24 GROUP BY b.id"})