This commit is contained in:
张良(004796)
2024-03-13 15:45:03 +08:00
parent e79d7d8c5c
commit 01c813137b
12 changed files with 118 additions and 43 deletions

View File

@@ -4,16 +4,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.xq.mapper.UserInviteMapper">
<resultMap type="com.ruoyi.xq.domain.UserInvite" id="UserInviteResult">
<result property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="usercode" column="usercode"/>
<result property="inviteId" column="invite_id"/>
<result property="inviteCode" column="invite_code"/>
<result property="cashbackTotal" column="cashback_total"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="pageAdmin" resultType="com.ruoyi.xq.dto.admin.user.UserInviteAdminVo">
select
t1.*,
t2.nickname, t2.mobile, t2.avatar,
t3.nickname as invite_nickname, t3.mobile as invite_mobile, t3.avatar as invite_avatar
from xq_user_invite t1
left join xq_user t2 on t1.user_id = t2.id
left join xq_user t3 on t1.invite_id = t3.id
<where>
<if test="bo.usercode != null and bo.usercode != ''">
and t1.usercode = #{bo.usercode}
</if>
<if test="bo.nickname != null and bo.nickname != ''">
and t2.nickname like concat('%',#{bo.nickname},'%')
</if>
<if test="bo.mobile != null and bo.mobile != ''">
and t2.mobile = #{bo.mobile}
</if>
<if test="bo.inviteCode != null and bo.inviteCode != ''">
and t1.usercode = #{bo.inviteCode}
</if>
<if test="bo.inviteNickname != null and bo.inviteNickname != ''">
and t3.nickname like concat('%',#{bo.inviteNickname},'%')
</if>
<if test="bo.inviteMobile != null and bo.inviteMobile != ''">
and t3.mobile = #{bo.inviteMobile}
</if>
</where>
order by t1.create_time
</select>
</mapper>