ForeignReceivablesRepository.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using AutoMapper;
  2. using OASystem.Domain;
  3. using OASystem.Domain.Entities.Financial;
  4. using OASystem.Domain.ViewModels.Financial;
  5. using SqlSugar;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace OASystem.Infrastructure.Repositories.Financial
  12. {
  13. /// <summary>
  14. /// 财务 - 团组应收款项 仓库
  15. /// 雷怡 2023.08.16 15:03
  16. /// </summary>
  17. public class ForeignReceivablesRepository:BaseRepository<Fin_ForeignReceivables,Fin_ForeignReceivablesView>
  18. {
  19. private readonly IMapper _mapper;
  20. public ForeignReceivablesRepository(SqlSugarClient sqlSugar, IMapper mapper)
  21. :base(sqlSugar)
  22. {
  23. _mapper = mapper;
  24. }
  25. /// <summary>
  26. /// 根据diid查询团组已收收款项
  27. /// </summary>
  28. /// <param name="diid"></param>
  29. /// <returns></returns>
  30. public async Task<Result> GetGroupReceivablesByDiid(int diid)
  31. {
  32. Result result = new() { Code = -2 };
  33. string sql = string.Format(@"Select * From Fin_ProceedsReceived Where IsDel=0 And Diid={0}", diid);
  34. var groupReceivedList = await _sqlSugar.SqlQueryable<Fin_ProceedsReceivedView>(sql).ToListAsync();
  35. result.Code = 0;
  36. result.Msg = "查询成功!";
  37. result.Data = groupReceivedList;
  38. return result;
  39. }
  40. }
  41. }