...
|
...
|
@@ -6,10 +6,12 @@ |
|
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
<result column="pwd" property="pwd" jdbcType="VARCHAR" />
|
|
|
<result column="level" property="level" jdbcType="INTEGER" />
|
|
|
<result column="email" property="email" jdbcType="VARCHAR" />
|
|
|
<result column="mobile" property="mobile" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="Base_Column_List" >
|
|
|
id, name, pwd, level
|
|
|
id, name, pwd, level, email, mobile
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
...
|
...
|
@@ -32,6 +34,14 @@ |
|
|
from user
|
|
|
</select>
|
|
|
|
|
|
<select id="selectUsers" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from user
|
|
|
order by id desc
|
|
|
limit #{startIndex},#{pageSize}
|
|
|
</select>
|
|
|
|
|
|
<delete id="deleteById" parameterType="java.lang.Integer" >
|
|
|
delete from user
|
|
|
where id = #{id,jdbcType=INTEGER}
|
...
|
...
|
@@ -44,23 +54,30 @@ |
|
|
|
|
|
<insert id="insert" parameterType="com.model.User" >
|
|
|
insert into user
|
|
|
(name,pwd,level, create_time, update_time)
|
|
|
(name,pwd,level,email,mobile, create_time, update_time)
|
|
|
values
|
|
|
(#{name,jdbcType=VARCHAR},#{pwd,jdbcType=VARCHAR},#{level,jdbcType=INTEGER}, now(),now())
|
|
|
(#{name,jdbcType=VARCHAR},#{pwd,jdbcType=VARCHAR},#{level,jdbcType=INTEGER},
|
|
|
#{email,jdbcType=INTEGER},#{mobile,jdbcType=INTEGER},now(),now())
|
|
|
</insert>
|
|
|
|
|
|
<update id="updatePwd" parameterType="com.model.User" >
|
|
|
<update id="update" parameterType="com.model.User" >
|
|
|
update user
|
|
|
set pwd = #{pwd,jdbcType=VARCHAR},
|
|
|
update_time = now()
|
|
|
set level = #{level,jdbcType=INTEGER},
|
|
|
email = #{email,jdbcType=VARCHAR},
|
|
|
mobile = #{mobile,jdbcType=VARCHAR},
|
|
|
update_time = now()
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
<update id="updateLevel" parameterType="com.model.User" >
|
|
|
<update id="updatePwd" parameterType="com.model.User" >
|
|
|
update user
|
|
|
set level = #{level,jdbcType=INTEGER},
|
|
|
update_time = now()
|
|
|
set pwd = #{pwd,jdbcType=VARCHAR},
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
<select id="selectCount" resultType="java.lang.Integer">
|
|
|
select
|
|
|
count(1)
|
|
|
from user
|
|
|
</select>
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|