select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3 where t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and t1.coupon_id=t2.coupon_id and t2.coupon_id=t3.coupon_id
and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t1.enable_flag=1 and t3.enable_flag=1
select t2.* from tb_cf_take_coupon t1,tb_cf_coupon t2 ,tb_cf_issue_coupon t3
where ((t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t1.enable_flag=1)
or (t1.user_id=#{userId} and t1.coupon_id=t2.coupon_id and <![CDATA[ t2.valid_end_time<#{nowTime}]]> and t1.enable_flag=1))