123444444444444444

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 !&quot;&quot;.equals(username.trim())">

USERNAME=#{username}

</if>

<if test="password != null and !&quot;&quot;.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>


上官飞云
浏览 1307回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java