| | |
| | | /// <summary> |
| | | /// 单位值 |
| | | /// </summary> |
| | | public partial class SysUnitValue : Yw.CAL.ISysUnitValue |
| | | public partial class SysUnitValue |
| | | { |
| | | private readonly Yw.CAL.ISysUnitValue _cal = CALCreateHelper.CreateCAL<Yw.CAL.ISysUnitValue>(); |
| | | |
| | | #region Query |
| | | public Task<List<SysUnitValueDto>> GetAll() |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public virtual async Task<List<SysUnitValueVmo>> GetAll() |
| | | { |
| | | return _cal.GetAll(); |
| | | var dtoList = await _cal.GetAll(); |
| | | return Dto2Vmos(dtoList); |
| | | } |
| | | |
| | | public Task<SysUnitValueDto> GetByID(long ID) |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public virtual async Task<SysUnitValueVmo> GetByID(long ID) |
| | | { |
| | | return _cal.GetByID(ID); |
| | | var dto = await _cal.GetByID(ID); |
| | | return Dto2Vmo(dto); |
| | | } |
| | | |
| | | public Task<List<SysUnitValueDto>> GetByIds(List<long> Ids) |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public virtual async Task<List<SysUnitValueVmo>> GetByIds(List<long> Ids) |
| | | { |
| | | return _cal.GetByIds(Ids); |
| | | if (Ids == null || Ids.Count < 1) |
| | | { |
| | | return default; |
| | | } |
| | | var dtoList = await _cal.GetByIds(Ids); |
| | | return Dto2Vmos(dtoList); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public virtual async Task<List<SysUnitValueVmo>> GetByTypeID(long TypeID) |
| | | { |
| | | var dtoList = await _cal.GetByTypeID(TypeID); |
| | | return Dto2Vmos(dtoList); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Insert |
| | | |
| | | public Task<long> Insert(AddSysUnitValueInput model) |
| | | |
| | | /// <summary> |
| | | /// 插入一条 |
| | | /// </summary> |
| | | public virtual async Task<long> Insert(SysUnitValueVmo vmo) |
| | | { |
| | | return _cal.Insert(model); |
| | | var dto = Vmo2AddDto(vmo); |
| | | var id = await _cal.Insert(dto); |
| | | return id; |
| | | } |
| | | |
| | | public Task<bool> Inserts(List<AddSysUnitValueInput> list) |
| | | /// <summary> |
| | | /// 插入多条 |
| | | /// </summary> |
| | | public virtual async Task<bool> Inserts(List<SysUnitValueVmo> vmoList) |
| | | { |
| | | return _cal.Inserts(list); |
| | | } |
| | | |
| | | public Task<bool> BulkInserts(List<AddSysUnitValueInput> list) |
| | | { |
| | | return _cal.BulkInserts(list); |
| | | var dtoList = Vmo2AddDtos(vmoList); |
| | | var bol = await _cal.Inserts(dtoList); |
| | | return bol; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Update |
| | | |
| | | public Task<bool> Update(UpdateSysUnitValueInput model) |
| | | /// <summary> |
| | | /// 更新 |
| | | /// </summary> |
| | | public virtual async Task<bool> Update(SysUnitValueVmo vmo) |
| | | { |
| | | return _cal.Update(model); |
| | | var dto = Vmo2UpdateDto(vmo); |
| | | var bol = await _cal.Update(dto); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<bool> Updates(List<UpdateSysUnitValueInput> list) |
| | | /// <summary> |
| | | /// 批量更新 |
| | | /// </summary> |
| | | public virtual async Task<bool> Updates(List<SysUnitValueVmo> vmoList) |
| | | { |
| | | return _cal.Updates(list); |
| | | var dtoList = Vmo2UpdateDtos(vmoList); |
| | | var bol = await _cal.Updates(dtoList); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<bool> BulkUpdates(List<UpdateSysUnitValueInput> list) |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public virtual async Task<bool> UpdateCode(long ID, string Code) |
| | | { |
| | | return _cal.BulkUpdates(list); |
| | | var bol = await _cal.UpdateCode(ID, Code); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<bool> UpdateCode(long ID, string Code) |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public virtual async Task<bool> UpdateSortCode(long ID, int SortCode) |
| | | { |
| | | return _cal.UpdateCode(ID, Code); |
| | | var bol = await _cal.UpdateSortCode(ID, SortCode); |
| | | return bol; |
| | | } |
| | | |
| | | public Task<bool> UpdateSortCode(long ID, int SortCode) |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public virtual async Task<bool> UpdateSorter(List<Yw.Vmo.Sorter> Sorters) |
| | | { |
| | | return _cal.UpdateSortCode(ID, SortCode); |
| | | } |
| | | |
| | | public Task<bool> UpdateSorter(List<UpdateSortCodeInput> Sorters) |
| | | { |
| | | return _cal.UpdateSorter(Sorters); |
| | | var dtoList = Sorters.ToDtoList(); |
| | | var bol = await _cal.UpdateSorter(dtoList); |
| | | return bol; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Delete |
| | | public Task<bool> DeleteByID(long ID) |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public virtual async Task<bool> DeleteByID(long ID) |
| | | { |
| | | return _cal.DeleteByID(ID); |
| | | } |
| | | public Task<bool> DeleteByIds(List<long> Ids) |
| | | { |
| | | return _cal.DeleteByIds(Ids); |
| | | return await _cal.DeleteByID(ID); |
| | | } |
| | | |
| | | public Task<bool> DeleteAll() |
| | | { |
| | | return _cal.DeleteAll(); |
| | | } |
| | | #endregion |
| | | |
| | | } |