|
@@ -33,13 +33,13 @@
|
|
|
su.real_name_ as realName,
|
|
|
su.username_ as username,
|
|
|
ci.client_type_ as clientType,
|
|
|
- ci.use_state_ as useState,
|
|
|
+ ci.issue_way_ as issueWay,
|
|
|
ci.order_no_ as orderNo,
|
|
|
from_unixtime(ci.start_time_) as startTime,
|
|
|
from_unixtime(ci.end_time_) as endTime,
|
|
|
from_unixtime(ci.issue_time_) as issueTime,
|
|
|
from_unixtime(ci.use_time_) as useTime,
|
|
|
- (case when ci.status_ = 0 then 'WITHDRAW' when ci.end_time_ < unix_timestamp(now()) and ci.issue_way_ = 'USABLE' then 'EXPIRED' else ci.issue_way_ end ) as issueWay,
|
|
|
+ (case when ci.status_ = 0 then 'WITHDRAW' when ci.end_time_ < unix_timestamp(now()) and ci.use_state_ = 'USABLE' then 'EXPIRED' else ci.use_state_ end ) as useState,
|
|
|
ci.issuer_ as issuer,
|
|
|
ci.remark_ as remark,
|
|
|
cou.name_ as couponName,
|
|
@@ -73,24 +73,24 @@
|
|
|
or cou.name_ like concat('%',#{query.couponKeyword},'%')
|
|
|
)
|
|
|
</if>
|
|
|
- <if test="query.issueWay != null">
|
|
|
+ <if test="query.useState != null">
|
|
|
<choose>
|
|
|
- <when test="query.issueWay.code == 'EXPIRED'">
|
|
|
- and ci.end_time_ < unix_timestamp(now()) and ci.issue_way_ = 'USABLE'
|
|
|
+ <when test="query.useState.code == 'EXPIRED'">
|
|
|
+ and ci.end_time_ < unix_timestamp(now()) and ci.use_state_ = 'USABLE'
|
|
|
</when>
|
|
|
- <when test="query.issueWay.code == 'USABLE'">
|
|
|
- and ci.end_time_ >= unix_timestamp(now()) and ci.issue_way_ = 'USABLE'
|
|
|
+ <when test="query.useState.code == 'USABLE'">
|
|
|
+ and ci.end_time_ >= unix_timestamp(now()) and ci.use_state_ = 'USABLE'
|
|
|
</when>
|
|
|
- <when test="query.issueWay.code == 'WITHDRAW'">
|
|
|
+ <when test="query.useState.code == 'WITHDRAW'">
|
|
|
and ci.status_ = 0
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
- and ci.issue_way_ = #{query.issueWay}
|
|
|
+ and ci.use_state_ = #{query.useState}
|
|
|
</otherwise>
|
|
|
</choose>
|
|
|
</if>
|
|
|
- <if test="query.useState != null">
|
|
|
- and #{query.useState} = ci.use_state_
|
|
|
+ <if test="query.issueWay != null">
|
|
|
+ and #{query.issueWay} = ci.issue_way_
|
|
|
</if>
|
|
|
<if test="query.issueStartTime != null">
|
|
|
and unix_timestamp( #{query.issueStartTime}) <= ci.issue_time_
|