<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="sy.dao.UserMapper" >
<resultMap id="BaseResultMap" type="sy.model.User" >
<id column="userId" property="userid" jdbcType="INTEGER" />
<result column="userName" property="username" jdbcType="VARCHAR" />
<result column="userPassword" property="userpassword" jdbcType="VARCHAR" />
<result column="userEmail" property="useremail" jdbcType="VARCHAR" />
<result column="userNickname" property="usernickname" jdbcType="VARCHAR" />
<result column="userBirthday" property="userbirthday" jdbcType="TIMESTAMP" />
<result column="sex" property="sex" jdbcType="INTEGER" />
<result column="userPoints" property="userpoints" jdbcType="INTEGER" />
<result column="userRemark" property="userremark" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
userId, userName, userPassword, userEmail, userNickname, userBirthday, sex, userPoints,
userRemark
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from user
where userId = #{userid,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from user
where userId = #{userid,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="sy.model.User" >
insert into user (userId, userName, userPassword,
userEmail, userNickname, userBirthday,
sex, userPoints, userRemark
)
values (#{userid,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{userpassword,jdbcType=VARCHAR},
#{useremail,jdbcType=VARCHAR}, #{usernickname,jdbcType=VARCHAR}, #{userbirthday,jdbcType=TIMESTAMP},
#{sex,jdbcType=INTEGER}, #{userpoints,jdbcType=INTEGER}, #{userremark,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="sy.model.User" >
insert into user
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="userid != null" >
userId,
</if>
<if test="username != null" >
userName,
</if>
<if test="userpassword != null" >
userPassword,
</if>
<if test="useremail != null" >
userEmail,
</if>
<if test="usernickname != null" >
userNickname,
</if>
<if test="userbirthday != null" >
userBirthday,
</if>
<if test="sex != null" >
sex,
</if>
<if test="userpoints != null" >
userPoints,
</if>
<if test="userremark != null" >
userRemark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="userid != null" >
#{userid,jdbcType=INTEGER},
</if>
<if test="username != null" >
#{username,jdbcType=VARCHAR},
</if>
<if test="userpassword != null" >
#{userpassword,jdbcType=VARCHAR},
</if>
<if test="useremail != null" >
#{useremail,jdbcType=VARCHAR},
</if>
<if test="usernickname != null" >
#{usernickname,jdbcType=VARCHAR},
</if>
<if test="userbirthday != null" >
#{userbirthday,jdbcType=TIMESTAMP},
</if>
<if test="sex != null" >
#{sex,jdbcType=INTEGER},
</if>
<if test="userpoints != null" >
#{userpoints,jdbcType=INTEGER},
</if>
<if test="userremark != null" >
#{userremark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="sy.model.User" >
update user
<set >
<if test="username != null" >
userName = #{username,jdbcType=VARCHAR},
</if>
<if test="userpassword != null" >
userPassword = #{userpassword,jdbcType=VARCHAR},
</if>
<if test="useremail != null" >
userEmail = #{useremail,jdbcType=VARCHAR},
</if>
<if test="usernickname != null" >
userNickname = #{usernickname,jdbcType=VARCHAR},
</if>
<if test="userbirthday != null" >
userBirthday = #{userbirthday,jdbcType=TIMESTAMP},
</if>
<if test="sex != null" >
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="userpoints != null" >
userPoints = #{userpoints,jdbcType=INTEGER},
</if>
<if test="userremark != null" >
userRemark = #{userremark,jdbcType=VARCHAR},
</if>
</set>
where userId = #{userid,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="sy.model.User" >
update user
set userName = #{username,jdbcType=VARCHAR},
userPassword = #{userpassword,jdbcType=VARCHAR},
userEmail = #{useremail,jdbcType=VARCHAR},
userNickname = #{usernickname,jdbcType=VARCHAR},
userBirthday = #{userbirthday,jdbcType=TIMESTAMP},
sex = #{sex,jdbcType=INTEGER},
userPoints = #{userpoints,jdbcType=INTEGER},
userRemark = #{userremark,jdbcType=VARCHAR}
where userId = #{userid,jdbcType=INTEGER}
</update>
</mapper>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
SpringMvc+Spring+MyBatis+Maven_孙宇老师.rar (45个子文件)
META-INF
maven
sy.mybatistest
mybatistest
pom.xml 2KB
pom.properties 124B
MANIFEST.MF 129B
WEB-INF
web.xml 215B
classes
sy
dao
PostMapper.class 361B
ManagerMapper.class 373B
UserMapper.class 361B
model
User.class 2KB
Post.class 2KB
Manager.class 1KB
mapping
PostMapper.xml 3KB
UserMapper.xml 5KB
ManagerMapper.xml 3KB
controller
UserController.class 1KB
service
UserServiceI.class 177B
UserServiceImpl.class 986B
spring-mybatis.xml 5KB
spring-mvc.xml 2KB
log4j.properties 577B
config.properties 381B
spring.xml 682B
lib
jackson-mapper-asl-1.9.12.jar 762KB
spring-web-4.2.0.RELEASE.jar 748KB
spring-webmvc-4.2.0.RELEASE.jar 845KB
spring-test-4.2.0.RELEASE.jar 537KB
aopalliance-1.0.jar 4KB
druid-1.0.15.jar 1.86MB
spring-core-4.2.0.RELEASE.jar 1MB
spring-context-4.2.0.RELEASE.jar 1.03MB
mysql-connector-java-5.1.36.jar 949KB
mybatis-3.3.0.jar 1.35MB
spring-jdbc-4.2.0.RELEASE.jar 412KB
mybatis-spring-1.2.3.jar 50KB
spring-beans-4.2.0.RELEASE.jar 712KB
commons-logging-1.2.jar 60KB
aspectjweaver-1.8.6.jar 1.78MB
spring-tx-4.2.0.RELEASE.jar 257KB
commons-io-2.2.jar 170KB
spring-aop-4.2.0.RELEASE.jar 355KB
javax.servlet-api-3.1.0.jar 94KB
commons-fileupload-1.3.1.jar 67KB
jackson-core-asl-1.9.12.jar 227KB
spring-expression-4.2.0.RELEASE.jar 256KB
showUser.jsp 274B
index.jsp 52B
共 45 条
- 1
资源评论
- shenhuahuige2016-10-01假的,不是孙宇老师ssm+maven的源码
xa31202
- 粉丝: 1
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功