计算断面达标情况
来源:互联网 发布:require.js干嘛的 编辑:程序博客网 时间:2024/04/27 15:41
public string LoadControlRate(int year, int month, string province, string stationType = "省份")
{
var monidata = efhelper.FindAll<T_DATA_RiverMonitorMonth>().Where(t => t.Year == year && t.Month == month);//t.SectionCode == "110000_0001".OrderByDescending(t => t.Month)
var target=efhelper.FindAll<T_BAS_WaterTarget>().Where(t=>t.Year==year);
var data=(from m in monidata
join t in target on m.SectionCode equals t.Sectioncode
select new
{
m.SectionCode,
m.Province,
m.Year,
m.DissolutionO,
KMn = m.KMn,
m.ChemistryO,
m.BOD5,
m.NH4N,
m.P,
m.N,
m.Cu,
m.Zn,
m.Fluoride,
m.Se,
m.AsAs,
m.Hg,
m.Cd,
m.Cr6,
m.Pb,
m.Cyanide,
m.Volatilization,
m.Petroleum,
m.AnSurfactant,
m.SX,
m.EscherichiaColi,
WaterType=t.TargetLevel,
specialOne=t.SpecialItem,
specialTwo=t.SpecialItem2,
valueOne = t.SpecialValue,
valueTwo = t.SpecialValue2
}).ToList();
var s1 = data;
var datas = from m in data
select new
{
m.SectionCode,
m.Province,
m.Year,
DissolutionO = Convert.ToDecimal((m.DissolutionO.IndexOf("L") > -1 || m.DissolutionO.IndexOf("#") > -1 || m.DissolutionO.IndexOf("E") > -1) ? "0" : m.DissolutionO),
KMn = Convert.ToDecimal((m.KMn.IndexOf("L") > -1 || m.KMn.IndexOf("#") > -1 || m.KMn.IndexOf("E") > -1) ? "0" : m.KMn),
ChemistryO = Convert.ToDecimal((m.ChemistryO.IndexOf("L") > -1 || m.ChemistryO.IndexOf("#") > -1 || m.ChemistryO.IndexOf("E") > -1) ? "0" : m.ChemistryO),
BOD5 = Convert.ToDecimal((m.BOD5.IndexOf("L") > -1 || m.BOD5.IndexOf("#") > -1 || m.BOD5.IndexOf("E") > -1) ? "0" : m.BOD5),
NH4N = Convert.ToDecimal((m.NH4N.IndexOf("L") > -1 || m.NH4N.IndexOf("#") > -1 || m.NH4N.IndexOf("E") > -1) ? "0" : m.NH4N),
P = Convert.ToDecimal((m.P.IndexOf("L") > -1 || m.P.IndexOf("#") > -1 || m.P.IndexOf("E") > -1) ? "0" : m.P),
N = Convert.ToDecimal((m.N.IndexOf("L") > -1 || m.N.IndexOf("#") > -1 || m.N.IndexOf("E") > -1) ? "0" : m.N),
Cu = Convert.ToDecimal((m.Cu.IndexOf("L") > -1 || m.Cu.IndexOf("#") > -1 || m.Cu.IndexOf("E") > -1) ? "0" : m.Cu),
Zn = Convert.ToDecimal((m.Zn.IndexOf("L") > -1 || m.Zn.IndexOf("#") > -1 || m.Zn.IndexOf("E") > -1) ? "0" : m.Zn),
Fluoride = Convert.ToDecimal((m.Fluoride.IndexOf("L") > -1 || m.Fluoride.IndexOf("#") > -1 || m.Fluoride.IndexOf("E") > -1) ? "0" : m.Fluoride),
Se = Convert.ToDecimal((m.Se.IndexOf("L") > -1 || m.Se.IndexOf("#") > -1 || m.Se.IndexOf("#") > -1 || m.Se.IndexOf("E") > -1) ? "0" : m.Se),
AsAs = Convert.ToDecimal((m.AsAs.IndexOf("L") > -1 || m.AsAs.IndexOf("#") > -1 || m.AsAs.IndexOf("E") > -1) ? "0" : m.AsAs),
Hg = Convert.ToDecimal((m.Hg.IndexOf("L") > -1 || m.Hg.IndexOf("#") > -1 || m.Hg.IndexOf("E") > -1) ? "0" : m.Hg),
Cd = Convert.ToDecimal((m.Cd.IndexOf("L") > -1 || m.Cd.IndexOf("#") > -1 || m.Cd.IndexOf("E") > -1) ? "0" : m.Cd),
Cr6 = Convert.ToDecimal((m.Cr6.IndexOf("L") > -1 || m.Cr6.IndexOf("#") > -1 || m.Cr6.IndexOf("E") > -1) ? "0" : m.Cr6),
Pb = Convert.ToDecimal((m.Pb.IndexOf("L") > -1 || m.Pb.IndexOf("#") > -1 || m.Pb.IndexOf("E") > -1) ? "0" : m.Pb),
Cyanide = Convert.ToDecimal((m.Cyanide.IndexOf("L") > -1 || m.Cyanide.IndexOf("#") > -1 || m.Cyanide.IndexOf("E") > -1) ? "0" : m.Cyanide),
Volatilization = Convert.ToDecimal((m.Volatilization.IndexOf("L") > -1 || m.Volatilization.IndexOf("#") > -1 || m.Volatilization.IndexOf("E") > -1) ? "0" : m.Volatilization),
Petroleum = Convert.ToDecimal((m.Petroleum.IndexOf("L") > -1 || m.Petroleum.IndexOf("#") > -1 || m.Petroleum.IndexOf("E") > -1) ? "0" : m.Petroleum),
AnSurfactant = Convert.ToDecimal((m.AnSurfactant.IndexOf("L") > -1 || m.AnSurfactant.IndexOf("#") > -1 || m.AnSurfactant.IndexOf("E") > -1) ? "0" : m.AnSurfactant),
SX = Convert.ToDecimal((m.SX.IndexOf("L") > -1 || m.SX.IndexOf("#") > -1 || m.SX.IndexOf("E") > -1) ? "0" : m.SX),
EscherichiaColi = Convert.ToDecimal((m.EscherichiaColi.IndexOf("L") > -1 || m.EscherichiaColi.IndexOf("#") > -1 || m.EscherichiaColi.IndexOf("E") > -1) ? "0" : m.EscherichiaColi),
m.WaterType,
m.specialOne,
m.specialTwo,
m.valueOne,
m.valueTwo
};
var d1 = datas.ToList();
var dd=0;
List<WaterQualityType> list = new List<WaterQualityType>();
//达标
foreach (var item in datas)
{
list.Add(new WaterQualityType
{
SectionCode = item.SectionCode,
Province=item.Province,
Type = WaterQualityType.GetSectionStandard(item.DissolutionO, item.KMn, item.ChemistryO, item.BOD5, item.NH4N, item.P
, item.N, item.Cu, item.Zn, item.Fluoride, item.Se, item.AsAs, item.Hg, item.Cd, item.Cr6, item.Pb, item.Cyanide
, item.Volatilization, item.Petroleum, item.AnSurfactant, item.SX, item.EscherichiaColi, 1, item.WaterType.Value
, item.specialOne, item.specialTwo, item.valueOne, item.valueTwo)
});
}
List<ControlRate> ctrl = new List<ControlRate>();
var ll = list.GroupBy(t =>t.Province).Select(t => new ControlRate
{
code=t.Key,
upStd=t.Where(x=>x.Type==0).Count(),
subStd = t.Where(x => x.Type == 1).Count(),
upsub=t.Count(),
rate = Convert.ToDecimal(t.Where(x => x.Type == 0).Count()) / Convert.ToDecimal(t.Count())
}).ToList();
return ll.ToJson();
}
{
var monidata = efhelper.FindAll<T_DATA_RiverMonitorMonth>().Where(t => t.Year == year && t.Month == month);//t.SectionCode == "110000_0001".OrderByDescending(t => t.Month)
var target=efhelper.FindAll<T_BAS_WaterTarget>().Where(t=>t.Year==year);
var data=(from m in monidata
join t in target on m.SectionCode equals t.Sectioncode
select new
{
m.SectionCode,
m.Province,
m.Year,
m.DissolutionO,
KMn = m.KMn,
m.ChemistryO,
m.BOD5,
m.NH4N,
m.P,
m.N,
m.Cu,
m.Zn,
m.Fluoride,
m.Se,
m.AsAs,
m.Hg,
m.Cd,
m.Cr6,
m.Pb,
m.Cyanide,
m.Volatilization,
m.Petroleum,
m.AnSurfactant,
m.SX,
m.EscherichiaColi,
WaterType=t.TargetLevel,
specialOne=t.SpecialItem,
specialTwo=t.SpecialItem2,
valueOne = t.SpecialValue,
valueTwo = t.SpecialValue2
}).ToList();
var s1 = data;
var datas = from m in data
select new
{
m.SectionCode,
m.Province,
m.Year,
DissolutionO = Convert.ToDecimal((m.DissolutionO.IndexOf("L") > -1 || m.DissolutionO.IndexOf("#") > -1 || m.DissolutionO.IndexOf("E") > -1) ? "0" : m.DissolutionO),
KMn = Convert.ToDecimal((m.KMn.IndexOf("L") > -1 || m.KMn.IndexOf("#") > -1 || m.KMn.IndexOf("E") > -1) ? "0" : m.KMn),
ChemistryO = Convert.ToDecimal((m.ChemistryO.IndexOf("L") > -1 || m.ChemistryO.IndexOf("#") > -1 || m.ChemistryO.IndexOf("E") > -1) ? "0" : m.ChemistryO),
BOD5 = Convert.ToDecimal((m.BOD5.IndexOf("L") > -1 || m.BOD5.IndexOf("#") > -1 || m.BOD5.IndexOf("E") > -1) ? "0" : m.BOD5),
NH4N = Convert.ToDecimal((m.NH4N.IndexOf("L") > -1 || m.NH4N.IndexOf("#") > -1 || m.NH4N.IndexOf("E") > -1) ? "0" : m.NH4N),
P = Convert.ToDecimal((m.P.IndexOf("L") > -1 || m.P.IndexOf("#") > -1 || m.P.IndexOf("E") > -1) ? "0" : m.P),
N = Convert.ToDecimal((m.N.IndexOf("L") > -1 || m.N.IndexOf("#") > -1 || m.N.IndexOf("E") > -1) ? "0" : m.N),
Cu = Convert.ToDecimal((m.Cu.IndexOf("L") > -1 || m.Cu.IndexOf("#") > -1 || m.Cu.IndexOf("E") > -1) ? "0" : m.Cu),
Zn = Convert.ToDecimal((m.Zn.IndexOf("L") > -1 || m.Zn.IndexOf("#") > -1 || m.Zn.IndexOf("E") > -1) ? "0" : m.Zn),
Fluoride = Convert.ToDecimal((m.Fluoride.IndexOf("L") > -1 || m.Fluoride.IndexOf("#") > -1 || m.Fluoride.IndexOf("E") > -1) ? "0" : m.Fluoride),
Se = Convert.ToDecimal((m.Se.IndexOf("L") > -1 || m.Se.IndexOf("#") > -1 || m.Se.IndexOf("#") > -1 || m.Se.IndexOf("E") > -1) ? "0" : m.Se),
AsAs = Convert.ToDecimal((m.AsAs.IndexOf("L") > -1 || m.AsAs.IndexOf("#") > -1 || m.AsAs.IndexOf("E") > -1) ? "0" : m.AsAs),
Hg = Convert.ToDecimal((m.Hg.IndexOf("L") > -1 || m.Hg.IndexOf("#") > -1 || m.Hg.IndexOf("E") > -1) ? "0" : m.Hg),
Cd = Convert.ToDecimal((m.Cd.IndexOf("L") > -1 || m.Cd.IndexOf("#") > -1 || m.Cd.IndexOf("E") > -1) ? "0" : m.Cd),
Cr6 = Convert.ToDecimal((m.Cr6.IndexOf("L") > -1 || m.Cr6.IndexOf("#") > -1 || m.Cr6.IndexOf("E") > -1) ? "0" : m.Cr6),
Pb = Convert.ToDecimal((m.Pb.IndexOf("L") > -1 || m.Pb.IndexOf("#") > -1 || m.Pb.IndexOf("E") > -1) ? "0" : m.Pb),
Cyanide = Convert.ToDecimal((m.Cyanide.IndexOf("L") > -1 || m.Cyanide.IndexOf("#") > -1 || m.Cyanide.IndexOf("E") > -1) ? "0" : m.Cyanide),
Volatilization = Convert.ToDecimal((m.Volatilization.IndexOf("L") > -1 || m.Volatilization.IndexOf("#") > -1 || m.Volatilization.IndexOf("E") > -1) ? "0" : m.Volatilization),
Petroleum = Convert.ToDecimal((m.Petroleum.IndexOf("L") > -1 || m.Petroleum.IndexOf("#") > -1 || m.Petroleum.IndexOf("E") > -1) ? "0" : m.Petroleum),
AnSurfactant = Convert.ToDecimal((m.AnSurfactant.IndexOf("L") > -1 || m.AnSurfactant.IndexOf("#") > -1 || m.AnSurfactant.IndexOf("E") > -1) ? "0" : m.AnSurfactant),
SX = Convert.ToDecimal((m.SX.IndexOf("L") > -1 || m.SX.IndexOf("#") > -1 || m.SX.IndexOf("E") > -1) ? "0" : m.SX),
EscherichiaColi = Convert.ToDecimal((m.EscherichiaColi.IndexOf("L") > -1 || m.EscherichiaColi.IndexOf("#") > -1 || m.EscherichiaColi.IndexOf("E") > -1) ? "0" : m.EscherichiaColi),
m.WaterType,
m.specialOne,
m.specialTwo,
m.valueOne,
m.valueTwo
};
var d1 = datas.ToList();
var dd=0;
List<WaterQualityType> list = new List<WaterQualityType>();
//达标
foreach (var item in datas)
{
list.Add(new WaterQualityType
{
SectionCode = item.SectionCode,
Province=item.Province,
Type = WaterQualityType.GetSectionStandard(item.DissolutionO, item.KMn, item.ChemistryO, item.BOD5, item.NH4N, item.P
, item.N, item.Cu, item.Zn, item.Fluoride, item.Se, item.AsAs, item.Hg, item.Cd, item.Cr6, item.Pb, item.Cyanide
, item.Volatilization, item.Petroleum, item.AnSurfactant, item.SX, item.EscherichiaColi, 1, item.WaterType.Value
, item.specialOne, item.specialTwo, item.valueOne, item.valueTwo)
});
}
List<ControlRate> ctrl = new List<ControlRate>();
var ll = list.GroupBy(t =>t.Province).Select(t => new ControlRate
{
code=t.Key,
upStd=t.Where(x=>x.Type==0).Count(),
subStd = t.Where(x => x.Type == 1).Count(),
upsub=t.Count(),
rate = Convert.ToDecimal(t.Where(x => x.Type == 0).Count()) / Convert.ToDecimal(t.Count())
}).ToList();
return ll.ToJson();
}
0 0
- 计算断面达标情况
- 南方CASS工程应用--道路断面土方计算实例教程
- 只有点坐标的情况下如何利用Arcgis获取河道断面
- 水环境学——显式差分 计算均匀河段各断面BOD变化
- 断面快照 scada系统
- 铁路环评不达标
- 取前30分钟断面数据
- flex河流断面高亮闪烁
- SQL Server 计算表增长情况
- ARM中RAM占用情况的计算
- 云计算 常见问题案例汇总情况
- Linux实际内存使用情况计算
- freeRTOS计算任务堆栈使用情况:
- 【阿迪达斯男士沐浴露被检未达标:去污力不佳】
- 据国家概况人不达标的
- 有没有可以达标的牛人
- 你的运营思维达标了吗?
- 端子断面检测分析仪XDT-620E
- oracle 数据库函数
- easyui 的datagrid合并行或者列
- System.Data.OracleClient需要Orac…
- 关于数据库获取前几行不同数据库的…
- oracle中start with con…
- 计算断面达标情况
- C#基础知识_判断一个年份是不是闰…
- C#基础知识_根据输入的年月得到该…
- 在线HA集群HANA版本从122.01升级到122.05版本问题记录
- Ubuntu 14.04(LTS)下Docker安装
- C#中小数点后保留两位小数,四舍五…
- Oracle之物化视图
- CentOS 64-bit下安装JDK和Tomcat并设置Tomcat开机启动操作步骤
- Leetcode 462