| | |
| | | limit #{pageNum}, #{size} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="queryCoupon1" resultType="map"> |
| | | select |
| | | a.id as id, |
| | | a.money as money, |
| | | a.couponUseType as userType, |
| | | DATE_FORMAT(a.expirationTime, '%Y-%m-%d') as time, |
| | | a.couponType as `type`, |
| | | a.fullMoney as fullMoney, |
| | | a.state as state, |
| | | b.`name` as `name`, |
| | | c.citys |
| | | from t_user_coupon_record a |
| | | left join t_company b on (a.companyId = b.id) |
| | | left join t_sys_coupon_record c on (a.couponId = c.id) |
| | | where a.expirationTime >= now() |
| | | <if test="null != uid"> |
| | | and a.userId = #{uid} |
| | | </if> |
| | | <if test="null != cityCode and '' != cityCode"> |
| | | and JSON_CONTAINS(c.citys, #{cityCode}) |
| | | </if> |
| | | <if test="null != state"> |
| | | and a.state = #{state} |
| | | </if> |
| | | <if test="null != couponUseType"> |
| | | and a.couponUseType = #{couponUseType} |
| | | </if> |
| | | <if test="null != money"> |
| | | and if(a.couponType = 1, a.money <= #{money}, a.fullMoney <= #{money}) |
| | | </if> |
| | | order by a.insertTime desc |
| | | <if test="null != pageNum and null != size"> |
| | | limit #{pageNum}, #{size} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | |
| | |
| | | a.couponType as `type`, |
| | | a.fullMoney as fullMoney, |
| | | a.state as state, |
| | | b.`name` as `name` |
| | | b.`name` as `name`, |
| | | c.citys |
| | | from t_user_coupon_record a |
| | | left join t_company b on (a.companyId = b.id) |
| | | left join t_sys_coupon_record c on (a.couponId = c.id) |
| | | where 1 = 1 |
| | | <if test="null != uid"> |
| | | and a.userId = #{uid} |