Esempio n. 1
1
        private static string WhereSql(Model.StatMetaData.Query query)
        {
            SQLBuilder builder = new SQLBuilder();

            builder.AppendWhere();
            builder.Append(query.StatTimeStart != null, "and", "stat_time>@StatTimeStart");
            builder.Append(query.StatTimeEnd != null, "and", "stat_time<=@StatTimeEnd");
            builder.Append(!string.IsNullOrWhiteSpace(query.ServiceName), "and", "servcie_name=@ServiceName");
            builder.Append(!string.IsNullOrWhiteSpace(query.ApiPath), "and", "api_path=@ApiPath");
            return(builder.Sql());
        }
Esempio n. 2
0
        private static String QuerySql(CategoryQuery query)
        {
            var builder = new SQLBuilder();

            builder.AppendWhere();
            builder.Append(query.RestaurantId > 0, "and", "RestaurantId=@RestaurantId");

            return(builder.Sql());
        }
Esempio n. 3
0
        internal static string WhereSql(Query query)
        {
            SQLBuilder builder = new SQLBuilder();

            builder.AppendWhere();
            builder.Append(query.DirectoryId > 0, "and", "directory_id=@DirectoryId");
            builder.Append(!string.IsNullOrWhiteSpace(query.Name), "and", "api_name like '%" + query.Name + "%'");

            return builder.Sql();
        }
Esempio n. 4
0
        internal static string WhereSql(Query query)
        {
            SQLBuilder builder = new SQLBuilder();

            builder.AppendWhere();
            builder.Append(query.DirectoryId > 0, "and", "directory_id=@DirectoryId");
            builder.Append(!string.IsNullOrWhiteSpace(query.Name), "and", "api_name like '%" + query.Name + "%'");

            return(builder.Sql());
        }
Esempio n. 5
0
        private static string WhereSql(Model.ServiceStatMinute.Query query)
        {
            SQLBuilder builder = new SQLBuilder();
            builder.AppendWhere();
            builder.Append(query.StatTimeStart != null, "and", "stat_time>@StatTimeStart");
            builder.Append(query.StatTimeEnd != null, "and", "stat_time<=@StatTimeEnd");
            builder.Append(!string.IsNullOrWhiteSpace(query.ServiceName), "and", "service_name=@ServiceName");


            return builder.Sql();
        }
Esempio n. 6
0
        private static string WhereSql(Model.ServiceHostStatMinute.Query query)
        {
            SQLBuilder builder = new SQLBuilder();

            builder.AppendWhere();
            builder.Append(query.StatTimeStart != null, "and", "stat_time>@StatTimeStart");
            builder.Append(query.StatTimeEnd != null, "and", "stat_time<=@StatTimeEnd");
            builder.Append(!string.IsNullOrWhiteSpace(query.Host), "and", "host=@Host");
            builder.Append(!string.IsNullOrWhiteSpace(query.ServiceName), "and", "service_name=@ServiceName");

            return(builder.Sql());
        }