using System.Collections.Generic;
using System.Linq;
using Edu.Model.Entity.Finance;
using Edu.Model.ViewModel.Finance;
namespace Edu.Repository.Finance
{
///
/// 财务单据凭证仓储层
///
public class RB_VoucherRepository : BaseRepository
{
///
/// 表名称
///
public string TableName { get { return nameof(RB_Voucher); } }
///
/// 获取单据凭证列表
///
///
///
public List GetList(RB_Voucher_Extend model)
{
string where = " WHERE 1=1 ";
if (model.Type > 0)
{
where += string.Format(" AND " + nameof(RB_Voucher.Type) + "={0} ", (int)model.Type);
}
if (model.FinanceId > 0)
{
where += string.Format(" AND " + nameof(RB_Voucher.FinanceId) + "={0} ", model.FinanceId);
}
if (!string.IsNullOrWhiteSpace(model.FrIdStr))
{
where += string.Format(" AND " + nameof(RB_Voucher.FinanceId) + " in({0}) ", model.FrIdStr);
}
if (model.TradeWayId > 0)
{
where += string.Format(" AND " + nameof(RB_Voucher.TradeWayId) + "={0} ", model.TradeWayId);
}
return Get("select * from " + TableName + " " + where).ToList();
}
}
}