64 lines
2.4 KiB
XML
64 lines
2.4 KiB
XML
<?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.sqx.modules.ext.dao.ExtSysDao">
|
|
|
|
<select id="findInviteFriendList" resultType="com.sqx.modules.ext.dto.InviteFriendDTO">
|
|
select
|
|
t1.user_id as userId,
|
|
t1.user_name as userName,
|
|
t1.phone,
|
|
t1.avatar,
|
|
t2.signInNum,
|
|
t2.awardAmount
|
|
from tb_user t1
|
|
left JOIN (select user_id,sum(money) as awardAmount,sum(case when title = '签到奖励' then 1 else 0 end) as signInNum from user_money_details where classify = 6 group by user_id) t2 on t1.user_id = t2.user_id
|
|
<where>
|
|
and t2.awardAmount is not null
|
|
<if test="keywords != null and keywords != ''">
|
|
and (t1.user_name like concat('%',#{keywords},'%') or t1.phone like concat('%',#{keywords},'%')
|
|
</if>
|
|
</where>
|
|
ORDER BY t1.user_id
|
|
</select>
|
|
<select id="findInviteSignInList" resultType="com.sqx.modules.ext.dto.SignInNumDTO">
|
|
SELECT
|
|
t1.by_user_id AS userId,
|
|
MIN( t1.create_time ) as createTime,
|
|
t2.user_name as userName,
|
|
t2.phone,
|
|
t3.cert_name as realName,
|
|
t3.cert_no as idCardNo,
|
|
t3.bank_name as bankName,
|
|
t3.account_no as bankCardNo,
|
|
t3.mobile,
|
|
t3.province,
|
|
t3.city,
|
|
t3.bank_branch
|
|
FROM
|
|
user_money_details t1
|
|
LEFT JOIN tb_user t2 on t1.by_user_id = t2.user_id
|
|
LEFT JOIN user_info t3 on t1.by_user_id = t3.user_id
|
|
WHERE
|
|
t1.user_id = #{userId}
|
|
AND t1.classify = 6
|
|
AND t1.title = '签到奖励'
|
|
GROUP BY t1.by_user_id
|
|
ORDER BY t1.by_user_id
|
|
</select>
|
|
<select id="findInviteAwardDetailList" resultType="com.sqx.modules.ext.dto.InviteAwardDTO">
|
|
SELECT DISTINCT
|
|
t1.by_user_id AS userId,
|
|
t1.money as amount,
|
|
t2.phone as userPhone,
|
|
t1.create_time as createTime
|
|
FROM
|
|
user_money_details t1
|
|
LEFT JOIN tb_user t2 on t1.by_user_id = t2.user_id
|
|
WHERE
|
|
t1.user_id = #{userId}
|
|
AND t1.classify = '6'
|
|
and t1.by_user_id is not null
|
|
and t2.user_id is not null
|
|
order by t1.create_time desc,t1.by_user_id asc
|
|
</select>
|
|
</mapper> |