/// <summary> /// DeleteAllTable /// </summary> void DeleteAllTable() { Stopwatch watch = new Stopwatch(); watch.Start(); SQLiteTableMapAttribute tableAttribute = StrayFogConfigHelper.GetTableAttribute <XLS_Report_Table_Report>(); UnityEngine.Debug.LogFormat("Delete Table【{0}->{1}】", GetSrcData(tableAttribute), tableAttribute.sqliteTableName); List <XLS_Report_Table_Report> reports = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); watch.Stop(); UnityEngine.Debug.LogFormat("Select Table SQLite Data =>{0} , Time=>{1} , Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize()); watch.Reset(); watch.Start(); StrayFogConfigHelper.DeleteAll <XLS_Report_Table_Report>(); watch.Stop(); UnityEngine.Debug.LogFormat("DeleteAll Table SQLite Data =>{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 Table SQLite Data =>{0} , Time=>{1}", reports.Count, watch.Elapsed, reports.JsonSerialize()); }
/// <summary> /// RefreshTable /// </summary> void RefreshTable() { Stopwatch watch = new Stopwatch(); watch.Start(); SQLiteTableMapAttribute tableAttribute = StrayFogConfigHelper.GetTableAttribute <XLS_Report_Table_Report>(); UnityEngine.Debug.LogFormat("Refresh Table【{0}->{1}】", GetSrcData(tableAttribute), tableAttribute.sqliteTableName); List <XLS_Report_Table_Report> reports = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); watch.Stop(); UnityEngine.Debug.LogFormat("Select Table SQLite Data =>{0} , Time=>{1} , Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize()); if (reports.Count > 0) { watch.Reset(); watch.Start(); reports[0].Set_stringCol("Refresh Table"); watch.Stop(); UnityEngine.Debug.LogFormat("Modify Table SQLite Data =>{0} , Time=>{1}, Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize()); } watch.Reset(); watch.Start(); StrayFogConfigHelper.Reload <XLS_Report_Table_Report>(); reports = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); watch.Stop(); UnityEngine.Debug.LogFormat("Select Table SQLite Data =>{0} , Time=>{1}", reports.JsonSerialize(), watch.Elapsed, reports.JsonSerialize()); }
/// <summary> /// 更新行列式表 /// </summary> void UpdateDeterminantTable() { Stopwatch watch = new Stopwatch(); watch.Start(); SQLiteTableMapAttribute tableAttribute = StrayFogConfigHelper.GetTableAttribute <XLS_Report_Determinant_Table_ReportDeterminant>(); UnityEngine.Debug.LogFormat("Update【Determinant Table 】【{0}->{1}】", GetSrcData(tableAttribute), tableAttribute.sqliteTableName); List <XLS_Report_Determinant_Table_ReportDeterminant> reports = StrayFogConfigHelper.Select <XLS_Report_Determinant_Table_ReportDeterminant>(); watch.Stop(); UnityEngine.Debug.LogFormat("Select【Determinant Table 】SQLite Data =>{0} , Time=>{1} , Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize()); if (reports.Count > 0) { watch.Reset(); watch.Start(); reports[0].Set_ReportTip("Update Determinant Table"); reports[0].Set_DeterminantTip(Guid.NewGuid().ToString()); StrayFogConfigHelper.Update(reports[0]); watch.Stop(); UnityEngine.Debug.LogFormat("Update【Determinant Table】SQLite Data 【Same PK】=>{0} , Time=>{1}, Data=>【{2}】", reports.Count, watch.Elapsed, reports.JsonSerialize()); } watch.Reset(); watch.Start(); reports = StrayFogConfigHelper.Select <XLS_Report_Determinant_Table_ReportDeterminant>(); watch.Stop(); UnityEngine.Debug.LogFormat("Select【Determinant Table】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 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> /// 插入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> /// SelectTable /// </summary> void SelectTable() { SQLiteTableMapAttribute tableAttribute = StrayFogConfigHelper.GetTableAttribute <XLS_Report_Table_Report>(); UnityEngine.Debug.LogFormat("【Select Table 】【{0}->{1}】", GetSrcData(tableAttribute), tableAttribute.sqliteTableName); Stopwatch watch = new Stopwatch(); watch.Start(); List <XLS_Report_Table_Report> maps = StrayFogConfigHelper.Select <XLS_Report_Table_Report>(); watch.Stop(); UnityEngine.Debug.LogFormat("Select Table【{0}->{1}】Count->{2} Time->{3}", GetSrcData(tableAttribute), tableAttribute.sqliteTableName, maps.Count, watch.Elapsed); }