| | |
| | | /// <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.PumpPartMainVmo>> GetAll() |
| | | public async Task<List<Vmo.AssetsPumpPartMainVmo>> GetAll() |
| | | { |
| | | var DtoList = await _cal.GetAll(); |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<PumpPartMainDto, Vmo.PumpPartMainVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<PumpPartMainDto>, List<Vmo.PumpPartMainVmo>>(DtoList); |
| | | var VmoList = mapper.Map<List<AssetsPumpPartMainDto>, List<Vmo.AssetsPumpPartMainVmo>>(DtoList); |
| | | |
| | | return VmoList; |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<Vmo.PumpPartMainVmo> 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.PumpPartMainVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>() |
| | | ).CreateMapper(); |
| | | var Vmo = mapper.Map<PumpPartMainDto, Vmo.PumpPartMainVmo>(Dto); |
| | | var Vmo = mapper.Map<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>(Dto); |
| | | |
| | | return Vmo; |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<List<Vmo.PumpPartMainVmo>> 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.PumpPartMainVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<PumpPartMainDto>, List<Vmo.PumpPartMainVmo>>(DtoList); |
| | | var VmoList = mapper.Map<List<AssetsPumpPartMainDto>, List<Vmo.AssetsPumpPartMainVmo>>(DtoList); |
| | | |
| | | return VmoList; |
| | | } |
| | | |
| | | //通过泵型号ID获取 |
| | | public async Task<List<Vmo.PumpPartMainVmo>> 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.PumpPartMainVmo>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<AssetsPumpPartMainDto, Vmo.AssetsPumpPartMainVmo>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<PumpPartMainDto>, List<Vmo.PumpPartMainVmo>>(DtoList); |
| | | var VmoList = mapper.Map<List<AssetsPumpPartMainDto>, List<Vmo.AssetsPumpPartMainVmo>>(DtoList); |
| | | |
| | | return VmoList; |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<long> Insert(Vmo.PumpPartMainVmo model) |
| | | public async Task<long> Insert(Vmo.AssetsPumpPartMainVmo model) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMainVmo, AddPumpPartMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var Vmo = mapper.Map<Vmo.PumpPartMainVmo, AddPumpPartMainInput>(model); |
| | | var Vmo = mapper.Map<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>(model); |
| | | return await _cal.Insert(Vmo); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> Inserts(List<Vmo.PumpPartMainVmo> list) |
| | | public async Task<bool> Inserts(List<Vmo.AssetsPumpPartMainVmo> list) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMainVmo, AddPumpPartMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<Vmo.PumpPartMainVmo>, List<AddPumpPartMainInput>>(list); |
| | | var VmoList = mapper.Map<List<Vmo.AssetsPumpPartMainVmo>, List<AddAssetsPumpPartMainInput>>(list); |
| | | |
| | | return await _cal.Inserts(VmoList); |
| | | } |
| | | |
| | | public async Task<long> InsertEx(Vmo.PumpPartMainVmo part, List<Vmo.PumpPropContentVmo> propcontents, Vmo.PumpMainAndPartMapVmo partmap) |
| | | public async Task<long> InsertEx(Vmo.AssetsPumpPartMainVmo part, List<Vmo.AssetsPumpPropContentVmo> propcontents, Vmo.AssetsPumpMainAndPartMapVmo partmap) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMainVmo, AddPumpPartMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoPart = mapper.Map<Vmo.PumpPartMainVmo, AddPumpPartMainInput>(part); |
| | | var VmoPart = mapper.Map<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>(part); |
| | | |
| | | var mapperContent = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPropContentVmo, AddPumpPropContentInput>() |
| | | var mapperContent = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPropContentVmo, AddAssetsPumpPropContentInput>() |
| | | ).CreateMapper(); |
| | | var VmoContent = mapperContent.Map<List<Vmo.PumpPropContentVmo>, List<AddPumpPropContentInput>>(propcontents); |
| | | var VmoContent = mapperContent.Map<List<Vmo.AssetsPumpPropContentVmo>, List<AddAssetsPumpPropContentInput>>(propcontents); |
| | | |
| | | var mapperPartmap = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpMainAndPartMapVmo, AddPumpMainAndPartMapDto>() |
| | | var mapperPartmap = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpMainAndPartMapVmo, AddAssetsPumpMainAndPartMapDto>() |
| | | ).CreateMapper(); |
| | | var Vmopartmap = mapperPartmap.Map<Vmo.PumpMainAndPartMapVmo, 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.PumpPartMainVmo> list) |
| | | public async Task<bool> BulkInserts(List<Vmo.AssetsPumpPartMainVmo> list) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMainVmo, AddPumpPartMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, AddAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<Vmo.PumpPartMainVmo>, List<AddPumpPartMainInput>>(list); |
| | | var VmoList = mapper.Map<List<Vmo.AssetsPumpPartMainVmo>, List<AddAssetsPumpPartMainInput>>(list); |
| | | |
| | | return await _cal.BulkInserts(VmoList); |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> Update(Vmo.PumpPartMainVmo model) |
| | | public async Task<bool> Update(Vmo.AssetsPumpPartMainVmo model) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMainVmo, UpdatePumpPartMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var Vmo = mapper.Map<Vmo.PumpPartMainVmo, UpdatePumpPartMainInput>(model); |
| | | var Vmo = mapper.Map<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>(model); |
| | | |
| | | return await _cal.Update(Vmo); |
| | | } |
| | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public async Task<bool> Updates(List<Vmo.PumpPartMainVmo> list) |
| | | public async Task<bool> Updates(List<Vmo.AssetsPumpPartMainVmo> list) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMainVmo, UpdatePumpPartMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<Vmo.PumpPartMainVmo>, List<UpdatePumpPartMainInput>>(list); |
| | | var VmoList = mapper.Map<List<Vmo.AssetsPumpPartMainVmo>, List<UpdateAssetsPumpPartMainInput>>(list); |
| | | |
| | | return await _cal.Updates(VmoList); |
| | | } |
| | | |
| | | public async Task<bool> UpdateEx(Vmo.PumpPartMainVmo pumppart, List<Vmo.PumpPropContentVmo> updatePumpPropContentDtos) |
| | | public async Task<bool> UpdateEx(Vmo.AssetsPumpPartMainVmo pumppart, List<Vmo.AssetsPumpPropContentVmo> updateAssetsPumpPropContentDtos) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMainVmo, UpdatePumpPartMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<Vmo.PumpPartMainVmo, UpdatePumpPartMainInput>(pumppart); |
| | | var VmoList = mapper.Map<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>(pumppart); |
| | | |
| | | var mapperContent = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPropContentVmo, UpdatePumpPropContentInput>() |
| | | var mapperContent = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPropContentVmo, UpdateAssetsPumpPropContentInput>() |
| | | ).CreateMapper(); |
| | | var VmoListContent = mapperContent.Map<List<Vmo.PumpPropContentVmo>, List<UpdatePumpPropContentInput>>(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.PumpPartMainVmo> list) |
| | | public async Task<bool> BulkUpdates(List<Vmo.AssetsPumpPartMainVmo> list) |
| | | { |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.PumpPartMainVmo, UpdatePumpPartMainInput>() |
| | | var mapper = new MapperConfiguration(cfg => cfg.CreateMap<Vmo.AssetsPumpPartMainVmo, UpdateAssetsPumpPartMainInput>() |
| | | ).CreateMapper(); |
| | | var VmoList = mapper.Map<List<Vmo.PumpPartMainVmo>, List<UpdatePumpPartMainInput>>(list); |
| | | var VmoList = mapper.Map<List<Vmo.AssetsPumpPartMainVmo>, List<UpdateAssetsPumpPartMainInput>>(list); |
| | | |
| | | return await _cal.BulkUpdates(VmoList); |
| | | } |