using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Common.Enum;
using Edu.Model.Entity.Finance;
using Edu.Model.ViewModel.Finance;
namespace Edu.Repository.Finance
{
///
/// 简易报表仓储层
///
public partial class RB_SimpleReportRepository : BaseRepository
{
///
/// 获取列表
///
///
///
public List GetList(RB_SimpleReport_Extend model)
{
string where = " 1=1 ";
if (model.Year > 0)
{
where += string.Format(" AND A." + nameof(RB_SimpleReport_Extend.Year) + "=" + model.Year);
}
if (model.Rb_Group_Id > 0)
{
where += string.Format(" AND A." + nameof(RB_SimpleReport_Extend.Rb_Group_Id) + "=" + model.Rb_Group_Id);
}
if (model.BranchId >= -1)
{
where += string.Format(" AND A." + nameof(RB_SimpleReport_Extend.BranchId) + "=" + model.BranchId);
}
if (!string.IsNullOrEmpty(model.Abstract))
{
where += string.Format(" AND A." + nameof(RB_SimpleReport_Extend.Abstract) + "='{0}'", model.Abstract);
}
if (model.IsSelectAllCompany == 1)
{
where += string.Format(" AND A." + nameof(RB_SimpleReport_Extend.BranchId) + " !=-1 ");
}
string sql = string.Format(@"SELECT * FROM {0} AS A WHERE {1} order by Sort asc", nameof(RB_SimpleReport), where);
return Get(sql).ToList();
}
}
}