|
|
@ -25,35 +25,64 @@ public interface BaseService<T> { |
|
|
|
return getBaseDao().findOne(id); |
|
|
|
return getBaseDao().findOne(id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 查询全部 |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
default List<T> findAll(){ |
|
|
|
default List<T> findAll(){ |
|
|
|
return getBaseDao().findAll(); |
|
|
|
return getBaseDao().findAll(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 保存 |
|
|
|
|
|
|
|
* @param entity |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
default Long save(T entity){ |
|
|
|
default Long save(T entity){ |
|
|
|
return getBaseDao().save(entity); |
|
|
|
return getBaseDao().save(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 更新 |
|
|
|
|
|
|
|
* @param entity |
|
|
|
|
|
|
|
*/ |
|
|
|
default void update(T entity){ |
|
|
|
default void update(T entity){ |
|
|
|
getBaseDao().update(entity); |
|
|
|
getBaseDao().update(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 删除 |
|
|
|
|
|
|
|
* @param id |
|
|
|
|
|
|
|
*/ |
|
|
|
default void delete(Long id){ |
|
|
|
default void delete(Long id){ |
|
|
|
getBaseDao().delete(id); |
|
|
|
getBaseDao().delete(id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 批量保存 |
|
|
|
|
|
|
|
* @param entityList |
|
|
|
|
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
default void batchSave(List<T> entitylist){ |
|
|
|
default void batchSave(List<T> entityList){ |
|
|
|
getBaseDao().batchSave(entitylist); |
|
|
|
getBaseDao().batchSave(entityList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 批量更新 |
|
|
|
|
|
|
|
* @param entityList |
|
|
|
|
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
default void batchUpdate(List<T> entitylist){ |
|
|
|
default void batchUpdate(List<T> entityList){ |
|
|
|
getBaseDao().batchSave(entitylist); |
|
|
|
getBaseDao().batchSave(entityList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 批量删除 |
|
|
|
|
|
|
|
* @param entityList |
|
|
|
|
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
default void batchDelete(List<T> entitylist){ |
|
|
|
default void batchDelete(List<T> entityList){ |
|
|
|
getBaseDao().batchDelete(entitylist); |
|
|
|
getBaseDao().batchDelete(entityList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|