| | |
| | | |
| | | <select id="queryConponRuleOfJson" resultType="java.util.Map"> |
| | | SELECT JSON_EXTRACT(content, "$.conditionalAmount") as conditionalAmount, |
| | | JSON_EXTRACT(content, "$.deductionAmount") as deductionAmount, |
| | | JSON_EXTRACT(content, "$.experienceName") as experienceName |
| | | JSON_EXTRACT(content, "$.deductionAmount") as deductionAmount, |
| | | JSON_EXTRACT(content, "$.experienceName") as experienceName |
| | | FROM t_coupon |
| | | where 1=1 |
| | | <if test="id != null"> |
| | | and `id` = #{id} |
| | | and `id` = #{id} |
| | | </if> |
| | | </select> |
| | | <select id="queryCouponListOfSearch" resultType="java.util.Map"> |
| | |
| | | </if> |
| | | |
| | | <if test="cityCode != null"> |
| | | and id in( |
| | | and id in( |
| | | SELECT DISTINCT couponId FROM |
| | | |
| | | (SELECT DISTINCT couponId |
| | |
| | | and `state` = #{state} |
| | | </if> |
| | | and auditStatus = 2 |
| | | order by insertTime desc |
| | | order by insertTime desc |
| | | </select> |
| | | <select id="queryCouponListOfSearch1" resultType="java.util.Map"> |
| | | SELECT id, |
| | |
| | | state, |
| | | illustrate |
| | | from t_coupon |
| | | where 1 = 1 and distributionMethod = 4 |
| | | where 1 = 1 and distributionMethod = 4 |
| | | and auditStatus = 2 |
| | | and startTime < now() |
| | | and startTime < now() |
| | | <if test="cityCode != null"> |
| | | and id in( |
| | | SELECT DISTINCT couponId FROM |
| | |
| | | state, |
| | | illustrate |
| | | from t_coupon |
| | | where 1 = 1 and distributionMethod = 4 and useScope = 1 |
| | | where 1 = 1 and distributionMethod = 4 and useScope = 1 |
| | | and auditStatus = 2 |
| | | and startTime < now() |
| | | and startTime < now() |
| | | <if test="name != null"> |
| | | and `name` like concat('%', #{name}, '%') |
| | | </if> |
| | |
| | | </select> |
| | | <select id="queryCouponExamineList" 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, |
| | | auditStatus, |
| | | `name`, |
| | | useScope, |
| | | `type`, |
| | | distributionMethod, |
| | | date_format(startTime ,'%Y-%m-%d') as startTime, |
| | | date_format(endTime ,'%Y-%m-%d') as endTime, |
| | | userPopulation, |
| | | quantityIssued, |
| | | pickUpQuantity, |
| | | auditStatus, |
| | | publisherType, |
| | | cityManagerId |
| | | from t_coupon |
| | |
| | | order by insertTime desc |
| | | </select> |
| | | <select id="listRecord" resultType="java.util.Map"> |
| | | select id,userId,status from t_user_coupon where couponId =#{id} |
| | | and userId in <foreach collection="ids" separator="," open="(" item="i" close=")"> |
| | | #{i} |
| | | </foreach> |
| | | <if test="type !=null"> |
| | | and status =#{type} |
| | | </if> |
| | | select id,userId,status from t_user_coupon where couponId =#{id} |
| | | and userId in |
| | | <foreach collection="ids" separator="," open="(" item="i" close=")"> |
| | | #{i} |
| | | </foreach> |
| | | <if test="type !=null"> |
| | | and status =#{type} |
| | | </if> |
| | | </select> |
| | | |
| | | |