myecplice LOG:2016-03-05 09:38:14,018 [main] DEBUG [User.insertUser] - ==> Preparing: insert into web_user (username,password,department,userinfo,quanxian) values ("123","123","123","123","123") 2016-03-05 09:38:14,058 [main] DEBUG [User.insertUser] - ==> Parameters: 2016-03-05 09:38:14,058 [main] DEBUG [User.insertUser] - <== Updates: 1查看数据库中却没有相应记录。xml内容如下:<mapper namespace="User"> <!-- 实体类数据库映射 --> <resultMap type="bean.User" id="UserResult"> <id column="ID" jdbcType="INTEGER" property="id" /> <result column="USERNAME" jdbcType="VARCHAR" property="username" /> <result column="QUANXIAN" jdbcType="VARCHAR" property="quanxian" /> <result column="DEPARTMENT" jdbcType="VARCHAR" property="department" /> <result column="USERINFO" jdbcType="VARCHAR" property="userinfo" /> <result column="PASSWORD" jdbcType="VARCHAR" property="password" /> </resultMap> <!--SQL语句 --> <select id="queryUser" parameterType="bean.User" resultType="bean.User"> select * from web_user <where> <if test="username != null and !"".equals(username.trim())"> USERNAME=#{username} </if> <if test="password != null and !"".equals(password.trim())"> and PASSWORD=#{password} </if> </where> </select> <select id="userList" parameterType="int" resultMap="UserResult"> select * from web_user </select> <insert id="insertUser" parameterType="bean.User"> insert into web_user (username,password,department,userinfo,quanxian) values ("123","123","123","123","123") <!-- (#{username},#{password},#{department},#{userinfo},#{quanxian})--> </insert>
添加回答
举报
0/150
提交
取消