{ "Name": "View_任务工时统计", "Columns": [ { "$type": "Forguncy.Model.Tables.BindingColumn, ServerDesignerCommon", "DatabaseColumnType": "bigint", "MaxLength": -1, "Name": "项目ID", "ColumnType": "System.Int64, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" }, { "$type": "Forguncy.Model.Tables.BindingColumn, ServerDesignerCommon", "DatabaseColumnType": "bigint", "MaxLength": -1, "Name": "任务ID", "ColumnType": "System.Int64, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" }, { "$type": "Forguncy.Model.Tables.BindingColumn, ServerDesignerCommon", "DatabaseColumnType": "nvarchar", "MaxLength": -1, "Name": "执行人", "ColumnType": "System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" }, { "$type": "Forguncy.Model.Tables.BindingColumn, ServerDesignerCommon", "DatabaseColumnType": "datetime", "MaxLength": -1, "Name": "工时日期", "ColumnType": "System.DateTime, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" }, { "$type": "Forguncy.Model.Tables.BindingColumn, ServerDesignerCommon", "DatabaseColumnType": "float", "MaxLength": -1, "Name": "计划工时", "ColumnType": "System.Double, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" }, { "$type": "Forguncy.Model.Tables.BindingColumn, ServerDesignerCommon", "DatabaseColumnType": "float", "MaxLength": -1, "Name": "实际工时", "ColumnType": "System.Double, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" } ], "ExternalDatabaseInfo": { "ConnectionId": "业务表", "SourceTableName": "View_任务工时统计", "SourceTableSchema": "dbo", "CreateViewSql": "SELECT \r\n [项目ID],\r\n [任务ID],\r\n [执行人],\r\n [工时日期],\r\n SUM(CASE WHEN [工时类型] = '计划' THEN [工时] ELSE 0 END) AS [计划工时],\r\n SUM(CASE WHEN [工时类型] = '实际' THEN [工时] ELSE 0 END) AS [实际工时]\r\nFROM \r\n [dbo].[任务工时表]\r\nGROUP BY \r\n [项目ID],\r\n [任务ID],\r\n [执行人],\r\n [工时日期];", "ViewInfo": { "ViewName": "View_任务工时统计", "IsUpdatable": true, "QueryColumns": [ "项目ID" ] } }, "Indexes": [], "Relations": [ { "PrimarySchema": null, "PrimaryTable": "任务表", "PrimaryColumn": "ID", "ForeignSchema": null, "ForeignTable": "View_任务工时统计", "ForeignColumn": "任务ID", "RelationTypeOnDelete": 0, "RelationTypeOnUpdate": 0, "IsDetailTableRelation": true }, { "PrimarySchema": null, "PrimaryTable": "项目表", "PrimaryColumn": "ID", "ForeignSchema": null, "ForeignTable": "View_任务工时统计", "ForeignColumn": "项目ID", "RelationTypeOnDelete": 0, "RelationTypeOnUpdate": 0, "IsDetailTableRelation": true }, { "PrimarySchema": null, "PrimaryTable": "用户信息视图", "PrimaryColumn": "用户名", "ForeignSchema": null, "ForeignTable": "View_任务工时统计", "ForeignColumn": "执行人", "RelationTypeOnDelete": 0, "RelationTypeOnUpdate": 0, "IsDetailTableRelation": true } ] }