You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
通过如下方法实现自定义字段
var customCol1 = field.NewFieldRaw("IF(column1='1',column1,?)","456")
var customCol2 = field.NewFieldRaw("case column2 when ? then ? else ? end","1","正常","异常")
query.Table1.Select(customCol1,customCol2,query.Table1.Column2).Order(customCol1.Desc()).Where(customCol2.Eq(value))
Motivation
select 时需要自定义字段
order by 时 需要通过自定义字段进行排序
where 时 需要通过自定义字段筛选