码迷,mamicode.com
首页 > 其他好文 > 详细

hql

时间:2015-12-30 17:08:02      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

  public IList<PrdtStdEntity> QueryPrdtStd(PrdtStdEntity prdtStdEntity)
        {
            try
            {
                var hql = "from PrdtStdEntity t where (t.StdNo=:stdNo or t.ReplacePrdtStdNo=:replacePrdtStdNo)";
                var paramList = new List<Parameter>
                {
                    new Parameter("stdNo", prdtStdEntity.StdNo),
                    new Parameter("replacePrdtStdNo", prdtStdEntity.ReplacePrdtStdNo)
                };


                //hql += " and (t.PublishDate BETWEEN TO_DATE(‘2015-12-09‘,‘yyyy-mm-dd‘) and TO_DATE(‘2015-12-10‘,‘yyyy-mm-dd‘)) ";



                hql += " and t.PublishDate between to_date(:beginSampleDate,‘yyyy-mm-dd‘) and to_date(:endSampleDate,‘yyyy-mm-dd‘)  ";
                paramList.Add(new Parameter("beginSampleDate", "2015-12-01"));
                paramList.Add(new Parameter("endSampleDate", "2015-12-19"));

                return DataAccess.FindAll<PrdtStdEntity>(hql, paramList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

 

hql

标签:

原文地址:http://www.cnblogs.com/yisheng/p/5089210.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!