肖潇晓枭逍 2019-05-08 15:26 采纳率: 100%
浏览 880
已采纳

求助,ssm框架insert语句接收不到pojo类的数据什么问题

这是前端输入的数据
图片说明

前端AJAX传入数据

图片说明

后台Controller层代码
图片说明

service层
图片说明

sql输出语句表示这两层都能接受数据
图片说明
但是插入语句找不到数据

==>  Preparing: insert into staff(id,sname,sex,birthday,sid,depart_id,post_id,entrydate,joinworkdate,workform, ,staffsource,politicalstatus,nation,nativeplace,stel,semail,sheight,bloodtype,maritalstatus, registeredresidence,education,degree,university,major,graduationdate,startdate,enddate,status,peroidopdate) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,? ,'正常' ,?) 

下面是Dao层代码

@Repository("staffDao")
@Mapper
public interface StaffDao {

    public int addStaff(Staff staff);
}

mybatis-conf.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
     <mappers>
        <mapper resource="com/mybatis/AdminMapper.xml"/>
        <mapper resource="com/mybatis/DepartmentMapper.xml"/>
        <mapper resource="com/mybatis/PostMapper.xml"/>
        <mapper resource="com/mybatis/StaffMapper.xml"/>
    </mappers>
</configuration>

StaffMapper.xml代码如下图片说明

数据库结构
图片说明

Staff类

public class Staff {
    private Integer id;
    private String sname;
    private String sex;
    private Date birthday;
    private String birthday1;
    private String sid;
    private Integer depart_id;
    private Integer post_id;
    private Date entrydate;
    private String entrydate1;
    private Date joinworkdate;
    private String joinworkdate1;
    private String workform;
    private String staffsource;
    private String politicalstatus;
    private String nation;
    private String nativeplace;
    private String stel;
    private String semail;
    private Double sheight;
    private String bloodtype;
    private String maritalstatus;
    private String registeredresidence;
    private String education;
    private String degree;
    private String university;
    private String major;
    private Date graduationdate;
    private String graduationdate1;
    private Date startdate;
    private String startdate1;
    private Date enddate;
    private String enddate1;
    private String status;
    private String dname;
    private String pname;
    //get和set省略
}
  • 写回答

6条回答 默认 最新

  • 肖潇晓枭逍 2019-05-08 23:36
    关注

    感谢各位,解决了,实体类中少了一个字段

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 链接问题 C++LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接