|  |  |  | 
|---|
|  |  |  | left join mall_goods_coupon b on b.id = a.coupon_id | 
|---|
|  |  |  | <where> | 
|---|
|  |  |  | a.member_id=#{record.memberId} | 
|---|
|  |  |  | <if test="record.state != null and record.state != ''"> | 
|---|
|  |  |  | <if test="record.state == 1"> | 
|---|
|  |  |  | and a.state=#{record.state} | 
|---|
|  |  |  | and a.expire_time >= #{record.expireTime} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.state == 2"> | 
|---|
|  |  |  | and a.state=#{record.state} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.state == 3"> | 
|---|
|  |  |  | and a.state=#{record.state} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.goodsId != null and record.goodsId != ''"> | 
|---|
|  |  |  | 
|---|
|  |  |  | order by a.CREATED_TIME desc | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectListByExpireTime" resultType="cc.mrbird.febs.mall.entity.MallMemberCoupon"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | a.* | 
|---|
|  |  |  | from mall_member_coupon a | 
|---|
|  |  |  | where a.expire_time <= #{date} | 
|---|
|  |  |  | and a.state = 1 | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </mapper> | 
|---|