From 2a9f8d487e3ff7e82b1b64c41921029006deb143 Mon Sep 17 00:00:00 2001 From: qiaozhanwei Date: Mon, 13 May 2019 18:54:39 +0800 Subject: [PATCH] columns alias update --- .../dao/mapper/ProcessDefinitionMapperProvider.java | 2 +- .../cn/escheduler/dao/mapper/ProcessInstanceMapper.java | 1 + .../dao/mapper/ProcessInstanceMapperProvider.java | 2 +- .../main/java/cn/escheduler/dao/mapper/ProjectMapper.java | 2 ++ .../cn/escheduler/dao/mapper/ProjectMapperProvider.java | 4 ++-- .../java/cn/escheduler/dao/mapper/TenantMapperProvider.java | 2 +- .../src/main/java/cn/escheduler/dao/mapper/UserMapper.java | 2 ++ .../java/cn/escheduler/dao/mapper/UserMapperProvider.java | 6 +++--- 8 files changed, 13 insertions(+), 8 deletions(-) diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessDefinitionMapperProvider.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessDefinitionMapperProvider.java index 192e46aec2..a619ee4ad5 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessDefinitionMapperProvider.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessDefinitionMapperProvider.java @@ -134,7 +134,7 @@ public class ProcessDefinitionMapperProvider { public String queryByDefineId(Map parameter) { return new SQL() { { - SELECT("pd.*,u.user_name,p.name as projectName"); + SELECT("pd.*,u.user_name,p.name as project_name"); FROM(TABLE_NAME + " pd"); JOIN("t_escheduler_user u ON pd.user_id = u.id"); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapper.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapper.java index 03fbd6db27..c76b7bd950 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapper.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapper.java @@ -94,6 +94,7 @@ public interface ProcessInstanceMapper { @Result(property = "dependenceScheduleTimes", column = "dependence_schedule_times", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "duration", column = "duration", javaType = Long.class, jdbcType = JdbcType.BIGINT), @Result(property = "tenantCode", column = "tenant_code", javaType = String.class, jdbcType = JdbcType.VARCHAR), + @Result(property = "queue", column = "queue", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "workerGroupId", column = "worker_group_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER), @Result(property = "timeout", column = "timeout", javaType = Integer.class, jdbcType = JdbcType.INTEGER), @Result(property = "processInstancePriority", column = "process_instance_priority", javaType = Priority.class, typeHandler = EnumOrdinalTypeHandler.class, jdbcType = JdbcType.TINYINT) diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java index cd9daa3781..7e078b995b 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java @@ -220,7 +220,7 @@ public class ProcessInstanceMapperProvider { public String queryDetailById(Map parameter) { return new SQL() { { - SELECT("inst.*,q.queue_name as queue,t.tenant_code as tenantCode,UNIX_TIMESTAMP(inst.end_time)-UNIX_TIMESTAMP(inst.start_time) as duration"); + SELECT("inst.*,q.queue_name as queue,t.tenant_code,UNIX_TIMESTAMP(inst.end_time)-UNIX_TIMESTAMP(inst.start_time) as duration"); FROM(TABLE_NAME + " inst, t_escheduler_user u,t_escheduler_tenant t,t_escheduler_queue q"); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapper.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapper.java index 9428899c09..ab44b7444d 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapper.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapper.java @@ -67,6 +67,7 @@ public interface ProjectMapper { @Result(property = "userId", column = "user_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER), @Result(property = "name", column = "name", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "desc", column = "desc", javaType = String.class, jdbcType = JdbcType.VARCHAR), + @Result(property = "userName", column = "user_name", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), }) @@ -82,6 +83,7 @@ public interface ProjectMapper { @Result(property = "userId", column = "user_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER), @Result(property = "name", column = "name", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "desc", column = "desc", javaType = String.class, jdbcType = JdbcType.VARCHAR), + @Result(property = "userName", column = "user_name", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), }) diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapperProvider.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapperProvider.java index 1a701ec76a..d6a2e4adcf 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapperProvider.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapperProvider.java @@ -93,7 +93,7 @@ public class ProjectMapperProvider { public String queryById(Map parameter) { return new SQL() {{ SELECT("p.user_id"); - SELECT("u.user_name as userName"); + SELECT("u.user_name"); SELECT("p.*"); FROM(TABLE_NAME + " p"); @@ -114,7 +114,7 @@ public class ProjectMapperProvider { public String queryByName(Map parameter) { return new SQL() {{ SELECT("p.user_id"); - SELECT("u.user_name as userName"); + SELECT("u.user_name"); SELECT("p.*"); FROM(TABLE_NAME + " p"); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/TenantMapperProvider.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/TenantMapperProvider.java index 8560fc950b..f8151781d4 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/TenantMapperProvider.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/TenantMapperProvider.java @@ -150,7 +150,7 @@ public class TenantMapperProvider { public String queryTenantPaging(Map parameter) { return new SQL() { { - SELECT("t.*,q.queue_name as queueName"); + SELECT("t.*,q.queue_name"); FROM(TABLE_NAME +" t,t_escheduler_queue q"); WHERE( " t.queue_id = q.id"); Object searchVal = parameter.get("searchVal"); diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java index 9c814543b1..7b5dea5265 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java @@ -175,6 +175,8 @@ public interface UserMapper { @Result(property = "phone", column = "phone", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "userType", column = "user_type", typeHandler = EnumOrdinalTypeHandler.class, javaType = UserType.class, jdbcType = JdbcType.TINYINT), @Result(property = "tenantId", column = "tenant_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER), + @Result(property = "tenantName", column = "tenant_name", javaType = String.class, jdbcType = JdbcType.VARCHAR), + @Result(property = "queueName", column = "queue_name", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE) }) diff --git a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java index 2fe0af9f20..f70ba8250f 100644 --- a/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java +++ b/escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java @@ -203,7 +203,7 @@ public class UserMapperProvider { public String queryUserPaging(Map parameter) { return new SQL() { { - SELECT("u.*,t.tenant_name as tenantName,q.queue_name as queueName"); + SELECT("u.*,t.tenant_name,q.queue_name"); FROM(TABLE_NAME + " u "); LEFT_OUTER_JOIN("t_escheduler_tenant t on u.tenant_id = t.id"); LEFT_OUTER_JOIN("t_escheduler_queue q on t.queue_id = q.id"); @@ -228,7 +228,7 @@ public class UserMapperProvider { public String queryDetailsById(Map parameter) { return new SQL() { { - SELECT("u.*,q.queue_name as queueName,t.tenant_name as tenantName"); + SELECT("u.*,q.queue_name,t.tenant_name"); FROM(TABLE_NAME + " u,t_escheduler_tenant t,t_escheduler_queue q"); @@ -262,7 +262,7 @@ public class UserMapperProvider { public String queryTenantCodeByUserId(Map parameter) { return new SQL() { { - SELECT("u.*,t.tenant_code as tenantCode"); + SELECT("u.*,t.tenant_code"); FROM(TABLE_NAME + " u,t_escheduler_tenant t"); WHERE("u.tenant_id = t.id AND u.id = #{userId}"); }