Beispiel #1
0
        /// <summary>
        /// 附加where条件
        /// </summary>
        /// <param name="initSqlString">sql字符串</param>
        /// <param name="tableAlias">topic表在查询中的别名</param>
        /// <param name="searchEntity">查询条件实体</param>
        /// <returns></returns>
        public Sql AppendSqlWhere(string initSqlString, string tableAlias, SearchOtherPayment searchEntity)
        {
            Sql sql = Sql.Builder.Append(initSqlString);

            if (searchEntity.ShipIdEqual.HasValue)
            {
                sql.Where(string.Format(" {0}.CargoName = {1}", tableAlias, searchEntity.ShipIdEqual.Value));
            }
            return(sql);
        }
Beispiel #2
0
        /// <summary>
        /// 获取其他收支项列表
        /// </summary>
        /// <param name="orderEnums"></param>
        /// <param name="searchEntity"></param>
        /// <returns></returns>
        public List <OtherPayment> GetList(IEnumerable <OtherPaymentEnum> orderEnums, SearchOtherPayment searchEntity)
        {
            string sqlStr =
                @"select * from OtherPayment t";
            Sql sql = AppendSqlWhere(sqlStr, "t", searchEntity);

            if (orderEnums != null && orderEnums.Any())
            {
                sql = sql.OrderByT(orderEnums);
            }
            return(DatabaseProvider.Query <OtherPayment>(sql).ToList());
        }