|
@@ -370,45 +370,6 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
}
|
|
|
|
|
|
#region 分页添加读取数据库函数
|
|
|
- /// <summary>
|
|
|
- /// 获取颗粒全部所需信息
|
|
|
- /// </summary>
|
|
|
- /// <param name=""></param>
|
|
|
- /// <param name=""></param>
|
|
|
- /// <returns></returns>
|
|
|
- public DataTable GetAllInfo(string condition)
|
|
|
- {
|
|
|
- string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX,FieldPosY,ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX,FieldPosY,ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = INcAData.XRayId and fieldid = INcAData.fieldid ) as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, '&'),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + condition;
|
|
|
- DataTable DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
- return DT;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 获取合并颗粒总数
|
|
|
- /// </summary>
|
|
|
- /// <param name="condition"></param>
|
|
|
- /// <returns></returns>
|
|
|
- public int GetCountOfMergedParticles(string condition)
|
|
|
- {
|
|
|
- string sqliteString = "select count(*) from MergedParticleInfo where 1=1 " + condition;
|
|
|
- DataTable DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
- int Count = int.Parse(DT.Rows[0][0].ToString());
|
|
|
- return Count;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 获取正常颗粒总数,去除组成合并颗粒的几个部分
|
|
|
- /// </summary>
|
|
|
- /// <param name="condition"></param>
|
|
|
- /// <returns></returns>
|
|
|
- public int GetCountOfParticles(string condition)
|
|
|
- {
|
|
|
- string sqliteString = "select count ( * ) from INcAData where xrayid > -1"+condition+" and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 ";
|
|
|
- DataTable DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
- int Count = int.Parse(DT.Rows[0][0].ToString());
|
|
|
- return Count;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 获取分页查询所需信息
|
|
|
/// </summary>
|
|
@@ -419,36 +380,17 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
|
|
|
{
|
|
|
int p = (currentPage - 1) * pagesize;
|
|
|
string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX as 'SEMPosX',FieldPosY as 'SEMPosY',ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX,FieldPosY,ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles,(select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = INcAData.XRayId and fieldid = INcAData.fieldid ) as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + condition + " order by " + OrderFunction + " limit " + pagesize.ToString() + " offset " + p.ToString();
|
|
|
- //SQLiteTransaction tr = dbHelper.BeginTranscation();
|
|
|
DataTable DT=new DataTable();
|
|
|
DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
return DT;
|
|
|
}
|
|
|
-
|
|
|
public DataTable GetInfoForPartucleDevidePage2(string condition)
|
|
|
- {
|
|
|
- string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX as 'SEMPosX',FieldPosY as 'SEMPosY',ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX,FieldPosY,ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles,(select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = INcAData.XRayId and fieldid = INcAData.fieldid ) as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + condition;
|
|
|
- DataTable DT = new DataTable();
|
|
|
- DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
- return DT;
|
|
|
- }
|
|
|
-
|
|
|
- public DataTable GetInfoForPartucleDevidePage3(string condition)
|
|
|
{
|
|
|
string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX as 'SEMPosX',FieldPosY as 'SEMPosY',ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,ElementNum,SegmentNum,FieldPosX,FieldPosY,ParticleId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles,'' as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + condition;
|
|
|
DataTable DT = new DataTable();
|
|
|
DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
return DT;
|
|
|
}
|
|
|
-
|
|
|
- public DataTable GetInfoForPartucleDevidePage4(string condition)
|
|
|
- {
|
|
|
- string sqliteString = "select (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = INcAData.XRayId and fieldid = INcAData.fieldid ) as Element from INcAData where xrayid > -1 " + condition;
|
|
|
- DataTable DT = new DataTable();
|
|
|
- DT = dbHelper.ExecuteQuery(sqliteString);
|
|
|
- return DT;
|
|
|
- }
|
|
|
-
|
|
|
public DataTable GetElementChemistry()
|
|
|
{
|
|
|
string sqliteString = "select * from ElementChemistry";
|