<?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.system.mapper.SysDashboardMapper">
|
|
<select id="selectRegisterSummary" resultType="SysDashboardRegisterSummaryVO">
|
select count(1) as registerCount,
|
sum(case when plate_no is not null and plate_no != '' then 1 else 0 end) as vehicleCount
|
from t_visitor_record
|
where del_flag = '0'
|
and register_type = #{registerType}
|
and register_time is not null
|
and register_time >= #{beginTime}
|
and register_time < #{endTime}
|
</select>
|
|
<select id="selectStatusSummary" resultType="SysDashboardStatusSummaryVO">
|
select sum(case when status = 'VISITING' then 1 else 0 end) as visitingCount,
|
sum(case when status in ('SIGNED_OUT', 'OVERDUE_AUTO_SIGNED_OUT')
|
and sign_time is not null
|
and sign_time >= #{param1}
|
and sign_time < #{param2}
|
then 1 else 0 end) as signedOutCount,
|
sum(case when status = 'PENDING_CONFIRM' then 1 else 0 end) as overdueCount
|
from t_visitor_record
|
where del_flag = '0'
|
</select>
|
|
<select id="selectTrendDaily" resultType="SysDashboardTrendDailyVO">
|
select date_format(register_time, '%Y-%m-%d') as trendDate,
|
date_format(register_time, '%m-%d') as label,
|
sum(case when register_type = 'ONSITE' then 1 else 0 end) as onsiteCount,
|
sum(case when register_type = 'APPOINTMENT' then 1 else 0 end) as appointmentCount,
|
sum(case when plate_no is not null and plate_no != '' then 1 else 0 end) as vehicleCount
|
from t_visitor_record
|
where del_flag = '0'
|
and register_time is not null
|
and register_time >= #{beginTime}
|
and register_time < #{endTime}
|
group by date_format(register_time, '%Y-%m-%d'), date_format(register_time, '%m-%d')
|
order by trendDate asc
|
</select>
|
</mapper>
|