|
@@ -133,7 +133,7 @@
|
|
|
startDate,
|
|
|
endDate,
|
|
|
</if>
|
|
|
- <if test="userId >0">
|
|
|
+ <if test="userId != null and userId > 0">
|
|
|
if(#{registerTime} <![CDATA[ > ]]> startDate and #{registerTime} <![CDATA[ < ]]> endDate,#{registerTime},startDate) as startDate,
|
|
|
if(receiveFlag=1,endDate,date_add(if(#{registerTime} <![CDATA[ > ]]> startDate and #{registerTime} <![CDATA[ < ]]> endDate,#{registerTime},startDate),interval receivePeriod day)) as endDate,
|
|
|
</if>
|
|
@@ -156,7 +156,7 @@
|
|
|
AND NOW() <![CDATA[ > ]]> startDate
|
|
|
AND NOW() <![CDATA[ < ]]> if(receiveFlag = 1,endDate,date_add(startDate,interval receivePeriod day))
|
|
|
</if>
|
|
|
- <if test="userId > 0">
|
|
|
+ <if test="userId != null and userId > 0">
|
|
|
AND id NOT IN(SELECT couponId FROM cm_coupon_club WHERE userId = #{userId})
|
|
|
AND (couponType IN (0,1,3)
|
|
|
OR (couponType = 2 AND userId = #{userId})
|
|
@@ -306,4 +306,7 @@
|
|
|
LEFT JOIN shop s ON cc.shopId = s.shopId
|
|
|
where id = #{couponId}
|
|
|
</select>
|
|
|
+ <select id="findUserPermission" resultType="java.lang.Integer">
|
|
|
+ select userPermission from user where userID = #{userId}
|
|
|
+ </select>
|
|
|
</mapper>
|