金融方案查询实体
Inheritance: QueryModel
Ejemplo n.º 1
0
 public BasePageList<FinanceProgrammeViewModel> GetFinanceProgrammeList(FinanceProgrammeQueryModel query)
 {
     return _carervice.GetFinanceProgrammeList(query);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取金融方案列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public BasePageList<FinanceProgrammeViewModel> GetFinanceProgrammeList(FinanceProgrammeQueryModel query)
        {
            const string spName = "sp_common_pager";
            const string tableName = @"finance_programme as a left join sys_user as b on b.innerid=a.createdid ";
            const string fields = " a.*,b.username as createdname ";
            var orderField = string.IsNullOrWhiteSpace(query.Order) ? "a.applytime desc" : query.Order;
            var sqlWhere = new StringBuilder(" 1=1 ");
            //联系电话
            if (!string.IsNullOrWhiteSpace(query.mobile))
            {
                sqlWhere.Append($" and a.mobile={query.mobile}");
            }
            //创建人
            if (!string.IsNullOrWhiteSpace(query.createdid))
            {
                sqlWhere.Append($" and a.createdid='{query.createdid}'");
            }

            var model = new PagingModel(spName, tableName, fields, orderField, sqlWhere.ToString(), query.PageSize, query.PageIndex);
            var list = Helper.ExecutePaging<FinanceProgrammeViewModel>(model, query.Echo);
            return list;
        }