Merge remote-tracking branch 'origin/test' into test
| | |
| | | @ApiModelProperty("戳戳币总额") |
| | | private Integer coins; |
| | | |
| | | @ApiModelProperty("戳戳币剩余数量") |
| | | private Integer surplusCoins; |
| | | |
| | | @ApiModelProperty("地址") |
| | | private String address; |
| | | |
| | |
| | | */ |
| | | @GetMapping("/statistics/top") |
| | | public R getTopStatistics(@RequestParam("type") Integer type, @RequestParam("userId") Long userId) { |
| | | if (type.equals(1)) { |
| | | //戳戳游戏 |
| | | return mcsGameService.getTopStatistics(userId); |
| | | } else if (type.equals(2)) { |
| | | //戳戳资讯 |
| | | return mcsInformationService.getTopStatistics(userId); |
| | | } else { |
| | | return R.fail("未知错误"); |
| | | } |
| | | return mcsGameService.getTopStatistics(userId, type); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 查询商家下已被领取的卷总数 |
| | | * @param merchantId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | Integer selectAppliedCount(@Param("merchantId") Long merchantId); |
| | | Integer selectAppliedCount(@Param("merchantId") Long merchantId, @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 查询商家下已被核销的卷总数 |
| | | * @param merchantId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | Integer selectVerifiedCount(@Param("merchantId") Long merchantId); |
| | | Integer selectVerifiedCount(@Param("merchantId") Long merchantId, @Param("type") Integer type); |
| | | |
| | | /** |
| | | * 获取热门游戏 |
| | |
| | | /** |
| | | * 戳戳游戏顶部统计数据 |
| | | * @param userId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | R getTopStatistics(Long userId); |
| | | R getTopStatistics(Long userId, Integer type); |
| | | |
| | | /** |
| | | * 戳戳卷领取 |
| | |
| | | /** |
| | | * 戳戳游戏顶部统计数据 |
| | | * @param userId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getTopStatistics(Long userId) { |
| | | public R getTopStatistics(Long userId, Integer type) { |
| | | McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getUserId, userId)); |
| | | if (isNull(mcsMerchant)) { |
| | | return R.fail("未查询到商家信息"); |
| | |
| | | int surplusLitDays = DateUtils.retrieveRemainingDays(mcsMerchant.getExpireAt()); |
| | | topStatisticsVO.setSurplusLitDays(surplusLitDays > 0 ? surplusLitDays : 0); |
| | | } |
| | | Integer appliedCount = this.baseMapper.selectAppliedCount(mcsMerchant.getId()); |
| | | Integer appliedCount = this.baseMapper.selectAppliedCount(mcsMerchant.getId(), type); |
| | | topStatisticsVO.setAppliedTotal(appliedCount); |
| | | Integer verifiedCount = this.baseMapper.selectVerifiedCount(mcsMerchant.getId()); |
| | | Integer verifiedCount = this.baseMapper.selectVerifiedCount(mcsMerchant.getId(), type); |
| | | topStatisticsVO.setVerifiedTotal(verifiedCount); |
| | | |
| | | Integer publishLimit = mcsMerchant.getPublishLimit(); |
| | |
| | | public R getMcsGame(Long gameId) { |
| | | McsGameVO mcsGameVO = this.baseMapper.selectDetailById(gameId); |
| | | Integer gameCount = this.baseMapper.selectCount(new QueryWrapper<McsGame>().lambda() |
| | | .eq(McsGame::getMerchantId, mcsGameVO.getMerchantId()).eq(McsGame::getStatus, McsGame.Status.jxz).eq(McsGame::getIsDel, false)); |
| | | .eq(McsGame::getMerchantId, mcsGameVO.getMerchantId()).eq(McsGame::getStatus, McsGame.Status.jxz) |
| | | .eq(McsGame::getType, mcsGameVO.getType()).eq(McsGame::getIsDel, false)); |
| | | mcsGameVO.setGameCount(gameCount); |
| | | return R.ok(mcsGameVO); |
| | | } |
| | |
| | | <if test="type != null"> |
| | | AND t2.type = #{type} |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | <select id="pageJoinGameList" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO"> |
| | |
| | | <if test="pageJoinGameListDTO.keyword != null and pageJoinGameListDTO.keyword != """> |
| | | AND t2.`name` LIKE CONCAT(#{pageJoinGameListDTO.keyword}, '%') |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | <select id="getMcsGameStatistics" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.GameStatisticsVO"> |
| | |
| | | OR t3.phone LIKE CONCAT(#{pageMcsEvaluateDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | <select id="getMcsEvaluate" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO"> |
| | |
| | | SELECT COUNT(1) |
| | | FROM mcs_coupon t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | WHERE t2.merchant_id = #{merchantId} |
| | | WHERE t2.merchant_id = #{merchantId} AND t2.`type` = #{type} |
| | | </select> |
| | | <select id="selectVerifiedCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(1) |
| | | FROM mcs_coupon t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | WHERE t1.is_verified = 1 AND t2.merchant_id = #{merchantId} |
| | | WHERE t1.is_verified = 1 AND t2.merchant_id = #{merchantId} AND t2.`type` = #{type} |
| | | </select> |
| | | <select id="selectPopularGame" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | |
| | | <select id="pageH5McsGame" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | SELECT * FROM ( |
| | | SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons, t1.award_type, t1.cover, |
| | | SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons, t1.award_type, t1.cover, t1.coins, t1.surplus_coins, |
| | | t1.publish_at, t1.`status`, t1.merchant_id, t1.lat, t1.lon, t2.`name` AS merchantName, |
| | | ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((t1.lat * PI() / 180 - #{pageMcsGameDTO.lat} * PI() / 180) / 2),2) |
| | | + |
| | |
| | | #{pageMcsMerchantDTO.lon} * PI() / 180) / 2),2))), 2) AS distance |
| | | FROM mcs_merchant t1 |
| | | LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id |
| | | <if test="pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 1">LEFT JOIN (SELECT * FROM mcs_game |
| | | WHERE `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | <if test=" |
| | | pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 2">LEFT JOIN (SELECT * FROM mcs_information WHERE |
| | | `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | <if test="pageMcsMerchantDTO.type != null"> |
| | | LEFT JOIN (SELECT * FROM mcs_game |
| | | WHERE `status` = 2 AND `type` = #{pageMcsMerchantDTO.type} AND expire_at > NOW() GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | WHERE t1.is_del = 0 AND t1.expire_at > NOW() AND t2.`status` = 1 |
| | | <if test="pageMcsMerchantDTO.type != null"> |
| | |
| | | OR t1.`name` LIKE CONCAT('%', #{pageVerifyRecordDTO.keyword}, '%') |
| | | ) |
| | | </if> |
| | | ORDER BY t1.verified_at DESC |
| | | </select> |
| | | |
| | | </mapper> |