<?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">
<!--namespace表示命名空间-->
<mapper namespace="hz.saas.test1.mapper.StandMapper">
<resultMap id="StandResultMap" type="hz.saas.test1.model.standard.Stand220614">
<id column="id" property="id"/>
<result column="name" property="name"/>
</resultMap>
<insert id="standInsert" parameterType="hz.saas.test1.model.standard.Stand220614">
insert into standard(name)
values (#{name})
</insert>
</mapper>
package hz.saas.test1.mapper;
import hz.saas.test1.model.standard.Stand220614;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface StandMapper {
void standInsert(Stand220614 stand);
package hz.saas.test1.service.impl;
import hz.saas.test1.mapper.StandMapper;
import hz.saas.test1.model.standard.Stand220614;
import hz.saas.test1.service.StandService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service("standImpl")
public class StandImpl implements StandService{
@Resource(name = "standMapper")
StandMapper standMapper;
@Override
public void standInsert(Stand220614 stand){
standMapper.standInsert(stand);
}
}
package hz.saas.test1.service;
import hz.saas.test1.model.sort.Sort220610;
import hz.saas.test1.model.standard.Stand220614;
import java.util.List;
public interface StandService {
void standInsert(Stand220614 stand);
}
package hz.saas.test1.controller;
import com.alibaba.fastjson.JSON;
import hz.saas.test1.JsonMsg;
import hz.saas.test1.model.standard.Stand220614;
import hz.saas.test1.service.impl.StandImpl;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@RestController
public class StandController {
@Resource(name = "standImpl")
StandImpl standImpl;
@RequestMapping(value="/standInsert", method= RequestMethod.POST,produces="text/html;charset=utf-8")
public String standInsert(String name){
Stand220614 stand=new Stand220614();
stand.setName(name);
standImpl.standInsert(stand);
return "注册成功";
}
错误提示:There was an unexpected error (type=Internal Server Error, status=500).
Invalid bound statement (not found): hz.saas.test1.mapper.StandMapper.standInsert
检查过namespace没有问题,同项目的相同代码可以运行,仅仅是此项目块出现问题