Update exp to sql

This commit is contained in:
sunkaixuan 2025-08-16 15:33:25 +08:00
parent e297e9f3ea
commit 425a78694a

View File

@ -136,7 +136,14 @@ namespace SqlSugar
MapperSql.Sql = $"( {queryable.ToSql().Key} ) ";
if (isAny)
{
MapperSql.Sql = $" EXISTS( {MapperSql.Sql}) ";
if (MapperSql.Sql.StartsWith("( ") && MapperSql.Sql.EndsWith(" ) "))
{
MapperSql.Sql = $" EXISTS {MapperSql.Sql} ";
}
else
{
MapperSql.Sql = $" EXISTS( {MapperSql.Sql}) ";
}
}
return MapperSql;