mirror of
https://github.com/qiurunze123/miaosha.git
synced 2023-11-19 22:41:03 +08:00
63 lines
2.2 KiB
XML
63 lines
2.2 KiB
XML
<?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="com.geekq.miaosha.dao.UserMapper">
|
|
|
|
<!--结果集映射-->
|
|
<resultMap id="BaseResultMap" type="com.geekq.miaosha.domain.MiaoshaUser">
|
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
|
<result column="nickname" property="nickname" jdbcType="VARCHAR"/>
|
|
<result column="salt" property="salt" jdbcType="VARCHAR"/>
|
|
<result column="head" property="head" jdbcType="VARCHAR"/>
|
|
<result column="register_date" property="registerDate" jdbcType="TIMESTAMP"/>
|
|
<result column="last_login_date" property="lastLoginDate" jdbcType="TIMESTAMP"/>
|
|
<result column="login_Count" property="loginCount" jdbcType="INTEGER"/>
|
|
</resultMap>
|
|
|
|
<!--增加一条数据-->
|
|
|
|
<insert id="insertMiaoShaUser" parameterType="com.geekq.miaosha.domain.MiaoshaUser" keyProperty="id">
|
|
|
|
insert into miaosha_user (id, nickname, salt, register_date,last_login_date,login_Count ) values
|
|
(#{id,jdbcType=BIGINT},#{nickname,jdbcType=VARCHAR},
|
|
#{salt,jdbcType=VARCHAR},#{registerDate,jdbcType=DATE},#{lastLoginDate,jdbcType=DATE},
|
|
#{loginCount,jdbcType=INTEGER}
|
|
)
|
|
</insert>
|
|
|
|
<!--更新一条数据-->
|
|
|
|
<update id="updateMiaoShaUser" >
|
|
update miaosha_user set nickname = #{nickname},
|
|
login_Count = #{loginCount}
|
|
where id=#{id}
|
|
</update>
|
|
|
|
<!--删除一条数据-->
|
|
<delete id="deleteMiaoShaUser" parameterType="Long">
|
|
delete from miaosha_user
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</delete>
|
|
|
|
|
|
<sql id="Base_Column_List"> id, nickname, salt, register_date,last_login_date,login_Count </sql>
|
|
|
|
<select id="getMiaoShaUserById" parameterType="LONG" resultType="miaoshauser">
|
|
SELECT
|
|
<include refid="Base_Column_List"/>
|
|
FROM miaosha_user WHERE id = #{id}
|
|
</select>
|
|
|
|
|
|
<select id="getMiaoShaUserNum" resultType="int">
|
|
select count(*) from miaosha_user
|
|
</select>
|
|
|
|
|
|
<select id="countbyMenuId" parameterType="java.lang.Integer"
|
|
resultType="java.lang.Integer"> select count(*) from miaosha_user
|
|
</select>
|
|
|
|
|
|
</mapper>
|