using KGIS.Framework.Common; using KGIS.Framework.DBOperator; using KGIS.Framework.Maps; using KGIS.Framework.Platform; using KGIS.Framework.Utils; using KGIS.Framework.Utils.ExtensionMethod; using KGIS.Framework.Utils.Helper; using Kingo.PluginServiceInterface; using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using System.Text; namespace Kingo.Plugin.BGResultManager.Utility { public class ZKReportBasicOperate { #region 公用表名 public string sTableName_DLTB = "DLTB"; public string sTableName_DLTB_Temp = "DLTB_Temp"; public string sTableName_ZKJCJSB_Temp1 = "ZKJCJSB_Temp1";//整库基础计算表临时用表1 public string sTableName_ZKJCJSB_Temp2 = "ZKJCJSB_Temp2";//整库基础计算表临时用表2 public string sTableName_ZKJCJSB = "ZKJCJSB";//整库基础计算表(平方米版(初版,DLTB的数据字段精简版)) public string sTableName_ZKJCJSB_Gq = "ZKJCJSB_Gq";//整库基础计算表(公顷版) public string sTableName_ZKJCJSB_Gq_PC1 = "ZKJCJSB_Gq_PC1";//整库基础计算表第二次平差(各村级记录间的平差)公顷版 public string sTableName_ZKJCJSB_Gq_PC2 = "ZKJCJSB_Gq_PC2";//整库基础计算表第三次平差(各自村级内各记录间的平差)公顷版 public string sTableName_ZKJCTJB_Gq = "ZKJCTJB_Gq";//整库基础统计表(公顷版) public string sTableName_County_ZKRecord_Judge = "County_ZKRecord_Judge";//某县的整库记录验证用表 public string sTableName_XZQ = "XZQ";//行政区表 public string sTableName_CJDCQ = "CJDCQ";//村级调查区表 #endregion #region 公用字段 public string sTheNeedAddFields_1 = "DLBM,ZLDWDM,QSDWDM,QSXZ,GDLX,GDPDJB,CZCSXM,TBXHDM,ZZSXDM,MSSM,FRDBS,TBMJ,KCDLBM,KCMJ"; public string sTheNeedAddFields_2 = "DLBM,ZLDWDM,QSDWDM,QSXZ,GDLX,GDPDJB,CZCSXM,TBXHDM,ZZSXDM,MSSM,FRDBS,GTDCZMJ,KCMJ"; public string sTheNeedAddFields_3 = "ZLDWDM,QSDWDM,QSXZ,GDLX,GDPDJB,CZCSXM,TBXHDM,ZZSXDM,MSSM,FRDBS,GTDCZMJ"; #endregion #region 公用SQL语句 public string sSQL_GroupBySelect_ZKTJB_1 = @" select DLBM, substr(ZLDWDM,1,12) as 'ZLDWDM',substr(QSDWDM,1,12) as 'QSDWDM',QSXZ, GDLX,GDPDJB,CZCSXM, TBXHDM,ZZSXDM,MSSM, FRDBS,Sum(TBMJ) as 'TBMJ',Sum(KCMJ) as 'KCMJ' from '{0}' group by DLBM, substr(ZLDWDM,1,12),substr(QSDWDM,1,12),QSXZ, GDLX,GDPDJB,CZCSXM, TBXHDM,ZZSXDM,MSSM, FRDBS "; public string sSQL_GroupBySelect_ZKTJB_2 = @" select DLBM, substr(ZLDWDM,1,12) as 'ZLDWDM',substr(QSDWDM,1,12) as 'QSDWDM',QSXZ, GDLX,GDPDJB,CZCSXM, TBXHDM,ZZSXDM,MSSM, FRDBS,Sum(GTDCZMJ) as 'GTDCZMJ',Sum(KCMJ) as 'KCMJ' from '{0}' group by DLBM, substr(ZLDWDM,1,12),substr(QSDWDM,1,12),QSXZ, GDLX,GDPDJB,CZCSXM, TBXHDM,ZZSXDM,MSSM, FRDBS "; public string sSQL_Create_ZKTJB_1 = @" Create TABLE '{0}' ( DLBM text(255), ZLDWDM text(255),QSDWDM text(255),QSXZ text(255), GDLX text(255),GDPDJB text(255),CZCSXM text(255), TBXHDM text(255),ZZSXDM text(255),MSSM text(255), FRDBS text(255),GTDCZMJ double(16,10),KCMJ double(16,10) ) "; public string sSQL_Insert_ZKTJB_1 = @" Insert into '{0}' ( DLBM, ZLDWDM,QSDWDM,QSXZ, GDLX,GDPDJB,CZCSXM, TBXHDM,ZZSXDM,MSSM, FRDBS,GTDCZMJ,KCMJ) values ( '{1}', '{2}','{3}','{4}', '{5}','{6}','{7}', '{8}','{9}','{10}', '{11}','{12}','{13}' ) "; /// /// 获取 县列表 /// public string sSQL_Get_County_DMList = @" select substr(XZQDM,1,6) as CountyDM from {0} group by substr(XZQDM,1,6) having length(XZQDM)>=6 "; /// /// 获取 某县的镇列表 /// public string sSQL_Get_Town_DMList_Temp = @" select substr(XZQDM,1,9) as TownDM from {0} group by substr(XZQDM,1,9) having XZQDM like '{1}%' and length(XZQDM)>=9 "; /// /// 获取 某镇的村列表 /// public string sSQL_Get_Country_DMList_Temp = @" select substr(ZLDWDM,1,12) as CountryDM from {0} group by substr(ZLDWDM,1,12) having ZLDWDM like '{1}%' and length(ZLDWDM)>=12 "; /// /// 获取 权属县列表 /// public string sSQL_Get_QSCounty_DMList = @" select substr(QSDWDM,1,6) as QSCountyDM from (select QSDWDM from {0} where FRDBS='1' ) group by substr(QSDWDM,1,6) having length(QSDWDM)>=6 "; /// /// 获取 权属某县的镇列表 /// public string sSQL_Get_QSTown_DMList_Temp = @" select substr(QSDWDM,1,9) as QSTownDM from (select QSDWDM from {0} where FRDBS='1' ) group by substr(QSDWDM,1,9) having QSDWDM like '{1}%' and length(QSDWDM)>=9 "; /// /// 获取 权属某镇的村列表 /// public string sSQL_Get_QSCountry_DMList_Temp = @" select substr(QSDWDM,1,12) as QSCountryDM from (select QSDWDM from {0} where FRDBS='1' ) group by substr(QSDWDM,1,12) having QSDWDM like '{1}%' and length(QSDWDM)>=12 "; public string sSQL_Create_County_ZKRecord_JudgeTable1 = @" Create TABLE '{0}' ( KeyMark1 text, KeyMark2 text, KeyMark3 text, KeyMark4 text, KeyMark5 text ) "; public string sSQL_Insert_County_ZKRecord_JudgeTable1 = @" Insert into '{0}' ( KeyMark1,KeyMark2, KeyMark3,KeyMark4,KeyMark5) values ( '{1}', '{2}','{3}', '{4}','{5}' ) "; #endregion #region 地类字典---基础计算表专用 public Dictionary dicDLTypeMsg = new Dictionary(); public Dictionary GetBaseDLTypeMsg() { try { dicDLTypeMsg = new Dictionary(); //湿地 dicDLTypeMsg.Add("00", "0303,0304,0306,0402,0603,1105,1106,1108"); //耕地 dicDLTypeMsg.Add("01", "0101,0102,0103"); //种植园用地 dicDLTypeMsg.Add("02", "0201,0201K,0202,0202K,0203,0203K,0204,0204K");// //林地 dicDLTypeMsg.Add("03", "0301,0301K,0302,0302K,0305,0307,0307K");// //草地 dicDLTypeMsg.Add("04", "0401,0403,0403K,0404");// //商业服务业用地 dicDLTypeMsg.Add("05", "05H1,0508"); //工矿用地 dicDLTypeMsg.Add("06", "0601,0602"); //住宅用地 dicDLTypeMsg.Add("07", "0701,0702"); //公共管理与公共服务用地 dicDLTypeMsg.Add("08", "08H1,08H2,08H2A,0809,0810,0810A");// //特殊用地 dicDLTypeMsg.Add("09", ""); //交通运输用地 dicDLTypeMsg.Add("10", "1001,1002,1003,1004,1005,1006,1007,1008,1009"); //水域及水利设施用地 dicDLTypeMsg.Add("11", "1101,1102,1103,1104,1104A,1104K,1107,1107A,1109,1110");// //其他土地 dicDLTypeMsg.Add("12", "1201,1202,1203,1204,1205,1206,1207"); return dicDLTypeMsg; } catch (Exception ex) { LogAPI.Debug("获取基础地类配置信息 时失败!异常原因: " + ex + " ; "); dicDLTypeMsg = new Dictionary(); return dicDLTypeMsg; } } #endregion #region 公用函数 public bool DeleteDir(string strDirPath) { try { strDirPath = strDirPath.Trim(); if (Directory.Exists(strDirPath)) { string[] strDirs = Directory.GetDirectories(strDirPath); string[] strFiles = Directory.GetFiles(strDirPath); int iCountDirs = strDirs.Count(); int iFileDirs = strFiles.Count(); foreach (string strFile in strFiles) { File.Delete(strFile); } foreach (string strdir in strDirs) { Directory.Delete(strdir, true); } //LogAPI.Debug("清空整库统计信息文件夹(" + strDirPath + ") 。文件夹数量=" + iCountDirs + " ; 文件数量=" + iFileDirs + " ; "); } return true; } catch (Exception ex) { LogAPI.Debug("清空整库统计信息文件夹(" + strDirPath + ") 时失败,异常原因: " + ex + " ; "); return false; } } public bool DeleteFile(string strFilePath) { try { strFilePath = strFilePath.Trim(); if (File.Exists(strFilePath) == true) { File.Delete(strFilePath); LogAPI.Debug("删除文件(" + strFilePath + ") 完成 "); } return true; } catch (Exception ex) { LogAPI.Debug("删除文件(" + strFilePath + ") 时失败,异常原因: " + ex + " ; "); return false; } } /// /// 验证SQLite中是否存在某表 /// /// /// 要验证的表名 /// public bool Judge_SQLiteTable_IsExist(IRDBHelper rdbHelper, string sTableName) { try { //PS: if (rdbHelper.TableIsExist(dtName) == true) 判断方法无效。 DataTable dtJudge_Result = rdbHelper.ExecuteDatatable( "Judge_" + sTableName + "_IsExist", "SELECT COUNT(*) FROM sqlite_master where type='table' and name='" + sTableName + "';", true); if (dtJudge_Result == null || dtJudge_Result.Rows.Count <= 0) { return false; } else { int iResultTemp1 = Convert.ToInt32(dtJudge_Result.Rows[0]["COUNT(*)"].ToString()); if (iResultTemp1 <= 0) { return false; } else { return true; } } } catch (Exception ex) { LogAPI.Debug("在 验证 " + sTableName + " 表是否存在时 失败,异常原因: " + ex + " ; "); return false; } } /// /// 插入记录 /// /// /// 要插入的数据 /// 要插入数据的表名 /// 要插入数据的表的中文描述说明 public void InsertData_ZKTJB_1(IRDBHelper rdbHelper, DataTable dt, string dtName, string sDescript, bool bIsRecordTheJudgeLog1) { string sSQL_Create_ZKTJB = sSQL_Create_ZKTJB_1; string sSQL_Insert_ZKTJB = sSQL_Insert_ZKTJB_1; try { if (dt == null || dt.Rows.Count <= 0) { return; } if (string.IsNullOrWhiteSpace(sSQL_Create_ZKTJB) == true) { return; } if (string.IsNullOrWhiteSpace(sSQL_Insert_ZKTJB) == true) { return; } if (string.IsNullOrWhiteSpace(dtName) == true) { return; } if (string.IsNullOrWhiteSpace(sDescript) == true) { return; } if (Judge_SQLiteTable_IsExist(rdbHelper, dtName) == true) { rdbHelper.ExecuteSQL(@" Drop Table " + dtName + " "); } string sSQL_Create_ZKTJB_Temp = string.Format(sSQL_Create_ZKTJB, dtName); rdbHelper.ExecuteSQL(sSQL_Create_ZKTJB_Temp); DateTime dTimeStart5; TimeSpan tSpan5; dTimeStart5 = DateTime.Now; for (int m = 0; m < dt.Rows.Count; m++)//后期这里优化一下变成分批插入 { rdbHelper.ExecuteSQL( string.Format( sSQL_Insert_ZKTJB, dtName, dt.Rows[m]["DLBM"], dt.Rows[m]["ZLDWDM"], dt.Rows[m]["QSDWDM"], dt.Rows[m]["QSXZ"], dt.Rows[m]["GDLX"], dt.Rows[m]["GDPDJB"], dt.Rows[m]["CZCSXM"], dt.Rows[m]["TBXHDM"], dt.Rows[m]["ZZSXDM"], dt.Rows[m]["MSSM"], dt.Rows[m]["FRDBS"], dt.Rows[m]["GTDCZMJ"], dt.Rows[m]["KCMJ"] ) ); } tSpan5 = DateTime.Now - dTimeStart5; if (bIsRecordTheJudgeLog1 == true) { LogAPI.Debug("赋值 " + sDescript + " 报表数据 耗时: " + tSpan5 + " ; \r"); } } catch (Exception ex) { LogAPI.Debug(sDescript + " 数据插入失败,异常原因: " + ex + " ; "); return; } } /// /// 插入数据 /// /// /// 要插入的数据 /// 要插入数据的表名 /// 要插入数据的表的中文描述说明 /// 要插入数据的SQL /// 要插入数据的字段 public void InsertData_ZKTJB_2( IRDBHelper rdbHelper, DataTable dt, string dtName, string sDescript, string sTheSQL_Create_ZKTJB_2, string sAddFields, bool bIsRecordTheJudgeLog2) { string sSQL_Create_ZKTJB = sTheSQL_Create_ZKTJB_2; string sSQL_InsertAddFields_ZKTJB = sAddFields; try { if (dt == null || dt.Rows.Count <= 0) { return; } if (string.IsNullOrWhiteSpace(sSQL_Create_ZKTJB) == true) { return; } if (string.IsNullOrWhiteSpace(sSQL_InsertAddFields_ZKTJB) == true) { return; } if (string.IsNullOrWhiteSpace(dtName) == true) { return; } if (string.IsNullOrWhiteSpace(sDescript) == true) { return; } if (Judge_SQLiteTable_IsExist(rdbHelper, dtName) == true) { rdbHelper.ExecuteSQL(@" Drop Table " + dtName + " "); } string sSQL_Create_ZKTJB_Temp = string.Format(sSQL_Create_ZKTJB, dtName); rdbHelper.ExecuteSQL(sSQL_Create_ZKTJB_Temp); DateTime dTimeStart5; TimeSpan tSpan5; dTimeStart5 = DateTime.Now; string sSQL_Insert_ZKTJB_Temp1 = @" Insert into '{0}' ({1}) values ( "; string sSQL_Insert_ZKTJB_Real = string.Format(sSQL_Insert_ZKTJB_Temp1, dtName, sSQL_InsertAddFields_ZKTJB); if (string.IsNullOrWhiteSpace(sSQL_Insert_ZKTJB_Real) == true) { LogAPI.Debug("整库基础计算表的插入语句为空,故信息记录失败"); return; } string[] sSQL_InsertAddFields_ZKTJBArray = sSQL_InsertAddFields_ZKTJB.Split(','); List sSQL_InsertAddFields_ZKTJBList = new List(sSQL_InsertAddFields_ZKTJBArray); if (sSQL_InsertAddFields_ZKTJBList == null || sSQL_InsertAddFields_ZKTJBList.Count() <= 0) { LogAPI.Debug("整库基础计算表的插入字段信息为空,故信息记录失败"); return; } int iAddResultTemp2 = 0; int iAddCountTemp2 = 0; string sSQL_Insert_ZKTJB_RealLast = ""; for (int m = 0; m < dt.Rows.Count; m++)//后期这里优化一下变成分批插入 { sSQL_Insert_ZKTJB_RealLast = sSQL_Insert_ZKTJB_Real; for (int j = 0; j < sSQL_InsertAddFields_ZKTJBList.Count(); j++)//为了字段信息百分百对应,故建立一个序列 { sSQL_Insert_ZKTJB_RealLast += "'" + ExtendMethd.GetStringByObject(dt.Rows[m][sSQL_InsertAddFields_ZKTJBList[j]] as object).Trim() + "'"; if (j == sSQL_InsertAddFields_ZKTJBList.Count() - 1) { sSQL_Insert_ZKTJB_RealLast += ") "; } else { sSQL_Insert_ZKTJB_RealLast += ", "; } } iAddResultTemp2 = rdbHelper.ExecuteSQL(sSQL_Insert_ZKTJB_RealLast); if (iAddResultTemp2 <= 0) { iAddCountTemp2 += 1; } } if (iAddCountTemp2 > 0) { LogAPI.Debug("赋值 " + sDescript + " 报表数据 失败数量: " + iAddCountTemp2 + " 条; \r"); } tSpan5 = DateTime.Now - dTimeStart5; if (bIsRecordTheJudgeLog2 == true) { LogAPI.Debug("赋值 " + sDescript + " 报表数据 耗时: " + tSpan5 + " ; \r"); } } catch (Exception ex) { LogAPI.Debug(sDescript + " 数据插入失败,异常原因: " + ex + " ; "); return; } } /// /// 插入数据 /// /// /// 要插入的数据 /// 要插入数据的表名 /// 要插入数据的表的中文描述说明 /// 要插入数据的字段 public void InsertData_ZKTJB_3( IRDBHelper rdbHelper, DataTable dt, string dtName, string sDescript, string sAddFields, bool bIsRecordTheJudgeLog3) { string sSQL_InsertAddFields_ZKTJB = sAddFields; try { if (dt == null || dt.Rows.Count <= 0) { return; } if (string.IsNullOrWhiteSpace(sSQL_InsertAddFields_ZKTJB) == true) { return; } if (string.IsNullOrWhiteSpace(dtName) == true) { return; } if (string.IsNullOrWhiteSpace(sDescript) == true) { return; } DateTime dTimeStart5; TimeSpan tSpan5; dTimeStart5 = DateTime.Now; string sSQL_Insert_ZKTJB_Temp1 = @" Insert into '{0}' ({1}) values ( "; string sSQL_Insert_ZKTJB_Real = string.Format(sSQL_Insert_ZKTJB_Temp1, dtName, sSQL_InsertAddFields_ZKTJB); if (string.IsNullOrWhiteSpace(sSQL_Insert_ZKTJB_Real) == true) { LogAPI.Debug("整库基础计算表的插入语句为空,故信息记录失败"); return; } string[] sSQL_InsertAddFields_ZKTJBArray = sSQL_InsertAddFields_ZKTJB.Split(','); List sSQL_InsertAddFields_ZKTJBList = new List(sSQL_InsertAddFields_ZKTJBArray); if (sSQL_InsertAddFields_ZKTJBList == null || sSQL_InsertAddFields_ZKTJBList.Count() <= 0) { LogAPI.Debug("整库基础计算表的插入字段信息为空,故信息记录失败"); return; } int iAddResultTemp2 = 0; int iAddCountTemp2 = 0; string sSQL_Insert_ZKTJB_RealLast = ""; for (int m = 0; m < dt.Rows.Count; m++)//后期这里优化一下变成分批插入 { sSQL_Insert_ZKTJB_RealLast = sSQL_Insert_ZKTJB_Real; for (int j = 0; j < sSQL_InsertAddFields_ZKTJBList.Count(); j++)//为了字段信息百分百对应,故建立一个序列 { sSQL_Insert_ZKTJB_RealLast += "'" + ExtendMethd.GetStringByObject(dt.Rows[m][sSQL_InsertAddFields_ZKTJBList[j]] as object).Trim() + "'"; if (j == sSQL_InsertAddFields_ZKTJBList.Count() - 1) { sSQL_Insert_ZKTJB_RealLast += ") "; } else { sSQL_Insert_ZKTJB_RealLast += ", "; } } iAddResultTemp2 = rdbHelper.ExecuteSQL(sSQL_Insert_ZKTJB_RealLast); if (iAddResultTemp2 <= 0) { iAddCountTemp2 += 1; } } if (iAddCountTemp2 > 0) { LogAPI.Debug("赋值 " + sDescript + " 报表数据 失败数量: " + iAddCountTemp2 + " 条; \r"); LogAPI.Debug("-------------------------------------------------------------------------\r"); LogAPI.Debug("-------------------------------------------------------------------------\r"); LogAPI.Debug("-------------------------------------------------------------------------\r"); } tSpan5 = DateTime.Now - dTimeStart5; if (bIsRecordTheJudgeLog3 == true) { LogAPI.Debug("赋值 " + sDescript + " 报表数据 耗时: " + tSpan5 + " ; \r"); } } catch (Exception ex) { LogAPI.Debug(sDescript + " 数据插入失败,异常原因: " + ex + " ; "); return; } } /// /// 获取记录 /// /// /// 要插入数据的表名 /// 要插入数据的表的中文描述说明 /// 要获取数据的SQL /// public DataTable GetData_ZKTJB(IRDBHelper rdbHelper, string dtName, string sDescript, string sSelectSQL) { string sSQL_GroupBySelect_ZKTJB = sSelectSQL; string sSQL_GroupBySelect_ZKTJB_Now = ""; DataTable dtBFXHDLMJBHTJB_Now = new DataTable(); try { if (string.IsNullOrWhiteSpace(dtName) == true) { return null; } if (string.IsNullOrWhiteSpace(sDescript) == true) { return null; } if (string.IsNullOrWhiteSpace(sSQL_GroupBySelect_ZKTJB) == true) { return null; } if (Judge_SQLiteTable_IsExist(rdbHelper, dtName) == false) { MessageHelper.Show("数据库中未能找到 " + sDescript + " 信息表"); LogAPI.Debug("数据库中未能找到 " + sDescript + " 信息表"); return null; } sSQL_GroupBySelect_ZKTJB_Now = string.Format(sSQL_GroupBySelect_ZKTJB, dtName); dtBFXHDLMJBHTJB_Now = rdbHelper.ExecuteDatatable("Get_" + dtName + "_Now", sSQL_GroupBySelect_ZKTJB_Now, true); if (dtBFXHDLMJBHTJB_Now == null || dtBFXHDLMJBHTJB_Now.Rows.Count <= 0) { LogAPI.Debug(sDescript + " 信息数据查询为空; "); return null; } else { return dtBFXHDLMJBHTJB_Now; } } catch (Exception ex) { LogAPI.Debug(sDescript + " 数据获取失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取工程项目的行政区地址 /// /// public string GetTheProjectXZQDM() { try { ProjectInfo ProInfo = (MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo); if (ProInfo == null) { MessageHelper.Show("请先打开要统计的工程"); return ""; } if (ProInfo.CODE == null) { MessageHelper.Show("工程信息中区划代码未配置,故获取行政区编码失败!"); return ""; } return ProInfo.CODE; } catch (Exception ex) { LogAPI.Debug("在获取 项目所属行政区编码 时失败!异常原因: " + ex + " ; "); return ""; } } /// /// 获取Excel展示地址 /// /// /// public string GetShowExcelPath(EnumReportType rtEnum) { //方便统一维护 try { string sPath = ""; string sProjectXZQDM_1 = GetTheProjectXZQDM(); if (string.IsNullOrWhiteSpace(sProjectXZQDM_1) == true) { LogAPI.Debug("项目工程所属行政区代码为空,故获取所在展示文件地址失败"); return ""; } string sShowExcelDirectoryPath = AppDomain.CurrentDomain.BaseDirectory + "TempalateReports\\整库统计表\\展示导出\\"; //变更报表展示地址增加工程名字文件夹区分-2020-6-12 string sPrjUniqueID_Now_1 = GetProjectUniqueID(); if (string.IsNullOrWhiteSpace(sPrjUniqueID_Now_1) == true) { MessageHelper.Show("项目工程信息 获取失败"); LogAPI.Debug("项目工程信息 获取失败,故获取所在展示文件地址失败"); return ""; } sShowExcelDirectoryPath += sPrjUniqueID_Now_1 + "ZK"; if (Directory.Exists(sShowExcelDirectoryPath) == false) { MessageHelper.Show("项目工程信息 获取失败"); LogAPI.Debug("项目工程信息 获取失败,故获取所在展示文件地址失败"); return ""; } sShowExcelDirectoryPath += "\\(" + sProjectXZQDM_1 + ") "; #region 获取地址 switch (rtEnum) { #region 整库报表枚举 case EnumReportType.TDLYXZEJFLMJHZB://土地利用现状分类面积汇总表 sPath = sShowExcelDirectoryPath + "土地利用现状分类面积汇总表.xlsx"; break; case EnumReportType.TDLYXZYJFLMJHZB://土地利用现状一级分类面积汇总表 sPath = sShowExcelDirectoryPath + "土地利用现状一级分类面积汇总表.xlsx"; break; case EnumReportType.TDLYXZYJFLMJAQSXZHZB://土地利用现状一级分类面积按权属性质汇总表 sPath = sShowExcelDirectoryPath + "土地利用现状一级分类面积按权属性质汇总表.xlsx"; break; case EnumReportType.HDTDLYXZYJFLMJHZB://海岛土地利用现状一级分类面积汇总表 sPath = sShowExcelDirectoryPath + "海岛土地利用现状一级分类面积汇总表.xlsx"; break; case EnumReportType.FRDTDLYXZYJFLMJHZB://飞入地土地利用现状一级分类面积汇总表 sPath = sShowExcelDirectoryPath + "飞入地土地利用现状一级分类面积汇总表.xlsx"; break; case EnumReportType.FRDTDLYXZYJFLMJAQSXZHZB://飞入地土地利用现状一级分类面积按权属性质汇总表 sPath = sShowExcelDirectoryPath + "飞入地土地利用现状一级分类面积按权属性质汇总表.xlsx"; break; case EnumReportType.GCCDXSCDHZQKTJB://灌丛草地汇总情况统计表 sPath = sShowExcelDirectoryPath + "灌丛草地汇总情况统计表.xlsx"; break; case EnumReportType.CZCJGKYDMJHZB://城镇村及工矿用地面积汇总表 sPath = sShowExcelDirectoryPath + "城镇村及工矿用地面积汇总表.xlsx"; break; case EnumReportType.GDPDFJMJHZB://耕地坡度分级面积汇总表 sPath = sShowExcelDirectoryPath + "耕地坡度分级面积汇总表.xlsx"; break; case EnumReportType.GDXHDCQKTJB://耕地细化调查情况统计表 sPath = sShowExcelDirectoryPath + "耕地细化调查情况统计表.xlsx"; break; case EnumReportType.GDZZLXMJTJB://耕地种植类型面积统计表 sPath = sShowExcelDirectoryPath + "耕地种植类型面积统计表.xlsx"; break; case EnumReportType.FQXHBZTJB://废弃与垃圾填埋细化标注汇总统计表 sPath = sShowExcelDirectoryPath + "废弃与垃圾填埋细化标注汇总统计表.xlsx"; break; case EnumReportType.GYYDALXHZTJB://工业用地按类型汇总统计表 sPath = sShowExcelDirectoryPath + "工业用地按类型汇总统计表.xlsx"; break; case EnumReportType.JKHFGCHFZZTJB://即可恢复与工程恢复种植属性汇总统计表 sPath = sShowExcelDirectoryPath + "即可恢复与工程恢复种植属性汇总统计表.xlsx"; break; case EnumReportType.KTZDLMJHZB://可调整地类面积汇总表 sPath = sShowExcelDirectoryPath + "可调整地类面积汇总表.xlsx"; break; case EnumReportType.LXFWNYDHZTJB://林区范围内种植园用地汇总统计表 sPath = sShowExcelDirectoryPath + "林区范围内种植园用地汇总统计表.xlsx"; break; case EnumReportType.BFXHDLMJHZB://部分细化地类面积汇总表 sPath = sShowExcelDirectoryPath + "部分细化地类面积汇总表.xlsx"; break; case EnumReportType.HDTDLYXZEJFLMJHZB://海岛土地利用现状分类面积汇总表 sPath = sShowExcelDirectoryPath + "海岛土地利用现状分类面积汇总表.xlsx"; break; case EnumReportType.FRDCZCJGKYDMJHZB://飞入地城镇村及工矿用地面积汇总表 sPath = sShowExcelDirectoryPath + "飞入地城镇村及工矿用地面积汇总表.xlsx"; break; case EnumReportType.FRDTDLYXZEJFLMJHZB://飞入地土地利用现状分类面积汇总表 sPath = sShowExcelDirectoryPath + "飞入地土地利用现状分类面积汇总表.xlsx"; break; default: sPath = ""; break; #endregion } #endregion return sPath; } catch (Exception ex) { LogAPI.Debug("依据报表类型获取文档最终所在Excel地址 失败!异常原因: " + ex + " ; "); return ""; } } /// /// 获取当前工程唯一标识码 /// /// public string GetProjectUniqueID() { string sThePrjUniqueID_Now = ""; string strRecentOpenProjectRecordXmlPath = ""; string sPrjPath_Now = ""; try { SysConfigsOprator configOp = new SysConfigsOprator(); //获取当前工程唯一码 strRecentOpenProjectRecordXmlPath = KGIS.Framework.Utils.SysAppPath.GetRecentOpenProjectRecordConfigPath(); if (File.Exists(strRecentOpenProjectRecordXmlPath) == false) { //MessageHelper.Show("工程信息记录信息获取失败!"); return ""; } if (MapsManager.Instance.MapService == null) { MessageHelper.Show("工程信息获取失败"); return ""; } if (MapsManager.Instance.MapService.GetProjectInfo() == null) { MessageHelper.Show("工程信息获取失败"); return ""; } ProjectInfo iProInfo = MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo; if (iProInfo == null) { MessageHelper.Show("工程信息获取失败"); return ""; } if (iProInfo.ProjDir == null) { MessageHelper.Show("工程信息 获取失败"); return ""; } if (iProInfo.ProjName == null) { MessageHelper.Show("工程信息 获取失败"); return ""; } sPrjPath_Now = iProInfo.ProjDir + "\\" + iProInfo.ProjName + ".KBG"; if (string.IsNullOrWhiteSpace(sPrjPath_Now) == true) { MessageHelper.Show("项目工程信息 获取失败!"); return ""; } sThePrjUniqueID_Now = configOp.GetProjectUniqueIDInRecentOpenProjectRecordXmlMsg(strRecentOpenProjectRecordXmlPath, sPrjPath_Now); return sThePrjUniqueID_Now; } catch (Exception ex) { LogAPI.Debug("获取当前项目唯一码时 失败,异常原因: " + ex + " ; "); return ""; } } /// /// 依据整库报表类型获取所对应的原样表的名称 /// /// /// public string GetExcelModelNameByZKReportType(EnumReportType rtEnum) { try { string sExcelModelName = ""; switch (rtEnum) { #region 整库报表枚举 case EnumReportType.TDLYXZEJFLMJHZB://土地利用现状分类面积汇总表 sExcelModelName = "土地利用现状分类面积汇总表.xlsx"; break; case EnumReportType.TDLYXZYJFLMJHZB://土地利用现状一级分类面积汇总表 sExcelModelName = "土地利用现状一级分类面积汇总表.xlsx"; break; case EnumReportType.TDLYXZYJFLMJAQSXZHZB://土地利用现状一级分类面积按权属性质汇总表 sExcelModelName = "土地利用现状一级分类面积按权属性质汇总表.xlsx"; break; case EnumReportType.HDTDLYXZYJFLMJHZB://海岛土地利用现状一级分类面积汇总表 sExcelModelName = "海岛土地利用现状一级分类面积汇总表.xlsx"; break; case EnumReportType.FRDTDLYXZYJFLMJHZB://飞入地土地利用现状一级分类面积汇总表 sExcelModelName = "飞入地土地利用现状一级分类面积汇总表.xlsx"; break; case EnumReportType.FRDTDLYXZYJFLMJAQSXZHZB://飞入地土地利用现状一级分类面积按权属性质汇总表 sExcelModelName = "飞入地土地利用现状一级分类面积按权属性质汇总表.xlsx"; break; case EnumReportType.GCCDXSCDHZQKTJB://灌丛草地汇总情况统计表 sExcelModelName = "灌丛草地汇总情况统计表.xlsx"; break; case EnumReportType.CZCJGKYDMJHZB://城镇村及工矿用地面积汇总表 sExcelModelName = "城镇村及工矿用地面积汇总表.xlsx"; break; case EnumReportType.GDPDFJMJHZB://耕地坡度分级面积汇总表 sExcelModelName = "耕地坡度分级面积汇总表.xlsx"; break; case EnumReportType.GDXHDCQKTJB://耕地细化调查情况统计表 sExcelModelName = "耕地细化调查情况统计表.xlsx"; break; case EnumReportType.GDZZLXMJTJB://耕地种植类型面积统计表 sExcelModelName = "耕地种植类型面积统计表.xlsx"; break; case EnumReportType.FQXHBZTJB://废弃与垃圾填埋细化标注汇总统计表 sExcelModelName = "废弃与垃圾填埋细化标注汇总统计表.xlsx"; break; case EnumReportType.GYYDALXHZTJB://工业用地按类型汇总统计表 sExcelModelName = "工业用地按类型汇总统计表.xlsx"; break; case EnumReportType.JKHFGCHFZZTJB://即可恢复与工程恢复种植属性汇总统计表 sExcelModelName = "即可恢复与工程恢复种植属性汇总统计表.xlsx"; break; case EnumReportType.KTZDLMJHZB://可调整地类面积汇总表 sExcelModelName = "可调整地类面积汇总表.xlsx"; break; case EnumReportType.LXFWNYDHZTJB://林区范围内种植园用地汇总统计表 sExcelModelName = "林区范围内种植园用地汇总统计表.xlsx"; break; case EnumReportType.BFXHDLMJHZB://部分细化地类面积汇总表 sExcelModelName = "部分细化地类面积汇总表.xlsx"; break; case EnumReportType.HDTDLYXZEJFLMJHZB://海岛土地利用现状分类面积汇总表 sExcelModelName = "海岛土地利用现状分类面积汇总表.xlsx"; break; case EnumReportType.FRDCZCJGKYDMJHZB://飞入地城镇村及工矿用地面积汇总表 sExcelModelName = "飞入地城镇村及工矿用地面积汇总表.xlsx"; break; case EnumReportType.FRDTDLYXZEJFLMJHZB://飞入地土地利用现状分类面积汇总表 sExcelModelName = "飞入地土地利用现状分类面积汇总表.xlsx"; break; default: break; #endregion } return sExcelModelName; } catch (Exception ex) { LogAPI.Debug("依据 整库报表类型 获取 原文档所在Excel地址 失败!异常原因: " + ex + " ; "); return ""; } } /// /// 获取整库基础统计表(公顷) /// /// public DataTable GetZKJCTJB_Gq_Msg() { IRDBHelper rdbHelper = null; try { ProjectInfo ProInfo = (MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo); if (ProInfo == null) { MessageHelper.Show("请先打开要统计的工程"); return null; } string sProjDBPath = ProInfo.GetProjFilePath(); if (string.IsNullOrWhiteSpace(sProjDBPath) == true) { MessageHelper.Show("工程信息地址获取失败,无法输出报表!"); LogAPI.Debug("工程信息地址获取失败,无法输出报表!"); return null; } string dbPath = System.IO.Path.GetDirectoryName(sProjDBPath) + "\\ZKTJ.sqlite"; if (File.Exists(dbPath) == false) { MessageHelper.Show("整库信息未能记录成功,故信息生成失败"); LogAPI.Debug("整库信息未能记录成功,故信息生成失败"); return null; } rdbHelper = RDBFactory.CreateDbHelper("Data Source=" + dbPath, DatabaseType.SQLite); string sTheTableName_ZKJCTJB_Gq = ""; sTheTableName_ZKJCTJB_Gq = sTableName_ZKJCTJB_Gq; if (string.IsNullOrWhiteSpace(sTheTableName_ZKJCTJB_Gq) == true) { return null; } if (Judge_SQLiteTable_IsExist(rdbHelper, sTheTableName_ZKJCTJB_Gq) == false)//以防万一 { //CreateZKJCTJBOperate iCreateZKJCTJBOperate1 = new CreateZKJCTJBOperate(); //iCreateZKJCTJBOperate1.GetZKJCTJB(); MessageHelper.Show("整库基础统计表(公顷级) 信息获取 失败,请重新生成报表数据 "); LogAPI.Debug("整库基础统计表(公顷级) 信息获取 失败,请重新生成报表数据 "); return null; } if (Judge_SQLiteTable_IsExist(rdbHelper, sTheTableName_ZKJCTJB_Gq) == false) { return null; } DataTable dtGet_ZKJCTJB_Gq = rdbHelper.ExecuteDatatable("Get_" + sTheTableName_ZKJCTJB_Gq + "_Temp", " select * from " + sTheTableName_ZKJCTJB_Gq + " ", true); if (dtGet_ZKJCTJB_Gq == null || dtGet_ZKJCTJB_Gq.Rows.Count <= 0) { MessageHelper.Show("整库基础统计表(公顷级) 信息获取 失败 "); LogAPI.Debug("整库基础统计表(公顷级) 信息获取 失败 ; "); return null; } else { return dtGet_ZKJCTJB_Gq; } } catch (Exception ex) { LogAPI.Debug("获取 整库基础统计表(公顷级) 信息时失败,异常原因: " + ex + " ; "); return null; } finally { if (rdbHelper != null) { rdbHelper = null; } } } /// /// 处理整库基础统计表(公顷) /// public void DealWithZKJCTJB_Gq_Msg() { string sTheTableName_ZKJCTJB_Gq = ""; string sProjDBPath = ""; string dbPath = ""; string dbModelPath = ""; IRDBHelper rdbHelper = null; try { sTheTableName_ZKJCTJB_Gq = sTableName_ZKJCTJB_Gq; if (string.IsNullOrWhiteSpace(sTheTableName_ZKJCTJB_Gq) == true) { MessageHelper.Show("整库基础信息统计表 配置表名 获取失败,故信息生成失败"); LogAPI.Debug("整库基础信息统计表 配置表名 获取失败,故信息生成失败"); return; } ProjectInfo ProInfo = (MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo); if (ProInfo == null) { MessageHelper.Show("请先打开要统计的工程"); return; } sProjDBPath = ProInfo.GetProjFilePath(); if (string.IsNullOrWhiteSpace(sProjDBPath) == true) { MessageHelper.Show("工程信息地址获取失败,无法输出报表!"); LogAPI.Debug("工程信息地址获取失败,无法输出报表!"); return; } dbPath = System.IO.Path.GetDirectoryName(sProjDBPath) + "\\ZKTJ.sqlite"; //行政区信息 if (ProInfo.CODE == null) { MessageHelper.Show("工程信息中区划代码未配置,无法输出报表!"); LogAPI.Debug("工程信息中区划代码未配置,无法输出报表!"); return; } string sTheProj_XZQDX = ProInfo.CODE; if (File.Exists(dbPath) == true)//原先已存在 { #region 原先已存在 rdbHelper = RDBFactory.CreateDbHelper("Data Source=" + dbPath, DatabaseType.SQLite); string sTableName_County_ZKRecord_Judge_2 = sTableName_County_ZKRecord_Judge; if (string.IsNullOrWhiteSpace(sTableName_County_ZKRecord_Judge_2) == true) { MessageHelper.Show("验证表配置表名 获取失败,无法输出报表!"); LogAPI.Debug("验证表配置表名 获取失败,无法输出报表!"); return; } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_County_ZKRecord_Judge_2) == false)//不存在验证表 {//老版,重新处理 CreateZKJCTJBOperate iCreateZKJCTJBOperate_1 = new CreateZKJCTJBOperate(); iCreateZKJCTJBOperate_1.GetZKJCTJB(true); return; } else {//存在验证表 if (Judge_SQLiteTable_IsExist(rdbHelper, sTheTableName_ZKJCTJB_Gq) == false) {//不存在整库统计表(公顷版) CreateZKJCTJBOperate iCreateZKJCTJBOperate_3 = new CreateZKJCTJBOperate(); iCreateZKJCTJBOperate_3.GetZKJCTJB(true); return; } else {//存在整库统计表(公顷版) // 判断是不是本县的数据 #region 判断是不是本县的数据 //MessageHelper.Show("判断是不是本县的数据"); if (JudgeSQLLiteDataIsCurrentCountyZKData(rdbHelper, sTheProj_XZQDX) == true) {//是本县的整库数据,返回 return; } else {//不是本县的整库数据,重新处理 CreateZKJCTJBOperate iCreateZKJCTJBOperate1 = new CreateZKJCTJBOperate(); iCreateZKJCTJBOperate1.GetZKJCTJB(true); return; } #endregion } } #endregion } else//不存在DB,创建新的 { //KGIS.Framework.Platform.Helper.ProgressHelper.ShowProcessBar("生成整库基础统计表... ..."); #region 不存在DB,创建新的 dbModelPath = SysAppPath.GetCurrentAppPath() + "工作空间\\模板\\新建变更工程\\BGTJ.sqlite"; if (File.Exists(dbModelPath) == false) { MessageHelper.Show("SQLite模板获取失败,故报表信息生成失败"); LogAPI.Debug("SQLite模板获取失败,故报表信息生成失败"); return; } File.Copy(dbModelPath, dbPath, true); if (File.Exists(dbPath) == false) { MessageHelper.Show("整库信息未能记录成功,故信息生成失败"); LogAPI.Debug("整库信息未能记录成功,故信息生成失败"); return; } rdbHelper = RDBFactory.CreateDbHelper("Data Source=" + dbPath, DatabaseType.SQLite); CreateZKJCTJBOperate iCreateZKJCTJBOperate_2 = new CreateZKJCTJBOperate(); iCreateZKJCTJBOperate_2.GetZKJCTJB(true); //KGIS.Framework.Platform.Helper.ProgressHelper.CloseProcessBar(); return; #endregion } } catch (Exception ex) { LogAPI.Debug("处理 整库基础统计表(公顷级) 信息时失败,异常原因: " + ex + " ; "); return; } finally { if (rdbHelper != null) { rdbHelper = null; } } } /// /// 重新生成整库基础统计表(公顷) /// public void RebuildZKJCTJB_Gq_Msg() { string sTheTableName_ZKJCTJB_Gq = ""; string sProjDBPath_1 = ""; string dbPath_1 = ""; string dbModelPath_1 = ""; try { sTheTableName_ZKJCTJB_Gq = sTableName_ZKJCTJB_Gq; if (string.IsNullOrWhiteSpace(sTheTableName_ZKJCTJB_Gq) == true) { MessageHelper.Show("整库基础信息统计表 配置表名 获取失败,故信息重新生成失败"); LogAPI.Debug("整库基础信息统计表 配置表名 获取失败,故信息重新生成失败"); return; } ProjectInfo ProInfo_1 = (MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo); if (ProInfo_1 == null) { MessageHelper.Show("请先打开要统计的工程"); return; } sProjDBPath_1 = ProInfo_1.GetProjFilePath(); if (string.IsNullOrWhiteSpace(sProjDBPath_1) == true) { MessageHelper.Show("工程信息地址获取失败,无法重新生成报表!"); LogAPI.Debug("工程信息地址获取失败,无法重新生成报表!"); return; } dbPath_1 = System.IO.Path.GetDirectoryName(sProjDBPath_1) + "\\ZKTJ.sqlite"; //行政区信息 if (ProInfo_1.CODE == null) { MessageHelper.Show("工程信息中区划代码未配置,无法重新生成报表!"); LogAPI.Debug("工程信息中区划代码未配置,无法重新生成报表!"); return; } //if (File.Exists(dbPath_1) == true)//原先已存在 //{ // bool bDelDB = DeleteFile(dbPath_1); //} dbModelPath_1 = SysAppPath.GetCurrentAppPath() + "工作空间\\模板\\新建变更工程\\BGTJ.sqlite"; if (File.Exists(dbModelPath_1) == false) { MessageHelper.Show("SQLite模板获取失败,故报表信息重新生成失败"); LogAPI.Debug("SQLite模板获取失败,故报表信息重新生成失败"); return; } #region 创建新的 File.Copy(dbModelPath_1, dbPath_1, true); if (File.Exists(dbPath_1) == false) { MessageHelper.Show("整库信息未能记录成功,故信息重新生成失败"); LogAPI.Debug("整库信息未能记录成功,故信息重新生成失败"); return; } CreateZKJCTJBOperate iCreateZKJCTJBOperate_21 = new CreateZKJCTJBOperate(); iCreateZKJCTJBOperate_21.GetZKJCTJB(true); //KGIS.Framework.Platform.Helper.ProgressHelper.CloseProcessBar(); return; #endregion } catch (Exception ex) { LogAPI.Debug("重新生成 整库基础统计表(公顷级) 信息时失败,异常原因: " + ex + " ; "); return; } } /// /// 验证SQLLite中数据是否是本县的整库数据 /// /// /// /// public bool JudgeSQLLiteDataIsCurrentCountyZKData(IRDBHelper rdbHelper, string sTheProj_XZQDM) { string sJudgeTable_TableName = "";//某县的整库记录验证用表 string sZKJCTJB_Gq_TableName = "";//整库基础统计表(公顷版) try { sJudgeTable_TableName = sTableName_County_ZKRecord_Judge;//某县的整库记录验证用表 sZKJCTJB_Gq_TableName = sTableName_ZKJCTJB_Gq;//整库基础统计表(公顷版) if (string.IsNullOrWhiteSpace(sJudgeTable_TableName) == true || string.IsNullOrWhiteSpace(sZKJCTJB_Gq_TableName) == true ) { LogAPI.Debug("验证SQLLite中数据是否是本县的整库数据 时,验证表/整库基础统计表(公顷版) 表名获取失败"); return false; } if (string.IsNullOrWhiteSpace(sTheProj_XZQDM) == true) { LogAPI.Debug("验证SQLLite中数据是否是本县的整库数据 时,行政区信息有误"); return false; } #region 读取验证表数据 DataTable dt_JudgeMsg = rdbHelper.ExecuteDatatable("Get_JudgeMsg", " select KeyMark1,KeyMark2,KeyMark3,KeyMark4,KeyMark5 from " + sJudgeTable_TableName + " ", true); if (dt_JudgeMsg == null || dt_JudgeMsg.Rows.Count <= 0) { MessageHelper.Show("验证SQLLite中数据是否是本县的整库数据 时,验证表信息 获取失败"); LogAPI.Debug("验证SQLLite中数据是否是本县的整库数据 时,验证表信息 获取失败"); return false; } string sKeyMark1 = dt_JudgeMsg.Rows[0]["KeyMark1"].ToString(); sKeyMark1 = DecodeBase64("utf-8", sKeyMark1); sKeyMark1 = DecodeBase64("utf-8", sKeyMark1); string sKeyMark2 = dt_JudgeMsg.Rows[0]["KeyMark2"].ToString(); sKeyMark2 = DecodeBase64("utf-8", sKeyMark2); sKeyMark2 = DecodeBase64("utf-8", sKeyMark2); sKeyMark2 = DecodeBase64("utf-8", sKeyMark2); string sKeyMark3 = dt_JudgeMsg.Rows[0]["KeyMark3"].ToString(); sKeyMark3 = DecodeBase64("utf-8", sKeyMark3); sKeyMark3 = DecodeBase64("utf-8", sKeyMark3); sKeyMark3 = DecodeBase64("utf-8", sKeyMark3); string sKeyMark4 = dt_JudgeMsg.Rows[0]["KeyMark4"].ToString(); sKeyMark4 = DecodeBase64("utf-8", sKeyMark4); sKeyMark4 = DecodeBase64("utf-8", sKeyMark4); sKeyMark4 = DecodeBase64("utf-8", sKeyMark4); string sKeyMark5 = dt_JudgeMsg.Rows[0]["KeyMark5"].ToString(); sKeyMark5 = DecodeBase64("utf-8", sKeyMark5); sKeyMark5 = DecodeBase64("utf-8", sKeyMark5); #endregion #region 获取应该和验证表对比的数据 //县编码 #region 县编码 string sCountyDM_J = sTheProj_XZQDM; #endregion //整库基础统计表数量 #region 整库基础统计表数量 int iZKJCTJB_Gq_SumCount_J = 0; DataTable dt_Get_ZKJCTJB_Gq_TableName_Temp1 = rdbHelper.ExecuteDatatable("Get_" + sZKJCTJB_Gq_TableName + "_SumCount", " select count(*) as countsum from " + sZKJCTJB_Gq_TableName + " ", true); if (dt_Get_ZKJCTJB_Gq_TableName_Temp1 == null || dt_Get_ZKJCTJB_Gq_TableName_Temp1.Rows.Count <= 0) { MessageHelper.Show("整库基础信息统计表 总记录数 获取失败,故 验证结果为 非本县信息; "); LogAPI.Debug("整库基础信息统计表 总记录数 获取失败,故 验证结果为 非本县信息; "); return false; } iZKJCTJB_Gq_SumCount_J = ExtendMethd.GetIntByObject(dt_Get_ZKJCTJB_Gq_TableName_Temp1.Rows[0]["countsum"] as object); #endregion //总国土调查总面积 #region 总国土调查总面积 double dZKJCTJB_Gq_SumCount_J = 0.00; DataTable dt_Get_ZKJCTJB_Gq_TableName_Temp2 = rdbHelper.ExecuteDatatable("Get_" + sZKJCTJB_Gq_TableName + "_MJSum", " select sum(GTDCZMJ) as mjsum from " + sZKJCTJB_Gq_TableName + " ", true); if (dt_Get_ZKJCTJB_Gq_TableName_Temp2 == null || dt_Get_ZKJCTJB_Gq_TableName_Temp2.Rows.Count <= 0) { MessageHelper.Show("整库基础信息统计表 国土调查总面积数 获取失败,故 验证结果为 非本县信息; "); LogAPI.Debug("整库基础信息统计表 国土调查总面积数 获取失败,故 验证结果为 非本县信息; "); return false; } dZKJCTJB_Gq_SumCount_J = (dt_Get_ZKJCTJB_Gq_TableName_Temp2.Rows[0]["mjsum"] as object).ToDouble(); dZKJCTJB_Gq_SumCount_J = Math.Round(dZKJCTJB_Gq_SumCount_J, 2); #endregion //生成时间(yyyy-MM-dd HH:mm:ss) //一个100~200的随机数,2次BASE64加密 //100<= x <=200 #endregion #region 验证对比 if (sKeyMark1 != sCountyDM_J) { LogAPI.Debug("验证 发现 SQLLite中数据 不是本县(" + sCountyDM_J + ")的整库数据 "); return false; } if (sKeyMark2 != iZKJCTJB_Gq_SumCount_J.ToString()) { LogAPI.Debug("验证 发现 SQLLite中数据 不是本县(" + sCountyDM_J + ")的整库数据 "); return false; } if (sKeyMark3 != dZKJCTJB_Gq_SumCount_J.ToString()) { LogAPI.Debug("验证 发现 SQLLite中数据 不是本县(" + sCountyDM_J + ")的整库数据 "); return false; } //判断 sKeyMark4 是不是时间 if (ExtendMethd.JudgeIsCouldConversionDateTime(sKeyMark4 as object) == false) { LogAPI.Debug("验证 发现 SQLLite中数据 不是本县(" + sCountyDM_J + ")的整库数据 "); return false; } //判断是不是在 100~200 之间 int iJudge_KeyMark5 = ExtendMethd.GetIntByObject(sKeyMark5 as object); if (iJudge_KeyMark5 < 100 || iJudge_KeyMark5 > 200) { LogAPI.Debug("验证 发现 SQLLite中数据 不是本县(" + sCountyDM_J + ")的整库数据 "); return false; } #endregion return true; } catch (Exception ex) { LogAPI.Debug("验证SQLLite中数据是否是本县的整库数据 时失败,异常原因: " + ex + " ; "); return false; } } /// /// 生成整库报表 /// /// 整库报表 枚举类型 /// 整库报表 Excel最终结果所在地址 /// 整库报表 中文名描述 public void CreateZKReport(EnumReportType iTheEnumReportTypeNow, string sTheShowExcelPath, string sTableNameDescript) { //DateTime dTimeStart4; //TimeSpan tSpan4; //dTimeStart4 = DateTime.Now; string sFromPath_Temp = ""; string sTheElementEmptyExcelName = ""; bool bReportCreateResult = false; try { #region 生成 统计报表 DealWithZKJCTJB_Gq_Msg();//先处理一把看看是不是需要生成整库基础统计表 sTheElementEmptyExcelName = GetExcelModelNameByZKReportType(iTheEnumReportTypeNow); if (string.IsNullOrWhiteSpace(sTheElementEmptyExcelName) == true) { MessageHelper.Show("获取 " + sTableNameDescript + " 原样表时失败;"); LogAPI.Debug("获取 " + sTableNameDescript + " 原样表时失败;"); return; } sFromPath_Temp = AppDomain.CurrentDomain.BaseDirectory + "TempalateReports\\整库统计表\\原样表\\" + sTheElementEmptyExcelName; if (File.Exists(sFromPath_Temp) == false) { MessageHelper.Show(sTableNameDescript + " 原Excel模板 获取失败,故 报表生成 失败"); LogAPI.Debug(sTableNameDescript + " 原Excel模板 获取失败,故 报表生成 失败"); return; } if (File.Exists(sTheShowExcelPath) == true) { bool bDelFileTemp1 = DeleteFile(sTheShowExcelPath);//删除 if (bDelFileTemp1 == false) { MessageHelper.Show(sTableNameDescript + " 的 展示导出用 Excel 删除失败"); LogAPI.Debug(sTableNameDescript + " 的 展示导出用 Excel 删除失败"); return; } } else { File.Copy(sFromPath_Temp, sTheShowExcelPath, true);//拷贝空表 } //ProgressHelper.ShowProcessBar("正生成" + sTableNameDescript + "数据"); switch (iTheEnumReportTypeNow) { #region 整库报表枚举 //case EnumReportType.TDLYXZEJFLMJHZB://土地利用现状分类面积汇总表 // DealWithTDLYXZEJFLMJHZBData iDealWithTDLYXZEJFLMJHZBData = new DealWithTDLYXZEJFLMJHZBData(); // bReportCreateResult = iDealWithTDLYXZEJFLMJHZBData.SetExcelCellValue_ZK_TDLYXZEJFLMJHZB(sTheShowExcelPath); // //验证标记: // //出现了全部的一级/二级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和 // break; //case EnumReportType.TDLYXZYJFLMJHZB://土地利用现状一级分类面积汇总表 // DealWithTDLYXZYJFLMJHZBData iDealWithTDLYXZYJFLMJHZBData = new DealWithTDLYXZYJFLMJHZBData(); // bReportCreateResult = iDealWithTDLYXZYJFLMJHZBData.SetExcelCellValue_ZK_TDLYXZYJFLMJHZB(sTheShowExcelPath); // //验证标记: // //出现了全部的一级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和 // break; //case EnumReportType.TDLYXZYJFLMJAQSXZHZB://土地利用现状一级分类面积按权属性质汇总表 // DealWithTDLYXZYJFLMJAQSXZHZBData iDealWithTDLYXZYJFLMJAQSXZHZBData = new DealWithTDLYXZYJFLMJAQSXZHZBData(); // bReportCreateResult = iDealWithTDLYXZYJFLMJAQSXZHZBData.SetExcelCellValue_ZK_TDLYXZYJFLMJAQSXZHZB(sTheShowExcelPath); // //验证标记: // //出现了全部的一级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和 // //按照权属性质(1/2或者3/4开头的QSXZ就有筛选条件) // break; //case EnumReportType.HDTDLYXZYJFLMJHZB://海岛土地利用现状一级分类面积汇总表 // DealWithHDTDLYXZYJFLMJHZBData iDealWithHDTDLYXZYJFLMJHZBData = new DealWithHDTDLYXZYJFLMJHZBData(); // bReportCreateResult = iDealWithHDTDLYXZYJFLMJHZBData.SetExcelCellValue_ZK_HDTDLYXZYJFLMJHZB(sTheShowExcelPath); // //验证标记: // //出现了全部的一级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和 // //有筛选条件 MSSM='01' // break; //case EnumReportType.FRDTDLYXZYJFLMJHZB://飞入地土地利用现状一级分类面积汇总表 // DealWithFRDTDLYXZYJFLMJHZBData iDealWithFRDTDLYXZYJFLMJHZBData = new DealWithFRDTDLYXZYJFLMJHZBData(); // bReportCreateResult = iDealWithFRDTDLYXZYJFLMJHZBData.SetExcelCellValue_ZK_FRDTDLYXZYJFLMJHZB(sTheShowExcelPath); // //验证标记: // //出现了全部的一级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和 // //有筛选条件 FRDBS='1'; // break; //case EnumReportType.FRDTDLYXZYJFLMJAQSXZHZB://飞入地土地利用现状一级分类面积按权属性质汇总表 // DealWithFRDTDLYXZYJFLMJAQSXZHZBData iDealWithFRDTDLYXZYJFLMJAQSXZHZBData = new DealWithFRDTDLYXZYJFLMJAQSXZHZBData(); // bReportCreateResult = iDealWithFRDTDLYXZYJFLMJAQSXZHZBData.SetExcelCellValue_ZK_FRDTDLYXZYJFLMJAQSXZHZB(sTheShowExcelPath); // //验证标记: // //出现了全部的一级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和 // //有筛选条件 FRDBS='1' , QSXZ like '1%' or QSXZ like '2%' 或者 QSXZ like '3%' or QSXZ like '4%' ; // break; //case EnumReportType.GCCDXSCDHZQKTJB://灌丛草地汇总情况统计表 // DealWithGCCDXSCDHZQKTJBData iDealWithGCCDXSCDHZQKTJBData = new DealWithGCCDXSCDHZQKTJBData(); // bReportCreateResult = iDealWithGCCDXSCDHZQKTJBData.SetExcelCellValue_ZK_GCCDXSCDHZQKTJB(sTheShowExcelPath); // //验证标记: // //有筛选条件 TBXHDM='GCCD' 且计算 0401/0402/0403/0404 有值的数据,其中0403K归入0403 // break; //case EnumReportType.CZCJGKYDMJHZB://城镇村及工矿用地面积汇总表 // DealWithCZCJGKYDMJHZBData iDealWithCZCJGKYDMJHZBData = new DealWithCZCJGKYDMJHZBData(); // bReportCreateResult = iDealWithCZCJGKYDMJHZBData.SetExcelCellValue_ZK_CZCJGKYDMJHZB(sTheShowExcelPath); // //验证标记: // //多次(6次)出现了全部的一级/二级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和; // //城镇村属性码不区分 20X 与 20XA, 20XA 作为 20X 参与统计 // //有筛选条件 CZCSXM ; // break; //case EnumReportType.GDPDFJMJHZB://耕地坡度分级面积汇总表 // DealWithGDPDFJMJHZBData iDealWithGDPDFJMJHZBData = new DealWithGDPDFJMJHZBData(); // bReportCreateResult = iDealWithGDPDFJMJHZBData.SetExcelCellValue_ZK_GDPDFJMJHZB(sTheShowExcelPath); // //验证标记: // //没有出现地类 // //有筛选条件 GDPDJB(1~5) 并相应计算处配上 GDLX(空/TT/PD) // break; //case EnumReportType.GDXHDCQKTJB://耕地细化调查情况统计表 // DealWithGDXHDCQKTJBData iDealWithGDXHDCQKTJBData = new DealWithGDXHDCQKTJBData(); // bReportCreateResult = iDealWithGDXHDCQKTJBData.SetExcelCellValue_ZK_GDXHDCQKTJB(sTheShowExcelPath); // //验证标记: // //耕地(01)地类无A/K末级类 // //有筛选条件 TBXHDM 是 HDGD/HQGD/LQGD/MQGD/SHGD/SMGD/YJGD 之一,且0101/0102/0103 其中一个有数值即可; // break; //case EnumReportType.GDZZLXMJTJB://耕地种植类型面积统计表 // DealWithGDZZLXMJTJBData iDealWithGDZZLXMJTJBData = new DealWithGDZZLXMJTJBData(); // bReportCreateResult = iDealWithGDZZLXMJTJBData.SetExcelCellValue_ZK_GDZZLXMJTJB(sTheShowExcelPath); // //验证标记: // //耕地(01)地类无A/K末级类 // //有筛选条件 ZZSXDM 且只计算 0101/0102/0103 有值的数据 // break; //case EnumReportType.FQXHBZTJB://废弃与垃圾填埋细化标注汇总统计表 // DealWithFQXHBZTJBData iDealWithFQXHBZTJBData = new DealWithFQXHBZTJBData(); // bReportCreateResult = iDealWithFQXHBZTJBData.SetExcelCellValue_ZK_FQXHBZTJB(sTheShowExcelPath); // //验证标记: // //有筛选条件 TBXHDM 是(FQ或LJTM之一),且 0602、1001、1003、0301、0302、0305、0307、0404 有数值; // //其中 0301K、0302K、0307K 的值各自分别依次算入0301、0302、0307中; // break; //case EnumReportType.GYYDALXHZTJB://工业用地按类型汇总统计表 // DealWithGYYDALXHZTJBData iDealWithGYYDALXHZTJBData = new DealWithGYYDALXHZTJBData(); // bReportCreateResult = iDealWithGYYDALXHZTJBData.SetExcelCellValue_ZK_GYYDALXHZTJB(sTheShowExcelPath); // //验证标记: // //0601 地类无A/K // //有筛选条件 TBXHDM为 HDGY,GTGY,MTGY,SNGY,BLGY,DLGY 其中之一,且 0601 有数值; // break; //case EnumReportType.JKHFGCHFZZTJB://即可恢复与工程恢复种植属性汇总统计表 // DealWithJKHFGCHFZZTJBData iDealWithJKHFGCHFZZTJBData = new DealWithJKHFGCHFZZTJBData(); // bReportCreateResult = iDealWithJKHFGCHFZZTJBData.SetExcelCellValue_ZK_JKHFGCHFZZTJB(sTheShowExcelPath); // //验证标记: // //有筛选条件 ZZSXDM 且只计算 有值的数据 // //可调整的数值加到其所属的二级地类中 // //1104记录的是1104+1104A+1104K的面积 // break; //case EnumReportType.KTZDLMJHZB://可调整地类面积汇总表 // DealWithKTZDLMJHZBData iDealWithKTZDLMJHZBData = new DealWithKTZDLMJHZBData(); // bReportCreateResult = iDealWithKTZDLMJHZBData.SetExcelCellValue_ZK_KTZDLMJHZB(sTheShowExcelPath); // //验证标记: // //0201K,0202K,0203K,0204K,0301K,0302K,0307K,0403K,1104K 有数值即可; // break; //case EnumReportType.LXFWNYDHZTJB://林区范围内种植园用地汇总统计表 // DealWithLXFWNYDHZTJBData iDealWithLXFWNYDHZTJBData = new DealWithLXFWNYDHZTJBData(); // bReportCreateResult = iDealWithLXFWNYDHZTJBData.SetExcelCellValue_ZK_LXFWNYDHZTJB(sTheShowExcelPath); // //验证标记: // //有筛选条件 TBXHDM='LQYD' 且只计算 有值的数据 // //求了0201、0202、0203、0204,且将0201K、0202K、0203K、0204K 归入0201、0202、0203、0204; // break; //case EnumReportType.BFXHDLMJHZB://部分细化地类面积汇总表 // DealWithBFXHDLMJHZBData iDealWithBFXHDLMJHZBData = new DealWithBFXHDLMJHZBData(); // bReportCreateResult = iDealWithBFXHDLMJHZBData.SetExcelCellValue_ZK_BFXHDLMJHZB(sTheShowExcelPath); // //验证标记: // //第一部分: 08H2A,0810A,1104A,1107A 有值即可; // //第二部分: CZCSXM 为201A、202A、203A 即可; // break; //case EnumReportType.HDTDLYXZEJFLMJHZB://海岛土地利用现状分类面积汇总表 // DealWithHDTDLYXZEJFLMJHZBData iDealWithHDTDLYXZEJFLMJHZBData = new DealWithHDTDLYXZEJFLMJHZBData(); // bReportCreateResult = iDealWithHDTDLYXZEJFLMJHZBData.SetExcelCellValue_ZK_HDTDLYXZEJFLMJHZB(sTheShowExcelPath); // //验证标记: // //出现了全部的一级地类/二级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和 // //有筛选条件 MSSM='01'; // break; //case EnumReportType.FRDCZCJGKYDMJHZB://飞入地城镇村及工矿用地面积汇总表 // DealWithFRDCZCJGKYDMJHZBData iDealWithFRDCZCJGKYDMJHZBData = new DealWithFRDCZCJGKYDMJHZBData(); // bReportCreateResult = iDealWithFRDCZCJGKYDMJHZBData.SetExcelCellValue_ZK_FRDCZCJGKYDMJHZB(sTheShowExcelPath); // //验证标记: // //多次(6次)出现了全部的一级/二级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和; // //城镇村属性码不区分 20X 与 20XA, 20XA 作为 20X 参与统计 // //有筛选条件 CZCSXM 和 FRDBS; // break; //case EnumReportType.FRDTDLYXZEJFLMJHZB://飞入地土地利用现状分类面积汇总表 // DealWithFRDTDLYXZEJFLMJHZBData iDealWithFRDTDLYXZEJFLMJHZBData = new DealWithFRDTDLYXZEJFLMJHZBData(); // bReportCreateResult = iDealWithFRDTDLYXZEJFLMJHZBData.SetExcelCellValue_ZK_FRDTDLYXZEJFLMJHZB(sTheShowExcelPath); // //验证标记: // //出现了全部的一级地类/二级地类 // //已验证:带A/K的末级地类已归属4位数的二级地类,一级地类为所有包含的二级地类的和 // //有筛选条件 FRDBS='1' ; // break; default: break; #endregion } if (bReportCreateResult == false) { //MessageHelper.Show(sTableNameDescript + " 报表生成 失败");// LogAPI.Debug(sTableNameDescript + " 报表生成 失败"); } #endregion //tSpan4 = DateTime.Now - dTimeStart4; //LogAPI.Debug("生成 " + sTableNameDescript + " 报表数据 耗时: " + tSpan4 + " ; \r"); //KGIS.Framework.Platform.Helper.ProgressHelper.ShowProcessBar(sTableNameDescript + " 数据 生成完成"); return; } catch (Exception ex) { LogAPI.Debug("生成 " + sTableNameDescript + " 报表数据 时失败,异常原因: " + ex + " ; "); return; } finally { //ProgressHelper.CloseProcessBar(); } } #region 获取所在行政区信息 /// /// 获取县列表 /// /// /// public List Get_County_DMList(IRDBHelper rdbHelper) { List iCounty_DMList = new List(); string sNeedSQL_1 = ""; string sNeedTableName_1 = ""; try { sNeedSQL_1 = sSQL_Get_County_DMList; if (string.IsNullOrWhiteSpace(sNeedSQL_1) == true) { MessageHelper.Show("未能找到 获取县列表 配置SQL,故 县列表 获取失败"); LogAPI.Debug("未能找到 获取县列表 配置SQL,故 县列表 获取失败"); return iCounty_DMList; } sNeedTableName_1 = sTableName_XZQ; if (string.IsNullOrWhiteSpace(sNeedTableName_1) == true) { MessageHelper.Show("未能找到 行政区表名 配置,故 县列表 获取失败"); LogAPI.Debug("未能找到 行政区表名 配置,故 县列表 获取失败"); return iCounty_DMList; } string sSql_Get_County_DMList = string.Format(sNeedSQL_1, sNeedTableName_1); DataTable dt_Get_County_DMList = rdbHelper.ExecuteDatatable("Get_County_DMList", sSql_Get_County_DMList, true); if (dt_Get_County_DMList == null || dt_Get_County_DMList.Rows.Count <= 0) { //MessageHelper.Show(" 县列表 信息获取失败"); LogAPI.Debug(" 县列表 信息获取失败"); return iCounty_DMList; } for (int d = 0; d < dt_Get_County_DMList.Rows.Count; d++) { iCounty_DMList.Add(ExtendMethd.GetStringByObject(dt_Get_County_DMList.Rows[d]["CountyDM"] as object).Trim()); } return iCounty_DMList; } catch (Exception ex) { LogAPI.Debug("获取县代码列表时失败,异常原因: " + ex + " ; "); iCounty_DMList = new List(); return iCounty_DMList; } } /// /// 依据县编号获取镇列表 /// /// /// /// public List Get_Town_DMList(IRDBHelper rdbHelper, string sCountyDM) { List iTown_DMList = new List(); string sNeedSQL_2 = ""; string sNeedTableName_2 = ""; try { if (string.IsNullOrWhiteSpace(sCountyDM) == true) { MessageHelper.Show("县编号 获取 失败,故 镇列表 获取失败"); LogAPI.Debug("县编号 获取 失败,故 镇列表 获取失败"); return iTown_DMList; } if (sCountyDM.Length != 6) { MessageHelper.Show("县编号 有误,故 镇列表 获取失败"); LogAPI.Debug("县编号 有误,故 镇列表 获取失败"); return iTown_DMList; } if (JudgeValueIsAllNumeric(sCountyDM) == false) { MessageHelper.Show("县 编号有误,故 镇列表 获取失败"); LogAPI.Debug("县 编号有误,故 镇列表 获取失败"); return iTown_DMList; } sNeedSQL_2 = sSQL_Get_Town_DMList_Temp; if (string.IsNullOrWhiteSpace(sNeedSQL_2) == true) { MessageHelper.Show("未能找到 获取镇列表 配置SQL,故 镇列表 获取失败"); LogAPI.Debug("未能找到 获取镇列表 配置SQL,故 镇列表 获取失败"); return iTown_DMList; } sNeedTableName_2 = sTableName_XZQ; if (string.IsNullOrWhiteSpace(sNeedTableName_2) == true) { MessageHelper.Show("未能找到 行政区表表名 配置,故 镇列表 获取失败"); LogAPI.Debug("未能找到 行政区表表名 配置,故 镇列表 获取失败"); return iTown_DMList; } string sSql_Get_Twon_DMList = string.Format(sNeedSQL_2, sNeedTableName_2, sCountyDM); DataTable dt_Get_Town_DMList = rdbHelper.ExecuteDatatable("Get_Town_DMList", sSql_Get_Twon_DMList, true); if (dt_Get_Town_DMList == null || dt_Get_Town_DMList.Rows.Count <= 0) { //MessageHelper.Show(" 镇列表 信息获取失败"); LogAPI.Debug(" 镇列表 信息获取失败"); return iTown_DMList; } for (int d = 0; d < dt_Get_Town_DMList.Rows.Count; d++) { iTown_DMList.Add(ExtendMethd.GetStringByObject(dt_Get_Town_DMList.Rows[d]["TownDM"] as object).Trim()); } return iTown_DMList; } catch (Exception ex) { LogAPI.Debug("依据县编号获取镇列表,异常原因: " + ex + " ; "); iTown_DMList = new List(); return iTown_DMList; } } /// /// 判断字符串是否是全数字(true是 false不是) /// /// /// public bool JudgeValueIsAllNumeric(string sValue) { try { string sNumericValue = ",0,1,2,3,4,5,6,7,8,9,"; char[] ch = new char[sValue.Length]; ch = sValue.ToCharArray(); bool iIsAllNumeric = true; for (int i = 0; i < ch.Length; i++) { if (sNumericValue.Contains("," + ch[i] + ",") == false) { iIsAllNumeric = false; break; } else { continue; } } return iIsAllNumeric; } catch (Exception ex) { LogAPI.Debug("判断字符串(" + sValue + ") 是否是全数字时失败,异常原因: " + ex + " ; "); return false; } } /// /// 依据镇编号获取村列表 /// /// /// /// public List Get_Country_DMList(IRDBHelper rdbHelper, string sTownDM) { List iCountry_DMList = new List(); string sNeedSQL_3 = ""; string sNeedTableName_3 = ""; try { if (string.IsNullOrWhiteSpace(sTownDM) == true) { MessageHelper.Show("镇编号 获取 失败,故 村列表 获取失败"); LogAPI.Debug("镇编号 获取 失败,故 村列表 获取失败"); return iCountry_DMList; } if (sTownDM.Length != 9) { MessageHelper.Show("镇编号 有误,故 村列表 获取失败"); LogAPI.Debug("镇编号 有误,故 村列表 获取失败"); return iCountry_DMList; } if (JudgeValueIsAllNumeric(sTownDM) == false) { MessageHelper.Show("镇 编号有误,故 村列表 获取失败"); LogAPI.Debug("镇 编号有误,故 村列表 获取失败"); return iCountry_DMList; } sNeedSQL_3 = sSQL_Get_Country_DMList_Temp; if (string.IsNullOrWhiteSpace(sNeedSQL_3) == true) { MessageHelper.Show("未能找到 获取村列表 配置SQL,故 村列表 获取失败"); LogAPI.Debug("未能找到 获取村列表 配置SQL,故 村列表 获取失败"); return iCountry_DMList; } sNeedTableName_3 = sTableName_CJDCQ; if (string.IsNullOrWhiteSpace(sNeedTableName_3) == true) { MessageHelper.Show("未能找到 村级调查区表表名 配置,故 村列表 获取失败"); LogAPI.Debug("未能找到 村级调查区表表名 配置,故 村列表 获取失败"); return iCountry_DMList; } string sSql_Get_Country_DMList = string.Format(sNeedSQL_3, sNeedTableName_3, sTownDM); DataTable dt_Get_Country_DMList = rdbHelper.ExecuteDatatable("Get_Country_DMList", sSql_Get_Country_DMList, true); if (dt_Get_Country_DMList == null || dt_Get_Country_DMList.Rows.Count <= 0) { //MessageHelper.Show(" 村列表 信息获取失败"); LogAPI.Debug(" 村列表 信息获取失败"); return iCountry_DMList; } for (int d = 0; d < dt_Get_Country_DMList.Rows.Count; d++) { iCountry_DMList.Add(ExtendMethd.GetStringByObject(dt_Get_Country_DMList.Rows[d]["CountryDM"] as object).Trim()); } return iCountry_DMList; } catch (Exception ex) { LogAPI.Debug("依据镇编号获取村列表,异常原因: " + ex + " ; "); iCountry_DMList = new List(); return iCountry_DMList; } } #endregion #region 获取所属行政区信息 /// /// 获取飞入地权属所有的 所属县 的列表 /// /// /// public List Get_FRDQS_County_DMList(IRDBHelper rdbHelper) { List i_FRDQS_County_DMList = new List(); string sNeedSQL_11 = ""; string sNeedTableName_11 = ""; try { sNeedSQL_11 = sSQL_Get_QSCounty_DMList; if (string.IsNullOrWhiteSpace(sNeedSQL_11) == true) { MessageHelper.Show("未能找到 获取权属县列表 配置SQL,故 县列表 获取失败"); LogAPI.Debug("未能找到 获取权属县列表 配置SQL,故 县列表 获取失败"); return i_FRDQS_County_DMList; } sNeedTableName_11 = sTableName_ZKJCTJB_Gq; if (string.IsNullOrWhiteSpace(sNeedTableName_11) == true) { MessageHelper.Show("未能找到 整库基础统计表表名 配置,故 县列表 获取失败"); LogAPI.Debug("未能找到 整库基础统计表表名 配置,故 县列表 获取失败"); return i_FRDQS_County_DMList; } string sSql_Get_QSCounty_DMList = string.Format(sNeedSQL_11, sNeedTableName_11); DataTable dt_Get_QSCounty_DMList = rdbHelper.ExecuteDatatable("Get_QSCounty_DMList", sSql_Get_QSCounty_DMList, true); if (dt_Get_QSCounty_DMList == null || dt_Get_QSCounty_DMList.Rows.Count <= 0) { //MessageHelper.Show(" 权属县列表 信息获取失败"); //LogAPI.Debug("未出现非本县飞入本县的飞入地数据,故 非本县权属县列表 信息为空"); return i_FRDQS_County_DMList; } for (int d = 0; d < dt_Get_QSCounty_DMList.Rows.Count; d++) { i_FRDQS_County_DMList.Add(ExtendMethd.GetStringByObject(dt_Get_QSCounty_DMList.Rows[d]["QSCountyDM"] as object).Trim()); } return i_FRDQS_County_DMList; } catch (Exception ex) { LogAPI.Debug("获取所有的 权属县 列表时失败,异常原因: " + ex + " ; "); i_FRDQS_County_DMList = new List(); return i_FRDQS_County_DMList; } } /// /// 依据权属县编号获取权属镇列表 /// /// /// /// public List Get_FRDQS_Town_DMList(IRDBHelper rdbHelper, string sQSCountyDM) { List i_FRDQS_Town_DMList = new List(); string sNeedSQL_21 = ""; string sNeedTableName_21 = ""; try { if (string.IsNullOrWhiteSpace(sQSCountyDM) == true) { MessageHelper.Show("权属县编号 获取 失败,故 镇列表 获取失败"); LogAPI.Debug("权属县编号 获取 失败,故 镇列表 获取失败"); return i_FRDQS_Town_DMList; } if (sQSCountyDM.Length != 6) { MessageHelper.Show("权属县编号 有误,故 权属镇列表 获取失败"); LogAPI.Debug("权属县编号 有误,故 权属镇列表 获取失败"); return i_FRDQS_Town_DMList; } if (JudgeValueIsAllNumeric(sQSCountyDM) == false) { MessageHelper.Show("权属县 编号有误,故 权属镇列表 获取失败"); LogAPI.Debug("权属县 编号有误,故 权属镇列表 获取失败"); return i_FRDQS_Town_DMList; } sNeedSQL_21 = sSQL_Get_QSTown_DMList_Temp; if (string.IsNullOrWhiteSpace(sNeedSQL_21) == true) { MessageHelper.Show("未能找到 获取权属镇列表 配置SQL,故 权属镇列表 获取失败"); LogAPI.Debug("未能找到 获取权属镇列表 配置SQL,故 权属镇列表 获取失败"); return i_FRDQS_Town_DMList; } sNeedTableName_21 = sTableName_ZKJCTJB_Gq; if (string.IsNullOrWhiteSpace(sNeedTableName_21) == true) { MessageHelper.Show("未能找到 整库基础统计表表名 配置,故 权属镇列表 获取失败"); LogAPI.Debug("未能找到 整库基础统计表表名 配置,故 权属镇列表 获取失败"); return i_FRDQS_Town_DMList; } string sSql_Get_QSTwon_DMList = string.Format(sNeedSQL_21, sNeedTableName_21, sQSCountyDM); DataTable dt_Get_QSTown_DMList = rdbHelper.ExecuteDatatable("Get_QSTown_DMList", sSql_Get_QSTwon_DMList, true); if (dt_Get_QSTown_DMList == null || dt_Get_QSTown_DMList.Rows.Count <= 0) { //MessageHelper.Show(" 权属镇列表 信息获取失败"); LogAPI.Debug(" 权属镇列表 信息获取失败"); return i_FRDQS_Town_DMList; } for (int d = 0; d < dt_Get_QSTown_DMList.Rows.Count; d++) { i_FRDQS_Town_DMList.Add(ExtendMethd.GetStringByObject(dt_Get_QSTown_DMList.Rows[d]["QSTownDM"] as object).Trim()); } return i_FRDQS_Town_DMList; } catch (Exception ex) { LogAPI.Debug("依据权属县编号获取权属镇列表,异常原因: " + ex + " ; "); i_FRDQS_Town_DMList = new List(); return i_FRDQS_Town_DMList; } } /// /// 依据镇编号获取村列表 /// /// /// /// public List Get_FRDQS_Country_DMList(IRDBHelper rdbHelper, string sQSTownDM) { List i_FRDQS_Country_DMList = new List(); string sNeedSQL_31 = ""; string sNeedTableName_31 = ""; try { if (string.IsNullOrWhiteSpace(sQSTownDM) == true) { MessageHelper.Show("权属镇编号 获取 失败,故 权属村列表 获取失败"); LogAPI.Debug("权属镇编号 获取 失败,故 权属村列表 获取失败"); return i_FRDQS_Country_DMList; } if (sQSTownDM.Length != 9) { MessageHelper.Show("权属镇编号 有误,故 权属村列表 获取失败"); LogAPI.Debug("权属镇编号 有误,故 权属村列表 获取失败"); return i_FRDQS_Country_DMList; } if (JudgeValueIsAllNumeric(sQSTownDM) == false) { MessageHelper.Show("权属镇 编号有误,故 权属村列表 获取失败"); LogAPI.Debug("权属镇 编号有误,故 权属村列表 获取失败"); return i_FRDQS_Country_DMList; } sNeedSQL_31 = sSQL_Get_QSCountry_DMList_Temp; if (string.IsNullOrWhiteSpace(sNeedSQL_31) == true) { MessageHelper.Show("未能找到 获取权属村列表 配置SQL,故 权属村列表 获取失败"); LogAPI.Debug("未能找到 获取权属村列表 配置SQL,故 权属村列表 获取失败"); return i_FRDQS_Country_DMList; } sNeedTableName_31 = sTableName_ZKJCTJB_Gq; if (string.IsNullOrWhiteSpace(sNeedTableName_31) == true) { MessageHelper.Show("未能找到 整库基础统计表表名 配置,故 权属村列表 获取失败"); LogAPI.Debug("未能找到 整库基础统计表表名 配置,故 权属村列表 获取失败"); return i_FRDQS_Country_DMList; } string sSql_Get_QSCountry_DMList = string.Format(sNeedSQL_31, sNeedTableName_31, sQSTownDM); DataTable dt_Get_QSCountry_DMList = rdbHelper.ExecuteDatatable("Get_QSCountry_DMList", sSql_Get_QSCountry_DMList, true); if (dt_Get_QSCountry_DMList == null || dt_Get_QSCountry_DMList.Rows.Count <= 0) { //MessageHelper.Show(" 权属村列表 信息获取失败"); LogAPI.Debug(" 权属村列表 信息获取失败"); return i_FRDQS_Country_DMList; } for (int d = 0; d < dt_Get_QSCountry_DMList.Rows.Count; d++) { i_FRDQS_Country_DMList.Add(ExtendMethd.GetStringByObject(dt_Get_QSCountry_DMList.Rows[d]["QSCountryDM"] as object).Trim()); } return i_FRDQS_Country_DMList; } catch (Exception ex) { LogAPI.Debug("依据权属镇编号获取权属村列表,异常原因: " + ex + " ; "); i_FRDQS_Country_DMList = new List(); return i_FRDQS_Country_DMList; } } #endregion /// /// 用于将excel表格中列索引转成列号字母,从A对应1开始 /// /// 列索引 /// 列号 public string IndexToColumn(int index, string sTableNameNow) { int iOldNum = index; try { if (index <= 0) { return ""; } index--; string column = string.Empty; do { if (column.Length > 0) { index--; } column = ((char)(index % 26 + (int)'A')).ToString() + column; index = (int)((index - index % 26) / 26); } while (index > 0); return column; } catch (Exception ex) { LogAPI.Debug("获取 " + sTableNameNow + " Excel 单元格列所对应的的ABC字母序号时失败,异常原因: " + ex + " ; "); return ""; } } /// /// 编码 /// /// /// /// public string EncodeBase64(string code_type, string code) { string encode = ""; byte[] bytes = Encoding.GetEncoding(code_type).GetBytes(code); try { encode = Convert.ToBase64String(bytes); } catch { encode = code; } return encode; } /// /// 解码 /// /// /// /// public string DecodeBase64(string code_type, string code) { string decode = ""; byte[] bytes = Convert.FromBase64String(code); try { decode = Encoding.GetEncoding(code_type).GetString(bytes); } catch { decode = code; } return decode; } /// /// 获取 行政区表 信息 /// /// /// public DataTable GetXZQMsg(IRDBHelper rdbHelper) { string sTableName_XZQ_1 = sTableName_XZQ; try { if (string.IsNullOrWhiteSpace(sTableName_XZQ_1) == true) { MessageHelper.Show("行政区表 配置表名获取失败,故 行政区表 获取失败"); LogAPI.Debug("行政区表 配置表名获取失败,故 行政区表 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_XZQ_1) == false) { MessageHelper.Show("行政区表 数据获取失败"); LogAPI.Debug("行政区表 数据获取失败"); return null; } DataTable dt_XZQMsg = rdbHelper.ExecuteDatatable("Get_" + sTableName_XZQ_1, " select XZQDM,XZQMC,MSSM,HDMC from " + sTableName_XZQ_1 + " ", true); return dt_XZQMsg; } catch (Exception ex) { LogAPI.Debug("获取行政区表信息 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 村级调查区表 信息 /// /// /// public DataTable GetCJDCQMsg(IRDBHelper rdbHelper) { string sTableName_CJDCQ_1 = sTableName_CJDCQ; try { if (string.IsNullOrWhiteSpace(sTableName_CJDCQ_1) == true) { MessageHelper.Show("村级调查区表 配置表名获取失败,故 村级调查区表 获取失败"); LogAPI.Debug("村级调查区表 配置表名获取失败,故 村级调查区表 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_CJDCQ_1) == false) { MessageHelper.Show("村级调查区表 数据获取失败"); LogAPI.Debug("村级调查区表 数据获取失败"); return null; } DataTable dt_CJDCQMsg = rdbHelper.ExecuteDatatable("Get_" + sTableName_CJDCQ_1, " select ZLDWDM,ZLDWMC,MSSM,HDMC from " + sTableName_CJDCQ_1 + " ", true); return dt_CJDCQMsg; } catch (Exception ex) { LogAPI.Debug("获取村级调查区信息 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 村级-坐落单位名称 /// /// /// /// public string Get_Country_ZLDWMC_By_DiscrictDM(string sTheDiscrictDM, DataTable dt_TheCJDCQMsg) { try { if (dt_TheCJDCQMsg == null || dt_TheCJDCQMsg.Rows.Count <= 0) { LogAPI.Debug("村级调查区 信息获取失败,故 村级坐落单位名称信息获取失败"); return ""; } if (string.IsNullOrWhiteSpace(sTheDiscrictDM) == true) { return ""; } if (sTheDiscrictDM.Length != 12) { return ""; } if (JudgeValueIsAllNumeric(sTheDiscrictDM) == false) { return ""; } DataRow[] drArray_1 = dt_TheCJDCQMsg.Select(" ZLDWDM like '" + sTheDiscrictDM + "%' and Len(ZLDWDM)>=12 "); if (drArray_1 == null || drArray_1.Count() <= 0) { return ""; } string sName = ExtendMethd.GetStringByObject(drArray_1[0]["ZLDWMC"] as object).Trim(); return sName; } catch (Exception ex) { LogAPI.Debug("依据 村级行政区编码(" + sTheDiscrictDM + ") 获取 村级坐落单位名称 时失败,异常原因: " + ex + " ; "); return ""; } } /// /// 依据村级行政区编码 获取 村级-海岛名称 /// /// /// /// public string Get_Country_HDMC_By_DiscrictDM(string sTheDiscrictDM, DataTable dt_TheCJDCQMsg) { try { if (dt_TheCJDCQMsg == null || dt_TheCJDCQMsg.Rows.Count <= 0) { LogAPI.Debug("村级调查区 信息获取失败,故 村级海岛名称信息获取失败"); return ""; } if (string.IsNullOrWhiteSpace(sTheDiscrictDM) == true) { return ""; } if (sTheDiscrictDM.Length != 12) { return ""; } if (JudgeValueIsAllNumeric(sTheDiscrictDM) == false) { return ""; } DataRow[] drArray_2 = dt_TheCJDCQMsg.Select(" ZLDWDM like '" + sTheDiscrictDM + "%' and MSSM='01' and Len(ZLDWDM)>=12 "); if (drArray_2 == null || drArray_2.Count() <= 0) { return ""; } string sName2 = ExtendMethd.GetStringByObject(drArray_2[0]["HDMC"] as object).Trim(); return sName2; } catch (Exception ex) { LogAPI.Debug("依据 村级行政区编码(" + sTheDiscrictDM + ") 获取 村级海岛名称 时失败,异常原因: " + ex + " ; "); return ""; } } /// /// 获取 (乡)镇级-坐落单位名称 /// /// /// /// public string Get_Town_XZQMC_By_DiscrictDM(string sTheDiscrictDM, DataTable dt_TheXZQMsg) { try { if (dt_TheXZQMsg == null || dt_TheXZQMsg.Rows.Count <= 0) { LogAPI.Debug("(乡)镇 信息获取失败,故 (乡)镇级坐落单位名称信息获取失败"); return ""; } if (string.IsNullOrWhiteSpace(sTheDiscrictDM) == true) { return ""; } if (sTheDiscrictDM.Length != 9) { return ""; } if (JudgeValueIsAllNumeric(sTheDiscrictDM) == false) { return ""; } DataRow[] drArray_1 = dt_TheXZQMsg.Select(" XZQDM like '" + sTheDiscrictDM + "%' and Len(XZQDM)>=9 "); if (drArray_1 == null || drArray_1.Count() <= 0) { return ""; } string sName = ExtendMethd.GetStringByObject(drArray_1[0]["XZQMC"] as object).Trim(); return sName; } catch (Exception ex) { LogAPI.Debug("依据 (乡)镇级行政区编码(" + sTheDiscrictDM + ") 获取 (乡)镇级坐落单位名称 时失败,异常原因: " + ex + " ; "); return ""; } } /// /// 依据(乡)镇级行政区编码 获取 (乡)镇级-海岛名称 /// /// /// /// public string Get_Town_HDMC_By_DiscrictDM(string sTheDiscrictDM, DataTable dt_TheXZQMsg) { try { if (dt_TheXZQMsg == null || dt_TheXZQMsg.Rows.Count <= 0) { LogAPI.Debug("(乡)镇 信息获取失败,故 (乡)镇级海岛名称信息获取失败"); return ""; } if (string.IsNullOrWhiteSpace(sTheDiscrictDM) == true) { return ""; } if (sTheDiscrictDM.Length != 9) { return ""; } if (JudgeValueIsAllNumeric(sTheDiscrictDM) == false) { return ""; } DataRow[] drArray_2 = dt_TheXZQMsg.Select(" XZQDM like '" + sTheDiscrictDM + "%' and MSSM='01' and Len(XZQDM)>=9 "); if (drArray_2 == null || drArray_2.Count() <= 0) { return ""; } string sName2 = ExtendMethd.GetStringByObject(drArray_2[0]["HDMC"] as object).Trim(); return sName2; } catch (Exception ex) { LogAPI.Debug("依据 (乡)镇级行政区编码(" + sTheDiscrictDM + ") 获取 (乡)镇级海岛名称 时失败,异常原因: " + ex + " ; "); return ""; } } /// /// 获取 地类图斑表中的权属信息 信息 /// /// /// public DataTable GetDLTB_QSDWMsg(IRDBHelper rdbHelper) { string sTableName_DLTB_2 = sTableName_DLTB; try { if (string.IsNullOrWhiteSpace(sTableName_DLTB_2) == true) { MessageHelper.Show("地类图斑表 配置表名获取失败,故 地类图斑表中的权属信息 获取失败"); LogAPI.Debug("地类图斑表 配置表名获取失败,故 地类图斑表中的权属信息 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_DLTB_2) == false) { MessageHelper.Show("地类图斑表 数据获取失败"); LogAPI.Debug("地类图斑表 数据获取失败"); return null; } DataTable dt_DLTBMsg = rdbHelper.ExecuteDatatable("Get_" + sTableName_DLTB_2, " select QSDWDM,QSDWMC from " + sTableName_DLTB_2 + " group by QSDWDM ", true); return dt_DLTBMsg; } catch (Exception ex) { LogAPI.Debug("获取 地类图斑表中的权属信息 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 村级-权属单位名称 /// /// /// /// public string Get_QSCountry_QSDWMC_By_QSDWDM(string sTheQSDWDM, DataTable dt_TheQSDWMsg) { try { if (dt_TheQSDWMsg == null || dt_TheQSDWMsg.Rows.Count <= 0) { LogAPI.Debug("权属 信息获取失败,故 村级权属单位名称信息获取失败"); return ""; } if (string.IsNullOrWhiteSpace(sTheQSDWDM) == true) { return ""; } if (sTheQSDWDM.Length != 12) { return ""; } if (JudgeValueIsAllNumeric(sTheQSDWDM) == false) { return ""; } DataRow[] drArray_1 = dt_TheQSDWMsg.Select(" QSDWDM like '" + sTheQSDWDM + "%' and Len(QSDWDM)>=12 "); if (drArray_1 == null || drArray_1.Count() <= 0) { return ""; } string sName = ExtendMethd.GetStringByObject(drArray_1[0]["QSDWMC"] as object).Trim(); return sName; } catch (Exception ex) { LogAPI.Debug("依据 权属单位编码(" + sTheQSDWDM + ") 获取 村级权属单位名称 时失败,异常原因: " + ex + " ; "); return ""; } } /// /// 获取 飞入地专用坐落单位代码和权属单位代码 对照信息 /// /// /// /// public List GetFRD_ZLDWDM_QSDWDMList_HasResult(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_11 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_11) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_11) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_11 = ""; switch (sType) { case "FRD_ZLDWDM_QSDWDM_All_6": sSQL_11 = string.Format(@" select a.ZQ_6 as ZQ from ( select (substr(ZLDWDM,1,6)||'_'||substr(QSDWDM,1,6)) as ZQ_6 from {0} where FRDBS='1' and Length(ZLDWDM)>=6 and Length(QSDWDM)>=6 ) as a group by a.ZQ_6 ", sTableName_ZKJCTJB_Gq_11); break; case "FRD_ZLDWDM_QSDWDM_All_9": sSQL_11 = string.Format(@" select a.ZQ_9 as ZQ from ( select (substr(ZLDWDM,1,9)||'_'||substr(QSDWDM,1,9)) as ZQ_9 from {0} where FRDBS='1' and Length(ZLDWDM)>=9 and Length(QSDWDM)>=9 ) as a group by a.ZQ_9 ", sTableName_ZKJCTJB_Gq_11); break; case "FRD_ZLDWDM_QSDWDM_All_12": sSQL_11 = string.Format(@" select a.ZQ_12 as ZQ from ( select (substr(ZLDWDM,1,12)||'_'||substr(QSDWDM,1,12)) as ZQ_12 from {0} where FRDBS='1' and Length(ZLDWDM)>=12 and Length(QSDWDM)>=12 ) as a group by a.ZQ_12 ", sTableName_ZKJCTJB_Gq_11); break; case "FRD_ZLDWDM_QSDWDM_G_6": sSQL_11 = string.Format(@" select a.ZQ_6 as ZQ from ( select (substr(ZLDWDM,1,6)||'_'||substr(QSDWDM,1,6)) as ZQ_6 from {0} where FRDBS='1' and Length(ZLDWDM)>=6 and Length(QSDWDM)>=6 and ( QSXZ like '1%' or QSXZ like '2%' ) ) as a group by a.ZQ_6 ", sTableName_ZKJCTJB_Gq_11); break; case "FRD_ZLDWDM_QSDWDM_G_9": sSQL_11 = string.Format(@" select a.ZQ_9 as ZQ from ( select (substr(ZLDWDM,1,9)||'_'||substr(QSDWDM,1,9)) as ZQ_9 from {0} where FRDBS='1' and Length(ZLDWDM)>=9 and Length(QSDWDM)>=9 and ( QSXZ like '1%' or QSXZ like '2%' ) ) as a group by a.ZQ_9 ", sTableName_ZKJCTJB_Gq_11); break; case "FRD_ZLDWDM_QSDWDM_G_12": sSQL_11 = string.Format(@" select a.ZQ_12 as ZQ from ( select (substr(ZLDWDM,1,12)||'_'||substr(QSDWDM,1,12)) as ZQ_12 from {0} where FRDBS='1' and Length(ZLDWDM)>=12 and Length(QSDWDM)>=12 and ( QSXZ like '1%' or QSXZ like '2%' ) ) as a group by a.ZQ_12 ", sTableName_ZKJCTJB_Gq_11); break; case "FRD_ZLDWDM_QSDWDM_J_6": sSQL_11 = string.Format(@" select a.ZQ_6 as ZQ from ( select (substr(ZLDWDM,1,6)||'_'||substr(QSDWDM,1,6)) as ZQ_6 from {0} where FRDBS='1' and Length(ZLDWDM)>=6 and Length(QSDWDM)>=6 and ( QSXZ like '3%' or QSXZ like '4%' ) ) as a group by a.ZQ_6 ", sTableName_ZKJCTJB_Gq_11); break; case "FRD_ZLDWDM_QSDWDM_J_9": sSQL_11 = string.Format(@" select a.ZQ_9 as ZQ from ( select (substr(ZLDWDM,1,9)||'_'||substr(QSDWDM,1,9)) as ZQ_9 from {0} where FRDBS='1' and Length(ZLDWDM)>=9 and Length(QSDWDM)>=9 and ( QSXZ like '3%' or QSXZ like '4%' ) ) as a group by a.ZQ_9 ", sTableName_ZKJCTJB_Gq_11); break; case "FRD_ZLDWDM_QSDWDM_J_12": sSQL_11 = string.Format(@" select a.ZQ_12 as ZQ from ( select (substr(ZLDWDM,1,12)||'_'||substr(QSDWDM,1,12)) as ZQ_12 from {0} where FRDBS='1' and Length(ZLDWDM)>=12 and Length(QSDWDM)>=12 and ( QSXZ like '3%' or QSXZ like '4%' ) ) as a group by a.ZQ_12 ", sTableName_ZKJCTJB_Gq_11); break; default: sSQL_11 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_11) == true) { return null; } DataTable dt_Msg_11 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_11, sSQL_11, true); if (dt_Msg_11 == null || dt_Msg_11.Rows.Count <= 0) { return null; } List sList_11 = new List(); string sTemp_11 = ""; for (int i = 0; i < dt_Msg_11.Rows.Count; i++) { sTemp_11 = ExtendMethd.GetStringByObject(dt_Msg_11.Rows[i]["ZQ"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_11) == false) { sList_11.Add(sTemp_11); } } return sList_11; } catch (Exception ex) { LogAPI.Debug("获取 飞入地专用坐落单位代码和权属单位代码 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 土地利用现状一级分类面积汇总表/土地利用现状一级分类面积按权属性质汇总表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveData_List_HasResult(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_12 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_12) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_12) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_12 = ""; switch (sType) { case "ZLDWDM_Data_All_6": sSQL_12 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_12); break; case "ZLDWDM_Data_All_9": sSQL_12 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_12); break; case "ZLDWDM_Data_All_12": sSQL_12 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_12); break; case "ZLDWDM_Data_G_6": sSQL_12 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and ( QSXZ like '1%' or QSXZ like '2%' ) ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_12); break; case "ZLDWDM_Data_G_9": sSQL_12 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and ( QSXZ like '1%' or QSXZ like '2%' ) ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_12); break; case "ZLDWDM_Data_G_12": sSQL_12 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and ( QSXZ like '1%' or QSXZ like '2%' ) ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_12); break; case "ZLDWDM_Data_J_6": sSQL_12 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and ( QSXZ like '3%' or QSXZ like '4%' ) ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_12); break; case "ZLDWDM_Data_J_9": sSQL_12 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and ( QSXZ like '3%' or QSXZ like '4%' ) ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_12); break; case "ZLDWDM_Data_J_12": sSQL_12 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and ( QSXZ like '3%' or QSXZ like '4%' ) ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_12); break; default: sSQL_12 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_12) == true) { return null; } DataTable dt_Msg_12 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_12, sSQL_12, true); if (dt_Msg_12 == null || dt_Msg_12.Rows.Count <= 0) { return null; } List sList_12 = new List(); string sTemp_12 = ""; for (int i = 0; i < dt_Msg_12.Rows.Count; i++) { sTemp_12 = ExtendMethd.GetStringByObject(dt_Msg_12.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_12) == false) { sList_12.Add(sTemp_12); } } return sList_12; } catch (Exception ex) { LogAPI.Debug("获取 土地利用现状一级分类面积汇总表/土地利用现状一级分类面积按权属性质汇总表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 海岛土地利用现状一级分类面积汇总表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_HDZLDWDMHaveData_List_HasResult(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_13 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_13) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 海岛涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 海岛涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_13) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_13 = ""; switch (sType) { case "HD_ZLDWDM_Data_All_6": sSQL_13 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and MSSM='01' ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_13); break; case "HD_ZLDWDM_Data_All_9": sSQL_13 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and MSSM='01' ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_13); break; case "HD_ZLDWDM_Data_All_12": sSQL_13 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and MSSM='01' ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_13); break; case "HD_ZLDWDM_Data_G_6": sSQL_13 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and MSSM='01' and ( QSXZ like '1%' or QSXZ like '2%' ) ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_13); break; case "HD_ZLDWDM_Data_G_9": sSQL_13 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and MSSM='01' and ( QSXZ like '1%' or QSXZ like '2%' ) ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_13); break; case "HD_ZLDWDM_Data_G_12": sSQL_13 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and MSSM='01' and ( QSXZ like '1%' or QSXZ like '2%' ) ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_13); break; case "HD_ZLDWDM_Data_J_6": sSQL_13 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and MSSM='01' and ( QSXZ like '3%' or QSXZ like '4%' ) ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_13); break; case "HD_ZLDWDM_Data_J_9": sSQL_13 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and MSSM='01' and ( QSXZ like '3%' or QSXZ like '4%' ) ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_13); break; case "HD_ZLDWDM_Data_J_12": sSQL_13 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and MSSM='01' and ( QSXZ like '3%' or QSXZ like '4%' ) ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_13); break; default: sSQL_13 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_13) == true) { return null; } DataTable dt_Msg_13 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_13, sSQL_13, true); if (dt_Msg_13 == null || dt_Msg_13.Rows.Count <= 0) { return null; } List sList_13 = new List(); string sTemp_13 = ""; for (int i = 0; i < dt_Msg_13.Rows.Count; i++) { sTemp_13 = ExtendMethd.GetStringByObject(dt_Msg_13.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_13) == false) { sList_13.Add(sTemp_13); } } return sList_13; } catch (Exception ex) { LogAPI.Debug("获取 海岛土地利用现状一级分类面积汇总表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 有灌丛草地数据的 坐落单位信息 /// /// /// /// public List Get_GCCD_List_HasResult(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_14 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_14) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_14) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_14 = ""; switch (sType) { case "GCCD_Data_All_6": sSQL_14 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and TBXHDM='GCCD' and ( TBMJ_0401>0.00 or TBMJ_0402>0.00 or TBMJ_0403>0.00 or TBMJ_0403K>0.00 or TBMJ_0404>0.00 ) ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_14); break; case "GCCD_Data_All_9": sSQL_14 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and TBXHDM='GCCD' and ( TBMJ_0401>0.00 or TBMJ_0402>0.00 or TBMJ_0403>0.00 or TBMJ_0403K>0.00 or TBMJ_0404>0.00 ) ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_14); break; case "GCCD_Data_All_12": sSQL_14 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and TBXHDM='GCCD' and ( TBMJ_0401>0.00 or TBMJ_0402>0.00 or TBMJ_0403>0.00 or TBMJ_0403K>0.00 or TBMJ_0404>0.00 ) ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_14); break; default: sSQL_14 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_14) == true) { return null; } DataTable dt_Msg_14 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_14, sSQL_14, true); if (dt_Msg_14 == null || dt_Msg_14.Rows.Count <= 0) { return null; } List sList_14 = new List(); string sTemp_14 = ""; for (int i = 0; i < dt_Msg_14.Rows.Count; i++) { sTemp_14 = ExtendMethd.GetStringByObject(dt_Msg_14.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_14) == false) { sList_14.Add(sTemp_14); } } return sList_14; } catch (Exception ex) { LogAPI.Debug("获取 有灌丛草地数据的 坐落单位信息 (请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 有城镇村及工矿用地数据的 坐落单位信息 /// /// /// /// public List Get_CZCJGKYD_List_HasResult(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_15 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_15) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_15) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_15 = ""; switch (sType) { #region 20 的 SQL case "CZCJGKYD_Data_All_6_20": sSQL_15 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and CZCSXM in('201','201A','202','202A','203','203A','204','205') ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_9_20": sSQL_15 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and CZCSXM in('201','201A','202','202A','203','203A','204','205') ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_12_20": sSQL_15 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and CZCSXM in('201','201A','202','202A','203','203A','204','205') ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_15); break; #endregion #region 201 的 SQL case "CZCJGKYD_Data_All_6_201": sSQL_15 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and CZCSXM in('201','201A') ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_9_201": sSQL_15 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and CZCSXM in('201','201A') ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_12_201": sSQL_15 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and CZCSXM in('201','201A') ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_15); break; #endregion #region 202 的 SQL case "CZCJGKYD_Data_All_6_202": sSQL_15 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and CZCSXM in('202','202A') ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_9_202": sSQL_15 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and CZCSXM in('202','202A') ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_12_202": sSQL_15 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and CZCSXM in('202','202A') ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_15); break; #endregion #region 203 的 SQL case "CZCJGKYD_Data_All_6_203": sSQL_15 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and CZCSXM in('203','203A') ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_9_203": sSQL_15 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and CZCSXM in('203','203A') ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_12_203": sSQL_15 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and CZCSXM in('203','203A') ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_15); break; #endregion #region 204 的 SQL case "CZCJGKYD_Data_All_6_204": sSQL_15 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and CZCSXM='204' ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_9_204": sSQL_15 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and CZCSXM='204' ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_12_204": sSQL_15 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and CZCSXM='204' ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_15); break; #endregion #region 205 的 SQL case "CZCJGKYD_Data_All_6_205": sSQL_15 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and CZCSXM='205' ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_9_205": sSQL_15 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and CZCSXM='205' ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_15); break; case "CZCJGKYD_Data_All_12_205": sSQL_15 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and CZCSXM='205' ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_15); break; #endregion default: sSQL_15 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_15) == true) { return null; } DataTable dt_Msg_15 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_15, sSQL_15, true); if (dt_Msg_15 == null || dt_Msg_15.Rows.Count <= 0) { return null; } List sList_15 = new List(); string sTemp_15 = ""; for (int i = 0; i < dt_Msg_15.Rows.Count; i++) { sTemp_15 = ExtendMethd.GetStringByObject(dt_Msg_15.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_15) == false) { sList_15.Add(sTemp_15); } } return sList_15; } catch (Exception ex) { LogAPI.Debug("获取 有城镇村及工矿用地数据的 坐落单位信息 (请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 耕地坡度分级面积汇总表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveGDPDFJMJHZBData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_16 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_16) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_16) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_16 = ""; switch (sType) { case "ZLDWDM_GDPDFJData_All_6": sSQL_16 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and GDPDJB in ('1','2','3','4','5') ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_16); break; case "ZLDWDM_GDPDFJData_All_9": sSQL_16 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and GDPDJB in ('1','2','3','4','5') ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_16); break; case "ZLDWDM_GDPDFJData_All_12": sSQL_16 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and GDPDJB in ('1','2','3','4','5') ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_16); break; default: sSQL_16 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_16) == true) { return null; } DataTable dt_Msg_16 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_16, sSQL_16, true); if (dt_Msg_16 == null || dt_Msg_16.Rows.Count <= 0) { return null; } List sList_16 = new List(); string sTemp_16 = ""; for (int i = 0; i < dt_Msg_16.Rows.Count; i++) { sTemp_16 = ExtendMethd.GetStringByObject(dt_Msg_16.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_16) == false) { sList_16.Add(sTemp_16); } } return sList_16; } catch (Exception ex) { LogAPI.Debug("获取 耕地坡度分级面积汇总表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 耕地细化调查情况统计表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveGDXHDCQKTJBData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_17 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_17) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_17) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_17 = ""; switch (sType) { case "ZLDWDM_GDXHData_All_6": sSQL_17 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and TBXHDM in ('HDGD','HQGD','LQGD','MQGD','SHGD','SMGD','YJGD') ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_17); break; case "ZLDWDM_GDXHData_All_9": sSQL_17 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and TBXHDM in ('HDGD','HQGD','LQGD','MQGD','SHGD','SMGD','YJGD') ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_17); break; case "ZLDWDM_GDXHData_All_12": sSQL_17 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and TBXHDM in ('HDGD','HQGD','LQGD','MQGD','SHGD','SMGD','YJGD') ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_17); break; default: sSQL_17 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_17) == true) { return null; } DataTable dt_Msg_17 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_17, sSQL_17, true); if (dt_Msg_17 == null || dt_Msg_17.Rows.Count <= 0) { return null; } List sList_17 = new List(); string sTemp_17 = ""; for (int i = 0; i < dt_Msg_17.Rows.Count; i++) { sTemp_17 = ExtendMethd.GetStringByObject(dt_Msg_17.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_17) == false) { sList_17.Add(sTemp_17); } } return sList_17; } catch (Exception ex) { LogAPI.Debug("获取 耕地细化调查情况统计表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 耕地种植类型面积统计表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveGDZZLXMJTJBData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_18 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_18) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_18) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_18 = ""; switch (sType) { case "ZLDWDM_GDZZLXData_All_6": sSQL_18 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and (TBMJ_0101>0.00 or TBMJ_0102>0.00 or TBMJ_0103>0.00 ) and ZZSXDM in ('LS','FLS','LYFL','XG','LLJZ','WG') ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_18); break; case "ZLDWDM_GDZZLXData_All_9": sSQL_18 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and (TBMJ_0101>0.00 or TBMJ_0102>0.00 or TBMJ_0103>0.00 ) and ZZSXDM in ('LS','FLS','LYFL','XG','LLJZ','WG') ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_18); break; case "ZLDWDM_GDZZLXData_All_12": sSQL_18 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and (TBMJ_0101>0.00 or TBMJ_0102>0.00 or TBMJ_0103>0.00 ) and ZZSXDM in ('LS','FLS','LYFL','XG','LLJZ','WG') ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_18); break; default: sSQL_18 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_18) == true) { return null; } DataTable dt_Msg_18 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_18, sSQL_18, true); if (dt_Msg_18 == null || dt_Msg_18.Rows.Count <= 0) { return null; } List sList_18 = new List(); string sTemp_18 = ""; for (int i = 0; i < dt_Msg_18.Rows.Count; i++) { sTemp_18 = ExtendMethd.GetStringByObject(dt_Msg_18.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_18) == false) { sList_18.Add(sTemp_18); } } return sList_18; } catch (Exception ex) { LogAPI.Debug("获取 耕地种植类型面积统计表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 废弃与垃圾填埋细化标注汇总统计表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveFQXHBZTJBData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_19 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_19) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_19) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_19 = ""; switch (sType) { case "ZLDWDM_FQXHData_All_6": sSQL_19 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and TBXHDM in ('FQ','LJTM') ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_19); break; case "ZLDWDM_FQXHData_All_9": sSQL_19 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and TBXHDM in ('FQ','LJTM') ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_19); break; case "ZLDWDM_FQXHData_All_12": sSQL_19 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and TBXHDM in ('FQ','LJTM') ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_19); break; default: sSQL_19 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_19) == true) { return null; } DataTable dt_Msg_19 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_19, sSQL_19, true); if (dt_Msg_19 == null || dt_Msg_19.Rows.Count <= 0) { return null; } List sList_19 = new List(); string sTemp_19 = ""; for (int i = 0; i < dt_Msg_19.Rows.Count; i++) { sTemp_19 = ExtendMethd.GetStringByObject(dt_Msg_19.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_19) == false) { sList_19.Add(sTemp_19); } } return sList_19; } catch (Exception ex) { LogAPI.Debug("获取 废弃与垃圾填埋细化标注汇总统计表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 工业用地按类型汇总统计表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveGYYDLXMJTJBData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_20 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_20) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_20) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_20 = ""; switch (sType) { case "ZLDWDM_GYYDLXData_All_6": sSQL_20 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and TBMJ_0601>0.00 and TBXHDM in ('HDGY','GTGY','MTGY','SNGY','BLGY','DLGY') ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_20); break; case "ZLDWDM_GYYDLXData_All_9": sSQL_20 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and TBMJ_0601>0.00 and TBXHDM in ('HDGY','GTGY','MTGY','SNGY','BLGY','DLGY') ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_20); break; case "ZLDWDM_GYYDLXData_All_12": sSQL_20 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and TBMJ_0601>0.00 and TBXHDM in ('HDGY','GTGY','MTGY','SNGY','BLGY','DLGY') ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_20); break; default: sSQL_20 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_20) == true) { return null; } DataTable dt_Msg_20 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_20, sSQL_20, true); if (dt_Msg_20 == null || dt_Msg_20.Rows.Count <= 0) { return null; } List sList_20 = new List(); string sTemp_20 = ""; for (int i = 0; i < dt_Msg_20.Rows.Count; i++) { sTemp_20 = ExtendMethd.GetStringByObject(dt_Msg_20.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_20) == false) { sList_20.Add(sTemp_20); } } return sList_20; } catch (Exception ex) { LogAPI.Debug("获取 工业用地按类型汇总统计表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 即可恢复与工程恢复种植属性汇总统计表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveJKHFGCHFZZTJBData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_21 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_21) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_21) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sReferDLDMs = "0201,0201K,0202,0202K,0203,0203K,0204,0204K,0301,0301K,0302,0302K,0305,0307,0307K,0403K,0404,1104,1104A,1104K"; string[] sReferDLDMsArray = sReferDLDMs.Split(','); List sReferDLDMsList = new List(sReferDLDMsArray); /* and (TBMJ_0201>0.00 or TBMJ_0201K>0.00 or TBMJ_0202>0.00 or TBMJ_0202K>0.00 or TBMJ_0203>0.00 or TBMJ_0203K>0.00 or TBMJ_0204>0.00 or TBMJ_0204K>0.00 or TBMJ_0301>0.00 or TBMJ_0301K>0.00 or TBMJ_0302>0.00 or TBMJ_0302K>0.00 or TBMJ_0305>0.00 or TBMJ_0307>0.00 or TBMJ_0307K>0.00 or TBMJ_0403K>0.00 or TBMJ_0404>0.00 or TBMJ_1104>0.00 or TBMJ_1104A>0.00 or TBMJ_1104K>0.00 ) */ string sSQL_DLDMsPart = ""; for (int re = 0; re < sReferDLDMsList.Count(); re++) { if (re == 0) { sSQL_DLDMsPart += " and (TBMJ_" + sReferDLDMsList[re] + ">0.00 "; } else { //or TBMJ_0204>0.00 sSQL_DLDMsPart += " or TBMJ_" + sReferDLDMsList[re] + ">0.00 "; if (re == sReferDLDMsList.Count() - 1) { sSQL_DLDMsPart += ") "; } } } string sSQL_21 = ""; switch (sType) { case "ZLDWDM_JKHFGCHFZZData_All_6": sSQL_21 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and ZZSXDM in ('JKHF','GCHF') {1} ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_21, sSQL_DLDMsPart); break; case "ZLDWDM_JKHFGCHFZZData_All_9": sSQL_21 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and ZZSXDM in ('JKHF','GCHF') {1} ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_21, sSQL_DLDMsPart); break; case "ZLDWDM_JKHFGCHFZZData_All_12": sSQL_21 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and ZZSXDM in ('JKHF','GCHF') {1} ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_21, sSQL_DLDMsPart); break; default: sSQL_21 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_21) == true) { return null; } DataTable dt_Msg_21 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_21, sSQL_21, true); if (dt_Msg_21 == null || dt_Msg_21.Rows.Count <= 0) { return null; } List sList_21 = new List(); string sTemp_21 = ""; for (int i = 0; i < dt_Msg_21.Rows.Count; i++) { sTemp_21 = ExtendMethd.GetStringByObject(dt_Msg_21.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_21) == false) { sList_21.Add(sTemp_21); } } return sList_21; } catch (Exception ex) { LogAPI.Debug("获取 即可恢复与工程恢复种植属性汇总统计表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 可调整地类面积汇总表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveKTZDLMJTJBData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_22 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_22) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_22) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } //拼接要搜索的可调整地类查询语句 #region 拼接要搜索的可调整地类查询语句 string sReferDLDMs_2 = "0201K,0202K,0203K,0204K,0301K,0302K,0307K,0403K,1104K"; string[] sReferDLDMsArray_2 = sReferDLDMs_2.Split(','); List sReferDLDMsList_2 = new List(sReferDLDMsArray_2); string sSQL_DLDMsPart_2 = ""; for (int re = 0; re < sReferDLDMsList_2.Count(); re++) { if (re == 0) { sSQL_DLDMsPart_2 += " and (TBMJ_" + sReferDLDMsList_2[re] + ">0.00 "; } else { //or TBMJ_0202K>0.00 sSQL_DLDMsPart_2 += " or TBMJ_" + sReferDLDMsList_2[re] + ">0.00 "; if (re == sReferDLDMsList_2.Count() - 1) { sSQL_DLDMsPart_2 += ") "; } } } #endregion if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_22 = ""; switch (sType) { case "ZLDWDM_KTZDLData_All_6": sSQL_22 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 {1} ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_22, sSQL_DLDMsPart_2); break; case "ZLDWDM_KTZDLData_All_9": sSQL_22 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 {1} ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_22, sSQL_DLDMsPart_2); break; case "ZLDWDM_KTZDLData_All_12": sSQL_22 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 {1} ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_22, sSQL_DLDMsPart_2); break; default: sSQL_22 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_22) == true) { return null; } DataTable dt_Msg_22 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_22, sSQL_22, true); if (dt_Msg_22 == null || dt_Msg_22.Rows.Count <= 0) { return null; } List sList_22 = new List(); string sTemp_22 = ""; for (int i = 0; i < dt_Msg_22.Rows.Count; i++) { sTemp_22 = ExtendMethd.GetStringByObject(dt_Msg_22.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_22) == false) { sList_22.Add(sTemp_22); } } return sList_22; } catch (Exception ex) { LogAPI.Debug("获取 可调整地类面积汇总表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 林区范围内种植园用地汇总统计表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveLQZZYYDData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_23 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_23) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_23) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } //拼接要搜索的可调整地类查询语句 #region 拼接要搜索的可调整地类查询语句 string sReferDLDMs_3 = "0201,0201K,0202,0202K,0203,0203K,0204,0204K"; //string sReferDLDMs_3 = "0201,0202,0203,0204"; string[] sReferDLDMsArray_3 = sReferDLDMs_3.Split(','); List sReferDLDMsList_3 = new List(sReferDLDMsArray_3); string sSQL_DLDMsPart_3 = ""; for (int re = 0; re < sReferDLDMsList_3.Count(); re++) { if (re == 0) { sSQL_DLDMsPart_3 += " and (TBMJ_" + sReferDLDMsList_3[re] + ">0.00 "; } else { //or TBMJ_0202>0.00 sSQL_DLDMsPart_3 += " or TBMJ_" + sReferDLDMsList_3[re] + ">0.00 "; if (re == sReferDLDMsList_3.Count() - 1) { sSQL_DLDMsPart_3 += ") "; } } } #endregion if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_23 = ""; switch (sType) { case "ZLDWDM_LQZZYYDData_All_6": sSQL_23 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and TBXHDM='LQYD' {1} ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_23, sSQL_DLDMsPart_3); break; case "ZLDWDM_LQZZYYDData_All_9": sSQL_23 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and TBXHDM='LQYD' {1} ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_23, sSQL_DLDMsPart_3); break; case "ZLDWDM_LQZZYYDData_All_12": sSQL_23 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and TBXHDM='LQYD' {1} ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_23, sSQL_DLDMsPart_3); break; default: sSQL_23 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_23) == true) { return null; } DataTable dt_Msg_23 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_23, sSQL_23, true); if (dt_Msg_23 == null || dt_Msg_23.Rows.Count <= 0) { return null; } List sList_23 = new List(); string sTemp_23 = ""; for (int i = 0; i < dt_Msg_23.Rows.Count; i++) { sTemp_23 = ExtendMethd.GetStringByObject(dt_Msg_23.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_23) == false) { sList_23.Add(sTemp_23); } } return sList_23; } catch (Exception ex) { LogAPI.Debug("获取 林区范围内种植园用地汇总统计表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 部分细化地类面积汇总表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveBFXHDLData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_24 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_24) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_24) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_24 = ""; switch (sType) { case "ZLDWDM_BFXHDLData_All_6": sSQL_24 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and ( (TBMJ_08H2A>0.00 or TBMJ_0810A>0.00 or TBMJ_1104A>0.00 or TBMJ_1107A>0.00 ) or (CZCSXM in ('201A','202A','203A')) ) ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_24); break; case "ZLDWDM_BFXHDLData_All_9": sSQL_24 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and ( (TBMJ_08H2A>0.00 or TBMJ_0810A>0.00 or TBMJ_1104A>0.00 or TBMJ_1107A>0.00 ) or (CZCSXM in ('201A','202A','203A')) ) ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_24); break; case "ZLDWDM_BFXHDLData_All_12": sSQL_24 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and ( (TBMJ_08H2A>0.00 or TBMJ_0810A>0.00 or TBMJ_1104A>0.00 or TBMJ_1107A>0.00 ) or (CZCSXM in ('201A','202A','203A')) ) ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_24); break; default: sSQL_24 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_24) == true) { return null; } DataTable dt_Msg_24 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_24, sSQL_24, true); if (dt_Msg_24 == null || dt_Msg_24.Rows.Count <= 0) { return null; } List sList_24 = new List(); string sTemp_24 = ""; for (int i = 0; i < dt_Msg_24.Rows.Count; i++) { sTemp_24 = ExtendMethd.GetStringByObject(dt_Msg_24.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_24) == false) { sList_24.Add(sTemp_24); } } return sList_24; } catch (Exception ex) { LogAPI.Debug("获取 部分细化地类面积汇总表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 海岛土地利用现状分类面积汇总表 专用坐落单位代码涉及数据 对照信息 /// /// /// /// public List Get_ZLDWDMHaveHDTDLYXZEJFLData_List(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_25 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_25) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据 对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_25) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_25 = ""; switch (sType) { case "ZLDWDM_HDTDLYXZEJFLData_All_6": sSQL_25 = string.Format(@" select a.Z_6 as Z from ( select substr(ZLDWDM,1,6) as Z_6 from {0} where Length(ZLDWDM)>=6 and MSSM='01' ) as a group by a.Z_6 ", sTableName_ZKJCTJB_Gq_25); break; case "ZLDWDM_HDTDLYXZEJFLData_All_9": sSQL_25 = string.Format(@" select a.Z_9 as Z from ( select substr(ZLDWDM,1,9) as Z_9 from {0} where Length(ZLDWDM)>=9 and MSSM='01' ) as a group by a.Z_9 ", sTableName_ZKJCTJB_Gq_25); break; case "ZLDWDM_HDTDLYXZEJFLData_All_12": sSQL_25 = string.Format(@" select a.Z_12 as Z from ( select substr(ZLDWDM,1,12) as Z_12 from {0} where Length(ZLDWDM)>=12 and MSSM='01' ) as a group by a.Z_12 ", sTableName_ZKJCTJB_Gq_25); break; default: sSQL_25 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_25) == true) { return null; } DataTable dt_Msg_25 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_25, sSQL_25, true); if (dt_Msg_25 == null || dt_Msg_25.Rows.Count <= 0) { return null; } List sList_25 = new List(); string sTemp_25 = ""; for (int i = 0; i < dt_Msg_25.Rows.Count; i++) { sTemp_25 = ExtendMethd.GetStringByObject(dt_Msg_25.Rows[i]["Z"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_25) == false) { sList_25.Add(sTemp_25); } } return sList_25; } catch (Exception ex) { LogAPI.Debug("获取 海岛土地利用现状分类面积汇总表 专用坐落单位代码涉及数据 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } /// /// 获取 有飞入地城镇村及工矿用地数据的坐落单位及权属单位 对照信息 /// /// /// /// public List GetFRD_ZLDWDM_QSDWDMList_HasFRDCZCJGKYDResult(IRDBHelper rdbHelper, string sType) { string sTableName_ZKJCTJB_Gq_26 = sTableName_ZKJCTJB_Gq; try { if (string.IsNullOrWhiteSpace(sTableName_ZKJCTJB_Gq_26) == true) { MessageHelper.Show("整库基础统计表 配置表名获取失败,故 涉及数据对照 获取失败"); LogAPI.Debug("整库基础统计表 配置表名获取失败,故 涉及数据对照 获取失败"); } if (Judge_SQLiteTable_IsExist(rdbHelper, sTableName_ZKJCTJB_Gq_26) == false) { MessageHelper.Show("整库基础统计表 数据获取失败"); LogAPI.Debug("整库基础统计表 数据获取失败"); return null; } if (string.IsNullOrWhiteSpace(sType) == true) { return null; } string sSQL_26 = ""; switch (sType) { #region 20的 case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_6_20": sSQL_26 = string.Format(@" select a.ZQ_6 as ZQ from ( select (substr(ZLDWDM,1,6)||'_'||substr(QSDWDM,1,6)) as ZQ_6 from {0} where FRDBS='1' and Length(ZLDWDM)>=6 and Length(QSDWDM)>=6 and CZCSXM in('201','201A','202','202A','203','203A','204','205') ) as a group by a.ZQ_6 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_9_20": sSQL_26 = string.Format(@" select a.ZQ_9 as ZQ from ( select (substr(ZLDWDM,1,9)||'_'||substr(QSDWDM,1,9)) as ZQ_9 from {0} where FRDBS='1' and Length(ZLDWDM)>=9 and Length(QSDWDM)>=9 and CZCSXM in('201','201A','202','202A','203','203A','204','205') ) as a group by a.ZQ_9 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_12_20": sSQL_26 = string.Format(@" select a.ZQ_12 as ZQ from ( select (substr(ZLDWDM,1,12)||'_'||substr(QSDWDM,1,12)) as ZQ_12 from {0} where FRDBS='1' and Length(ZLDWDM)>=12 and Length(QSDWDM)>=12 and CZCSXM in('201','201A','202','202A','203','203A','204','205') ) as a group by a.ZQ_12 ", sTableName_ZKJCTJB_Gq_26); break; #endregion #region 201的 case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_6_201": sSQL_26 = string.Format(@" select a.ZQ_6 as ZQ from ( select (substr(ZLDWDM,1,6)||'_'||substr(QSDWDM,1,6)) as ZQ_6 from {0} where FRDBS='1' and Length(ZLDWDM)>=6 and Length(QSDWDM)>=6 and CZCSXM in('201','201A') ) as a group by a.ZQ_6 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_9_201": sSQL_26 = string.Format(@" select a.ZQ_9 as ZQ from ( select (substr(ZLDWDM,1,9)||'_'||substr(QSDWDM,1,9)) as ZQ_9 from {0} where FRDBS='1' and Length(ZLDWDM)>=9 and Length(QSDWDM)>=9 and CZCSXM in('201','201A') ) as a group by a.ZQ_9 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_12_201": sSQL_26 = string.Format(@" select a.ZQ_12 as ZQ from ( select (substr(ZLDWDM,1,12)||'_'||substr(QSDWDM,1,12)) as ZQ_12 from {0} where FRDBS='1' and Length(ZLDWDM)>=12 and Length(QSDWDM)>=12 and CZCSXM in('201','201A') ) as a group by a.ZQ_12 ", sTableName_ZKJCTJB_Gq_26); break; #endregion #region 202的 case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_6_202": sSQL_26 = string.Format(@" select a.ZQ_6 as ZQ from ( select (substr(ZLDWDM,1,6)||'_'||substr(QSDWDM,1,6)) as ZQ_6 from {0} where FRDBS='1' and Length(ZLDWDM)>=6 and Length(QSDWDM)>=6 and CZCSXM in('202','202A') ) as a group by a.ZQ_6 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_9_202": sSQL_26 = string.Format(@" select a.ZQ_9 as ZQ from ( select (substr(ZLDWDM,1,9)||'_'||substr(QSDWDM,1,9)) as ZQ_9 from {0} where FRDBS='1' and Length(ZLDWDM)>=9 and Length(QSDWDM)>=9 and CZCSXM in('202','202A') ) as a group by a.ZQ_9 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_12_202": sSQL_26 = string.Format(@" select a.ZQ_12 as ZQ from ( select (substr(ZLDWDM,1,12)||'_'||substr(QSDWDM,1,12)) as ZQ_12 from {0} where FRDBS='1' and Length(ZLDWDM)>=12 and Length(QSDWDM)>=12 and CZCSXM in('202','202A') ) as a group by a.ZQ_12 ", sTableName_ZKJCTJB_Gq_26); break; #endregion #region 203的 case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_6_203": sSQL_26 = string.Format(@" select a.ZQ_6 as ZQ from ( select (substr(ZLDWDM,1,6)||'_'||substr(QSDWDM,1,6)) as ZQ_6 from {0} where FRDBS='1' and Length(ZLDWDM)>=6 and Length(QSDWDM)>=6 and CZCSXM in('203','203A') ) as a group by a.ZQ_6 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_9_203": sSQL_26 = string.Format(@" select a.ZQ_9 as ZQ from ( select (substr(ZLDWDM,1,9)||'_'||substr(QSDWDM,1,9)) as ZQ_9 from {0} where FRDBS='1' and Length(ZLDWDM)>=9 and Length(QSDWDM)>=9 and CZCSXM in('203','203A') ) as a group by a.ZQ_9 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_12_203": sSQL_26 = string.Format(@" select a.ZQ_12 as ZQ from ( select (substr(ZLDWDM,1,12)||'_'||substr(QSDWDM,1,12)) as ZQ_12 from {0} where FRDBS='1' and Length(ZLDWDM)>=12 and Length(QSDWDM)>=12 and CZCSXM in('203','203A') ) as a group by a.ZQ_12 ", sTableName_ZKJCTJB_Gq_26); break; #endregion #region 204的 case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_6_204": sSQL_26 = string.Format(@" select a.ZQ_6 as ZQ from ( select (substr(ZLDWDM,1,6)||'_'||substr(QSDWDM,1,6)) as ZQ_6 from {0} where FRDBS='1' and Length(ZLDWDM)>=6 and Length(QSDWDM)>=6 and CZCSXM='204' ) as a group by a.ZQ_6 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_9_204": sSQL_26 = string.Format(@" select a.ZQ_9 as ZQ from ( select (substr(ZLDWDM,1,9)||'_'||substr(QSDWDM,1,9)) as ZQ_9 from {0} where FRDBS='1' and Length(ZLDWDM)>=9 and Length(QSDWDM)>=9 and CZCSXM='204' ) as a group by a.ZQ_9 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_12_204": sSQL_26 = string.Format(@" select a.ZQ_12 as ZQ from ( select (substr(ZLDWDM,1,12)||'_'||substr(QSDWDM,1,12)) as ZQ_12 from {0} where FRDBS='1' and Length(ZLDWDM)>=12 and Length(QSDWDM)>=12 and CZCSXM='204' ) as a group by a.ZQ_12 ", sTableName_ZKJCTJB_Gq_26); break; #endregion #region 205的 case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_6_205": sSQL_26 = string.Format(@" select a.ZQ_6 as ZQ from ( select (substr(ZLDWDM,1,6)||'_'||substr(QSDWDM,1,6)) as ZQ_6 from {0} where FRDBS='1' and Length(ZLDWDM)>=6 and Length(QSDWDM)>=6 and CZCSXM='205' ) as a group by a.ZQ_6 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_9_205": sSQL_26 = string.Format(@" select a.ZQ_9 as ZQ from ( select (substr(ZLDWDM,1,9)||'_'||substr(QSDWDM,1,9)) as ZQ_9 from {0} where FRDBS='1' and Length(ZLDWDM)>=9 and Length(QSDWDM)>=9 and CZCSXM='205' ) as a group by a.ZQ_9 ", sTableName_ZKJCTJB_Gq_26); break; case "FRDCZCJGKYD_ZLDWDM_QSDWDM_All_12_205": sSQL_26 = string.Format(@" select a.ZQ_12 as ZQ from ( select (substr(ZLDWDM,1,12)||'_'||substr(QSDWDM,1,12)) as ZQ_12 from {0} where FRDBS='1' and Length(ZLDWDM)>=12 and Length(QSDWDM)>=12 and CZCSXM='205' ) as a group by a.ZQ_12 ", sTableName_ZKJCTJB_Gq_26); break; #endregion default: sSQL_26 = ""; break; } if (string.IsNullOrWhiteSpace(sSQL_26) == true) { return null; } DataTable dt_Msg_26 = rdbHelper.ExecuteDatatable("Get_" + sTableName_ZKJCTJB_Gq_26, sSQL_26, true); if (dt_Msg_26 == null || dt_Msg_26.Rows.Count <= 0) { return null; } List sList_26 = new List(); string sTemp_26 = ""; for (int i = 0; i < dt_Msg_26.Rows.Count; i++) { sTemp_26 = ExtendMethd.GetStringByObject(dt_Msg_26.Rows[i]["ZQ"] as object).Trim(); if (string.IsNullOrWhiteSpace(sTemp_26) == false) { sList_26.Add(sTemp_26); } } return sList_26; } catch (Exception ex) { LogAPI.Debug("获取 有飞入地城镇村及工矿用地数据的坐落单位及权属单位 对照信息(请求类型为" + sType + ") 时失败,异常原因: " + ex + " ; "); return null; } } #endregion } }