Merge remote-tracking branch 'origin/master'
This commit is contained in:
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.common.mapper;
|
||||
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.domain.Annex;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
import org.apache.ibatis.annotations.Options;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 务工者Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-14
|
||||
*/
|
||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface WgzMapper extends BaseMapperPlus<BgtProjectRecruitApply> {
|
||||
|
||||
@Select("SELECT count(1) FROM bgt_project_recruit_apply WHERE user_id = #{userId} and status in ('3','5') FOR UPDATE")
|
||||
@Options(useCache = false) // 禁用 MyBatis 缓存
|
||||
Integer QueryWhetherTheCurrentUserHasAnOngoingProject(@Param("userId") Long userId);
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.ruoyi.common.service;
|
||||
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
|
||||
public interface IWgzService extends IServicePlus<BgtProjectRecruitApply> {
|
||||
//行级锁-查询当前用户是否已有进行中项目
|
||||
Integer QueryWhetherTheCurrentUserHasAnOngoingProject(Long userId);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.ruoyi.common.service.impl;
|
||||
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.ruoyi.common.mapper.WgzMapper;
|
||||
import com.ruoyi.common.service.IWgzService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class WgzServiceImpl extends ServicePlusImpl<WgzMapper, BgtProjectRecruitApply> implements IWgzService {
|
||||
|
||||
@Override
|
||||
public Integer QueryWhetherTheCurrentUserHasAnOngoingProject(Long userId) {
|
||||
return baseMapper.QueryWhetherTheCurrentUserHasAnOngoingProject(userId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user