resultMap:外部的resultMap的引用,和resultType不能同时使用。
<resultMap id="BaseResultMap" type="com.lamsey.survey.entities.guest.User" > <id column="user_id" property="userId" jdbcType="INTEGER" /> <result column="user_name" property="userName" jdbcType="CHAR" /> <result column="user_pwd" property="userPwd" jdbcType="CHAR" /> <result column="company" property="company" jdbcType="BIT" /> </resultMap> <!-- 根据用户名查询用户信息 --> <select id="selectUser" resultMap="BaseResultMap"> select user_id, user_name, user_pwd, company from guest_user where user_name = #{userName,jdbcType=CHAR} </select>
时间: 2024-11-23 01:17:51