This commit is contained in:
777
2025-09-13 01:06:44 +08:00
parent 8c98c6928c
commit 77e19742e7
25 changed files with 748 additions and 12 deletions

View File

@@ -0,0 +1,25 @@
<?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.ruoyi.cai.mapper.UnionTotalMapper">
<select id="countUnionTotal" resultType="com.ruoyi.cai.domain.UnionTotal">
select
t2.id as unionId, t2.name as unionName,
sum(anchor_amount) as anchorEarningsTotal,
if(t2.id,sum(union_amount),0) as unionEarningsTotal
from cai_consume_log t1
join cai_union t2 on t1.union_user_id = t2.user_id
where t1.create_time between #{startTime} and #{endTime} and t2.id is not null
group by t2.id
</select>
<select id="countUnion" resultType="com.ruoyi.cai.domain.UnionTotal">
select
ifnull(sum(anchor_earnings_total),0) as anchor_earnings_total,
ifnull(sum(union_earnings_total),0) as union_earnings_total
from cai_union_total t1
where t1.union_id = #{unionId}
</select>
</mapper>