公司框架DAO模板

<%@ CodeTemplate Language="C#" TargetLanguage="T-SQL" Debug="true" CompilerVersion="v3.5" Description="" %>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Optional="False" Category="Required" %>
<%@ Property Name="NameSpace" Optional="False" Type="System.String" Default="Beyondbit.App.Entity" Category="Style" Description="Object Namespace." %>
//----------------------------------------------------------------
// Copyright (C) 2012 上海互联网软件有限公司
// 版权所有.
// All rights reserved.
//
// 文件名: DAO<%= SourceTable %>.cs
// 文件功能描述:
//
// 创建标识: <%= DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") %>
//
// 修改标识:
// 修改描述:
//----------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Beyondbit.Framework.DataAccess.ObjectDAO;
using Beyondbit.DocumentSpare.Entity;
using System.Data;
using Beyondbit.Core.Common.Tools;

namespace Beyondbit.DocumentSpare.DAO
<%--
SourceTable.Columns[i].ExtendedProperties[]
==CS_IsRowGuidCol
==CS_IsIdentity
==CS_IsComputed
==CS_IsDeterministic
==CS_IdentitySeed
==CS_IdentityIncrement
==CS_Default
==CS_ComputedDefinition
==CS_Collation
==CS_ObjectID
==CS_SystemType
==CS_UserType
==MS_Description
==CS_Description
--%>

namespace <%=NameSpace%> {

public class DAO<%=SourceTable.Name%> : ObjectDAO<<%=SourceTable.Name%>> {
public SplitPageResult<<%=SourceTable.Name%>> Query<%=SourceTable.Name%>Info(PageSearch pSearch,string Condition)
{
string strSql = "Select * From <%=SourceTable.Name%> Where 1=1 ";

if (Condition != null && Condition != "")
{
strSql += Condition;
}

if (pSearch.SortFields == string.Empty)
pSearch.SortFields = "CreateTime";


return base.QuerySplitPage(strSql, "*", pSearch.SortFields, pSearch.PageSize,
pSearch.PageIndex, null);
}
}
}

原文地址:https://www.cnblogs.com/yuanxiaoping_21cn_com/p/2803935.html