Oracle 多表查询是遇到字段错误 返回

求助
7 1191

var list2 = DbBase.GetInstance().Queryable<DbColumn, DbTable>((col, tb) => new object[] {

              JoinType.Left, tb.ProjectId ==col.ProjectId  && tb.Name == col.TableName 

            })

            .Select((col, tb) => new { col, tb })

            .ToList();

生成SQL没有下划线,实际数据库字段是有下划线的,在属性上做了配置,例如[SugarColumn(ColumnName = "PROJECT_ID" )]:

SELECT "COL". "PROJECTID" AS "DBCOLUMN.PROJECT_ID", "COL". "TABLENAME" AS "DBCOLUMN.TABLE_NAME",

       "COL". "COLUMNNAME" AS "DBCOLUMN.COLUMN_NAME", "COL". "DATATYPE" AS "DBCOLUMN.DATA_TYPE",

       "COL". "DATALENGTH" AS "DBCOLUMN.DATA_LENGTH", "COL". "DATASCALE" AS "DBCOLUMN.DATA_SCALE",

       "COL". "DATAPRECISION" AS "DBCOLUMN.DATA_PRECISION", "COL". "NULLABLE" AS "DBCOLUMN.NULLABLE",

       "COL". "COMMENTS" AS "DBCOLUMN.COMMENTS", "COL". "POSITION" AS "DBCOLUMN.POSITION",

       "TB". "PROJECTID" AS "DBTABLE.PROJECT_ID", "TB". "NAME" AS "DBTABLE.NAME",

       "TB". "COMMENTS" AS "DBTABLE.COMMENTS"

  FROM "DB_COLUMN" col

  LEFT JOIN "DB_TABLE" tb

    ON (("TB". "PROJECT_ID" = "COL". "PROJECT_ID") AND ("TB". "NAME" = "COL". "TABLE_NAME")) 


注:普通查询是正常的

热忱回答7

版块

学习文档

最新会员

发布达人

回贴达人