PgSql update exp to sql

This commit is contained in:
sunkaixuna 2021-11-06 00:44:31 +08:00
parent 85fdcb11e9
commit 6e985d8834
4 changed files with 14 additions and 2 deletions

View File

@ -177,7 +177,8 @@ namespace OrmTest
var list4 = db.Queryable<ABMapping>()
.Mapper(it => it.A, it => it.AId)
.Mapper(it => it.B, it => it.BId).ToList();
.Mapper(it => it.B, it => it.BId)
.Where(it => it.A.Id == 1).ToList();
//Manual mode
var result = db.Queryable<OrderInfo>().Take(10).Select<ViewOrder>().Mapper((itemModel, cache) =>

View File

@ -45,6 +45,11 @@ namespace SqlSugar
}
public override string GetTranslationColumnName(string propertyName)
{
if (propertyName.Contains(".")&& !propertyName.Contains(SqlTranslationLeft))
{
return string.Join(".", propertyName.Split('.').Select(it => $"{SqlTranslationLeft}{it.ToLower(isAutoToLower)}{SqlTranslationRight}"));
}
if (propertyName.Contains(SqlTranslationLeft)) return propertyName;
else
return SqlTranslationLeft + propertyName.ToLower(isAutoToLower) + SqlTranslationRight;

View File

@ -168,7 +168,8 @@ namespace OrmTest
var list4 = db.Queryable<ABMapping>()
.Mapper(it => it.A, it => it.AId)
.Mapper(it => it.B, it => it.BId).ToList();
.Mapper(it => it.B, it => it.BId)
.Where(it=>it.A.Id==1).ToList();
//Manual mode
var result = db.Queryable<OrderInfo>().Take(10).Select<ViewOrder>().Mapper((itemModel, cache) =>

View File

@ -45,6 +45,11 @@ namespace SqlSugar
}
public override string GetTranslationColumnName(string propertyName)
{
if (propertyName.Contains(".")&& !propertyName.Contains(SqlTranslationLeft))
{
return string.Join(".", propertyName.Split('.').Select(it => $"{SqlTranslationLeft}{it.ToLower(isAutoToLower)}{SqlTranslationRight}"));
}
if (propertyName.Contains(SqlTranslationLeft)) return propertyName;
else
return SqlTranslationLeft + propertyName.ToLower(isAutoToLower) + SqlTranslationRight;