lixiaojun
2024-12-12 fe59cb0e4d060664927dca75d453162deae3e17d
Service/HStation.Service.Assets.Core/05-service/11-Exchanger/05-ExchangerMainAndPartMapping/ExchangerMainAndPartMapping.cs
@@ -8,16 +8,16 @@
        #region Cache
        //获取缓存
        private static List<Model.AssetsExchangerMainAndPartMap> GetCache()
        private static List<Model.AssetsExchangerMainAndPartMapping> GetCache()
        {
            var all = AssetsExchangerMainAndPartMapCacheHelper.GetSet(() =>
            {
                var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMap>();
                var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMapping>();
                var entity_list = dal.GetAll();
                var model_list = Entity2Models(entity_list);
                if (model_list == null)
                {
                    model_list = new List<Model.AssetsExchangerMainAndPartMap>();
                    model_list = new List<Model.AssetsExchangerMainAndPartMapping>();
                }
                return model_list;
            }, Yw.Service.ConfigHelper.CacheKeepTime, Yw.Service.ConfigHelper.CacheRandomTime);
@@ -27,7 +27,7 @@
        //通过 ID 更新缓存
        private static void UpdateCache(long ID)
        {
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMap>();
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMapping>();
            var entity_ds = dal.GetByID(ID);
            var model_ds = Entity2Model(entity_ds);
            var all = GetCache();
@@ -46,7 +46,7 @@
        //通过 PartID 更新缓存
        public static void UpdateCacheByPartID(long ID)
        {
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMap>();
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMapping>();
            var alllist = dal.GetAll();
            var select = alllist.Find(x => x.PartID == ID);
            var model_ds = Entity2Model(select);
@@ -70,7 +70,7 @@
            {
                return;
            }
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMap>();
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMapping>();
            var entity_list = dal.GetByIds(Ids);
            var model_list = Entity2Models(entity_list);
            var all = GetCache();
@@ -114,7 +114,7 @@
        /// <summary>
        /// 获取所有
        /// </summary>
        public List<Model.AssetsExchangerMainAndPartMap> GetAll()
        public List<Model.AssetsExchangerMainAndPartMapping> GetAll()
        {
            var all = GetCache();
            return all;
@@ -123,7 +123,7 @@
        /// <summary>
        /// 通过 ID 获取
        /// </summary>
        public Model.AssetsExchangerMainAndPartMap GetByID(long ID)
        public Model.AssetsExchangerMainAndPartMapping GetByID(long ID)
        {
            var all = GetAll();
            return all.Find(x => x.ID == ID);
@@ -132,7 +132,7 @@
        /// <summary>
        /// 通过 ID 获取
        /// </summary>
        public List<Model.AssetsExchangerMainAndPartMap> GetByIds(List<long> Ids)
        public List<Model.AssetsExchangerMainAndPartMapping> GetByIds(List<long> Ids)
        {
            if (Ids == null || Ids.Count < 1)
            {
@@ -162,13 +162,13 @@
        /// <summary>
        /// 插入一条数据
        /// </summary>
        public long Insert(Model.AssetsExchangerMainAndPartMap model)
        public long Insert(Model.AssetsExchangerMainAndPartMapping model)
        {
            if (model == null)
            {
                return default;
            }
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMap>();
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMapping>();
            var entity = Model2Entity(model);
            var id = dal.Insert(entity);
            if (id > 0)
@@ -181,13 +181,13 @@
        /// <summary>
        /// 插入多条
        /// </summary>
        public bool Inserts(List<Model.AssetsExchangerMainAndPartMap> list)
        public bool Inserts(List<Model.AssetsExchangerMainAndPartMapping> list)
        {
            if (list == null || list.Count < 1)
            {
                return false;
            }
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMap>();
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMapping>();
            var entity_list = Model2Entities(list);
            var ids = dal.InsertsR(entity_list);
            if (ids != null && ids.Count > 0)
@@ -205,14 +205,14 @@
        /// <summary>
        /// 更新一条
        /// </summary>
        public bool Update(Model.AssetsExchangerMainAndPartMap model)
        public bool Update(Model.AssetsExchangerMainAndPartMapping model)
        {
            if (model == null)
            {
                return false;
            }
            var entity = Model2Entity(model);
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMap>();
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMapping>();
            var bol = dal.Update(entity);
            if (bol)
            {
@@ -224,7 +224,7 @@
        /// <summary>
        /// 批量更新
        /// </summary>
        public bool Updates(List<Model.AssetsExchangerMainAndPartMap> list)
        public bool Updates(List<Model.AssetsExchangerMainAndPartMapping> list)
        {
            if (list == null || list.Count < 1)
            {
@@ -235,7 +235,7 @@
                return false;
            }
            var entity_list = Model2Entities(list);
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMap>();
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMapping>();
            var bol = dal.Updates(entity_list);
            if (bol)
            {
@@ -254,7 +254,7 @@
        public bool DeleteByID(long ID, out string Msg)
        {
            Msg = string.Empty;
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMap>();
            var dal = DALCreateHelper.CreateDAL<HStation.DAL.IAssetsExchangerMainAndPartMapping>();
            var bol = dal.DeleteByID(ID);
            if (bol)
            {