Commit 06522649 by s_guodong

fix bug- sqlDate

parent 570fc5ff
...@@ -36,7 +36,6 @@ import java.net.URLEncoder; ...@@ -36,7 +36,6 @@ import java.net.URLEncoder;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.sql.Timestamp;
import java.text.*; import java.text.*;
import java.util.*; import java.util.*;
import java.util.concurrent.Semaphore; import java.util.concurrent.Semaphore;
...@@ -586,23 +585,20 @@ public class MdaUtils { ...@@ -586,23 +585,20 @@ public class MdaUtils {
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
c.setTime(date); c.setTime(date);
switch (type) { switch (type) {
case DESC:
case GE: case GE:
c.set(11, 23); case GT:
c.set(12, 59);
c.set(13, 59);
c.set(14, 999);
if (type == OpType.LT)
return new Timestamp(c.getTime().getTime());
return new Date(c.getTime().getTime());
case BETWEEN:
case EQ: case EQ:
c.set(11, 0); c.set(11, 0);
c.set(12, 0); c.set(12, 0);
c.set(13, 0); c.set(13, 0);
c.set(14, 0); c.set(14, 0);
if (type == OpType.GT) return new Date(c.getTime().getTime());
return new Timestamp(c.getTime().getTime()); case LT:
case LE:
c.set(11, 23);
c.set(12, 59);
c.set(13, 59);
c.set(14, 999);
return new Date(c.getTime().getTime()); return new Date(c.getTime().getTime());
} }
return date; return date;
......
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