Commit e3033bac by 高显刚

自动服务修改

parent 7b8a4cca
using Adf.Core.Db; using Adf.Core.Db;
...@@ -187,6 +187,13 @@ namespace CompanyServer ...@@ -187,6 +187,13 @@ namespace CompanyServer
//{// 暂时注释 //{// 暂时注释
//查询苗子(关联两个以上的疾病) //查询苗子(关联两个以上的疾病)
seleseedling(); seleseedling();
//MDataTable tempmiaomessage1 = DbService.GetTable("adf_datadic", 0, "diccode = 'miaomessage' ") ?? new MDataTable();
//string miaomessage1 = tempmiaomessage1.Rows[0].Get("dicvalue", "");
//DoQLetterAllSent(con, "17596500427,18964275156", miaomessage1);
//return;
//同步到政务云 //同步到政务云
#region 教学日 #region 教学日
...@@ -356,37 +363,37 @@ namespace CompanyServer ...@@ -356,37 +363,37 @@ namespace CompanyServer
if (teachingdata.Rows.Count > 0) if (teachingdata.Rows.Count > 0)
{ {
#region 教学日期间日报短信 #region 教学日期间日报短信
if ((DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:54:59") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:56:00"))) //if ((DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:54:59") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:56:00")))
{ //{
try // try
{ // {
MDataTable dayReport1 = GetDayList(con, 0) ?? new MDataTable(); // MDataTable dayReport1 = GetDayList(con, 0) ?? new MDataTable();
#region 数据 // #region 数据
int erCount = 1; // int erCount = 1;
string curAnswer = string.Empty; // string curAnswer = string.Empty;
int allcount = dayReport1.Rows.Count; // int allcount = dayReport1.Rows.Count;
foreach (MDataRow er1 in dayReport1.Rows) // foreach (MDataRow er1 in dayReport1.Rows)
{ // {
if (allcount == erCount) // if (allcount == erCount)
{ // {
break; // break;
} // }
curAnswer += er1.Get("message", "").ToString(); // curAnswer += er1.Get("message", "").ToString();
erCount++; // erCount++;
} // }
string bottommes = string.Empty; // string bottommes = string.Empty;
bottommes = dayReport1.Rows[allcount - 1].Get("message", ""); // bottommes = dayReport1.Rows[allcount - 1].Get("message", "");
curAnswer = curAnswer + "\n" + bottommes; // curAnswer = curAnswer + "\n" + bottommes;
#endregion // #endregion
DoSentAllDayReport(con, mrsprphone, curAnswer, "因病数据报送群"); // DoSentAllDayReport(con, mrsprphone, curAnswer, "因病数据报送群");
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
LogHelper.WriteLog(DateTime.Now.ToString() + "10:00短信报错:" + ex.ToString()); // LogHelper.WriteLog(DateTime.Now.ToString() + "10:00短信报错:" + ex.ToString());
} // }
} //}
if ((DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 14:54:59") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 14:56:00"))) if ((DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 14:54:59") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 14:56:00")))
{ {
try try
...@@ -639,37 +646,37 @@ namespace CompanyServer ...@@ -639,37 +646,37 @@ namespace CompanyServer
#region 非教学日日报短信 短信审核人 #region 非教学日日报短信 短信审核人
if ((DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:54:59") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:56:00"))) //if ((DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:54:59") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 09:56:00")))
{ //{
try // try
{ // {
MDataTable dayReport1 = GetDayList(con, 0) ?? new MDataTable(); // MDataTable dayReport1 = GetDayList(con, 0) ?? new MDataTable();
#region 数据 // #region 数据
int erCount = 1; // int erCount = 1;
string curAnswer = string.Empty; // string curAnswer = string.Empty;
int allcount = dayReport1.Rows.Count; // int allcount = dayReport1.Rows.Count;
foreach (MDataRow er1 in dayReport1.Rows) // foreach (MDataRow er1 in dayReport1.Rows)
{ // {
if (allcount == erCount) // if (allcount == erCount)
{ // {
break; // break;
} // }
curAnswer += er1.Get("message", "").ToString(); // curAnswer += er1.Get("message", "").ToString();
erCount++; // erCount++;
} // }
string bottommes = string.Empty; // string bottommes = string.Empty;
bottommes = dayReport1.Rows[allcount - 1].Get("message", ""); // bottommes = dayReport1.Rows[allcount - 1].Get("message", "");
curAnswer = curAnswer + "\n" + bottommes; // curAnswer = curAnswer + "\n" + bottommes;
#endregion // #endregion
DoSentAllDayReport(con, mrsprphone, curAnswer); // DoSentAllDayReport(con, mrsprphone, curAnswer);
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
LogHelper.WriteLog(DateTime.Now.ToString() + "09:55短信报错:" + ex.ToString()); // LogHelper.WriteLog(DateTime.Now.ToString() + "09:55短信报错:" + ex.ToString());
} // }
} //}
if ((DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 14:54:59") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 14:56:00"))) if ((DateTime.Now > Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 14:54:59") && DateTime.Now < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd") + " 14:56:00")))
{ {
try try
...@@ -4076,7 +4083,7 @@ group by c.CountyName,c.CityName,c.CommunityName,c.SchoolCode,SchoolName,Contact ...@@ -4076,7 +4083,7 @@ group by c.CountyName,c.CityName,c.CommunityName,c.SchoolCode,SchoolName,Contact
using (MAction action = new MAction("report_standard", con)) using (MAction action = new MAction("report_standard", con))
{ {
//获取两个疾病以上苗子 //获取两个疾病以上苗子
MDataTable standard = action.Select(" isnull(DiseaseCode2,'') !='' or isnull(DiseaseCode3,'') !='' ") ?? new MDataTable(); MDataTable standard = action.Select(" isnull(DiseaseCode,'') !='' or isnull(DiseaseCode2,'') !='' or isnull(DiseaseCode3,'') !='' ") ?? new MDataTable();
foreach (MDataRow onestandard in standard.Rows) foreach (MDataRow onestandard in standard.Rows)
{ {
string StandardCode = onestandard.Get("StandardCode", "");//标准编号 string StandardCode = onestandard.Get("StandardCode", "");//标准编号
...@@ -4094,7 +4101,7 @@ group by c.CountyName,c.CityName,c.CommunityName,c.SchoolCode,SchoolName,Contact ...@@ -4094,7 +4101,7 @@ group by c.CountyName,c.CityName,c.CommunityName,c.SchoolCode,SchoolName,Contact
string StandardOrder = onestandard.Get("StandardOrder", "");//标准序号 string StandardOrder = onestandard.Get("StandardOrder", "");//标准序号
if (StandardType == "校级") if (StandardType == "校级")
{ {
if (!string.IsNullOrEmpty(DiseaseCode2) && !string.IsNullOrEmpty(DiseaseCode3)) if (!string.IsNullOrEmpty(DiseaseCode2) || !string.IsNullOrEmpty(DiseaseCode3))
{ {
#region 关联三个疾病 #region 关联三个疾病
//某个学校多少人发病 //某个学校多少人发病
...@@ -4104,7 +4111,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode ...@@ -4104,7 +4111,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode
where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @"-1 --在这区间内最近的几天 and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @"-1 --在这区间内最近的几天
group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName
having COUNT(1)=3 having COUNT(1)=2
)x001 group by SchoolCode )x001 group by SchoolCode
"; ";
action.ResetTable(sql); action.ResetTable(sql);
...@@ -4128,7 +4135,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode ...@@ -4128,7 +4135,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode
where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and AbsenceDate= CONVERT(varchar(10),GETDATE(),120) and SchoolCode='" + schoolcode + @"' and AbsenceDate= CONVERT(varchar(10),GETDATE(),120) and SchoolCode='" + schoolcode + @"'
group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName
having COUNT(1)=3"; having COUNT(1)=2";
action.ResetTable(todaysql); action.ResetTable(todaysql);
if (action.Select().Rows.Count > 0) if (action.Select().Rows.Count > 0)
{ {
...@@ -4171,7 +4178,7 @@ from report_absencedetail a inner join Report_Student_Absence b on a.AbsenceCode ...@@ -4171,7 +4178,7 @@ from report_absencedetail a inner join Report_Student_Absence b on a.AbsenceCode
where (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @" and SchoolCode='" + schoolcode + @"' and Casenature='新发' --在这区间内最近的几天 and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @" and SchoolCode='" + schoolcode + @"' and Casenature='新发' --在这区间内最近的几天
group by b.AbsenceCode,SchoolCode,AbsenceDate,Grade,Class,OtherGrade,Gender,StudentName,Age,Casenature,CaseStatus,Remark,AbsenceNumber,Disease,OtherDisease,Symptom,OtherSymptom,Hurt,OtherHurt,Degree,ReprotCode,CreateDate,CreateUserCode,ModifyDate,ModifyUserCode group by b.AbsenceCode,SchoolCode,AbsenceDate,Grade,Class,OtherGrade,Gender,StudentName,Age,Casenature,CaseStatus,Remark,AbsenceNumber,Disease,OtherDisease,Symptom,OtherSymptom,Hurt,OtherHurt,Degree,ReprotCode,CreateDate,CreateUserCode,ModifyDate,ModifyUserCode
having COUNT(1)=3"; having COUNT(1)=2";
action.ResetTable(SeedDetailSql); action.ResetTable(SeedDetailSql);
MDataTable SeedDetailTab = action.Select() ?? new MDataTable(); MDataTable SeedDetailTab = action.Select() ?? new MDataTable();
//插入从表 //插入从表
...@@ -4226,7 +4233,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode ...@@ -4226,7 +4233,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode
where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @"-1 --在这区间内最近的几天 and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @"-1 --在这区间内最近的几天
group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName
having COUNT(1)=2 having COUNT(1)=1
)x001 group by SchoolCode )x001 group by SchoolCode
"; ";
action.ResetTable(sql); action.ResetTable(sql);
...@@ -4250,7 +4257,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode ...@@ -4250,7 +4257,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode
where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and AbsenceDate= CONVERT(varchar(10),GETDATE(),120) and SchoolCode='" + schoolcode + @"' and AbsenceDate= CONVERT(varchar(10),GETDATE(),120) and SchoolCode='" + schoolcode + @"'
group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName
having COUNT(1)=2"; having COUNT(1)=1";
action.ResetTable(todaysql); action.ResetTable(todaysql);
if (action.Select().Rows.Count > 0) if (action.Select().Rows.Count > 0)
{ {
...@@ -4293,7 +4300,7 @@ from report_absencedetail a inner join Report_Student_Absence b on a.AbsenceCode ...@@ -4293,7 +4300,7 @@ from report_absencedetail a inner join Report_Student_Absence b on a.AbsenceCode
where (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @" and SchoolCode='" + schoolcode + @"' and Casenature='新发' --在这区间内最近的几天 and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @" and SchoolCode='" + schoolcode + @"' and Casenature='新发' --在这区间内最近的几天
group by b.AbsenceCode,SchoolCode,AbsenceDate,Grade,Class,OtherGrade,Gender,StudentName,Age,Casenature,CaseStatus,Remark,AbsenceNumber,Disease,OtherDisease,Symptom,OtherSymptom,Hurt,OtherHurt,Degree,ReprotCode,CreateDate,CreateUserCode,ModifyDate,ModifyUserCode group by b.AbsenceCode,SchoolCode,AbsenceDate,Grade,Class,OtherGrade,Gender,StudentName,Age,Casenature,CaseStatus,Remark,AbsenceNumber,Disease,OtherDisease,Symptom,OtherSymptom,Hurt,OtherHurt,Degree,ReprotCode,CreateDate,CreateUserCode,ModifyDate,ModifyUserCode
having COUNT(1)=2"; having COUNT(1)=1";
action.ResetTable(SeedDetailSql); action.ResetTable(SeedDetailSql);
MDataTable SeedDetailTab = action.Select() ?? new MDataTable(); MDataTable SeedDetailTab = action.Select() ?? new MDataTable();
//插入从表 //插入从表
...@@ -4341,7 +4348,7 @@ having COUNT(1)=2"; ...@@ -4341,7 +4348,7 @@ having COUNT(1)=2";
} }
else if (StandardType == "班级") else if (StandardType == "班级")
{ {
if (!string.IsNullOrEmpty(DiseaseCode2) && !string.IsNullOrEmpty(DiseaseCode3)) if (!string.IsNullOrEmpty(DiseaseCode2) || !string.IsNullOrEmpty(DiseaseCode3))
{ {
#region 关联三个疾病 #region 关联三个疾病
//某个学校多少人发病 //某个学校多少人发病
...@@ -4351,7 +4358,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode ...@@ -4351,7 +4358,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode
where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @"-1 --在这区间内最近的几天 and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @"-1 --在这区间内最近的几天
group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName
having COUNT(1)=3 having COUNT(1)=2
)x001 group by SchoolCode,Grade,Class )x001 group by SchoolCode,Grade,Class
"; ";
action.ResetTable(sql); action.ResetTable(sql);
...@@ -4377,7 +4384,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode ...@@ -4377,7 +4384,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode
where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and AbsenceDate= CONVERT(varchar(10),GETDATE(),120) and SchoolCode='" + schoolcode + @"' and Grade='" + Grade + @"' and Class='" + Class + @"' and AbsenceDate= CONVERT(varchar(10),GETDATE(),120) and SchoolCode='" + schoolcode + @"' and Grade='" + Grade + @"' and Class='" + Class + @"'
group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName
having COUNT(1)=3"; having COUNT(1)=2";
action.ResetTable(todaysql); action.ResetTable(todaysql);
if (action.Select().Rows.Count > 0) if (action.Select().Rows.Count > 0)
{ {
...@@ -4420,7 +4427,7 @@ from report_absencedetail a inner join Report_Student_Absence b on a.AbsenceCode ...@@ -4420,7 +4427,7 @@ from report_absencedetail a inner join Report_Student_Absence b on a.AbsenceCode
where (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @" and Casenature='新发' and SchoolCode='" + schoolcode + @"'and Grade='" + Grade + @"' and Class='" + Class + @"' --在这区间内最近的几天 and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @" and Casenature='新发' and SchoolCode='" + schoolcode + @"'and Grade='" + Grade + @"' and Class='" + Class + @"' --在这区间内最近的几天
group by b.AbsenceCode,SchoolCode,AbsenceDate,Grade,Class,OtherGrade,Gender,StudentName,Age,Casenature,CaseStatus,Remark,AbsenceNumber,Disease,OtherDisease,Symptom,OtherSymptom,Hurt,OtherHurt,Degree,ReprotCode,CreateDate,CreateUserCode,ModifyDate,ModifyUserCode group by b.AbsenceCode,SchoolCode,AbsenceDate,Grade,Class,OtherGrade,Gender,StudentName,Age,Casenature,CaseStatus,Remark,AbsenceNumber,Disease,OtherDisease,Symptom,OtherSymptom,Hurt,OtherHurt,Degree,ReprotCode,CreateDate,CreateUserCode,ModifyDate,ModifyUserCode
having COUNT(1)=3"; having COUNT(1)=2";
action.ResetTable(SeedDetailSql); action.ResetTable(SeedDetailSql);
MDataTable SeedDetailTab = action.Select() ?? new MDataTable(); MDataTable SeedDetailTab = action.Select() ?? new MDataTable();
//插入从表 //插入从表
...@@ -4475,7 +4482,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode ...@@ -4475,7 +4482,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode
where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @"-1 --在这区间内最近的几天 and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @"-1 --在这区间内最近的几天
group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName
having COUNT(1)=2 having COUNT(1)=1
)x001 group by SchoolCode,Grade,Class )x001 group by SchoolCode,Grade,Class
"; ";
action.ResetTable(sql); action.ResetTable(sql);
...@@ -4501,7 +4508,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode ...@@ -4501,7 +4508,7 @@ left join Report_Student_Absence b on a.AbsenceCode=b.AbsenceCode
where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where Casenature='新发' and (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and AbsenceDate= CONVERT(varchar(10),GETDATE(),120) and SchoolCode='" + schoolcode + @"' and Grade='" + Grade + @"' and Class='" + Class + @"' and AbsenceDate= CONVERT(varchar(10),GETDATE(),120) and SchoolCode='" + schoolcode + @"' and Grade='" + Grade + @"' and Class='" + Class + @"'
group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName group by b.AbsenceCode,b.SchoolCode,b.Grade,b.Class,b.StudentName
having COUNT(1)=2"; having COUNT(1)=1";
action.ResetTable(todaysql); action.ResetTable(todaysql);
if (action.Select().Rows.Count > 0) if (action.Select().Rows.Count > 0)
{ {
...@@ -4514,6 +4521,8 @@ having COUNT(1)=2"; ...@@ -4514,6 +4521,8 @@ having COUNT(1)=2";
action.Set("SeedlingClaim", StandardName); action.Set("SeedlingClaim", StandardName);
action.Set("SeedlingName", DiseaseCode); action.Set("SeedlingName", DiseaseCode);
action.Set("StandardTypeName", StandardTypeName); action.Set("StandardTypeName", StandardTypeName);
action.Set("Grade", Grade);
action.Set("Class", Class);
action.Set("SchoolCode", schoolcode); action.Set("SchoolCode", schoolcode);
action.Set("SchoolNumber", SchoolInfo.Get("SchoolNumber", "")); action.Set("SchoolNumber", SchoolInfo.Get("SchoolNumber", ""));
action.Set("SchoolName", SchoolInfo.Get("SchoolName", "")); action.Set("SchoolName", SchoolInfo.Get("SchoolName", ""));
...@@ -4544,7 +4553,7 @@ from report_absencedetail a inner join Report_Student_Absence b on a.AbsenceCode ...@@ -4544,7 +4553,7 @@ from report_absencedetail a inner join Report_Student_Absence b on a.AbsenceCode
where (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"') where (a.DiseaseCode='" + DiseaseCode + @"' or a.DiseaseCode='" + DiseaseCode2 + @"' or a.DiseaseCode='" + DiseaseCode3 + @"')
and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @" and Casenature='新发' and SchoolCode='" + schoolcode + @"'and Grade='" + Grade + @"' and Class='" + Class + @"' --在这区间内最近的几天 and DATEDIFF(DAY,AbsenceDate,GETDATE())<=" + StandardDay + @" and Casenature='新发' and SchoolCode='" + schoolcode + @"'and Grade='" + Grade + @"' and Class='" + Class + @"' --在这区间内最近的几天
group by b.AbsenceCode,SchoolCode,AbsenceDate,Grade,Class,OtherGrade,Gender,StudentName,Age,Casenature,CaseStatus,Remark,AbsenceNumber,Disease,OtherDisease,Symptom,OtherSymptom,Hurt,OtherHurt,Degree,ReprotCode,CreateDate,CreateUserCode,ModifyDate,ModifyUserCode group by b.AbsenceCode,SchoolCode,AbsenceDate,Grade,Class,OtherGrade,Gender,StudentName,Age,Casenature,CaseStatus,Remark,AbsenceNumber,Disease,OtherDisease,Symptom,OtherSymptom,Hurt,OtherHurt,Degree,ReprotCode,CreateDate,CreateUserCode,ModifyDate,ModifyUserCode
having COUNT(1)=2"; having COUNT(1)=1";
action.ResetTable(SeedDetailSql); action.ResetTable(SeedDetailSql);
MDataTable SeedDetailTab = action.Select() ?? new MDataTable(); MDataTable SeedDetailTab = action.Select() ?? new MDataTable();
//插入从表 //插入从表
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment