Browse Source

columns alias update

pull/2/head
qiaozhanwei 6 years ago
parent
commit
2a9f8d487e
  1. 2
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessDefinitionMapperProvider.java
  2. 1
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapper.java
  3. 2
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java
  4. 2
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapper.java
  5. 4
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapperProvider.java
  6. 2
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/TenantMapperProvider.java
  7. 2
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapper.java
  8. 6
      escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java

2
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessDefinitionMapperProvider.java

@ -134,7 +134,7 @@ public class ProcessDefinitionMapperProvider {
public String queryByDefineId(Map<String, Object> parameter) { public String queryByDefineId(Map<String, Object> parameter) {
return new SQL() { 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"); FROM(TABLE_NAME + " pd");
JOIN("t_escheduler_user u ON pd.user_id = u.id"); JOIN("t_escheduler_user u ON pd.user_id = u.id");

1
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 = "dependenceScheduleTimes", column = "dependence_schedule_times", javaType = String.class, jdbcType = JdbcType.VARCHAR),
@Result(property = "duration", column = "duration", javaType = Long.class, jdbcType = JdbcType.BIGINT), @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 = "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 = "workerGroupId", column = "worker_group_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "timeout", column = "timeout", 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) @Result(property = "processInstancePriority", column = "process_instance_priority", javaType = Priority.class, typeHandler = EnumOrdinalTypeHandler.class, jdbcType = JdbcType.TINYINT)

2
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProcessInstanceMapperProvider.java

@ -220,7 +220,7 @@ public class ProcessInstanceMapperProvider {
public String queryDetailById(Map<String, Object> parameter) { public String queryDetailById(Map<String, Object> parameter) {
return new SQL() { 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"); FROM(TABLE_NAME + " inst, t_escheduler_user u,t_escheduler_tenant t,t_escheduler_queue q");

2
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 = "userId", column = "user_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "name", column = "name", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "name", column = "name", javaType = String.class, jdbcType = JdbcType.VARCHAR),
@Result(property = "desc", column = "desc", 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 = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
@Result(property = "updateTime", column = "update_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 = "userId", column = "user_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "name", column = "name", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "name", column = "name", javaType = String.class, jdbcType = JdbcType.VARCHAR),
@Result(property = "desc", column = "desc", 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 = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
@Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE), @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
}) })

4
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/ProjectMapperProvider.java

@ -93,7 +93,7 @@ public class ProjectMapperProvider {
public String queryById(Map<String, Object> parameter) { public String queryById(Map<String, Object> parameter) {
return new SQL() {{ return new SQL() {{
SELECT("p.user_id"); SELECT("p.user_id");
SELECT("u.user_name as userName"); SELECT("u.user_name");
SELECT("p.*"); SELECT("p.*");
FROM(TABLE_NAME + " p"); FROM(TABLE_NAME + " p");
@ -114,7 +114,7 @@ public class ProjectMapperProvider {
public String queryByName(Map<String, Object> parameter) { public String queryByName(Map<String, Object> parameter) {
return new SQL() {{ return new SQL() {{
SELECT("p.user_id"); SELECT("p.user_id");
SELECT("u.user_name as userName"); SELECT("u.user_name");
SELECT("p.*"); SELECT("p.*");
FROM(TABLE_NAME + " p"); FROM(TABLE_NAME + " p");

2
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/TenantMapperProvider.java

@ -150,7 +150,7 @@ public class TenantMapperProvider {
public String queryTenantPaging(Map<String, Object> parameter) { public String queryTenantPaging(Map<String, Object> parameter) {
return new SQL() { return new SQL() {
{ {
SELECT("t.*,q.queue_name as queueName"); SELECT("t.*,q.queue_name");
FROM(TABLE_NAME +" t,t_escheduler_queue q"); FROM(TABLE_NAME +" t,t_escheduler_queue q");
WHERE( " t.queue_id = q.id"); WHERE( " t.queue_id = q.id");
Object searchVal = parameter.get("searchVal"); Object searchVal = parameter.get("searchVal");

2
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 = "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 = "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 = "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 = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
@Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE) @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE)
}) })

6
escheduler-dao/src/main/java/cn/escheduler/dao/mapper/UserMapperProvider.java

@ -203,7 +203,7 @@ public class UserMapperProvider {
public String queryUserPaging(Map<String, Object> parameter) { public String queryUserPaging(Map<String, Object> parameter) {
return new SQL() { 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 "); FROM(TABLE_NAME + " u ");
LEFT_OUTER_JOIN("t_escheduler_tenant t on u.tenant_id = t.id"); 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"); LEFT_OUTER_JOIN("t_escheduler_queue q on t.queue_id = q.id");
@ -228,7 +228,7 @@ public class UserMapperProvider {
public String queryDetailsById(Map<String, Object> parameter) { public String queryDetailsById(Map<String, Object> parameter) {
return new SQL() { 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"); FROM(TABLE_NAME + " u,t_escheduler_tenant t,t_escheduler_queue q");
@ -262,7 +262,7 @@ public class UserMapperProvider {
public String queryTenantCodeByUserId(Map<String, Object> parameter) { public String queryTenantCodeByUserId(Map<String, Object> parameter) {
return new SQL() { return new SQL() {
{ {
SELECT("u.*,t.tenant_code as tenantCode"); SELECT("u.*,t.tenant_code");
FROM(TABLE_NAME + " u,t_escheduler_tenant t"); FROM(TABLE_NAME + " u,t_escheduler_tenant t");
WHERE("u.tenant_id = t.id AND u.id = #{userId}"); WHERE("u.tenant_id = t.id AND u.id = #{userId}");
} }

Loading…
Cancel
Save