Mybatis和oracle查询结果错误

时间:2016-07-05 00:05:35

标签: java oracle mybatis

使用mybatis,但是sql失败 但sqldeveloper,它运作良好....
我该怎么办?

这是日志。

DEBUG [http-bio-8080-exec-3] - ==>参数:2016-07-04(String),2016-07-04(String)
[2016-07-05 08:57:49] [DEBUG]
「「org.apache.ibatis.logging.jdbc.PreparedStatementLogger:invoke(72)」经过时间[0:00:00.000]

select A.REG_NO as REG_NO,
       C.CUSTOMER_IDENTIFIER as CUSTOMER_IDENTIFIER,
       C.NAME as NAME,
       B.ORG_NM as ORG_NM,
       A.TEL_NO as TEL_NO,
       to_date(A.BIRTH_DT,'yyyymmdd') as BIRTH_DT,
       C.APP_VERSION as APP_VERSION,
       to_date(A.REG_DT,'yyyy-mm-dd') as REG_DT,
       to_date(A.NOTI_DT,'yyyy-mm-dd') as NOTI_DT,
       to_date(A.CNFRM_DT,'yyyy-mm-dd') as CNFRM_DT,
       A.CNFRM_TM as CNFRM_TM,
       to_char(C.LAST_LOGIN_DATE,'yyyy-mm-dd:hh:mm:ss') as last_login_date
  from smtc_patmst a,smtc_orgmst b,smtc_customer c
  where  to_char(C.LAST_LOGIN_DATE,'yyyy-mm-dd') between  '2016-07-04' /**P*/ and  '2016-07-04' /**P*/
    and A.ORG_CD=B.ORG_CD
    and a.TEL_NO=CRYPTO_AES256.DEC_AES(c.PHONE_NUMBER)
    and A.CNFRM_DT != ' '
  order by C.LAST_LOGIN_DATE DESC

查询结果[]:-1row

这是我的sql。

[select A.REG_NO as REG_NO,
        C.CUSTOMER_IDENTIFIER as CUSTOMER_IDENTIFIER,
        C.NAME as NAME,
        B.ORG_NM as ORG_NM,
        A.TEL_NO as TEL_NO,
        to_date(A.BIRTH_DT,'yyyymmdd') as BIRTH_DT,
        C.APP_VERSION as APP_VERSION,
        to_date(A.REG_DT,'yyyy-mm-dd') as REG_DT,
        to_date(A.NOTI_DT,'yyyy-mm-dd') as NOTI_DT,
        to_date(A.CNFRM_DT,'yyyy-mm-dd') as CNFRM_DT,
        A.CNFRM_TM as CNFRM_TM, 
        to_char(C.LAST_LOGIN_DATE,'yyyy-mm-dd:hh:mm:ss') as last_login_date 
  from smtc_patmst a,smtc_orgmst b,smtc_customer c  
  where to_char(C.LAST_LOGIN_DATE,'yyyy-mm-dd') between #{startdate,jdbcType=VARCHAR} and #{enddate,jdbcType=VARCHAR}
    and A.ORG_CD = B.ORG_CD
    and a.TEL_NO=CRYPTO_AES256.DEC_AES(c.PHONE_NUMBER)
    and A.CNFRM_DT != ' ' 
  order by C.LAST_LOGIN_DATE DESC]

和我的servlet

[String startdate = request.getParameter("startdate");
 String enddate = request.getParameter("enddate");

 if(startdate==null){
   SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
   startdate = sdf.format(new Date());
   enddate = sdf.format(new Date());
   }

 session.insert("McDownload.getMcDownloadList","2016-07-04");
 session.insert("McDownload.getMcDownloadList","2016-07-04");

 List<McDownload> mcdownload = session.selectList("McDownload.getMcDownloadList");

 Gson gson = new GsonBuilder().create();

 String arrayListToJson = gson.toJson(mcdownload);

 response.setContentType("text/html;charset=UTF-8");

 PrintWriter out = response.getWriter();
 out.print(arrayListToJson);
 out.flush();]

0 个答案:

没有答案