com.diboot.core.binding.Binder Maven / Gradle / Ivy
Show all versions of diboot-core Show documentation
/*
* Copyright (c) 2015-2020, www.dibo.ltd ([email protected]).
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.diboot.core.binding;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.diboot.core.vo.Pagination;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 绑定器统一调用入口类
* @author [email protected]
* @version v2.0
* @date 2020/04/18
*/
public class Binder {
public static final String COUNT_COL = "_cnt";
/**
* 关联查询一条主表数据
* @param queryWrapper
* @param entityClazz 返回结果entity/vo类
* @return
* @throws Exception
*/
public static T joinQueryOne(QueryWrapper queryWrapper, Class entityClazz){
return JoinsBinder.queryOne(queryWrapper, entityClazz);
}
/**
* 关联查询符合条件的全部主表数据集合(不分页)
* @param queryWrapper 调用QueryBuilder.to*QueryWrapper得到的实例
* @param entityClazz 返回结果entity/vo类
* @return
* @throws Exception
*/
public static List joinQueryList(QueryWrapper queryWrapper, Class entityClazz){
return JoinsBinder.queryList(queryWrapper, entityClazz);
}
/**
* 关联查询符合条件的指定页数据(分页)
* @param queryWrapper 调用QueryBuilder.to*QueryWrapper得到的实例
* @param entityClazz 返回结果entity/vo类
* @param pagination 分页
* @return
* @throws Exception
*/
public static List joinQueryList(QueryWrapper queryWrapper, Class entityClazz, Pagination pagination){
return JoinsBinder.queryList(queryWrapper, entityClazz, pagination);
}
/**
* 关联查询符合条件的指定页数据(分页)
* @param queryWrapper 调用QueryBuilder.to*QueryWrapper得到的实例
* @param entityClazz 返回结果entity/vo类
* @param page 分页
* @return
* @throws Exception
*/
public static IPage joinQueryPage(QueryWrapper queryWrapper, Class entityClazz, Page page){
return JoinsBinder.queryPage(queryWrapper, entityClazz, page);
}
/**
* 关联查询符合条件的指定页数据(分页)
* @param queryWrapper 调用QueryBuilder.to*QueryWrapper得到的实例
* @param entityClazz 返回结果entity/vo类
* @param page 分页
* @return
* @throws Exception
*/
public static IPage