using DapperORM.Common.Models;
using PushInfo.Core.Models.Tables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace PushInfo.Core.IDAL
{
    internal interface IPushMessageDAL
    {
        #region 添加发送记录
        /// <summary>
        /// 添加发送记录
        /// </summary>
        /// <param name="obj">数据实体</param>
        /// <returns></returns>
        ResultModel Add(Push_Message obj);
        #endregion

        #region 查询集合
        /// <summary>
        /// 查询集合
        /// </summary>
        /// <param name="where">查询条件</param>
        /// <param name="select">查询字段</param>
        /// <param name="sort">排序</param>
        /// <returns></returns>
        ResultModel<IEnumerable<Push_Message>> GetList(Expression<Func<Push_Message, bool>> where = null, Expression<Func<Push_Message, object>> select = null, IDictionary<string, bool> sort = null);
        #endregion

        #region 查询推送用户的最新一条记录
        /// <summary>
        /// 查询推送用户的最新一条记录
        /// </summary>
        /// <returns></returns>
        ResultModel<IEnumerable<Push_Message>> GetUserLastPush();
        #endregion

        #region 局部更新
        ResultModel UpdatePartail(Push_Message model, Expression<Func<Push_Message, object>> updateExp, Expression<Func<Push_Message, bool>> whereExp);
        #endregion
    }
}
