mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 18:28:43 +08:00 
			
		
		
		
	infra:标准化代码
This commit is contained in:
		| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.infra.dal.mysql.job; | |||||||
|  |  | ||||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||||
| import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||||
| import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogExportReqVO; | import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogExportReqVO; | ||||||
| import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogPageReqVO; | import cn.iocoder.yudao.module.infra.controller.admin.job.vo.log.JobLogPageReqVO; | ||||||
| import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO; | import cn.iocoder.yudao.module.infra.dal.dataobject.job.JobLogDO; | ||||||
| @@ -19,24 +19,24 @@ import java.util.List; | |||||||
| public interface JobLogMapper extends BaseMapperX<JobLogDO> { | public interface JobLogMapper extends BaseMapperX<JobLogDO> { | ||||||
|  |  | ||||||
|     default PageResult<JobLogDO> selectPage(JobLogPageReqVO reqVO) { |     default PageResult<JobLogDO> selectPage(JobLogPageReqVO reqVO) { | ||||||
|         return selectPage(reqVO, new QueryWrapperX<JobLogDO>() |         return selectPage(reqVO, new LambdaQueryWrapperX<JobLogDO>() | ||||||
|                 .eqIfPresent("job_id", reqVO.getJobId()) |                 .eqIfPresent(JobLogDO::getJobId, reqVO.getJobId()) | ||||||
|                 .likeIfPresent("handler_name", reqVO.getHandlerName()) |                 .likeIfPresent(JobLogDO::getHandlerName, reqVO.getHandlerName()) | ||||||
|                 .geIfPresent("begin_time", reqVO.getBeginTime()) |                 .geIfPresent(JobLogDO::getBeginTime, reqVO.getBeginTime()) | ||||||
|                 .leIfPresent("end_time", reqVO.getEndTime()) |                 .leIfPresent(JobLogDO::getEndTime, reqVO.getEndTime()) | ||||||
|                 .eqIfPresent("status", reqVO.getStatus()) |                 .eqIfPresent(JobLogDO::getStatus, reqVO.getStatus()) | ||||||
|                 .orderByDesc("id") // ID 倒序 |                 .orderByDesc(JobLogDO::getId) // ID 倒序 | ||||||
|         ); |         ); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     default List<JobLogDO> selectList(JobLogExportReqVO reqVO) { |     default List<JobLogDO> selectList(JobLogExportReqVO reqVO) { | ||||||
|         return selectList(new QueryWrapperX<JobLogDO>() |         return selectList(new LambdaQueryWrapperX<JobLogDO>() | ||||||
|                 .eqIfPresent("job_id", reqVO.getJobId()) |                 .eqIfPresent(JobLogDO::getJobId, reqVO.getJobId()) | ||||||
|                 .likeIfPresent("handler_name", reqVO.getHandlerName()) |                 .likeIfPresent(JobLogDO::getHandlerName, reqVO.getHandlerName()) | ||||||
|                 .geIfPresent("begin_time", reqVO.getBeginTime()) |                 .geIfPresent(JobLogDO::getBeginTime, reqVO.getBeginTime()) | ||||||
|                 .leIfPresent("end_time", reqVO.getEndTime()) |                 .leIfPresent(JobLogDO::getEndTime, reqVO.getEndTime()) | ||||||
|                 .eqIfPresent("status", reqVO.getStatus()) |                 .eqIfPresent(JobLogDO::getStatus, reqVO.getStatus()) | ||||||
|                 .orderByDesc("id") // ID 倒序 |                 .orderByDesc(JobLogDO::getId) // ID 倒序 | ||||||
|         ); |         ); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -76,7 +76,7 @@ public class CodegenServiceImpl implements CodegenService { | |||||||
|  |  | ||||||
|     private Long createCodegen0(Long userId, Long dataSourceConfigId, TableInfo tableInfo) { |     private Long createCodegen0(Long userId, Long dataSourceConfigId, TableInfo tableInfo) { | ||||||
|         // 校验导入的表和字段非空 |         // 校验导入的表和字段非空 | ||||||
|         checkTableInfo(tableInfo); |         validateTableInfo(tableInfo); | ||||||
|         // 校验是否已经存在 |         // 校验是否已经存在 | ||||||
|         if (codegenTableMapper.selectByTableNameAndDataSourceConfigId(tableInfo.getName(), |         if (codegenTableMapper.selectByTableNameAndDataSourceConfigId(tableInfo.getName(), | ||||||
|                 dataSourceConfigId) != null) { |                 dataSourceConfigId) != null) { | ||||||
| @@ -100,7 +100,7 @@ public class CodegenServiceImpl implements CodegenService { | |||||||
|         return table.getId(); |         return table.getId(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private void checkTableInfo(TableInfo tableInfo) { |     private void validateTableInfo(TableInfo tableInfo) { | ||||||
|         if (tableInfo == null) { |         if (tableInfo == null) { | ||||||
|             throw exception(CODEGEN_IMPORT_TABLE_NULL); |             throw exception(CODEGEN_IMPORT_TABLE_NULL); | ||||||
|         } |         } | ||||||
| @@ -149,7 +149,7 @@ public class CodegenServiceImpl implements CodegenService { | |||||||
|  |  | ||||||
|     private void syncCodegen0(Long tableId, TableInfo tableInfo) { |     private void syncCodegen0(Long tableId, TableInfo tableInfo) { | ||||||
|         // 校验导入的表和字段非空 |         // 校验导入的表和字段非空 | ||||||
|         checkTableInfo(tableInfo); |         validateTableInfo(tableInfo); | ||||||
|         List<TableField> tableFields = tableInfo.getFields(); |         List<TableField> tableFields = tableInfo.getFields(); | ||||||
|  |  | ||||||
|         // 构建 CodegenColumnDO 数组,只同步新增的字段 |         // 构建 CodegenColumnDO 数组,只同步新增的字段 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV