Commit 06522649 by s_guodong

fix bug- sqlDate

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