create table user_info
(user_id int primary key auto_increment,
register_time timestamp not null DEFAULT CURRENT_TIMESTAMP,//注册时间是固定的,不会再变化
last_edit_time timestamp not null,//每次有更新时,要变化;
unique (user_name)
……
);
<insert id="insertUser" parameterType="java.util.HashMap" useGeneratedKeys="true" keyProperty="user_id">
insert into user_info(user_name,password,email,self_pic,is_active,is_perfect,role_id,last_edit_time)
values(#{username},#{password},#{email},#{selfpic},1,0,1,NOW());
</insert>