首页 新闻 会员 周边 捐助

mysql报错

0
[已解决问题] 解决于 2016-10-21 15:00

<!-- mapper.xml -->
<select id="getSharedListByParmas" resultType="com.lab.model.SharedExp" parameterType="com.lab.model.SharedExp" >
select * from sharedexps where posttime >=#{maxPostTime} or posttime <=#{minPostTime}
</select>

 

 

<!-- daoImpl -->

@Override
public List<SharedExp> getListByParam(SharedExp sharedExp) {
return this.selectList("shareExpSql.getSharedListByParmas", sharedExp);
}

 

报错:

2016-10-20 10:01:44,607 DEBUG [org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader] - <Loading bean definitions>
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
### The error may involve shareExpSql.getSharedListByParmas-Inline
### The error occurred while setting parameters
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:233)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:346)
at $Proxy6.selectList(Unknown Source)

凯伦的主页 凯伦 | 初学一级 | 园豆:186
提问于:2016-10-20 10:09
< >
分享
最佳答案
0

sql语句有问题吧

奖励园豆:5
乖乖女宇帆 | 菜鸟二级 |园豆:207 | 2016-10-20 16:58

是的,sql语句有问题

凯伦 | 园豆:186 (初学一级) | 2016-10-21 15:00
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册