Xiangyanglyz
xiangyanglyz
2016-06-28 00:53
采纳率: 63.6%
浏览 3.8k
已采纳

找不到表名,但是mapper文件里有表名?

错误信息:
严重: Servlet.service() for servlet [default] in context with path [/eigpay-debt-frontweb] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:

Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'eigpay_framework.task_executor' doesn't exist

The error may exist in URL [jar:file:/D:/workspace-eigpay-debt/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/eigpay-debt-frontweb/WEB-INF/lib/eigpay-debt-base-1.0-SNAPSHOT.jar!/mybatis/TaskExecutorMapper.xml]

The error may involve com.eigpay.framework.dao.privilege.dao.TaskExecutorMapper.selectByPrimaryKey-Inline

The error occurred while setting parameters

SQL: select id, task_id, executor, status, assign_time, received_total, confirmed_total from task_executor where id = ?

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'eigpay_framework.task_executor' doesn't exist

; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'eigpay_framework.task_executor' doesn't exist] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'eigpay_framework.task_executor' doesn't exist

mapper.xml文件:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >











id, task_id, executor, status, assign_time, received_total, confirmed_total


select

from
task_executor
where id = #{id,jdbcType=BIGINT}


delete
from
task_executor
where id = #{id,jdbcType=BIGINT}


insert into task_executor (id, task_id, executor,
status, assign_time, received_total,
confirmed_total)
values (#{id,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT}, #{executor,jdbcType=BIGINT},
#{status,jdbcType=INTEGER}, #{assignTime,jdbcType=TIMESTAMP}, #{receivedTotal,jdbcType=DECIMAL},
#{confirmedTotal,jdbcType=DECIMAL})


insert into task_executor


id,


task_id,


executor,


status,


assign_time,


received_total,


confirmed_total,




#{id,jdbcType=BIGINT},


#{taskId,jdbcType=BIGINT},


#{executor,jdbcType=BIGINT},


#{status,jdbcType=INTEGER},


#{assignTime,jdbcType=TIMESTAMP},


#{receivedTotal,jdbcType=DECIMAL},


#{confirmedTotal,jdbcType=DECIMAL},




update task_executor


task_id = #{taskId,jdbcType=BIGINT},


executor = #{executor,jdbcType=BIGINT},


status = #{status,jdbcType=INTEGER},


assign_time = #{assignTime,jdbcType=TIMESTAMP},


received_total = #{receivedTotal,jdbcType=DECIMAL},


confirmed_total = #{confirmedTotal,jdbcType=DECIMAL},


where id = #{id,jdbcType=BIGINT}


update task_executor
set task_id = #{taskId,jdbcType=BIGINT},
executor = #{executor,jdbcType=BIGINT},
status = #{status,jdbcType=INTEGER},
assign_time = #{assignTime,jdbcType=TIMESTAMP},
received_total = #{receivedTotal,jdbcType=DECIMAL},
confirmed_total = #{confirmedTotal,jdbcType=DECIMAL}
where id = #{id,jdbcType=BIGINT}

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • aline200
    aline200 2016-06-28 01:12
    已采纳

    测试一下,数据库能不能正常连接

    点赞 评论
  • zym5wb
    zym5wb 2016-06-28 01:21

    可能是mapper文件里的表名没写正确吧?

    点赞 评论

相关推荐