" where goods_type = 1 and goods_id = #{couponId} and child_order_status in (2,3,6,7) and DATE_FORMAT(pay_time,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m')"})
" select a.sales_price,sum(notUseCount) notUseCount,sum(a.useCount) useCount from "+
"(select a.sales_price, (select count(1) FROM high_coupon_code_other WHERE cou_type_code = a.coupon_key and `status` = 20 <if test='param.salesTimeS != null'> and create_time BETWEEN #{param.salesTimeS} and #{param.salesTimeE} </if> ) notUseCount, "+
"(select count(1) FROM high_coupon_code_other WHERE cou_type_code = a.coupon_key and `status` = 40 <if test='param.salesTimeS != null'> and create_time BETWEEN #{param.salesTimeS} and #{param.salesTimeE} </if> ) useCount "+
" FROM high_coupon a"+
" WHERE a.coupon_source = #{param.couponSource} GROUP BY coupon_key ORDER BY a.sales_price) a where 1 = 1 "+
" <if test='param.salesPrice != null'> and a.sales_price = #{param.salesPrice} </if>"+