记得上下班打卡 | git大法好,push需谨慎

Commit 6886334c authored by 胡佳晨's avatar 胡佳晨

抽奖数据迁移

parent 0bfda7ad
......@@ -18,7 +18,7 @@ public class SweetConstant {
public final static String REDIS_KEY_SWEET_LUCK_DRAW_SURPLUS = "sweet:artists:luckDraw:surplus:num:";//中奖库存
public final static String REDIS_KEY_SWEET_LUCK_DRAW_ALL = "sweet:artists:luckDraw:all:num:";//中奖总量
public final static String REDIS_KEY_SWEET_LUCK_DRAW_PRESENT_MOBILE = "sweet:artists:luckDraw:present:mobile:";//中奖库存
public final static String REDIS_KEY_SWEET_LUCK_DRAW_PRESENT_MOBILE = "sweet:luckDraw:present:mobile:";//中奖库存
public final static String REDIS_KEY_SWEET_WECHAT_USER_INFO="sweet:wechatUser:unionId:";
public final static String REDIS_KEY_SWEET_WECHAT_USER_INFO_STR="sweet:wechatUser:unionIdStr:";
......
......@@ -328,7 +328,7 @@ public class SweetAppletController {
@ApiImplicitParam(type = "query", dataType = "String", name = "uid", value = "用户id", required = true),
@ApiImplicitParam(type = "query", dataType = "String", name = "luckDrawNum", value = "抽奖编号", required = true),
})
public ResponseDto<Boolean> luckDrawStatus(@RequestParam String uid,
public ResponseDto<Integer> luckDrawStatus(@RequestParam String uid,
@RequestParam String luckDrawNum) {
if (uid.equalsIgnoreCase("0")) {
return ResponseDto.failure();
......
......@@ -70,6 +70,7 @@ public class SweetDataController {
return ResponseDto.success();
} catch (Exception e) {
e.printStackTrace();
return ResponseDto.failure();
}
}
......
......@@ -20,60 +20,60 @@ public interface SweetAnswerMapper extends BaseMapper<SweetAnswer> {
// 鸠占鹊巢 写sql 选中你了
// 海皮威尔门票
@Select({"select user_id as 'uid',user_mobile as 'mobile' from kylin_order_tickets as kot" +
" inner join kylin_order_ticket_status as kots on kot.order_tickets_id = kots.order_id" +
" inner join kylin_order_ticket_relations as kotr on kot.order_tickets_id = kotr.order_id" +
"where (status = 1 or status = 4) and performance_id in (select performances_id from kylin_performances where title like '%海皮威尔%')" +
"group by user_id;"
@Select({"select user_id as 'uid',user_mobile as 'mobile' from kylin_order_tickets as kot " +
" inner join kylin_order_ticket_status as kots on kot.order_tickets_id = kots.order_id " +
" inner join kylin_order_ticket_relations as kotr on kot.order_tickets_id = kotr.order_id " +
" where (status = 1 or status = 4) and performance_id in (select performances_id from kylin_performances where title like '%海皮威尔%')" +
" group by user_id;"
})
List<SweetUserTempVo> selectHPWR();
// 和平饭店门票
@Select({"select user_id as 'uid',user_mobile as 'mobile' from kylin_order_tickets as kot\n" +
" inner join kylin_order_ticket_status as kots on kot.order_tickets_id = kots.order_id\n" +
" inner join kylin_order_ticket_relations as kotr on kot.order_tickets_id = kotr.order_id\n" +
"where (status = 1 or status = 4) and performance_id in (select performances_id from kylin_performances where title like '%和平饭店%')\n" +
"group by user_id;"
@Select({"select user_id as 'uid',user_mobile as 'mobile' from kylin_order_tickets as kot " +
" inner join kylin_order_ticket_status as kots on kot.order_tickets_id = kots.order_id " +
" inner join kylin_order_ticket_relations as kotr on kot.order_tickets_id = kotr.order_id " +
" where (status = 1 or status = 4) and performance_id in (select performances_id from kylin_performances where title like '%和平饭店%')\n" +
" group by user_id;"
})
List<SweetUserTempVo> selectHPFD();
// 虎啸春门票
@Select({"select user_id as 'uid',user_mobile as 'mobile' from kylin_order_tickets as kot" +
" inner join kylin_order_ticket_status as kots on kot.order_tickets_id = kots.order_id" +
" inner join kylin_order_ticket_relations as kotr on kot.order_tickets_id = kotr.order_id" +
"where (status = 1 or status = 4) and performance_id in (select performances_id from kylin_performances where title like '%虎啸春%')" +
"group by user_id;"
@Select({"select user_id as 'uid',user_mobile as 'mobile' from kylin_order_tickets as kot " +
" inner join kylin_order_ticket_status as kots on kot.order_tickets_id = kots.order_id " +
" inner join kylin_order_ticket_relations as kotr on kot.order_tickets_id = kotr.order_id " +
" where (status = 1 or status = 4) and performance_id in (select performances_id from kylin_performances where title like '%虎啸春%')" +
" group by user_id;"
})
List<SweetUserTempVo> selectHXC();
// 会员
@Select({"select au.uid as 'uid',au.mobile as 'mobile' from adam_user_member as aum " +
"inner join adam_user au on aum.uid = au.uid " +
"where aum.state = 1 and aum.expiry_at >= '2021-08-20';"
" inner join adam_user au on aum.uid = au.uid " +
" where aum.state = 1 and aum.expiry_at >= '2021-08-20';"
})
List<SweetUserTempVo> selectMember();
// 消费不小于1
@Select({"select count(0) as 'buyCount',user_id as 'uid',user_mobile as 'mobile' from kylin_order_tickets as kot inner join kylin_order_ticket_status as kots on kot.order_tickets_id = kots.order_id " +
"where (status = 1 or status = 4) " +
"group by user_id " +
"having buyCount >= 1;"
" where (status = 1 or status = 4) " +
" group by user_id " +
" having buyCount >= 1;"
})
List<SweetUserTempVo> selectOrder1();
// 消费不小于2
@Select({"select count(0) as 'buyCount',user_id as 'uid',user_mobile as 'mobile' from kylin_order_tickets as kot inner join kylin_order_ticket_status as kots on kot.order_tickets_id = kots.order_id " +
"where (status = 1 or status = 4) " +
"group by user_id " +
"having buyCount >= 2;"
" where (status = 1 or status = 4) " +
" group by user_id " +
" having buyCount >= 2;"
})
List<SweetUserTempVo> selectOrder2();
// 消费不小于3
@Select({"select count(0) as 'buyCount',user_id as 'uid',user_mobile as 'mobile' from kylin_order_tickets as kot inner join kylin_order_ticket_status as kots on kot.order_tickets_id = kots.order_id " +
"where (status = 1 or status = 4) " +
"group by user_id " +
"having buyCount >= 2;"
" where (status = 1 or status = 4) " +
" group by user_id " +
" having buyCount >= 2;"
})
List<SweetUserTempVo> selectOrder3();
......
......@@ -391,9 +391,9 @@ public class RedisDataUtils {
}
//获取抽奖状态
public Boolean getLuckDrawStatus(String uid, String luckDrawNum) {
public int getLuckDrawStatus(String uid, String luckDrawNum) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_LUCK_DRAW.concat(uid).concat(":luckDrawNum:" + luckDrawNum);
return redisUtil.hasKey(redisKey);
return (int) redisUtil.get(redisKey);
}
//修改抽奖状态
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment