MyBatis:Parameter Maps collection does not contain value for 的问题解决

    xiaoxiao2021-12-14  17

    发现问题:

    <resultMap id="BaseResultMap" type="com.team1.vo.User" > <id column="userID" property="userid" jdbcType="INTEGER" /> <result column="roleID" property="roleid" jdbcType="INTEGER" /> <result column="password" property="password" jdbcType="VARCHAR" /> <result column="username" property="username" jdbcType="VARCHAR" /> <result column="sex" property="sex" jdbcType="INTEGER" /> <result column="age" property="age" jdbcType="INTEGER" /> <result column="deptID" property="deptid" jdbcType="INTEGER" /> <result column="position" property="position" jdbcType="VARCHAR" /> <result column="introduction" property="introduction" jdbcType="VARCHAR" /> <result column="interests" property="interests" jdbcType="VARCHAR" /> <result column="phone" property="phone" jdbcType="VARCHAR" /> <result column="mobilephone" property="mobilephone" jdbcType="VARCHAR" /> <result column="Email" property="email" jdbcType="VARCHAR" /> <result column="Address" property="address" jdbcType="VARCHAR" /> </resultMap> <select id="userLogin" parameterMap="BaseResultMap" resultMap="BaseResultMap"> select * from user where roleid=#{roleid} and username=#{username} and password= MD5(#{password}) </select>解决问题

    <resultMap id="BaseResultMap" type="com.team1.vo.User" > <id column="userID" property="userid" jdbcType="INTEGER" /> <result column="roleID" property="roleid" jdbcType="INTEGER" /> <result column="password" property="password" jdbcType="VARCHAR" /> <result column="username" property="username" jdbcType="VARCHAR" /> <result column="sex" property="sex" jdbcType="INTEGER" /> <result column="age" property="age" jdbcType="INTEGER" /> <result column="deptID" property="deptid" jdbcType="INTEGER" /> <result column="position" property="position" jdbcType="VARCHAR" /> <result column="introduction" property="introduction" jdbcType="VARCHAR" /> <result column="interests" property="interests" jdbcType="VARCHAR" /> <result column="phone" property="phone" jdbcType="VARCHAR" /> <result column="mobilephone" property="mobilephone" jdbcType="VARCHAR" /> <result column="Email" property="email" jdbcType="VARCHAR" /> <result column="Address" property="address" jdbcType="VARCHAR" /> </resultMap> <select id="userLogin" parameterType="User" resultMap="BaseResultMap"> select * from user where roleid=#{roleid} and username=#{username} and password= MD5(#{password}) </select> parammeterMap="BaseResultMap" -------》parameterType="com.demo.sys.entity.Module"

    转载请注明原文地址: https://ju.6miu.com/read-968022.html

    最新回复(0)