基本语句:
常用语句:
1.mybatis-mysql 获取自增长主键并插入数据
1 <resultMap id="BaseResultMap" type="com.matto.user.pojo.User" > 2 <id column="id" property="id" jdbcType="INTEGER" /> 3 </resultMap>
1 <insert id="addUser" parameterType="com.matto.user.pojo.User" useGeneratedKeys="true"> 2 <selectKey resultType="java.lang.Integer" order="BEFORE" keyProperty="id"> 5 SELECT LAST_INSERT_ID() AS ID 6 </selectKey> 7 INSERT INTO t_user (user_id,login_id,login_pwd,reg_time) VALUES (#{userId},#{loginId},#{loginPwd},now()) 8 </insert>
函数:
1.获取当前系统时间
now()
时间: 2024-11-08 23:20:46