mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
优化
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package cn.lihongjie.coal.cronJobLog.dto;
|
||||
|
||||
import cn.lihongjie.coal.base.dto.CommonDto;
|
||||
import cn.lihongjie.coal.common.DictCode;
|
||||
import cn.lihongjie.coal.cronJob.dto.CronJobDto;
|
||||
import cn.lihongjie.coal.pojoProcessor.DictTranslate;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.Formula;
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -22,8 +24,15 @@ public class CronJobLogDto extends CommonDto {
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Formula("(EXTRACT(EPOCH FROM (endTime - startTime)) * 1000)")
|
||||
private long time;
|
||||
|
||||
private String logs;
|
||||
|
||||
|
||||
@Comment("执行状态")
|
||||
private String execStatus;
|
||||
|
||||
|
||||
@DictTranslate(dictKey = DictCode.CRONJOB_EXECSTATUS)
|
||||
private String execStatusName;
|
||||
}
|
||||
|
||||
@@ -35,14 +35,7 @@ public class CronJobLogEntity extends CommonEntity {
|
||||
private String execStatus;
|
||||
|
||||
|
||||
@Formula(
|
||||
"(select i.name\n"
|
||||
+ "from t_dictionary d,\n"
|
||||
+ " t_dictionary_item i\n"
|
||||
+ "where d.id = i.dictionary_id\n"
|
||||
+ " and d.code = 'cronJob.execStatus'\n"
|
||||
+ " and i.code = exec_status)")
|
||||
private String execStatusName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user