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());
        }
Example #2
0
 static SqlTemplate()
 {
     Select  = new SelectTemplate();
     Update  = new UpdateTemplate();
     Delete  = new DeleteTemplate();
     Insert  = new InsertTemplate();
     Repeate = new RepeateTemplate();
     Count   = new CountTemplate();
 }
        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());
        }