嗨森逛服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hai-server/hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapper...

51 lines
1.8 KiB

4 years ago
package com.hai.dao;
4 years ago
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
4 years ago
/**
* mapper扩展类
*/
public interface HighActivityAwardUserMapperExt {
4 years ago
3 years ago
@Select(" select insert(b.phone, 4, 4, '****') phone,a.name awardName,a.create_time receiveTime from " +
4 years ago
" (select a.create_time, b.name,a.user_id " +
" from high_activity_award_user a,high_activity_award b " +
" where a.activity_award_id = b.id and a.activity_info_id = #{activityId} " +
" ORDER BY a.create_time desc LIMIT 50) a" +
" LEFT JOIN high_user b on b.id = a.user_id")
List<Map<String, Object>> selectWinLotteryList(@Param("activityId") Long activityId);
4 years ago
/**
* 查询活动中奖的用户
* @param activityId
* @param param
* @return
*/
@Select("<script>" +
" select " +
" b.phone userPhone," +
" b.`name` userName," +
" a.`name` awardName," +
" a.create_time winLotteryTime " +
" from " +
" (select a.user_id,b.name,a.create_time from high_activity_award_user a,high_activity_award b" +
" where " +
" a.activity_award_id = b.id " +
" and b.activity_info_id = #{activityId}" +
" <if test='param.awardName != null'> and b.`name` LIKE concat('%',#{param.awardName},'%') </if>" +
" GROUP BY a.id" +
" ORDER BY a.create_time desc) a" +
" LEFT JOIN high_user b on a.user_id = b.id" +
" where 1 = 1" +
" <if test='param.userPhone != null'> and b.phone = #{param.userPhone} </if>" +
"</script>")
List<Map<String, Object>> selectWinLotteryUserList(@Param("activityId") Long activityId, @Param("param") Map<String, Object> param);
4 years ago
}