Exemplo n.º 1
0
        public string SelectCountTable(SqlRelationModel model)
        {
            CountTemplate template = new CountTemplate();
            StringBuilder sql      = new StringBuilder();

            sql.Append(template.SelectCount(model.EntityModel));
            sql.Append(JoinRule(model, model.Tables));
            return(sql.ToString());
        }
Exemplo n.º 2
0
        public string SelectCountSource(SqlRelationModel model)
        {
            CountTemplate template = new CountTemplate();
            StringBuilder sql      = new StringBuilder();

            model.UseDefaultFilter();
            sql.Append(template.SelectCount(model.EntityModel));
            sql.Append(JoinRule(model, model.Sources));
            model.ClearFilter();
            return(sql.ToString());
        }
Exemplo n.º 3
0
        /// <summary>
        /// 根据model信息生成 SELECT COUNT(*) FROM [TableName] WHERE  + condition
        /// </summary>
        /// <param name="model"></param>
        /// <param name="condition"></param>
        /// <returns></returns>

        public static string CustomerCount(SqlModel model, string condition)
        {
            return($"{Count.SelectCount(model)} WHERE {condition}");
        }