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
{
    /// <summary>
    /// 报表更新记录仓储层
    /// </summary>
    public partial class RB_Report_UpdateRecordRepository : BaseRepository<RB_Report_UpdateRecord>
    {
        /// <summary>
        /// 表名称
        /// </summary>
        public string TableName { get { return nameof(RB_Report_UpdateRecord); } }

        /// <summary>
        /// 根据团控id获取操作日志列表
        /// </summary>
        /// <param name="where"></param>
        /// <returns></returns>
        public List<RB_Report_UpdateRecord> GetList(RB_Report_UpdateRecord where)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat(" SELECT * FROM {0} WHERE 1=1 ", TableName);
            if (where.Type > 0)
            {
                sb.AppendFormat(" And Type={0}", where.Type);
            }
            return Get<RB_Report_UpdateRecord>(sb.ToString() + " Order By ID DESC LIMIT 1 ").ToList();
        }
    }
}
