123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using OASystem.Domain;
- using OASystem.Domain.Entities.System;
- namespace OASystem.Infrastructure.Repositories.System
- {
- public class CompanyRepository : BaseRepository<Sys_Company, CompanyView>
- {
- public CompanyRepository(SqlSugarClient sqlSugar) : base(sqlSugar)
- {
- }
- /// <summary>
- /// 获取所有公司数据
- /// </summary>
- /// <param name="_CompanyRepository"></param>
- /// <returns></returns>
- public Result GetCompanyData(CompanyRepository _CompanyRepository)
- {
- Result result = new Result();
- string sql = "select * from Sys_Company where isdel = 0";
- var DBdata = _CompanyRepository.GetListBySqlWithNolock(sql);
- if (DBdata == null || DBdata.Count == 0)
- {
- result.Code = -1;
- result.Msg = "暂无数据!";
- return result;
- }
- result.Code = 0;
- result.Msg = "成功!";
- result.Data = DBdata.Select(x=> new CompanyView
- {
- CompanyCode = x.CompanyCode,
- CompanyName = x.CompanyName,
- id = x.Id,
- ParentCompanyId = x.ParentCompanyId
- });
- return result;
- }
- }
- }
|