|
|
@@ -31,274 +31,274 @@ import java.util.function.Function;
|
|
|
*/
|
|
|
@Component
|
|
|
@TenantIgnore
|
|
|
-public class TenantIgnoreUtil<T extends BaseService<E>,E extends BaseEntity> {
|
|
|
+public class TenantIgnoreUtil<S extends BaseService<T>,T extends BaseEntity>{
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean deleteLogic(T t, @NotEmpty List ids) {
|
|
|
- return t.deleteLogic(ids);
|
|
|
+ public boolean deleteLogic(S s, @NotEmpty List ids) {
|
|
|
+ return s.deleteLogic(ids);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean changeStatus(T t, @NotEmpty List ids, Integer status) {
|
|
|
- return t.changeStatus(ids, status);
|
|
|
+ public boolean changeStatus(S s, @NotEmpty List ids, Integer status) {
|
|
|
+ return s.changeStatus(ids, status);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean save(T t, E entity) {
|
|
|
- return t.save(entity);
|
|
|
+ public boolean save(S s, T entity) {
|
|
|
+ return s.save(entity);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean saveBatch(T t, Collection entityList) {
|
|
|
- return t.saveBatch(entityList);
|
|
|
+ public boolean saveBatch(S s, Collection entityList) {
|
|
|
+ return s.saveBatch(entityList);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean saveBatch(T t, Collection entityList, int batchSize) {
|
|
|
- return t.saveBatch(entityList, batchSize);
|
|
|
+ public boolean saveBatch(S s, Collection entityList, int batchSize) {
|
|
|
+ return s.saveBatch(entityList, batchSize);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean saveOrUpdateBatch(T t, Collection entityList) {
|
|
|
- return t.saveOrUpdateBatch(entityList);
|
|
|
+ public boolean saveOrUpdateBatch(S s, Collection entityList) {
|
|
|
+ return s.saveOrUpdateBatch(entityList);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean saveOrUpdateBatch(T t, Collection entityList, int batchSize) {
|
|
|
- return t.saveOrUpdateBatch(entityList, batchSize);
|
|
|
+ public boolean saveOrUpdateBatch(S s, Collection entityList, int batchSize) {
|
|
|
+ return s.saveOrUpdateBatch(entityList, batchSize);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean removeById(T t, Serializable id) {
|
|
|
- return t.removeById(id);
|
|
|
+ public boolean removeById(S s, Serializable id) {
|
|
|
+ return s.removeById(id);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean remove(T t, Wrapper queryWrapper) {
|
|
|
- return t.remove(queryWrapper);
|
|
|
+ public boolean remove(S s, Wrapper queryWrapper) {
|
|
|
+ return s.remove(queryWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean updateById(T t, E entity) {
|
|
|
- return t.updateById(entity);
|
|
|
+ public boolean updateById(S s, T entity) {
|
|
|
+ return s.updateById(entity);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean update(T t, Wrapper updateWrapper) {
|
|
|
- return t.update(updateWrapper);
|
|
|
+ public boolean update(S s, Wrapper updateWrapper) {
|
|
|
+ return s.update(updateWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean update(T t, E entity, Wrapper updateWrapper) {
|
|
|
- return t.update(entity, updateWrapper);
|
|
|
+ public boolean update(S s, T entity, Wrapper updateWrapper) {
|
|
|
+ return s.update(entity, updateWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean updateBatchById(T t, Collection entityList) {
|
|
|
- return t.updateBatchById(entityList);
|
|
|
+ public boolean updateBatchById(S s, Collection entityList) {
|
|
|
+ return s.updateBatchById(entityList);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean removeByIds(T t, Collection idList) {
|
|
|
- return t.removeByIds(idList);
|
|
|
+ public boolean removeByIds(S s, Collection idList) {
|
|
|
+ return s.removeByIds(idList);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean removeByMap(T t, Map columnMap) {
|
|
|
- return t.removeByMap(columnMap);
|
|
|
+ public boolean removeByMap(S s, Map columnMap) {
|
|
|
+ return s.removeByMap(columnMap);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean updateBatchById(T t, Collection entityList, int batchSize) {
|
|
|
- return t.updateBatchById(entityList, batchSize);
|
|
|
+ public boolean updateBatchById(S s, Collection entityList, int batchSize) {
|
|
|
+ return s.updateBatchById(entityList, batchSize);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean saveOrUpdate(T t, E entity) {
|
|
|
- return t.saveOrUpdate(entity);
|
|
|
+ public boolean saveOrUpdate(S s, T entity) {
|
|
|
+ return s.saveOrUpdate(entity);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public E getById(T t, Serializable id) {
|
|
|
- return t.getById(id);
|
|
|
+ public T getById(S s, Serializable id) {
|
|
|
+ return s.getById(id);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public E getOne(T t, Wrapper<E> queryWrapper) {
|
|
|
- return t.getOne(queryWrapper);
|
|
|
+ public T getOne(S s, Wrapper<T> queryWrapper) {
|
|
|
+ return s.getOne(queryWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List listByMap(T t, Map columnMap) {
|
|
|
- return t.listByMap(columnMap);
|
|
|
+ public List listByMap(S s, Map columnMap) {
|
|
|
+ return s.listByMap(columnMap);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List listByIds(T t, Collection idList) {
|
|
|
- return t.listByIds(idList);
|
|
|
+ public List listByIds(S s, Collection idList) {
|
|
|
+ return s.listByIds(idList);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public E getOne(T t, Wrapper<E> queryWrapper, boolean throwEx) {
|
|
|
- return t.getOne(queryWrapper, throwEx);
|
|
|
+ public T getOne(S s, Wrapper<T> queryWrapper, boolean throwEx) {
|
|
|
+ return s.getOne(queryWrapper, throwEx);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public Map<String, Object> getMap(T t, Wrapper<E> queryWrapper) {
|
|
|
- return t.getMap(queryWrapper);
|
|
|
+ public Map<String, Object> getMap(S s, Wrapper<T> queryWrapper) {
|
|
|
+ return s.getMap(queryWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public int count(T t) {
|
|
|
- return t.count();
|
|
|
+ public int count(S s) {
|
|
|
+ return s.count();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public int count(T t, Wrapper queryWrapper) {
|
|
|
- return t.count(queryWrapper);
|
|
|
+ public int count(S s, Wrapper queryWrapper) {
|
|
|
+ return s.count(queryWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List list(T t, Wrapper queryWrapper) {
|
|
|
- return t.list(queryWrapper);
|
|
|
+ public List list(S s, Wrapper queryWrapper) {
|
|
|
+ return s.list(queryWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List list(T t) {
|
|
|
- return t.list();
|
|
|
+ public List list(S s) {
|
|
|
+ return s.list();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List<Map<String, Object>> listMaps(T t, Wrapper queryWrapper) {
|
|
|
- return t.listMaps(queryWrapper);
|
|
|
+ public List<Map<String, Object>> listMaps(S s, Wrapper queryWrapper) {
|
|
|
+ return s.listMaps(queryWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List<Map<String, Object>> listMaps(T t) {
|
|
|
- return t.listMaps();
|
|
|
+ public List<Map<String, Object>> listMaps(S s) {
|
|
|
+ return s.listMaps();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List<Object> listObjs(T t) {
|
|
|
- return t.listObjs();
|
|
|
+ public List<Object> listObjs(S s) {
|
|
|
+ return s.listObjs();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List<E> listObjs(T t, Wrapper queryWrapper) {
|
|
|
- return t.listObjs(queryWrapper);
|
|
|
+ public List<T> listObjs(S s, Wrapper queryWrapper) {
|
|
|
+ return s.listObjs(queryWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public <P extends IPage<Map<String, Object>>> P pageMaps(T t, P page) {
|
|
|
- return t.pageMaps(page);
|
|
|
+ public <P extends IPage<Map<String, Object>>> P pageMaps(S s, P page) {
|
|
|
+ return s.pageMaps(page);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public <P extends IPage<Map<String, Object>>> P pageMaps(T t, P page, Wrapper<E> queryWrapper) {
|
|
|
- return t.pageMaps(page, queryWrapper);
|
|
|
+ public <P extends IPage<Map<String, Object>>> P pageMaps(S s, P page, Wrapper<T> queryWrapper) {
|
|
|
+ return s.pageMaps(page, queryWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List listObjs(T t, Wrapper queryWrapper, Function mapper) {
|
|
|
- return t.listObjs(queryWrapper, mapper);
|
|
|
+ public List listObjs(S s, Wrapper queryWrapper, Function mapper) {
|
|
|
+ return s.listObjs(queryWrapper, mapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public List listObjs(T t, Function mapper) {
|
|
|
- return t.listObjs(mapper);
|
|
|
+ public List listObjs(S s, Function mapper) {
|
|
|
+ return s.listObjs(mapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public <P extends IPage<E>> P page(T t, P page) {
|
|
|
- return t.page(page);
|
|
|
+ public <P extends IPage<T>> P page(S s, P page) {
|
|
|
+ return s.page(page);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public <P extends IPage<E>> P page(T t, P page, Wrapper<E> queryWrapper) {
|
|
|
- return t.page(page, queryWrapper);
|
|
|
+ public <P extends IPage<T>> P page(S s, P page, Wrapper<T> queryWrapper) {
|
|
|
+ return s.page(page, queryWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public BaseMapper getBaseMapper(T t) {
|
|
|
- return t.getBaseMapper();
|
|
|
+ public BaseMapper getBaseMapper(S s) {
|
|
|
+ return s.getBaseMapper();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public Class getEntityClass(T t) {
|
|
|
- return t.getEntityClass();
|
|
|
+ public Class getEntityClass(S s) {
|
|
|
+ return s.getEntityClass();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public QueryChainWrapper query(T t) {
|
|
|
- return t.query();
|
|
|
+ public QueryChainWrapper query(S s) {
|
|
|
+ return s.query();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public LambdaQueryChainWrapper lambdaQuery(T t) {
|
|
|
- return t.lambdaQuery();
|
|
|
+ public LambdaQueryChainWrapper lambdaQuery(S s) {
|
|
|
+ return s.lambdaQuery();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public KtQueryChainWrapper ktQuery(T t) {
|
|
|
- return t.ktQuery();
|
|
|
+ public KtQueryChainWrapper ktQuery(S s) {
|
|
|
+ return s.ktQuery();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public KtUpdateChainWrapper ktUpdate(T t) {
|
|
|
- return t.ktUpdate();
|
|
|
+ public KtUpdateChainWrapper ktUpdate(S s) {
|
|
|
+ return s.ktUpdate();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public UpdateChainWrapper update(T t) {
|
|
|
- return t.update();
|
|
|
+ public UpdateChainWrapper update(S s) {
|
|
|
+ return s.update();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public LambdaUpdateChainWrapper lambdaUpdate(T t) {
|
|
|
- return t.lambdaUpdate();
|
|
|
+ public LambdaUpdateChainWrapper lambdaUpdate(S s) {
|
|
|
+ return s.lambdaUpdate();
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public boolean saveOrUpdate(T t, E entity, Wrapper updateWrapper) {
|
|
|
- return t.saveOrUpdate(entity, updateWrapper);
|
|
|
+ public boolean saveOrUpdate(S s, T entity, Wrapper updateWrapper) {
|
|
|
+ return s.saveOrUpdate(entity, updateWrapper);
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public Object getObj(T t, Wrapper<E> queryWrapper, Function mapper) {
|
|
|
- return t.getObj(queryWrapper, mapper);
|
|
|
+ public Object getObj(S s, Wrapper<T> queryWrapper, Function mapper) {
|
|
|
+ return s.getObj(queryWrapper, mapper);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 通过反射代理执行
|
|
|
- * @param t
|
|
|
+ * @param s
|
|
|
* @param funName
|
|
|
* @param tClass
|
|
|
* @param Es
|
|
|
* @return
|
|
|
*/
|
|
|
@TenantIgnore
|
|
|
- public Object invoke(T t,String funName,Class<T> tClass,Object... Es){
|
|
|
+ public Object invoke(S s,String funName,Class<S> tClass,Object... Es){
|
|
|
try {
|
|
|
- Method declaredMethod = t.getClass().getDeclaredMethod(funName,tClass);
|
|
|
- return declaredMethod.invoke(t,Es);
|
|
|
- } catch (NoSuchMethodException e) {
|
|
|
- e.printStackTrace();
|
|
|
- } catch (InvocationTargetException e) {
|
|
|
- e.printStackTrace();
|
|
|
- } catch (IllegalAccessException e) {
|
|
|
- e.printStackTrace();
|
|
|
+ Method declaredMethod = s.getClass().getDeclaredMethod(funName,tClass);
|
|
|
+ return declaredMethod.invoke(s,Es);
|
|
|
+ } catch (NoSuchMethodException t) {
|
|
|
+ t.printStackTrace();
|
|
|
+ } catch (InvocationTargetException t) {
|
|
|
+ t.printStackTrace();
|
|
|
+ } catch (IllegalAccessException t) {
|
|
|
+ t.printStackTrace();
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@TenantIgnore
|
|
|
- public Object invoke(T t,Method method,Object... Es){
|
|
|
+ public Object invoke(S s,Method method,Object... Es){
|
|
|
try {
|
|
|
- return method.invoke(t,Es);
|
|
|
- } catch (InvocationTargetException e) {
|
|
|
- e.printStackTrace();
|
|
|
- } catch (IllegalAccessException e) {
|
|
|
- e.printStackTrace();
|
|
|
+ return method.invoke(s,Es);
|
|
|
+ } catch (InvocationTargetException t) {
|
|
|
+ t.printStackTrace();
|
|
|
+ } catch (IllegalAccessException t) {
|
|
|
+ t.printStackTrace();
|
|
|
}
|
|
|
return null;
|
|
|
}
|