|
|
@@ -68,11 +68,9 @@
|
|
|
</select>
|
|
|
<select id="findPage" resultType="com.yami.shop.bean.model.PointsRecord">
|
|
|
select * from (
|
|
|
-
|
|
|
select id,user_id,channel_id,order_number,points_id,`code`,parent_code,points,variable_points,points_type,points_audit,expiry_date,creation_date,currently_available_points from tz_points_record where channel_id = #{platform} and user_id = #{userId}
|
|
|
UNION ALL
|
|
|
- SELECT id,user_id,channel_id,order_number,points_id,`code`,parent_code,(points-IFNULL(variable_points,0)) AS points,variable_points, 4 as points_type,points_audit,expiry_date,creation_date,currently_available_points from tz_points_record where channel_id = #{platform} and user_id = #{userId} and expiry_date <=NOW() and points-IFNULL(variable_points,0) >0 and points_type =3
|
|
|
-
|
|
|
+ SELECT id,user_id,channel_id,order_number,points_id,`code`,parent_code,points,variable_points, 4 as points_type,points_audit,expiry_date,creation_date,currently_available_points from tz_points_record where channel_id = #{platform} and user_id = #{userId} and expiry_date <=creation_date and points>0 and points_type =3
|
|
|
) a
|
|
|
order by a.creation_date DESC,a.order_number
|
|
|
|