/// <summary> /// 插入PK表无重复键数据 /// </summary> void InsertPKDifferentKeyTable() { Stopwatch watch = new Stopwatch(); watch.Start(); SQLiteTableMapAttribute tableAttribute = StrayFogConfigHelper.GetTableAttribute <XLS_Report_Table_Report>(); UnityEngine.Debug.LogFormat("【Insert PK Table 】【Different Key】 【{0}->{1}】", GetSrcData(tableAttribute), tableAttribute.sqliteTableName); List <XLS_Report_Table_Report> reports = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); watch.Stop(); UnityEngine.Debug.LogFormat("【Select PK Table 】【Different Key】SQLite Data =>{0} , Time=>{1} , Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize()); watch.Reset(); watch.Start(); XLS_Report_Table_Report insertReport = new XLS_Report_Table_Report(Guid.NewGuid().ToString().GetHashCode()); insertReport.Set_stringCol("Insert PK Table"); StrayFogConfigHelper.Insert(insertReport); watch.Stop(); UnityEngine.Debug.LogFormat("【Insert PK Table】【Different Key】SQLite Data 【Different PK】=>{0} , Time=>{1}, Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize()); watch.Reset(); watch.Start(); reports = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); watch.Stop(); UnityEngine.Debug.LogFormat("【Select PK Table】【Different Key】SQLite Data =>{0} , Time=>{1}", reports.Count, watch.Elapsed, reports.JsonSerialize()); }
/// <summary> /// 插入NoPK表数据 /// </summary> void InsertNoPKTable() { Stopwatch watch = new Stopwatch(); watch.Start(); SQLiteTableMapAttribute tableAttribute = StrayFogConfigHelper.GetTableAttribute <XLS_Report_Table_ReportColumnMaping>(); UnityEngine.Debug.LogFormat("Insert 【NoPk Table】 【{0}->{1}】", GetSrcData(tableAttribute), tableAttribute.sqliteTableName); watch.Reset(); watch.Start(); List <XLS_Report_Table_ReportColumnMaping> reportColumnMapings = StrayFogConfigHelper.Select <XLS_Report_Table_ReportColumnMaping>(); watch.Stop(); UnityEngine.Debug.LogFormat("Select【NoPk Table】SQLite Data =>{0} , Time=>{1}", reportColumnMapings.Count, watch.Elapsed); if (reportColumnMapings.Count > 0) { watch.Reset(); watch.Start(); reportColumnMapings[0].Set_stringCol("Insert NoPk Table"); StrayFogConfigHelper.Insert(reportColumnMapings[0]); watch.Stop(); UnityEngine.Debug.LogFormat("Insert【NoPk Table】SQLite Data =>{0} , Time=>{1}", reportColumnMapings.Count, watch.Elapsed); } watch.Reset(); watch.Start(); reportColumnMapings = StrayFogConfigHelper.Select <XLS_Report_Table_ReportColumnMaping>(); watch.Stop(); UnityEngine.Debug.LogFormat("Select【NoPk Table】SQLite Data =>{0} , Time=>{1}", reportColumnMapings.Count, watch.Elapsed); }
/// <summary> /// 插入PK表有重复键数据 /// </summary> void InsertPKSameKeyTable() { Stopwatch watch = new Stopwatch(); watch.Start(); SQLiteTableMapAttribute tableAttribute = StrayFogConfigHelper.GetTableAttribute <XLS_Report_Table_Report>(); UnityEngine.Debug.LogFormat("【Insert PK Table 】【Same Key】【{0}->{1}】", GetSrcData(tableAttribute), tableAttribute.sqliteTableName); List <XLS_Report_Table_Report> reports = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); watch.Stop(); UnityEngine.Debug.LogFormat("【Select PK Table 】【Same Key】SQLite Data =>{0} , Time=>{1} , Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize()); if (reports.Count > 0) { watch.Reset(); watch.Start(); StrayFogConfigHelper.Insert(reports[0]); watch.Stop(); UnityEngine.Debug.LogFormat("【Insert PK Table】【Same Key】SQLite Data 【Same PK】=>{0} , Time=>{1}, Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize()); } watch.Reset(); watch.Start(); reports = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); watch.Stop(); UnityEngine.Debug.LogFormat("【Select PK Table】【Same Key】SQLite Data =>{0} , Time=>{1}", reports.Count, watch.Elapsed, reports.JsonSerialize()); }
/// <summary> /// OnRunGUI /// </summary> protected override void OnRunGUI() { StrayFogGamePools.sceneManager.DrawLevelSelectButtonOnGUI(); StrayFogGamePools.eventHandlerManager.DrawLevelSelectButtonOnGUI(); if (GUILayout.Button("Update ")) { XLS_Report_Determinant_Table_ReportDeterminant tbRd = StrayFogConfigHelper.Select <XLS_Report_Determinant_Table_ReportDeterminant>()[0]; tbRd.Set_ReportTip(Guid.NewGuid().ToString()); StrayFogConfigHelper.Update(tbRd); StrayFogConfigHelper.SaveExcelPackage(); Debug.Log("Update" + tbRd + "=>" + tbRd.JsonSerialize()); } if (GUILayout.Button("Insert")) { XLS_Report_Table_Report tbInsertRp = new XLS_Report_Table_Report(Guid.NewGuid().ToString().UniqueHashCode()); Debug.Log(tbInsertRp + " Before Insert" + tbInsertRp.JsonSerialize()); tbInsertRp.Set_stringCol("Insert" + Guid.NewGuid().ToString()); StrayFogConfigHelper.Insert(tbInsertRp); StrayFogConfigHelper.SaveExcelPackage(); Debug.Log("After Insert =>" + StrayFogConfigHelper.Select <XLS_Report_Table_Report>().JsonSerialize()); } if (GUILayout.Button("Delete")) { XLS_Report_Table_Report tbDeleteRp = StrayFogConfigHelper.Select <XLS_Report_Table_Report>()[0]; Debug.Log(tbDeleteRp + " Before Delete" + tbDeleteRp.JsonSerialize()); StrayFogConfigHelper.Delete(tbDeleteRp); StrayFogConfigHelper.SaveExcelPackage(); Debug.Log("After Delete =>" + StrayFogConfigHelper.Select <XLS_Report_Table_Report>().JsonSerialize()); } if (GUILayout.Button("Reload All")) { List <XLS_Report_Table_Report> tbReloadRps = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); if (tbReloadRps.Count > 0) { Debug.Log(tbReloadRps + " Before Reload" + tbReloadRps.JsonSerialize()); StrayFogConfigHelper.Delete(tbReloadRps[0]); } StrayFogConfigHelper.Reload <XLS_Report_Table_Report>(enSQLiteReloadClassify.DiskCoverAllCahche); Debug.Log("After Reload =>" + StrayFogConfigHelper.Select <XLS_Report_Table_Report>().JsonSerialize()); } if (GUILayout.Button("Reload Same")) { List <XLS_Report_Table_Report> tbReloadSameRps = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); if (tbReloadSameRps.Count > 0) { Debug.Log(tbReloadSameRps + " Before Reload Same" + tbReloadSameRps.JsonSerialize()); tbReloadSameRps[0].Set_stringCol("Reload Same"); StrayFogConfigHelper.Update(tbReloadSameRps[0]); } StrayFogConfigHelper.Reload <XLS_Report_Table_Report>(); Debug.Log("After Reload Same=>" + StrayFogConfigHelper.Select <XLS_Report_Table_Report>().JsonSerialize()); } }