using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XYY.Core.Standard.Data.Infrastructure;
using XYY.Model.Standard.Order;

namespace XYY.Data.Standard.Order
{
    public interface IJobMessageRepository : IBaseRepository<Job_Message>
    {
        Task AddJobAsNotTransfer(string message, string action);
        Task AddJob(string message, string action);
    }
    public class JobMessageRepository : BaseRepository<Job_Message>, IJobMessageRepository
    {
        public JobMessageRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
        {
        }
        public async Task AddJobAsNotTransfer(string message, string action)
        {
            string sql = $"insert into Job_Message (JsonMessage,Action,CreateTime) values(@message,@action,getdate())";
            await base.ExecuteSqlNotTransferAsync(sql, new { message = message, action = action });
        }

        public async Task AddJob(string message, string action)
        {
            string sql = $"insert into Job_Message (JsonMessage,Action,CreateTime) values(@message,@action,getdate())";
            await base.ExecuteSqlAsync(sql, new { message = message, action = action });
        }
    }
}
