<insert id="saveCustomer" parameterType="com.xiaonatech.dsx.entity.CustomerEntity" useGeneratedKeys="true" keyProperty="policyID">
insert into customer (certType,code,password,name,mobile,effDate,expDate,address,createID,createTime,updateID,updateTime)
values
(#{certType},#{code}, #{password}, #{name}, #{mobile}, #{effDate},#{expDate},#{address},#{createID},#{createTime} ,#{updateID},#{updateTime})
</insert>
dao层
public int saveCustomer(CustomerEntity cs);
这个方法返回得一直是1。 对象.id得值 一直是空。数据库是mysql
CustomerEntity applyRecord = new CustomerEntity();
applyRecord.setCertType("0");
applyRecord.setCode("423565462256");
applyRecord.setPassword("123456");
applyRecord.setName("sds");
applyRecord.setMobile("12345678978");
applyRecord.setCreateID("150");
applyRecord.setUpdateID("150");
applyRecord.setUpdateTime(new Date());
int i = dao.saveCustomer(cs);
System.out.println("i========="+i+" id================"+applyRecord.getCarOwnerID());
FFIVE
相关分类