日期:2014-05-20 浏览次数:20939 次
using PWMIS.SqlMapper.Entity; namespace PLZDModel { public class PFT_Report : Entity { public PFT_Report() { TableName = "PFT_Report"; //IdentityName = "标识列";//如果指定了标识列,可以处理自增列插入问题 //PrimaryKeys.Add("主键列");//指定主键列方可以删除和更新实体数据 AddProperty("ID", default(System.Int32)); AddProperty("FinancialPlanersNo", default(System.String)); AddProperty("FundAccount", default(System.String)); AddProperty("CityCode", default(System.String)); AddProperty("BankCode", default(System.String)); AddProperty("NetWork", default(System.String)); AddProperty("ApplyTime", default(System.DateTime)); AddProperty("FileName", default(System.String)); AddProperty("GenerateTime", default(System.DateTime)); } public System.Int32 ID { get { return (System.Int32)getProperty("ID"); } set { setProperty("ID", value); } } public System.String FinancialPlanersNo { get { return (System.String)getProperty("FinancialPlanersNo"); } set { setProperty("FinancialPlanersNo", value); } } public System.String FundAccount { get { return (System.String)getProperty("FundAccount"); } set { setProperty("FundAccount", value); } } public System.String CityCode { get { return (System.String)getProperty("CityCode"); } set { setProperty("CityCode", value); } } public System.String BankCode { get { return (System.String)getProperty("BankCode"); } set { setProperty("BankCode", value); } } public System.String NetWork { get { return (System.String)getProperty("NetWork"); } set { setProperty("NetWork", value); } } public System.DateTime ApplyTime { get { return (System.DateTime)getProperty("ApplyTime"); } set { setProperty("ApplyTime", value); } } public System.String FileName { get { return (System.String)getProperty("FileName"); } set { setProperty("FileName", value); } } public System.DateTime GenerateTime { get { return (System.DateTime)getProperty("GenerateTime"); } set { setProperty("GenerateTime", value); } } } }
class Program { static void Main(string[] args) { PFT_Report utlReport = new PFT_Report(); OQL oqlQuerry = new OQL(utlReport); utlReport.FundAccount = "1234234242423"; oqlQuerry.TopCount = 3; oqlQuerry.Select(utlReport.ApplyTime , utlReport.BankCode,utlReport.FileName ,utlReport.FundAccount ) .Where(utlReport.FundAccount) .OrderBy(utlReport.GenerateTime, "desc"); Console.WriteLine ("SQL="+oqlQuerry.ToString ()); Console.Read(); }