| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- package com.cyksj.mapper;
- import cn.hutool.core.date.DateTime;
- import com.baomidou.mybatisplus.core.mapper.BaseMapper;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.cyksj.model.entity.GroupsRelation;
- import com.cyksj.model.entity.PhoneCode;
- import com.cyksj.model.manage.views.GroupsRelationBackView;
- import com.cyksj.model.manage.views.GroupsRelationView;
- import com.cyksj.model.response.GptRechargeStatisticsRecordResp;
- import com.cyksj.model.views.GroupsRelationUserView;
- import com.cyksj.model.views.RenewalView;
- import com.cyksj.model.views.UserRecommendGoodsFrontView;
- import com.cyksj.model.views.UserTicketView;
- import org.apache.ibatis.annotations.Param;
- import org.apache.ibatis.annotations.Select;
- import org.apache.ibatis.annotations.Update;
- import java.util.Date;
- import java.util.List;
- /**
- * @author chan
- * @date 2022/9/27 11:10 AM
- */
- public interface GroupsRelationMapper extends BaseMapper<GroupsRelation> {
- @Select("select * from groups_relation where id = #{relationId} for update")
- GroupsRelation selectByIdForUpdate(@Param("relationId") Long relationId);
- /**
- * Database ownership fence for assigning an available seat. Redis only
- * reduces contention; this CAS is the cross-process source of truth.
- */
- @Update("update groups_relation set user_id = #{userId}, status = #{status}, " +
- "start_time = #{startTime}, expiry_time = #{expiryTime}, yhs_id = #{yhsId}, " +
- "cmt = #{cmt} where id = #{id} and user_id = 0 and status = 'none'")
- int claimAvailableRelation(@Param("id") Long id,
- @Param("userId") Long userId,
- @Param("status") GroupsRelation.Status status,
- @Param("startTime") Date startTime,
- @Param("expiryTime") Date expiryTime,
- @Param("yhsId") Long yhsId,
- @Param("cmt") Integer cmt);
- /**
- * Claims a dynamically allocated outside seat without changing its outside
- * status. The ownership predicates prevent the main service and recovery
- * job from assigning the same relation concurrently.
- */
- @Update("update groups_relation set user_id = #{userId}, " +
- "start_time = #{startTime}, expiry_time = #{expiryTime}, yhs_id = #{yhsId}, " +
- "cmt = #{cmt} where id = #{id} and user_id = 0 and status = 'outside'")
- int claimOutsideRelation(@Param("id") Long id,
- @Param("userId") Long userId,
- @Param("startTime") Date startTime,
- @Param("expiryTime") Date expiryTime,
- @Param("yhsId") Long yhsId,
- @Param("cmt") Integer cmt);
- List<Long> getAccountIdsByUserIdOrNickNameOrSubmitAccount(@Param("userId") Long userId, @Param("nickName") String nickName, @Param("submitAccount") String submitAccount);
- Integer updateExpiryTime(@Param("entity") GroupsRelation relation, @Param("expireTime") Date expireTime);
- Long getGroupTripsSkuIdByRelationId(Long relationId);
- @Update("update groups_relation set customer_service = null where id = #{id}")
- void updateCustomerService(Long id);
- Long selectSimilarExpiredRelation(@Param("skuId") Long skuId, @Param("minExpiryTime") DateTime minExpiryTime, @Param("maxNum") Integer maxNum, @Param("ip") String ip);
- List<GroupsRelationView> selectRelationByGoodsId(@Param("goodsId") Long goodsId, @Param("userIds") List<Long> userIds, @Param("yhsId") Long yhsId);
- GroupsRelationView getGroupRelationViewByUserIdAndRelationId(@Param("userId") Long userId, @Param("relationId") Long relationId);
- String getBindPhoneByUserId(Long userId);
- Integer selectViewPwdCount(Long groupsId);
- GroupsRelation selectRandomOneRelationByGroupsId(Long groupsId);
- List<GroupsRelation> selectExpiredRelationByCondition(@Param("now") DateTime now, @Param("list") List<Long> filterSkuIds);
- GroupsRelation selectOutsideRelationByGroupsId(@Param("groupsId") Long groupsId, @Param("relationNum") Integer relationNum);
- List<GroupsRelation> selectExpiredChatGPTRelation(@Param("nextBeginDay") DateTime nextBeginDay, @Param("list") List<Long> gptSkuIds);
- List<GroupsRelationUserView> getUserRelationUserViews(@Param("groupsId") Long groupsId, @Param("relationId") Long relationId, @Param("userId") Long userId, @Param("status") List<GroupsRelation.Status> status);
- List<Long> getTicketGoodsId(@Param("list") List<Long> userIds, @Param("status") List<String> status);
- Page<UserRecommendGoodsFrontView> getRecommendGoodsViews(@Param("page") Page<UserRecommendGoodsFrontView> page, @Param("list") List<Long> filter_goods_id, @Param("isPayNf") Boolean isPayNf, @Param("filterCourseGoods") Boolean filterCourseGoods, @Param("yhShopGoodsIds") List<Long> yhShopGoodsIds);
- Long getOutSideGroupsTripsRelationByGoodsId(@Param("skuId") Long skuId, @Param("beginOfDay") DateTime beginOfDay, @Param("extraNum") Integer extraNum, @Param("userId") Long userId, @Param("skuNum") Integer skuNum, @Param("maxNum") Integer maxNum);
- Integer selectAvailableRelation(@Param("skuId") Long skuId, @Param("skuNum") Integer skuNum);
- Integer selectSpecialGroupsRelationAvailable(@Param("skuId") Long skuId, @Param("maxNum") Integer maxNum, @Param("skuNum") Integer skuNum, @Param("extractNum") Integer extractNum, @Param("tenExpiry") DateTime tenExpiry);
- Integer selectNumWaitingGroups(Long skuId);
- Integer selectLimitAvailableNum(@Param("skuId") Long skuId, @Param("maxNum") Integer maxNum);
- GroupsRelationBackView getGroupRelationAccountView(Long relationId);
- PhoneCode getAreaPhoneByUserId(Long userId);
- List<RenewalView> getUserHasPayGoods(@Param("list") List<Long> userIds, @Param("now") DateTime now);
- Long getExperienceTicket(@Param("userId") Long userId, @Param("skuId") Long skuId);
- Long selectGoodsDonQaByGoodsId(Long goodsId);
- GroupsRelation selectRelationByAccountAndNum(@Param("account") String account, @Param("password") String password, @Param("goodsId") Long goodsId, @Param("num") Integer num);
- List<GroupsRelation> selectExtraRelation(@Param("userId") Long userId, @Param("skuId") Long skuId, @Param("relationId") Long relationId);
- void incrExpiryTime(@Param("relationId") Long relationId, @Param("userId") Long userId);
- List<UserTicketView> selectUserTickets(@Param("userIds") List<Long> userIds, @Param("goodsId") Long goodsId, @Param("skuId") Long skuId);
- Integer selectCountByGoodsId(@Param("userIds") List<Long> userIdList, @Param("goodsId") Long goodsId, @Param("now") DateTime now);
- Integer updateUserVipSkusExpiryTime(@Param("userIds") List<Long> userIds, @Param("vipSkuIds") List<Long> vipSkuIds, @Param("expiryTime") Date expiryTime);
- List<GptRechargeStatisticsRecordResp> selectRechargeRecordNum(@Param("goodsIds") List<Long> goodsIds, @Param("start") String start, @Param("end") String end, @Param("operator") String operator);
- }
|