Browse Source

交通指标查询条件修改

develop
王兴琳 4 months ago
parent
commit
79f6ccf97e
  1. 2
      zc-business/src/main/java/com/zc/business/domain/ComprehensiveIndexQuery.java
  2. 16
      zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml
  3. 4
      zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml

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

@ -34,4 +34,6 @@ public class ComprehensiveIndexQuery {
private Integer crowdingRate;
private Integer periodType;
private String startDate;
private String endDate;
}

16
zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml

@ -199,18 +199,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ON ps.facility_code = dgsd.gantry_code
AND
<if test="periodType == 1">
YEAR(dgsd.statistical_date) = #{startDate}
YEAR(dgsd.statistical_date) = #{startDate} AND
</if>
<if test="periodType == 3">
DATE_FORMAT(dgsd.statistical_date, '%Y-%m') = #{startDate}
DATE_FORMAT(dgsd.statistical_date, '%Y-%m') = #{startDate} AND
</if>
<if test="periodType == 4">
DATE(dgsd.statistical_date) = DATE(#{startDate})
<if test="periodType == 4 and startDate !=null and endDate !=null" >
dgsd.statistical_date BETWEEN DATE(#{startDate}) and DATE(#{endDate}) AND
</if>
<if test="periodType == 4 and startDate !=null and endDate ==null" >
DATE(dgsd.statistical_date) = DATE(#{startDate}) AND
</if>
<if test="periodType == 5">
DATE(dgsd.statistical_date) = DATE(#{startDate})
DATE(dgsd.statistical_date) = DATE(#{startDate}) AND
</if>
AND dgsd.period_type = #{periodType}
dgsd.period_type = #{periodType}
ORDER BY
dgsd.statistical_date DESC
</select>

4
zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml

@ -328,7 +328,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
JOIN dc_gantry_statistics_data AS dgsd
ON ps.facility_code = dgsd.gantry_code
AND DATE(dgsd.statistical_date) BETWEEN #{startDate} AND #{endDate}
<if test="startDate !=null">
AND DATE(dgsd.statistical_date) BETWEEN #{startDate} AND #{endDate}
</if>
<if test="periodType != null">
AND dgsd.period_type = #{periodType}
</if>

Loading…
Cancel
Save