示例#1
0
        public SqlBuilder Filter(string column, ContractKindParameter kind)
        {
            if (kind == null)
            {
                return(this);
            }

            if (kind.Eq != null)
            {
                AppendFilter($@"""{column}"" = {kind.Eq}");
            }

            if (kind.Ne != null)
            {
                AppendFilter($@"""{column}"" != {kind.Ne}");
            }

            if (kind.In != null)
            {
                AppendFilter($@"""{column}"" = ANY ({Param(kind.In)})");
            }

            if (kind.Ni != null && kind.Ni.Count > 0)
            {
                AppendFilter($@"NOT (""{column}"" = ANY ({Param(kind.Ni)}))");
            }

            return(this);
        }
示例#2
0
        public SqlBuilder Filter(string column, ContractKindParameter kind)
        {
            if (kind == null)
            {
                return(this);
            }

            if (kind.Eq != null)
            {
                AppendFilter($@"""{column}"" = {kind.Eq}");
            }

            if (kind.Ne != null)
            {
                AppendFilter($@"""{column}"" != {kind.Ne}");
            }

            return(this);
        }