| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class PumpPartMain |
| | | public class AssetsPumpPartMain |
| | | { |
| | | private readonly HStation.CAL.IPumpPartMain _cal = CALCreateHelper.CreateCAL<HStation.CAL.IPumpPartMain>(); |
| | | private readonly HStation.CAL.IAssetsPumpPartMain _cal = CALCreateHelper.CreateCAL<HStation.CAL.IAssetsPumpPartMain>(); |
| | | |
| | | #region Query |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<List<Vmo.PumpPartMain>> GetAll() |
| | | public async Task<List<Vmo.AssetsPumpPartMainVmo>> GetAll() |
| | | { |
| | | var DtoList = await _cal.GetAll(); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<PumpPartMainDto, Vmo.PumpPartMain>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<PumpPartMainDto>, List<Vmo.PumpPartMain>>(DtoList); |
| | | var VmoList = mapper.Map<List<AssetsPumpPartMainDto>, List<Vmo.AssetsPumpPartMainVmo>>(DtoList); |
| | | |
| | | return VmoList; |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<Vmo.PumpPartMain> GetByID(long ID) |
| | | public async Task<Vmo.AssetsPumpPartMainVmo> GetByID(long ID) |
| | | { |
| | | var Dto = await _cal.GetByID(ID); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<PumpPartMainDto, Vmo.PumpPartMain>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>() |
| | | ).CreateMapper(); |
| | | var Vmo = mapper.Map<PumpPartMainDto, Vmo.PumpPartMain>(Dto); |
| | | var Vmo = mapper.Map<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>(Dto); |
| | | |
| | | return Vmo; |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<List<Vmo.PumpPartMain>> GetByIds(List<long> Ids) |
| | | public async Task<List<Vmo.AssetsPumpPartMainVmo>> GetByIds(List<long> Ids) |
| | | { |
| | | var DtoList = await _cal.GetByIds(Ids); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<PumpPartMainDto, Vmo.PumpPartMain>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<PumpPartMainDto>, List<Vmo.PumpPartMain>>(DtoList); |
| | | var VmoList = mapper.Map<List<AssetsPumpPartMainDto>, List<Vmo.AssetsPumpPartMainVmo>>(DtoList); |
| | | |
| | | return VmoList; |
| | | } |
| | | |
| | | //通过泵型号ID获取 |
| | | public async Task<List<Vmo.PumpPartMain>> GetByPumpMainID(long ID) |
| | | public async Task<List<Vmo.AssetsPumpPartMainVmo>> GetByPumpMainID(long ID) |
| | | { |
| | | var DtoList = await _cal.GetByPumpMainID(ID); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<PumpPartMainDto, Vmo.PumpPartMain>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<PumpPartMainDto>, List<Vmo.PumpPartMain>>(DtoList); |
| | | var VmoList = mapper.Map<List<AssetsPumpPartMainDto>, List<Vmo.AssetsPumpPartMainVmo>>(DtoList); |
| | | |
| | | return VmoList; |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<long> Insert(Vmo.PumpPartMain model) |
| | | public async Task<long> Insert(Vmo.AssetsPumpPartMainVmo model) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMain, AddPumpPartMainDto>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var Vmo = mapper.Map<Vmo.PumpPartMain, AddPumpPartMainDto>(model); |
| | | var Vmo = mapper.Map<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>(model); |
| | | return await _cal.Insert(Vmo); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> Inserts(List<Vmo.PumpPartMain> list) |
| | | public async Task<bool> Inserts(List<Vmo.AssetsPumpPartMainVmo> list) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMain, AddPumpPartMainDto>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<Vmo.PumpPartMain>, List<AddPumpPartMainDto>>(list); |
| | | var VmoList = mapper.Map<List<Vmo.AssetsPumpPartMainVmo>, List<AddAssetsPumpPartMainInput>>(list); |
| | | |
| | | return await _cal.Inserts(VmoList); |
| | | } |
| | | |
| | | public async Task<long> InsertEx(Vmo.PumpPartMain part, List<Vmo.PumpPropContent> propcontents, Vmo.PumpMainAndPartMap partmap) |
| | | public async Task<long> InsertEx(Vmo.AssetsPumpPartMainVmo part, List<Vmo.AssetsPumpPropContentVmo> propcontents, Vmo.AssetsPumpMainAndPartMapVmo partmap) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMain, AddPumpPartMainDto>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoPart = mapper.Map<Vmo.PumpPartMain, AddPumpPartMainDto>(part); |
| | | var VmoPart = mapper.Map<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>(part); |
| | | |
| | | var mapperContent = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPropContent, AddPumpPropContentDto>() |
| | | var mapperContent = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPropContentVmo, AddAssetsPumpPropContentInput>() |
| | | ).CreateMapper(); |
| | | var VmoContent = mapperContent.Map<List<Vmo.PumpPropContent>, List<AddPumpPropContentDto>>(propcontents); |
| | | var VmoContent = mapperContent.Map<List<Vmo.AssetsPumpPropContentVmo>, List<AddAssetsPumpPropContentInput>>(propcontents); |
| | | |
| | | var mapperPartmap = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpMainAndPartMap, AddPumpMainAndPartMapDto>() |
| | | var mapperPartmap = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpMainAndPartMapVmo, AddAssetsPumpMainAndPartMapDto>() |
| | | ).CreateMapper(); |
| | | var Vmopartmap = mapperPartmap.Map<Vmo.PumpMainAndPartMap, AddPumpMainAndPartMapDto>(partmap); |
| | | var Vmopartmap = mapperPartmap.Map<Vmo.AssetsPumpMainAndPartMapVmo, AddAssetsPumpMainAndPartMapDto>(partmap); |
| | | |
| | | return await _cal.InsertEx(VmoPart, VmoContent, Vmopartmap); |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> BulkInserts(List<Vmo.PumpPartMain> list) |
| | | public async Task<bool> BulkInserts(List<Vmo.AssetsPumpPartMainVmo> list) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMain, AddPumpPartMainDto>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<Vmo.PumpPartMain>, List<AddPumpPartMainDto>>(list); |
| | | var VmoList = mapper.Map<List<Vmo.AssetsPumpPartMainVmo>, List<AddAssetsPumpPartMainInput>>(list); |
| | | |
| | | return await _cal.BulkInserts(VmoList); |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> Update(Vmo.PumpPartMain model) |
| | | public async Task<bool> Update(Vmo.AssetsPumpPartMainVmo model) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMain, UpdatePumpPartMainDto>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var Vmo = mapper.Map<Vmo.PumpPartMain, UpdatePumpPartMainDto>(model); |
| | | var Vmo = mapper.Map<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>(model); |
| | | |
| | | return await _cal.Update(Vmo); |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> Updates(List<Vmo.PumpPartMain> list) |
| | | public async Task<bool> Updates(List<Vmo.AssetsPumpPartMainVmo> list) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMain, UpdatePumpPartMainDto>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<Vmo.PumpPartMain>, List<UpdatePumpPartMainDto>>(list); |
| | | var VmoList = mapper.Map<List<Vmo.AssetsPumpPartMainVmo>, List<UpdateAssetsPumpPartMainInput>>(list); |
| | | |
| | | return await _cal.Updates(VmoList); |
| | | } |
| | | |
| | | public async Task<bool> UpdateEx(Vmo.PumpPartMain pumppart, List<Vmo.PumpPropContent> updatePumpPropContentDtos) |
| | | public async Task<bool> UpdateEx(Vmo.AssetsPumpPartMainVmo pumppart, List<Vmo.AssetsPumpPropContentVmo> updateAssetsPumpPropContentDtos) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMain, UpdatePumpPartMainDto>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<Vmo.PumpPartMain, UpdatePumpPartMainDto>(pumppart); |
| | | var VmoList = mapper.Map<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>(pumppart); |
| | | |
| | | var mapperContent = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPropContent, UpdatePumpPropContentDto>() |
| | | var mapperContent = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPropContentVmo, UpdateAssetsPumpPropContentInput>() |
| | | ).CreateMapper(); |
| | | var VmoListContent = mapperContent.Map<List<Vmo.PumpPropContent>, List<UpdatePumpPropContentDto>>(updatePumpPropContentDtos); |
| | | var VmoListContent = mapperContent.Map<List<Vmo.AssetsPumpPropContentVmo>, List<UpdateAssetsPumpPropContentInput>>(updateAssetsPumpPropContentDtos); |
| | | |
| | | return await _cal.UpdateEx(VmoList, VmoListContent); |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> BulkUpdates(List<Vmo.PumpPartMain> list) |
| | | public async Task<bool> BulkUpdates(List<Vmo.AssetsPumpPartMainVmo> list) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMain, UpdatePumpPartMainDto>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<Vmo.PumpPartMain>, List<UpdatePumpPartMainDto>>(list); |
| | | var VmoList = mapper.Map<List<Vmo.AssetsPumpPartMainVmo>, List<UpdateAssetsPumpPartMainInput>>(list); |
| | | |
| | | return await _cal.BulkUpdates(VmoList); |
| | | } |