You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
819 lines
34 KiB
819 lines
34 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.Data; |
|
using System.Linq; |
|
using System.Reflection; |
|
|
|
namespace Kingo.RuleCheck |
|
{ |
|
/// <summary> |
|
/// 人工环节 |
|
/// </summary> |
|
public class WLHRGChecker |
|
{ |
|
/// <summary> |
|
/// 变更范围标识码 |
|
/// </summary> |
|
private string _bgfwbsm; |
|
|
|
/// <summary> |
|
/// db文件路径 |
|
/// </summary> |
|
private string _dbpath; |
|
|
|
/// <summary> |
|
/// 要执行规则 |
|
/// </summary> |
|
private List<string> _excuteRules { get; set; } |
|
|
|
public static List<string> DLRuleNames = new List<string>() |
|
{ |
|
"KZST001","BCGD001","ZFFL001","CJFK001","ZJGCJ001","XZGD001","GDWP001","KZST002","BCGD002","ZFFL002","GJFK002","ZJGCJ002","GDWP003","KZST003","BCGD003","ZXHS001","JCGD001","JCGD002","DDTC301","DDTC302","DDTC303","DDTC304","DDTC305","DDTC306","HCD001","DL301","DL302","DL303","GD301","GD302","GD303","GD304","GD305","SX301","SX302","SX303","JSYD301","JSYD302","JSYD303","QT301","HS001","QT302","MS001","JW001","BB001","BB002","QT303" |
|
}; |
|
|
|
public static List<string> CZCRuleNames = new List<string>() |
|
{ |
|
"CZ001","CZC301","CZC302","CZC303","CZC304","CZC305","CZC306" |
|
}; |
|
|
|
public WLHRGChecker(string bgfwsm, string db, List<string> ExcuteRules) |
|
{ |
|
_bgfwbsm = bgfwsm; |
|
_dbpath = db; |
|
_excuteRules = ExcuteRules; |
|
} |
|
|
|
/// <summary> |
|
/// 地类检查入口 |
|
/// </summary> |
|
/// <returns></returns> |
|
public string CheckDL() |
|
{ |
|
try |
|
{ |
|
return DoCheck(DLRuleNames, true); |
|
} |
|
catch (Exception ex) |
|
{ |
|
//throw ex; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// 城镇村检查入口 |
|
/// </summary> |
|
/// <returns></returns> |
|
public string CheckCZC() |
|
{ |
|
try |
|
{ |
|
return DoCheck(CZCRuleNames, true); |
|
} |
|
catch (Exception ex) |
|
{ |
|
//throw ex; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// 执行检查 |
|
/// </summary> |
|
/// <param name="ruleNames"></param> |
|
/// <param name="unique"></param> |
|
/// <returns></returns> |
|
private string DoCheck(List<string> ruleNames, bool unique) |
|
{ |
|
if (_excuteRules != null && _excuteRules.Count > 0) |
|
{ |
|
var excuteRules = _excuteRules; |
|
ruleNames = ruleNames.Intersect(excuteRules).ToList(); |
|
} |
|
foreach (var item in ruleNames) |
|
{ |
|
MethodInfo method = this.GetType().GetMethod(item, BindingFlags.NonPublic | BindingFlags.Instance); |
|
if (method != null) |
|
{ |
|
object result = method.Invoke(this, null); |
|
string ruleCode = result + string.Empty; |
|
if (!string.IsNullOrEmpty(ruleCode)) |
|
{ |
|
if (unique) |
|
return ruleCode; |
|
} |
|
} |
|
} |
|
return null; |
|
} |
|
|
|
#region 人工地类规则 |
|
|
|
private string KZST001() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A left join DTBDLTBGXGC b on a.bsm=b.BGHTBBSM where A.BSM='{_bgfwbsm}' and TBLX='KZST' and bgqdlbm not in('0101','0102','0103') and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='') and (zzsxdm<>'WG' or zzsxdm is null) group by a.bsm,a.tbmj HAVING sum(TBBGMJ)>200 or sum(TBBGMJ)/a.tbmj>=0.5"; |
|
|
|
try |
|
{ |
|
sql = $"SELECT BSM FROM DTBDLTBGX A LEFT JOIN (SELECT BGHTBBSM,SUM(TBBGMJ) AS BGMJ FROM DTBDLTBGXGC WHERE ((BGQDLBM='0102' OR BGQDLBM='0103') AND BGHDLBM='0101') OR (BGQDLBM='0103' AND BGHDLBM='0102') GROUP BY BGHTBBSM ) B ON A.BSM=B.BGHTBBSM WHERE A.BSM='{_bgfwbsm}' and ((A.DDTCBZ NOT IN ('1301','1302','1303','1304','1306','1307','1308') OR DDTCBZ IS NULL) OR A.DDTCBZ IS NULL) AND A.ZZSXDM<>'WG' AND A.DLBM IN ({DLParams.gd_dlbms}) AND (B.BGMJ/A.TBMJ>0.3 OR B.BGMJ>2000)"; |
|
// |
|
DataTable dataTable1 = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
} |
|
catch (Exception ex) |
|
{ |
|
|
|
} |
|
|
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "KZST001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string BCGD001() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A left join DTBDLTBGXGC b on a.bsm=b.BGHTBBSM where A.BSM='{_bgfwbsm}' and TBLX='BCGD' and bgqdlbm not in('0101','0102','0103') and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='') and (zzsxdm<>'WG' or zzsxdm is null) group by a.bsm,a.tbmj HAVING sum(TBBGMJ)>200 or sum(TBBGMJ)/a.tbmj>=0.5"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "BCGD001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string ZFFL001() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A left join DTBDLTBGXGC b on a.bsm=b.BGHTBBSM where A.BSM='{_bgfwbsm}' and TBLX='ZFFL' and bgqdlbm not in('0101','0102','0103') and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='') and (zzsxdm<>'WG' or zzsxdm is null) group by a.bsm,a.tbmj HAVING sum(TBBGMJ)>200 or sum(TBBGMJ)/a.tbmj>=0.5"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "ZFFL001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string CJFK001() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A left join DTBDLTBGXGC b on a.bsm=b.BGHTBBSM where A.BSM='{_bgfwbsm}' and TBLX='CJFK' and bgqdlbm not in('0101','0102','0103') and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='') and (zzsxdm<>'WG' or zzsxdm is null) group by a.bsm,a.tbmj HAVING sum(TBBGMJ)>200 or sum(TBBGMJ)/a.tbmj>=0.5"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "CJFK001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string ZJGCJ001() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A left join DTBDLTBGXGC b on a.bsm=b.BGHTBBSM where A.BSM='{_bgfwbsm}' and TBLX='ZJGCJ' and bgqdlbm not in('0101','0102','0103') and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='') and (zzsxdm<>'WG' or zzsxdm is null) group by a.bsm,a.tbmj HAVING sum(TBBGMJ)>200 or sum(TBBGMJ)/a.tbmj>=0.5"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "ZJGCJ001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string XZGD001() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A left join DTBDLTBGXGC b on a.bsm=b.BGHTBBSM where A.BSM='{_bgfwbsm}' and bgqdlbm not in('0101','0102','0103') and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='') and (zzsxdm<>'WG' or zzsxdm is null) group by a.bsm,a.tbmj HAVING sum(TBBGMJ)>200 or sum(TBBGMJ)/a.tbmj>=0.5"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "XZGD001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string GDWP001() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A where A.BSM='{_bgfwbsm}' and TBLX='GDWP' and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "GDWP001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string KZST002() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A where A.BSM='{_bgfwbsm}' and TBLX='KZST' and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='')"; ; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "KZST002"; |
|
} |
|
return null; |
|
} |
|
|
|
private string BCGD002() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A where A.BSM='{_bgfwbsm}' and TBLX='BGCG' and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "BCGD002"; |
|
} |
|
return null; |
|
} |
|
|
|
private string ZFFL002() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A where A.BSM='{_bgfwbsm}' and TBLX='ZFFL' and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "ZFFL002"; |
|
} |
|
return null; |
|
} |
|
|
|
private string GJFK002() |
|
{ |
|
string sql = sql = $"select 1 from DTBDLTBGX A where A.BSM='{_bgfwbsm}' and TBLX='GJFK' and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "GJFK002"; |
|
} |
|
return null; |
|
} |
|
|
|
private string ZJGCJ002() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A where A.BSM='{_bgfwbsm}' and TBLX='ZJGCJ' and dlbm in ('0101','0102','0103') and (ddtcbz is null or ddtcbz='')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "ZJGCJ002"; |
|
} |
|
return null; |
|
} |
|
|
|
private string GDWP003() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A where A.BSM='{_bgfwbsm}' and TBLX='GDWP'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "GDWP003"; |
|
} |
|
return null; |
|
} |
|
|
|
private string KZST003() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A where A.BSM='{_bgfwbsm}' and TBLX='KZST'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "KZST003"; |
|
} |
|
return null; |
|
} |
|
|
|
private string BCGD003() |
|
{ |
|
string sql = $"select 1 from DTBDLTBGX A where A.BSM='{_bgfwbsm}' and TBLX='BCGD'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "KZST003"; |
|
} |
|
return null; |
|
} |
|
|
|
private string ZXHS001() |
|
{ |
|
string sql = $"SELECT 1 FROM DTBDLTBGX A WHERE A.BSM='{_bgfwbsm}' AND TBLX='HSL' and (ddtcbz is null or ddtcbz='') AND A.DLBM='0303'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "ZXHS001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string JCGD001() |
|
{ |
|
string sql = $"SELECT 1 FROM DTBDLTBGX A LEFT JOIN WYRW W ON A.TBBSM=W.TBBSM WHERE W.JCDL is not null and W.JCDL<>'' AND A.BSM='{_bgfwbsm}' AND A.TBLX NOT IN('01','02','03','04','SM') and (ddtcbz is null or ddtcbz='') AND A.DLBM IN ('0101','0102','0103','01')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "JCGD001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string JCGD002() |
|
{ |
|
string sql = $"SELECT 1 FROM DTBDLTBGX A LEFT JOIN WYRW W ON A.TBBSM=W.TBBSM WHERE W.JCDL is not null and W.JCDL<>'' AND A.BSM='{_bgfwbsm}' AND A.TBLX IN('01','02','03','04','SM') and (ddtcbz is null or ddtcbz='') AND A.DLBM IN ('0101','0102','0103','01')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "JCGD002"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// 临时用地图斑检查 |
|
/// </summary> |
|
/// <param name="dr"></param> |
|
/// <returns></returns> |
|
private string DDTC301() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DDTCBZ='1301'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "DDTC301"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// 光伏板区图斑检查 |
|
/// </summary> |
|
/// <param name="dr"></param> |
|
/// <returns></returns> |
|
private string DDTC302() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DDTCBZ='1302'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "DDTC302"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// 推土区图斑检查 |
|
/// </summary> |
|
/// <returns></returns> |
|
private string DDTC303() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DDTCBZ='1303'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "DDTC303"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// 拆除未尽区图斑检查 |
|
/// </summary> |
|
/// <returns></returns> |
|
private string DDTC304() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DDTCBZ='1304'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "DDTC304"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// 荒草特征图斑检查 |
|
/// </summary> |
|
/// <returns></returns> |
|
private string DDTC305() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DDTCBZ in('1306','1307')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "DDTC305"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// 荒草特征图斑检查 |
|
/// </summary> |
|
/// <returns></returns> |
|
private string DDTC306() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DDTCBZ in('1308')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "DDTC306"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string HCD001() |
|
{ |
|
string sql = $"SELECT 1 FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM='0404'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "HCD001"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string DL301() |
|
{ |
|
string sql = $"SELECT 1 FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DDTCBZ in('1305')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "DL301"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string DL302() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM IN('1001','1002','1003','1004','1004A','1006')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "DL302"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string DL303() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM IN('1001A','1002A','1003A')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "DL303"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string GD301() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX A LEFT JOIN (SELECT BGHTBBSM,SUM(TBBGMJ) AS BGMJ FROM DTBDLTBGXGC WHERE ((BGQDLBM='0102' OR BGQDLBM='0103') AND BGHDLBM='0101') OR (BGQDLBM='0103' AND BGHDLBM='0102') GROUP BY BGHTBBSM ) B ON A.BSM=B.BGHTBBSM WHERE A.BSM='{_bgfwbsm}' and ((A.DDTCBZ NOT IN ('1301','1302','1303','1304','1306','1307','1308') OR DDTCBZ IS NULL) OR A.DDTCBZ IS NULL) AND A.ZZSXDM<>'WG' AND A.DLBM IN ({DLParams.gd_dlbms}) AND (B.BGMJ/A.TBMJ>0.3 OR B.BGMJ>2000)"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "GD301"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string GD302() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX A LEFT JOIN (SELECT BGHTBBSM,SUM(TBBGMJ) AS BGMJ FROM DTBDLTBGXGC WHERE ((BGHDLBM='0102' OR BGHDLBM='0103') AND BGQDLBM='0101') OR (BGQDLBM='0102' AND BGHDLBM='0103') GROUP BY BGHTBBSM ) B ON A.BSM=B.BGHTBBSM WHERE A.BSM='{_bgfwbsm}' and ((A.DDTCBZ NOT IN ('1301','1302','1303','1304','1306','1307','1308') OR DDTCBZ IS NULL) OR A.DDTCBZ IS NULL) AND A.ZZSXDM<>'WG' AND A.DLBM IN ({DLParams.gd_dlbms}) AND (B.BGMJ/A.TBMJ>0.3 OR B.BGMJ>2000)"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "GD302"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string GD303() |
|
{ |
|
string sql = $"SELECT 1 FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM IN ({DLParams.gd_dlbms}) AND (zzsxdm<>'WG' or zzsxdm is null) "; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "GD303"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// 撂荒耕地上图检查 |
|
/// </summary> |
|
/// <returns></returns> |
|
private string GD304() |
|
{ |
|
string sql = $"SELECT 1 FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM IN ({DLParams.gd_dlbms}) AND zzsxdm='WG' "; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "GD304"; |
|
} |
|
return null; |
|
} |
|
|
|
|
|
/// <summary> |
|
/// 荒草地上图检查 |
|
/// </summary> |
|
/// <returns></returns> |
|
private string GD305() |
|
{ |
|
string sql = $"SELECT 1 FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM='0404' AND (ZZSXDM IS NULL OR ZZSXDM='')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "GD305"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string SX301() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and (DDTCBZ NOT IN ('1301','1302','1303','1304','1306','1307','1308') OR DDTCBZ IS NULL) AND (DLBM LIKE '02%' OR DLBM in ('0301','0301K','0302','0302K','0305','0307','0307K','0403K','0404A','1104','1104A','1104K')) AND (ZZSXDM='' OR ZZSXDM IS NULL) AND TBXHDM NOT IN ('LQYD')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "SX301"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string SX302() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and (DDTCBZ NOT IN ('1301','1302','1303','1304','1306','1307','1308') OR DDTCBZ IS NULL) AND (DLBM LIKE '02%' OR DLBM in ('0301','0301K','0302','0302K','0305','0307','0307K','0403K','0404A','1104','1104A','1104K')) AND ZZSXDM='JKHF'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "SX302"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string SX303() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and (DDTCBZ NOT IN ('1301','1302','1303','1304','1306','1307','1308') OR DDTCBZ IS NULL) AND (DLBM LIKE '02%' OR DLBM in ('0301','0301K','0302','0302K','0305','0307','0307K','0403K','0404A','1104','1104A','1104K')) AND ZZSXDM='GCHF' "; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "SX303"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string JSYD301() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM IN ({DLParams.jsyd_dlbms}) AND DLBM<>'1201' AND (DDTCBZ NOT IN ('1301','1302','1303','1304','1305') OR DDTCBZ IS NULL) "; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "JSYD301"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string JSYD302() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM ='1201' AND (DDTCBZ NOT IN ('1301','1302','1303','1304') OR DDTCBZ IS NULL) "; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "JSYD302"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string JSYD303() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM ='1202' AND (DDTCBZ NOT IN ('1301','1302','1303','1304') OR DDTCBZ IS NULL) "; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "JSYD303"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string QT301() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX A LEFT JOIN (SELECT BGHTBBSM,SUM(TBBGMJ) AS BGMJ FROM DTBDLTBGXGC WHERE BGQDLBM IN ({DLParams.nyd_dlbms}) AND BGHDLBM IN ({DLParams.wlyd_dlbms}) GROUP BY BGHTBBSM ) B ON A.BSM=B.BGHTBBSM WHERE A.BSM='{_bgfwbsm}' and ((A.DDTCBZ NOT IN ('1301','1302','1303','1304') OR DDTCBZ IS NULL) OR A.DDTCBZ IS NULL) AND A.DLBM IN ({DLParams.wlyd_dlbms}) AND (B.BGMJ/A.TBMJ>0.3 OR B.BGMJ>=600)"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "QT301"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string HS001() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM ='0303' "; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "HS001"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string QT302() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and (DDTCBZ NOT IN ('1301','1302','1303','1304') OR DDTCBZ IS NULL) AND DLBM IN ({DLParams.sd_dlbms})"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "QT302"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string MS001() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM IN ('9903')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "MS001"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string JW001() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM IN ('9902')"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "JW001"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string BB001() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM IN ('9904') and (DDTCBZ = '' or DDTCBZ is null) "; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "BB001"; |
|
} |
|
return null; |
|
} |
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string BB002() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and DLBM IN ('9905') "; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "BB002"; |
|
} |
|
return null; |
|
} |
|
|
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <returns></returns> |
|
private string QT303() |
|
{ |
|
return "QT303"; |
|
} |
|
#endregion |
|
|
|
#region 人工城镇村规则 |
|
private string CZ001() |
|
{ |
|
string sql = $"SELECT BSM FROM DTBDLTBGX WHERE BSM='{_bgfwbsm}' and CZCTBBH<>'' and CZCTBBH is not null"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "CZ001"; |
|
} |
|
return null; |
|
} |
|
|
|
private string CZC301() |
|
{ |
|
string sql = $"select gx.bsm from dtbdltbgx gx left join dtbdltbgxgc gc on gx.bsm=gc.bghtbbsm where gx.bsm='{_bgfwbsm}' and bghczcsxm='202' and bgqczcsxm='201'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "CZC301"; |
|
} |
|
return null; |
|
} |
|
|
|
private string CZC302() |
|
{ |
|
string sql = $"select gx.bsm from dtbdltbgx gx left join dtbdltbgxgc gc on gx.bsm=gc.bghtbbsm where gx.bsm='{_bgfwbsm}' and bghczcsxm='203' and bgqczcsxm='201'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "CZC302"; |
|
} |
|
return null; |
|
} |
|
|
|
private string CZC303() |
|
{ |
|
string sql = $"select gx.bsm from dtbdltbgx gx left join dtbdltbgxgc gc on gx.bsm=gc.bghtbbsm where gx.bsm='{_bgfwbsm}' and bghczcsxm='201' and bgqczcsxm='202'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "CZC303"; |
|
} |
|
return null; |
|
} |
|
|
|
private string CZC304() |
|
{ |
|
string sql = $"select gx.bsm from dtbdltbgx gx left join dtbdltbgxgc gc on gx.bsm=gc.bghtbbsm where gx.bsm='{_bgfwbsm}' and bghczcsxm='203' and bgqczcsxm='202'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "CZC304"; |
|
} |
|
return null; |
|
} |
|
|
|
private string CZC305() |
|
{ |
|
string sql = $"select gx.bsm from dtbdltbgx gx left join dtbdltbgxgc gc on gx.bsm=gc.bghtbbsm where gx.bsm='{_bgfwbsm}' and bghczcsxm='201' and bgqczcsxm='203'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "CZC305"; |
|
} |
|
return null; |
|
} |
|
|
|
private string CZC306() |
|
{ |
|
string sql = $"select gx.bsm from dtbdltbgx gx left join dtbdltbgxgc gc on gx.bsm=gc.bghtbbsm where gx.bsm='{_bgfwbsm}' and bghczcsxm='202' and bgqczcsxm='203'"; |
|
DataTable dataTable = Kingo.RuleCheck.CheckHelper.SQLiteDBOperate.Instance.ExceDataTable(_dbpath, sql); |
|
if (dataTable != null && dataTable.Rows.Count > 0) |
|
{ |
|
return "CZC306"; |
|
} |
|
return null; |
|
} |
|
|
|
#endregion |
|
} |
|
}
|
|
|