fix: 健康管理系统,统计分析修改。

This commit is contained in:
tianyongbao
2024-12-02 13:13:44 +08:00
parent c6a2cdfbbb
commit 2c18e66c77
3 changed files with 39 additions and 13 deletions

View File

@@ -25,6 +25,7 @@
<result property="contentUnit" column="content_unit" />
<result property="personName" column="person_name" />
<result property="healthRecordName" column="health_record_name" />
<result property="useDays" column="useDays" />
</resultMap>
<select id="selectMarRecordList" parameterType="HealthMarRecordDto" resultMap="HealthMarRecordResult">
@@ -37,7 +38,17 @@
hmr.person_id ,
hp."name" as person_name,
hmr.health_record_id as health_record_id,
hr."name" as health_record_name
hr."name" as health_record_name,
(
select
count(distinct to_char(t.dosing_time, 'yyyy-MM-dd'))
from
health_mar_record t
where
t.person_id = hmr.person_id
and t.health_record_id = hmr.health_record_id
and t.medicine_id = hmr.medicine_id
) as useDays
from
health_mar_record hmr
left join health_medicine_basic hmb on