mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-03-28 00:03:23 +08:00
update 优化 统一补全代码注释
This commit is contained in:
@@ -20,22 +20,34 @@ public interface ITestDemoService {
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
* @param id 主键
|
||||
* @return 测试单表视图对象
|
||||
*/
|
||||
TestDemoVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* 分页查询测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分页结果
|
||||
*/
|
||||
TableDataInfo<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 自定义分页查询
|
||||
* 按自定义 SQL 分页查询测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分页结果
|
||||
*/
|
||||
TableDataInfo<TestDemoVo> customPageList(TestDemoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* 查询符合条件的测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 结果列表
|
||||
*/
|
||||
List<TestDemoVo> queryList(TestDemoBo bo);
|
||||
|
||||
@@ -43,7 +55,7 @@ public interface ITestDemoService {
|
||||
* 根据新增业务对象插入测试单表
|
||||
*
|
||||
* @param bo 测试单表新增业务对象
|
||||
* @return
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(TestDemoBo bo);
|
||||
|
||||
@@ -51,7 +63,7 @@ public interface ITestDemoService {
|
||||
* 根据编辑业务对象修改测试单表
|
||||
*
|
||||
* @param bo 测试单表编辑业务对象
|
||||
* @return
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TestDemoBo bo);
|
||||
|
||||
@@ -60,12 +72,15 @@ public interface ITestDemoService {
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 批量保存
|
||||
* 批量保存测试单表数据。
|
||||
*
|
||||
* @param list 待保存数据
|
||||
* @return 是否保存成功
|
||||
*/
|
||||
Boolean saveBatch(List<TestDemo> list);
|
||||
}
|
||||
|
||||
@@ -16,12 +16,16 @@ public interface ITestTreeService {
|
||||
/**
|
||||
* 查询单个
|
||||
*
|
||||
* @return
|
||||
* @param id 主键
|
||||
* @return 测试树表视图对象
|
||||
*/
|
||||
TestTreeVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* 查询符合条件的测试树表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 结果列表
|
||||
*/
|
||||
List<TestTreeVo> queryList(TestTreeBo bo);
|
||||
|
||||
@@ -29,7 +33,7 @@ public interface ITestTreeService {
|
||||
* 根据新增业务对象插入测试树表
|
||||
*
|
||||
* @param bo 测试树表新增业务对象
|
||||
* @return
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(TestTreeBo bo);
|
||||
|
||||
@@ -37,7 +41,7 @@ public interface ITestTreeService {
|
||||
* 根据编辑业务对象修改测试树表
|
||||
*
|
||||
* @param bo 测试树表编辑业务对象
|
||||
* @return
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(TestTreeBo bo);
|
||||
|
||||
@@ -46,7 +50,7 @@ public interface ITestTreeService {
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
|
||||
@@ -32,11 +32,24 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
|
||||
private final TestDemoMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 根据主键查询测试单表详情。
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 测试单表视图对象
|
||||
*/
|
||||
@Override
|
||||
public TestDemoVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分页结果
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<TestDemo> lqw = buildQueryWrapper(bo);
|
||||
@@ -45,7 +58,11 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义分页查询
|
||||
* 通过自定义 SQL 分页查询测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 分页结果
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<TestDemoVo> customPageList(TestDemoBo bo, PageQuery pageQuery) {
|
||||
@@ -54,11 +71,23 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的测试单表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 结果列表
|
||||
*/
|
||||
@Override
|
||||
public List<TestDemoVo> queryList(TestDemoBo bo) {
|
||||
return baseMapper.selectVoList(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建测试单表动态查询条件。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 查询条件包装器
|
||||
*/
|
||||
private LambdaQueryWrapper<TestDemo> buildQueryWrapper(TestDemoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<TestDemo> lqw = Wrappers.lambdaQuery();
|
||||
@@ -72,6 +101,12 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测试单表数据。
|
||||
*
|
||||
* @param bo 新增业务对象
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(TestDemoBo bo) {
|
||||
TestDemo add = MapstructUtils.convert(bo, TestDemo.class);
|
||||
@@ -83,6 +118,12 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新测试单表数据。
|
||||
*
|
||||
* @param bo 编辑业务对象
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(TestDemoBo bo) {
|
||||
TestDemo update = MapstructUtils.convert(bo, TestDemo.class);
|
||||
@@ -99,6 +140,13 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键集合删除测试单表数据,并按需执行删除前校验。
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否执行删除校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
@@ -111,6 +159,12 @@ public class TestDemoServiceImpl implements ITestDemoService {
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存测试单表数据。
|
||||
*
|
||||
* @param list 待保存实体列表
|
||||
* @return 是否保存成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean saveBatch(List<TestDemo> list) {
|
||||
return baseMapper.insertBatch(list);
|
||||
|
||||
@@ -29,18 +29,36 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
||||
|
||||
private final TestTreeMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 根据主键查询测试树表详情。
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 测试树表视图对象
|
||||
*/
|
||||
@Override
|
||||
public TestTreeVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
// @DS("slave") // 切换从库查询
|
||||
/**
|
||||
* 查询符合条件的测试树表列表。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 结果列表
|
||||
*/
|
||||
@Override
|
||||
public List<TestTreeVo> queryList(TestTreeBo bo) {
|
||||
LambdaQueryWrapper<TestTree> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建测试树表动态查询条件。
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 查询条件包装器
|
||||
*/
|
||||
private LambdaQueryWrapper<TestTree> buildQueryWrapper(TestTreeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<TestTree> lqw = Wrappers.lambdaQuery();
|
||||
@@ -53,6 +71,12 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增测试树表数据。
|
||||
*
|
||||
* @param bo 新增业务对象
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(TestTreeBo bo) {
|
||||
TestTree add = MapstructUtils.convert(bo, TestTree.class);
|
||||
@@ -64,6 +88,12 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新测试树表数据。
|
||||
*
|
||||
* @param bo 编辑业务对象
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(TestTreeBo bo) {
|
||||
TestTree update = MapstructUtils.convert(bo, TestTree.class);
|
||||
@@ -80,6 +110,13 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 按主键集合删除测试树表数据,并按需执行删除前校验。
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否执行删除校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
|
||||
Reference in New Issue
Block a user