using OASystem.Domain;
using OASystem.Domain.Dtos;
using OASystem.Domain.Dtos.UserDto;
using OASystem.Domain.Entities.Customer;
using OASystem.Domain.ViewModels.CRM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OASystem.Infrastructure.Repositories.CRM
{
///
/// 签证客户公司
/// 仓库
///
public class VisaDeleClientCompanyRepository : BaseRepository
{
public VisaDeleClientCompanyRepository(SqlSugarClient sqlSugar) :
base(sqlSugar){ }
///
/// 签证客户公司 List
///
///
///
public async Task GetCrm_ClientCompanyList(DtoBase dto)
{
Result result = new Result() { Code = -2 };
if (dto.PortType == 1 || dto.PortType == 2)
{
string sql = string.Format(@"Select ccc.Id,ccc.CompanyName,ccc.Address,ccc.PostCodes,su.CnName UserName,ccc.CreateTime
From Crm_CustomerCompany ccc Inner Join Sys_Users su On ccc.CreateUserId = su.Id");
var _clientCompanyList = await _sqlSugar.SqlQueryable(sql).ToListAsync();
if (_clientCompanyList.Count > 0)
{
result.Code = 0;
result.Msg = "成功!";
result.Data = _clientCompanyList;
}
else
{
result.Msg = "查询失败!";
}
}
return result;
}
}
}