V13
This commit is contained in:
25
ruoyi-cai/src/main/resources/mapper/cai/UnionTotalMapper.xml
Normal file
25
ruoyi-cai/src/main/resources/mapper/cai/UnionTotalMapper.xml
Normal 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>
|
||||
Reference in New Issue
Block a user