| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <?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.sundot.airport.item.mapper.HkLargeScreenMapper">
- <!-- ============================= 模块一:运行数据 ============================= -->
- <!-- 运行数据汇总(5个大数字卡片) -->
- <select id="getOperationSummary" resultType="com.sundot.airport.item.domain.HkScreenOperationSummaryVO">
- SELECT
- SUM(a_zone + b_zone + vip + domestic_passenger + intl_passenger + vip_channel) AS passengerTotal,
- SUM(t1_luggage_check + t2_luggage_check) AS luggageTotal,
- SUM(domestic_cargo) AS domesticCargoTotal,
- SUM(intl_cargo) AS intlCargoTotal,
- SUM(south_vehicle_check + north_vehicle_check) AS vehicleCheckTotal
- FROM hk_operation_data
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- </select>
- <!-- T1旅检过检人数趋势(A区/B区) -->
- <select id="getT1PassengerTrend" resultType="com.sundot.airport.item.domain.HkScreenT1PassengerTrendVO">
- SELECT record_date AS recordDate,
- a_zone AS aZone,
- b_zone AS bZone
- FROM hk_operation_data
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- ORDER BY record_date ASC
- </select>
- <!-- T2旅检过检人数趋势(国内旅检/国际旅检) -->
- <select id="getT2PassengerTrend" resultType="com.sundot.airport.item.domain.HkScreenT2PassengerTrendVO">
- SELECT record_date AS recordDate,
- domestic_passenger AS domesticPassenger,
- intl_passenger AS intlPassenger
- FROM hk_operation_data
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- ORDER BY record_date ASC
- </select>
- <!-- 行检过检数趋势(T1行检/T2行检) -->
- <select id="getLuggageCheckTrend" resultType="com.sundot.airport.item.domain.HkScreenLuggageCheckTrendVO">
- SELECT record_date AS recordDate,
- t1_luggage_check AS t1LuggageCheck,
- t2_luggage_check AS t2LuggageCheck
- FROM hk_operation_data
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- ORDER BY record_date ASC
- </select>
- <!-- 货物过检数趋势(国内货站/国际货站) -->
- <select id="getCargoTrend" resultType="com.sundot.airport.item.domain.HkScreenCargoTrendVO">
- SELECT record_date AS recordDate,
- domestic_cargo AS domesticCargo,
- intl_cargo AS intlCargo
- FROM hk_operation_data
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- ORDER BY record_date ASC
- </select>
- <!-- 车辆过检数趋势(南侧车检/北侧车检) -->
- <select id="getVehicleCheckTrend" resultType="com.sundot.airport.item.domain.HkScreenVehicleCheckTrendVO">
- SELECT record_date AS recordDate,
- south_vehicle_check AS southVehicleCheck,
- north_vehicle_check AS northVehicleCheck
- FROM hk_operation_data
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- ORDER BY record_date ASC
- </select>
- <!-- ============================= 模块二:查获/收缴数据 ============================= -->
- <!-- 查获数据各类别合计(T1+T2) -->
- <select id="getSeizureCategoryTotal" resultType="com.sundot.airport.item.domain.HkScreenSeizureTotalVO">
- SELECT
- SUM(t1_fire_source + t2_fire_source) AS fireSource,
- SUM(t1_knife + t2_knife) AS knife,
- SUM(t1_police_weapon + t2_police_weapon) AS policeWeapon,
- SUM(t1_firework + t2_firework) AS firework,
- SUM(t1_live_animal + t2_live_animal) AS liveAnimal,
- SUM(t1_corrosive + t2_corrosive) AS corrosive,
- SUM(t1_fake_id + t2_fake_id) AS fakeId,
- SUM(t1_explosive + t2_explosive) AS explosive,
- SUM(t1_tool + t2_tool) AS tool,
- SUM(t1_gun_ammo + t2_gun_ammo) AS gunAmmo,
- SUM(t1_illegal + t2_illegal) AS illegal,
- SUM(t1_other + t2_other) AS other
- FROM hk_seizure_stat
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- </select>
- <!-- 各大队查获数对比(按班次+大队分组)
- 同时提供 T1总数、T2总数、合计,支持3个柱状图:总量对比、T1对比、T2对比 -->
- <select id="getBrigadeSeizureCompare" resultType="com.sundot.airport.item.domain.HkScreenBrigadeSeizureVO">
- SELECT
- shift,
- brigade,
- SUM(t1_fire_source + t1_knife + t1_police_weapon + t1_firework + t1_live_animal
- + t1_corrosive + t1_fake_id + t1_explosive + t1_tool + t1_gun_ammo
- + t1_illegal + t1_other) AS t1Total,
- SUM(t2_fire_source + t2_knife + t2_police_weapon + t2_firework + t2_live_animal
- + t2_corrosive + t2_fake_id + t2_explosive + t2_tool + t2_gun_ammo
- + t2_illegal + t2_other) AS t2Total,
- SUM(t1_fire_source + t1_knife + t1_police_weapon + t1_firework + t1_live_animal
- + t1_corrosive + t1_fake_id + t1_explosive + t1_tool + t1_gun_ammo
- + t1_illegal + t1_other
- + t2_fire_source + t2_knife + t2_police_weapon + t2_firework + t2_live_animal
- + t2_corrosive + t2_fake_id + t2_explosive + t2_tool + t2_gun_ammo
- + t2_illegal + t2_other) AS grandTotal
- FROM hk_seizure_stat
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- GROUP BY shift, brigade
- ORDER BY shift ASC, brigade ASC
- </select>
- <!-- 不合规充电宝功能数据汇总 -->
- <select id="getPowerBankSummary" resultType="com.sundot.airport.item.domain.HkScreenPowerBankSummaryVO">
- SELECT
- SUM(t1_mail + t2_mail) AS mailTotal,
- SUM(t1_temp_store + t2_temp_store) AS tempStoreTotal,
- SUM(t1_abandon + t2_abandon) AS abandonTotal,
- SUM(t1_recall + t2_recall) AS recallTotal,
- SUM(t1_no3c + t2_no3c) AS no3cTotal,
- SUM(t1_unclear_mark + t2_unclear_mark) AS unclearMarkTotal,
- SUM(t1_excess_qty + t2_excess_qty) AS excessQtyTotal,
- SUM(t1_recall + t1_no3c + t1_unclear_mark + t1_excess_qty + t1_mail + t1_abandon + t1_temp_store
- + t2_recall + t2_no3c + t2_unclear_mark + t2_excess_qty + t2_mail + t2_abandon + t2_temp_store) AS bothTotal
- FROM hk_persuade_power_bank
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- </select>
- <!-- 待检区收缴禁带物品数据汇总 -->
- <select id="getPendingConfiscateSummary" resultType="com.sundot.airport.item.domain.HkScreenPendingConfiscateSummaryVO">
- SELECT
- SUM(t1_a_fire_source + t1_b_fire_source
- + t2_domestic_fire_source + t2_intl_fire_source + t2_transit_fire_source) AS fireSourceTotal,
- SUM(t1_a_liquid + t1_b_liquid
- + t2_domestic_liquid + t2_intl_liquid + t2_transit_liquid) AS liquidTotal,
- SUM(t1_a_other + t1_b_other
- + t2_domestic_other + t2_intl_other + t2_transit_other) AS otherTotal
- FROM hk_pending_confiscate
- <where>
- <if test="startDate != null">AND record_date >= #{startDate}</if>
- <if test="endDate != null">AND record_date <= #{endDate}</if>
- </where>
- </select>
- </mapper>
|