<?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.fzm.mall.server.admin.user_center.mapper.UserMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.fzm.mall.server.admin.user_center.model.User">
        <id column="id" property="id"/>
        <result column="uid" property="uid"/>
        <result column="token" property="token"/>
        <result column="status" property="status"/>
        <result column="login_passward" property="loginPassward"/>
        <result column="area" property="area"/>
        <result column="phone" property="phone"/>
        <result column="address" property="address"/>
        <result column="user_id" property="userId"/>
        <result column="head_url" property="headUrl"/>
        <result column="nick_name" property="nickName"/>
        <result column="bi_account" property="biAccount"/>
        <result column="ali_account" property="aliAccount"/>
        <result column="wx_account" property="wxAccount"/>
        <result column="invite_code" property="inviteCode"/>
        <result column="register_code" property="registerCode"/>
        <result column="last_login" property="lastLogin"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
    </resultMap>

    <select id="page" resultType="com.fzm.mall.server.admin.user_center.entity.vo.UserVO">
        SELECT
        uid,phone,nick_name,register_code,invite_code,status,area,create_time,last_login
        FROM
        user
        <where>
            <if test="uid!=null and uid!=''">
                uid = #{uid}
            </if>
            <if test="account!=null and account!=''">
                AND
                phone = #{account}
            </if>
        </where>
        ORDER BY
        create_time
        DESC
    </select>

</mapper>
