从"Blog"仓库中分离出来

This commit is contained in:
小海
2019-11-28 19:18:16 +08:00
commit 16cc30f513
119 changed files with 11291 additions and 0 deletions

View File

@@ -0,0 +1,127 @@
<?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="cn.celess.blog.mapper.UserMapper">
<resultMap id="userResultMap" type="cn.celess.blog.entity.User">
<id column="u_id" property="id"/>
<result column="u_email" property="email"/>
<result column="u_uid" property="uid"/>
<result column="u_pwd" property="pwd"/>
<result column="email_status" property="emailStatus"/>
<result column="u_avatar" property="avatarImgUrl"/>
<result column="u_desc" property="desc"/>
<result column="recently_landed_time" property="recentlyLandedDate"/>
<result column="email_verify_id" property="emailVerifyId"/>
<result column="display_name" property="displayName"/>
<result column="role" property="role"/>
</resultMap>
<insert id="addUser">
insert into user(u_email, u_pwd)
values (#{email}, #{pwd})
</insert>
<update id="updateInfo">
update user set
<if test="desc!=null">`u_desc`=#{desc},</if>
<if test="displayName!=null">`display_name`=#{displayName}</if>
where u_id=#{id}
</update>
<update id="updateLoginTime">
update user
set `recently_landed_time`=#{date}
where `u_email` = #{email}
</update>
<update id="updateAvatarImgUrl">
update user
set `u_avatar`=#{avatarImgUrl}
where `u_id` = #{id}
</update>
<update id="updateEmailStatus">
update user
set `email_status`=#{status}
where `u_email` = #{email}
</update>
<update id="updatePwd">
update user
set `u_pwd`=#{pwd}
where `u_email` = #{email}
</update>
<update id="setUserRole">
update user
set role=#{role}
where u_id = #{uid}
</update>
<update id="update">
update user
set `u_email` = #{email},
`u_pwd` = #{pwd},
`email_status` = #{emailStatus},
`u_desc` = #{desc},
`display_name` = #{displayName},
`role` = #{role}
where `u_id` = #{id}
</update>
<delete id="delete">
delete
from user
where u_id = #{id}
</delete>
<select id="existsByEmail" resultType="java.lang.Boolean">
select exists(select * from user where u_email = #{email})
</select>
<select id="findByEmail" resultMap="userResultMap">
select *
from user
where u_email = #{email}
</select>
<select id="findById" resultMap="userResultMap">
select *
from user
where u_id = #{id}
</select>
<select id="getAvatarImgUrlById" resultType="string">
select u_avatar
from user
where u_id = #{id};
</select>
<select id="getEmail" resultType="java.lang.String">
select u_email
from user
where u_id = #{id}
</select>
<select id="getDisPlayName" resultType="java.lang.String">
select display_name
from user
where u_id = #{id}
</select>
<select id="getPwd" resultType="java.lang.String">
select u_pwd
from user
where u_email = #{email}
</select>
<select id="getRoleByEmail" resultType="java.lang.String">
select role
from user
where u_email = #{emai}
</select>
<select id="count" resultType="java.lang.Long">
select count(*)
from user
</select>
<select id="getRoleById" resultType="java.lang.String">
select role
from user
where u_id = #{id}
</select>
<select id="findAll" resultMap="userResultMap">
select *
from user
</select>
</mapper>