mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	!510 add BaseMapperPlus提供一组可选是否抛出异常的selectVoOne方法
* add BaseMapperPlus提供一组可选是否抛出异常的selectVoOne方法
This commit is contained in:
		@@ -144,11 +144,22 @@ public interface BaseMapperPlus<T, V> extends BaseMapper<T> {
 | 
			
		||||
        return selectVoOne(wrapper, this.currentVoClass());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    default V selectVoOne(Wrapper<T> wrapper, boolean throwEx) {
 | 
			
		||||
        return selectVoOne(wrapper, this.currentVoClass(), throwEx);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据 entity 条件,查询一条记录
 | 
			
		||||
     */
 | 
			
		||||
    default <C> C selectVoOne(Wrapper<T> wrapper, Class<C> voClass) {
 | 
			
		||||
        T obj = this.selectOne(wrapper);
 | 
			
		||||
        return selectVoOne(wrapper, voClass, true);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据 entity 条件,查询一条记录
 | 
			
		||||
     */
 | 
			
		||||
    default <C> C selectVoOne(Wrapper<T> wrapper, Class<C> voClass, boolean throwEx) {
 | 
			
		||||
        T obj = this.selectOne(wrapper, throwEx);
 | 
			
		||||
        if (ObjectUtil.isNull(obj)) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user