24 lines
780 B
XML
24 lines
780 B
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.mcwl.myInvitation.mapper.InvitationMapper">
|
|
|
|
|
|
<select id="getTotalAmount" resultType="java.lang.Double">
|
|
select sum(amount)
|
|
from inv_commission
|
|
where user_id = #{userId}
|
|
</select>
|
|
|
|
<select id="getEarningsDisplay" resultType="com.mcwl.myInvitation.domain.dto.EarningsDisplay">
|
|
select inv.user_id as userId, count(con.id) as count
|
|
from sys_user inv
|
|
left join inv_consume con
|
|
on inv.user_id = con.user_id
|
|
where inv.inviter_user_id = #{userId}
|
|
group by inv.user_id
|
|
</select>
|
|
|
|
|
|
</mapper> |