首页 新闻 赞助 找找看

很多公司总监都改不了的三大bug

0
悬赏园豆:10 [已关闭问题] 关闭于 2016-06-25 16:57

作为我们it,值得欣慰开心的事就是改正一个又一个bug,有成就感的就是做了一个又一个功能,bug也是有级别的,那么高级别的bug是什么样地呢?牵扯到了哪些东西呢?直接看↓

首先数据库日期格式是:2015/5/14 星期四 下午 2:58:27 //无法修改格式,也没有dba权限

sql比较简单,在mybatis里面截取日期格式进行比较:

<select id="userGraph" parameterType="java.util.HashMap"
resultMap="UserliebiaoUserMap">          ↓→//4,2  截取的下标
select count(*) as visitorId,substr(u.createddate,${dmType}) as createddate
from PT_USER u,pt_userinfo i
where u.userinfoids = i.ids
<if test="beginTime !=null and beginTime !=''">  ↓→//前台传过来的开始时间
<![CDATA[and substr(u.createddate,0,10) >= #{beginTime}]]>
</if>
<if test="overTime !=null and overTime !=''">   //结束时间
<![CDATA[and substr(u.createddate,0,10) <= #{overTime}]]>
</if>
<if test="companycode !=null and companycode !=''">
and u.COMPANYCODE = #{companycode}
</if>
<![CDATA[
group by substr(u.createddate, ${dmType})
order by substr(u.createddate, ${dmType}) desc
]]></select>          //为了节省空间,所以格式拼在同一行

//bug出现在执行sql的时候,应该怎样去解决呢?

Cause: java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]

//如果不截取日期 的年月日,则能正常运行

根目录97的主页 根目录97 | 初学一级 | 园豆:8
提问于:2016-06-25 16:54
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册