|
@@ -2,12 +2,14 @@
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.care.bigscreen.mapper.StStationMapper">
|
|
<mapper namespace="com.care.bigscreen.mapper.StStationMapper">
|
|
|
|
|
|
- <!--多条件分页查询-->
|
|
|
|
|
|
+ <!--查询-->
|
|
<select id="selectBigScreenStatistics" resultType="com.care.bigscreen.vo.BigScreenStatisticsVO">
|
|
<select id="selectBigScreenStatistics" resultType="com.care.bigscreen.vo.BigScreenStatisticsVO">
|
|
SELECT
|
|
SELECT
|
|
sum(older_amount) olderAmount,
|
|
sum(older_amount) olderAmount,
|
|
sum(older_60_80_amount) older6080Amount,
|
|
sum(older_60_80_amount) older6080Amount,
|
|
|
|
+ convert(sum(older_60_80_amount)/sum(older_amount),decimal(20,2)) older6080Rate,
|
|
sum(older_80_above_amount) older80AboveAmount,
|
|
sum(older_80_above_amount) older80AboveAmount,
|
|
|
|
+ convert(sum(older_80_above_amount)/sum(older_amount),decimal(20,2)) older80AboveRate,
|
|
sum(alone_living_amount) aloneLivingAmount,
|
|
sum(alone_living_amount) aloneLivingAmount,
|
|
convert(sum(alone_living_amount)/sum(older_amount),decimal(20,2)) aloneLivingRate,
|
|
convert(sum(alone_living_amount)/sum(older_amount),decimal(20,2)) aloneLivingRate,
|
|
sum(no_alone_living_amount) noAloneLivingAmount,
|
|
sum(no_alone_living_amount) noAloneLivingAmount,
|
|
@@ -42,21 +44,32 @@
|
|
sum(seats_amount) seatsAmount,
|
|
sum(seats_amount) seatsAmount,
|
|
convert(sum(seats_online_duration)/3600,decimal(20,2)) seatsOnlineDuration
|
|
convert(sum(seats_online_duration)/3600,decimal(20,2)) seatsOnlineDuration
|
|
FROM st_station t
|
|
FROM st_station t
|
|
-
|
|
|
|
<where>
|
|
<where>
|
|
1 = 1
|
|
1 = 1
|
|
|
|
+ <if test="stationId != null and stationId != ''">
|
|
|
|
+ AND t.station_id = #{stationId}
|
|
|
|
+ </if>
|
|
<if test="orgId != null and orgId != ''">
|
|
<if test="orgId != null and orgId != ''">
|
|
AND t.org_id = #{orgId}
|
|
AND t.org_id = #{orgId}
|
|
</if>
|
|
</if>
|
|
- <if test="stationIds != null and stationIds.size()>0" >
|
|
|
|
- AND t.station_id in
|
|
|
|
- <foreach collection="stationIds" item="item" open="(" close=")" separator="," >
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
</where>
|
|
</where>
|
|
-
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
-
|
|
|
|
|
|
+ <!--根据经纬度查询-->
|
|
|
|
+ <select id="selectBigScreenStatisticsByLongitudeLatitude" resultType="com.care.bigscreen.vo.BigScreenStatisticsVO">
|
|
|
|
+ SELECT
|
|
|
|
+ sum(older_amount) olderAmount,
|
|
|
|
+ sum(older_60_80_amount) older6080Amount,
|
|
|
|
+ convert(sum(older_60_80_amount)/sum(older_amount),decimal(20,2)) older6080Rate,
|
|
|
|
+ sum(older_80_above_amount) older80AboveAmount,
|
|
|
|
+ convert(sum(older_80_above_amount)/sum(older_amount),decimal(20,2)) older80AboveRate
|
|
|
|
+ FROM st_station t
|
|
|
|
+ <where>
|
|
|
|
+ t.longitude >= #{longitudeLeftUp} and t.longitude <= #{longitudeRightDown}
|
|
|
|
+ AND t.latitude <= #{latitudeLeftUp} and t.longitude >= #{latitudeRightDown}
|
|
|
|
+ <if test="orgId != null and orgId != ''">
|
|
|
|
+ AND t.org_id = #{orgId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|