using OASystem.Domain.Dtos.System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OASystem.Infrastructure.Repositories.System
{
    public class JobPostRepository : BaseRepository<Sys_JobPost, JobPostView>
    {
        public JobPostRepository(SqlSugarClient sqlSugar) : base(sqlSugar)
        {

        }

        public async Task<List<Sys_JobPostI>> QueryJobPost(string sqlWhere)
        {
            string sql = string.Format(@"select jp.*,dep.DepName as 'DepName',cmp.CompanyName as 'CompanyName' from Sys_JobPost jp left join 
                                                 Sys_Company cmp on jp.CompanyId=cmp.Id left join Sys_Department dep on jp.DepId=dep.Id  {0}", sqlWhere);
            return await _sqlSugar.SqlQueryable<Sys_JobPostI>(sql).ToListAsync();
        }

    }
}
