| | |
| | | </if> |
| | | order by insertTime desc |
| | | </select> |
| | | <select id="queryCouponListOfSearch1" resultType="java.util.Map"> |
| | | SELECT id, |
| | | `name`, |
| | | useScope, |
| | | `type`, |
| | | distributionMethod, |
| | | date_format(startTime ,'%Y-%m-%d') as startTime, |
| | | date_format(endTime ,'%Y-%m-%d') as endTime, |
| | | userPopulation, |
| | | quantityIssued, |
| | | pickUpQuantity, |
| | | `status`, |
| | | state, |
| | | illustrate |
| | | from t_coupon |
| | | where 1 = 1 and distributionMethod = 4 |
| | | <if test="cityCode != null"> |
| | | and id in( |
| | | SELECT DISTINCT couponId FROM |
| | | |
| | | (SELECT DISTINCT couponId |
| | | from t_coupon_store |
| | | WHERE storeId = #{storeId} |
| | | UNION ALL |
| | | SELECT DISTINCT couponId |
| | | |
| | | from t_coupon_city |
| | | WHERE provinceCode = #{cityCode}) o) |
| | | </if> |
| | | <if test="name != null"> |
| | | and `name` like concat('%', #{name}, '%') |
| | | </if> |
| | | <if test="type != null"> |
| | | and type = #{type} |
| | | </if> |
| | | |
| | | <if test="userPopulation != null"> |
| | | and userPopulation = #{userPopulation} |
| | | </if> |
| | | <if test="status !=null"> |
| | | and `status` = #{status} |
| | | </if> |
| | | <if test="state != null"> |
| | | and `state` = #{state} |
| | | </if> |
| | | |
| | | |
| | | union all |
| | | SELECT id, |
| | | `name`, |
| | | useScope, |
| | | `type`, |
| | | distributionMethod, |
| | | date_format(startTime ,'%Y-%m-%d') as startTime, |
| | | date_format(endTime ,'%Y-%m-%d') as endTime, |
| | | userPopulation, |
| | | quantityIssued, |
| | | pickUpQuantity, |
| | | `status`, |
| | | state, |
| | | illustrate |
| | | from t_coupon |
| | | where 1 = 1 and distributionMethod = 4 and useScope = 1 |
| | | |
| | | <if test="name != null"> |
| | | and `name` like concat('%', #{name}, '%') |
| | | </if> |
| | | <if test="type != null"> |
| | | and type = #{type} |
| | | </if> |
| | | |
| | | <if test="userPopulation != null"> |
| | | and userPopulation = #{userPopulation} |
| | | </if> |
| | | <if test="status !=null"> |
| | | and `status` = #{status} |
| | | </if> |
| | | <if test="state != null"> |
| | | and `state` = #{state} |
| | | </if> |
| | | |
| | | </select> |
| | | <select id="queryCouponExamineList" resultType="java.util.Map"> |
| | | SELECT id, |
| | | `name`, |