...
|
...
|
@@ -148,15 +148,35 @@ |
|
|
<if test="param.name != null">
|
|
|
and coupon_name=#{param.name}
|
|
|
</if>
|
|
|
<if test="param.status != null">
|
|
|
and status=#{param.status}
|
|
|
</if>
|
|
|
|
|
|
<if test="param.startTime != null">
|
|
|
and start_time>=#{param.startTime}
|
|
|
</if>
|
|
|
<if test="param.endTime != null">
|
|
|
and end_time <![CDATA[<= ]]> #{param.endTime}
|
|
|
</if>
|
|
|
<if test="param.status != null">
|
|
|
<if test="param.status == 3">
|
|
|
<!--已作废-->
|
|
|
and status=#{param.status}
|
|
|
</if>
|
|
|
<if test="param.status == 2">
|
|
|
<!--已过期-->
|
|
|
and end_time <![CDATA[< ]]> #{param.curTime}
|
|
|
and status != 3
|
|
|
</if>
|
|
|
<if test="param.status == 1">
|
|
|
<!--生效中-->
|
|
|
and start_time <![CDATA[<= ]]> #{param.curTime}
|
|
|
and end_time >= #{param.curTime}
|
|
|
and status != 3
|
|
|
</if>
|
|
|
<if test="param.status == 0">
|
|
|
<!--未生效-->
|
|
|
and start_time > #{param.curTime}
|
|
|
and status != 3
|
|
|
</if>
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="selectByCondition" resultType="com.yoho.ufo.model.coupon.Coupon">
|
|
|
select <include refid="Base_Column_List" /> from coupon where 1=1
|
...
|
...
|
@@ -166,15 +186,34 @@ |
|
|
<if test="param.name != null">
|
|
|
and coupon_name=#{param.name}
|
|
|
</if>
|
|
|
<if test="param.status != null">
|
|
|
and status=#{param.status}
|
|
|
</if>
|
|
|
<if test="param.startTime != null">
|
|
|
and start_time>=#{param.startTime}
|
|
|
</if>
|
|
|
<if test="param.endTime != null">
|
|
|
and end_time <![CDATA[<= ]]> #{param.endTime}
|
|
|
</if>
|
|
|
<if test="param.status != null">
|
|
|
<if test="param.status == 3">
|
|
|
<!--已作废-->
|
|
|
and status=#{param.status}
|
|
|
</if>
|
|
|
<if test="param.status == 2">
|
|
|
<!--已过期-->
|
|
|
and end_time <![CDATA[< ]]> #{param.curTime}
|
|
|
and status != 3
|
|
|
</if>
|
|
|
<if test="param.status == 1">
|
|
|
<!--生效中-->
|
|
|
and start_time <![CDATA[<= ]]> #{param.curTime}
|
|
|
and end_time >= #{param.curTime}
|
|
|
and status != 3
|
|
|
</if>
|
|
|
<if test="param.status == 0">
|
|
|
<!--未生效-->
|
|
|
and start_time > #{param.curTime}
|
|
|
and status != 3
|
|
|
</if>
|
|
|
</if>
|
|
|
order by id desc
|
|
|
<if test="param.size > 0">
|
|
|
limit #{param.start},#{param.size}
|
...
|
...
|
|