Browse Source

计数器SQL调整

章政 6 years ago
parent
commit
aa2a72dc4a

+ 3 - 3
UAS-MES/CustomControl/TextBoxWithIcon/SourceStepCount.cs

@@ -86,7 +86,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         public void Start()
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>sysdate-to_char(sysdate,'hh24')/24 and ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
             SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='"+User.UserCode+"' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
@@ -100,8 +100,8 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         private void CountRefresh_Tick(object sender, EventArgs e)
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>sysdate-to_char(sysdate,'hh24')/24 and ";
-            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "'and mp_inman='" + User.UserCode + "' ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
+            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
         }

+ 4 - 3
UAS_MES_NEW/CustomControl/TextBoxWithIcon/SourceStepCount.cs

@@ -83,9 +83,10 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
             //五分钟刷新一次
             CountRefresh.Interval = 60000;
         }
+
         public void Start()
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>sysdate-to_char(sysdate,'hh24')/24 and ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
             SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
@@ -99,8 +100,8 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
 
         private void CountRefresh_Tick(object sender, EventArgs e)
         {
-            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>sysdate-to_char(sysdate,'hh24')/24 and ";
-            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "'and mp_inman='" + User.UserCode + "' ";
+            string SQL = "select count(distinct mp_sncode) from makeprocess where mp_indate>trunc(sysdate) and ";
+            SQL += "mp_sourcecode='" + Source1 + "' and mp_linecode='" + LineCode1 + "' and mp_stepcode='" + StepCode1 + "' and mp_inman='" + User.UserCode + "' ";
             DataTable dt = (DataTable)Dh.ExecuteSql(SQL, "select");
             Count.Text = "计数:" + dt.Rows[0][0].ToString();
         }