李昊 4 years ago
parent
commit
3d17e150b4

+ 17 - 5
GxPress/Repository/GxPress.Repository.Implement/WorkFlow/FlowTodoRepository.cs

@@ -79,11 +79,23 @@ namespace GxPress.Repository.Implement.WorkFlow
 
         public async Task<IEnumerable<FlowTodo>> GetListByFlowIdAsync(int flowId)
         {
-            var orderByKey = new string[] { nameof(FlowTodo.Sort) };
-            return await _repository.GetAllAsync(Q
-                .Where(nameof(FlowTodo.FlowId), flowId)
-                .OrderBy(orderByKey)
-            );
+            string sql = $@"
+            SELECT 
+                    *
+                FROM
+                    tede_flow_todo a
+                        INNER JOIN
+                    tede_user b ON a.UserId = b.UserId
+                WHERE
+                    a.FlowId = {flowId} order by a.Sort 
+            ";
+            var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
+            var database = new Database(databaseType, _connectionString);
+            var connection = database.GetConnection();
+            var result =
+               await connection
+                    .QueryAsync<FlowTodo>(sql);
+            return result;
         }
 
         public async Task<bool> DeleteAsync(int todoId)