diff --git a/ProjectCommon.targets b/ProjectCommon.targets index 7fa3a9c..0bfa5b8 100644 --- a/ProjectCommon.targets +++ b/ProjectCommon.targets @@ -1,7 +1,7 @@ $(VersionSuffix) - 0.0.2.5 + 0.0.2.6 $(Version) $(Version) $(Version)$(VersionSuffix) diff --git a/src/SV.Db.Sloth.MySql/MySqlConnectionProvider.cs b/src/SV.Db.Sloth.MySql/MySqlConnectionProvider.cs index a1e9955..056ddfe 100644 --- a/src/SV.Db.Sloth.MySql/MySqlConnectionProvider.cs +++ b/src/SV.Db.Sloth.MySql/MySqlConnectionProvider.cs @@ -120,6 +120,15 @@ private void BuildSelectStatement(DbCommand cmd, DbEntityInfo info, SelectStatem } } + if (statement.Where == null || statement.Where.Condition == null) + { + table = table.Replace("{Where}", string.Empty, StringComparison.OrdinalIgnoreCase); + } + else + { + table = table.Replace("{Where}", BuildCondition(cmd, info, statement.Where.Condition), StringComparison.OrdinalIgnoreCase); + } + if (statement.GroupBy.IsNotNullOrEmpty()) { table = table.Replace("{OrderBy}", $"group by {ConvertFields(info, statement.GroupBy, false)} ");