feat: 首页日历功能新增。

This commit is contained in:
tianyongbao
2024-08-01 18:54:18 +08:00
parent d33cbc89a4
commit 4fe312a482
6 changed files with 220 additions and 1 deletions

View File

@@ -159,7 +159,8 @@
from
accounts_deal_record a
<where>
a.deal_category = '1'
a.del_flag='0'
and a.deal_category = '1'
<if test="endTime!=null and endTime !=''">
and #{endTime}>=to_char(a.create_time, 'yyyy-MM-dd')
</if>
@@ -175,4 +176,39 @@
a.child_category
order by sum(a.amount) desc
</select>
<resultMap type="AccountCalendarVo" id="AccountCalendarResult">
<result property="title" column="title" />
<result property="name" column="name" />
<result property="start" column="start" />
<result property="color" column="color" />
</resultMap>
<select id="selectDailyExpensesByDate" parameterType="AccountsDealRecordDto" resultMap="AccountCalendarResult">
select
to_char(a.create_time,
'yyyy-MM-dd') as start,
concat('日常支出:',
sum(a.amount)) as title,
'magenta' as color,
5 as type
from
accounts_deal_record a
<where>
a.del_flag='0'
and a.deal_type = '2'
and a.deal_category = '1'
<if test="endTime!=null and endTime !=''">
and #{endTime}>to_char(a.create_time, 'yyyy-MM-dd')
</if>
<if test="startTime!=null and startTime !=''">
and to_char(a.create_time, 'yyyy-MM-dd')>=#{startTime}
</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
group by
to_char(a.create_time,
'yyyy-MM-dd')
</select>
</mapper>