DotNetNext / SqlSugar

.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping
https://www.donet5.com/Home/Doc
MIT License
5.35k stars 1.34k forks source link

字段IsJson查询生成Sql语句问题 #902

Closed feiyit closed 3 years ago

feiyit commented 3 years ago

字段定义: [SqlSugar.SugarColumn (ColumnDataType = "varchar(50)", IsJson = true)]
public List Attr { get; set; }

查询方法: where.And (m => m.Attr.Contains(param.Attr));

生成的Sql语句: SELECT Count(*) FROM cms_article WHERE (( 1 = 1 ) AND NOT (1=2) )

Attr在数据库是varchar类型 不知道为什么生成的sql是1=2, 2=是我传入的 attr怎么变成1了呢?

是不支持这种写法吗?

DotNetNext commented 3 years ago

这个肯定不支持 , 还没这么牛逼把JSON对象 当LINQ查询