| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.poyee.mapper.AppUserMapper">
- <resultMap id="appUserListMap" type="com.poyee.dto.AppUserListDTO">
- <id column="user_id" property="userId"/>
- <result column="nickname" property="nickname"/>
- <result column="phone" property="phone"/>
- <result column="register_time" property="registerTime"/>
- <result column="register_channel" property="registerChannel"/>
- <result column="face_verify" property="faceVerify"/>
- </resultMap>
- <select id="selectList" resultMap="appUserListMap">
- select
- abu.id as user_id,
- abu.nickname,
- aa.phone,
- abu.create_time as register_time,
- abu.register_channel,
- abu.avatar,
- coalesce(abu.face_verify, 0) as face_verify
- from app_base_user abu
- left join app_account aa on aa.account = abu.username and aa.del_flg = 0
- <where>
- and coalesce(abu.del_flg, 0) = 0
- <if test="query.nickname != null and query.nickname != ''">
- and abu.nickname like concat('%', #{query.nickname}, '%')
- </if>
- <if test="query.phone != null and query.phone != ''">
- and aa.phone = #{query.phone}
- </if>
- <if test="query.faceVerify != null">
- and coalesce(abu.face_verify, 0) = #{query.faceVerify}
- </if>
- <if test="query.registerChannel != null and query.registerChannel != ''">
- and abu.register_channel = #{query.registerChannel}
- </if>
- <if test="query.registerTimeStart != null">
- and abu.create_time >= #{query.registerTimeStart}
- </if>
- <if test="query.registerTimeEnd != null">
- and abu.create_time <= #{query.registerTimeEnd}
- </if>
- </where>
- order by abu.create_time desc, abu.id desc
- </select>
- <resultMap id="sysUserProfileMap" type="com.poyee.dto.SysUserProfileDTO">
- <result column="user_name" property="nickname"/>
- <result column="avatar" property="avatar"/>
- </resultMap>
- <select id="selectSysUserProfile" resultMap="sysUserProfileMap">
- select su.user_name, su.avatar
- from sys_user su
- where su.user_id = #{userId}
- and coalesce(su.del_flag, '0') = '0'
- limit 1;
- </select>
- </mapper>
|