Browse Source

收费站统计分析table接口修改

develop
lau572 9 months ago
parent
commit
2e23d3156c
  1. 2
      zc-business/src/main/java/com/zc/business/domain/DcInfoBoardVocabulary.java
  2. 34
      zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

2
zc-business/src/main/java/com/zc/business/domain/DcInfoBoardVocabulary.java

@ -29,7 +29,7 @@ public class DcInfoBoardVocabulary
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@Excel(name = "创建时间")
@Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
public void setId(Long id)

34
zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

@ -242,27 +242,33 @@
</select>
<select id="selectTollStationAnalysisByFacility" resultType="java.util.Map">
select
t2.facility_id facilityId,t3.facility_name facilityName,classify,
SUM(case when t2.classify = '6' then 1 else 0 end) facilityClose,
SUM(case when t2.classify = '7' then 1 else 0 end) facilityRestriction,
SUM(case when t2.classify = '9' then 1 else 0 end) facilityInterval
from dc_event t1
LEFT JOIN dc_event_traffic_control t2 on t1.id = t2.id
LEFT JOIN dc_facility t3 on t3.id = t2.facility_id
SELECT t1.id,t1.facility_name facilityName,IFNULL(t2.facilityClose,0) facilityClose,
IFNULL(t2.facilityInterval,0) facilityInterval,IFNULL(t2.facilityRestriction,0) facilityRestriction
from dc_facility t1
LEFT JOIN
(select
t2.facility_id facilityId,t3.facility_name facilityName,classify,
SUM(case when t2.classify = '6' then 1 else 0 end) facilityClose,
SUM(case when t2.classify = '7' then 1 else 0 end) facilityRestriction,
SUM(case when t2.classify = '9' then 1 else 0 end) facilityInterval
from dc_event t1
LEFT JOIN dc_event_traffic_control t2 on t1.id = t2.id
LEFT JOIN dc_facility t3 on t3.id = t2.facility_id
where
t1.event_type = '3' and t1.event_subclass = '3-2'
and date_format(t1.start_time,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
and (date_format(t1.end_time,'%Y-%m-%d %H:%i:%s') > date_format(#{startTime},'%Y-%m-%d %H:%i:%s') or ISNULL(t1.end_time))
and t2.classify in ('6','7','9')
GROUP BY t2.facility_id) t2 on t1.id = t2.facilityId
<where>
t1.event_type = '3' and t1.event_subclass = '3-2'
and date_format(t1.start_time,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
and (date_format(t1.end_time,'%Y-%m-%d %H:%i:%s') > date_format(#{startTime},'%Y-%m-%d %H:%i:%s') or ISNULL(t1.end_time))
and t2.classify in ('6','7','9')
t1.facility_type = '1'
<if test="facilityIdList != null and facilityIdList.length > 0">
AND t2.facility_id in
AND t1.id in
<foreach collection="facilityIdList" item="facilityId" open="(" separator="," close=")">
#{facilityId}
</foreach>
</if>
</where>
GROUP BY t2.facility_id
</select>
<select id="getTollStationAnalysis" resultType="java.util.Map">

Loading…
Cancel
Save