<?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.xzx.gc.user.mapper.AccountLogMapper">
|
|
<select id="queryAccountLogByAccount" resultType="com.xzx.gc.model.admin.AccountLogModel">
|
select
|
IFNULL(c.name, n.nick_name) as userName,
|
a.*,
|
IFNULL(c.mobile_phone, n.mobile_phone) as mobilePhone,
|
IFNULL(c.user_type, '1') as userType
|
from xzx_account_log a
|
left join xzx_account_info d on a.account_id = d.account_id
|
left join (select
|
k.name,
|
k.mobile_phone,
|
k.user_type,
|
k.user_id,
|
k.partner_id
|
from xzx_user_other_info k
|
where k.del_flag = 0) c on a.create_user_id = c.user_id
|
left join (select
|
m.mobile_phone,
|
m.nick_name,
|
m.user_id
|
from xzx_user_info m
|
where m.del_flag = 0) n on a.create_user_id = n.user_id
|
where d.del_flag = 0
|
|
<if test="startTime != null and startTime != ''">
|
and a.create_time >= #{startTime}
|
</if>
|
<if test="endTime != null and endTime != ''">
|
and a.create_time <= #{endTime}
|
</if>
|
|
<if test="type != null and type != ''">
|
and a.type=#{type}
|
</if>
|
|
<if test="userName != null and userName != ''">
|
and (c.name like concat("%",#{userName} ,"%") or c.mobile_phone like concat("%",#{userName},"%") or
|
n.mobile_phone like concat("%",#{userName},"%"))
|
</if>
|
|
|
<if test="typeList != null and typeList.size() != 0">
|
and a.channel_type in
|
<foreach collection="typeList" index="index" item="id" separator="," open="(" close=")">
|
#{id}
|
</foreach>
|
</if>
|
|
<if test="channelType != null and channelType != ''">
|
and a.channel_type=#{channelType}
|
</if>
|
|
<if test="accountId != null and accountId != ''">
|
and a.account_id=#{accountId}
|
</if>
|
|
<if test=" partnerIds != null and partnerIds.size() != 0">
|
and c.partner_id in
|
<foreach collection="partnerIds" index="index" item="id" separator="," open="(" close=")">
|
#{id}
|
</foreach>
|
</if>
|
order by a.create_time desc
|
</select>
|
</mapper>
|