HkLargeScreenMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.sundot.airport.item.mapper.HkLargeScreenMapper">
  4. <!-- ============================= 模块一:运行数据 ============================= -->
  5. <!-- 运行数据汇总(5个大数字卡片) -->
  6. <select id="getOperationSummary" resultType="com.sundot.airport.item.domain.HkScreenOperationSummaryVO">
  7. SELECT
  8. SUM(a_zone + b_zone + vip + domestic_passenger + intl_passenger + vip_channel) AS passengerTotal,
  9. SUM(t1_luggage_check + t2_luggage_check) AS luggageTotal,
  10. SUM(domestic_cargo) AS domesticCargoTotal,
  11. SUM(intl_cargo) AS intlCargoTotal,
  12. SUM(south_vehicle_check + north_vehicle_check) AS vehicleCheckTotal
  13. FROM hk_operation_data
  14. <where>
  15. <if test="startDate != null">AND record_date >= #{startDate}</if>
  16. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  17. </where>
  18. </select>
  19. <!-- T1旅检过检人数趋势(A区/B区) -->
  20. <select id="getT1PassengerTrend" resultType="com.sundot.airport.item.domain.HkScreenT1PassengerTrendVO">
  21. SELECT record_date AS recordDate,
  22. a_zone AS aZone,
  23. b_zone AS bZone
  24. FROM hk_operation_data
  25. <where>
  26. <if test="startDate != null">AND record_date >= #{startDate}</if>
  27. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  28. </where>
  29. ORDER BY record_date ASC
  30. </select>
  31. <!-- T2旅检过检人数趋势(国内旅检/国际旅检) -->
  32. <select id="getT2PassengerTrend" resultType="com.sundot.airport.item.domain.HkScreenT2PassengerTrendVO">
  33. SELECT record_date AS recordDate,
  34. domestic_passenger AS domesticPassenger,
  35. intl_passenger AS intlPassenger
  36. FROM hk_operation_data
  37. <where>
  38. <if test="startDate != null">AND record_date >= #{startDate}</if>
  39. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  40. </where>
  41. ORDER BY record_date ASC
  42. </select>
  43. <!-- 行检过检数趋势(T1行检/T2行检) -->
  44. <select id="getLuggageCheckTrend" resultType="com.sundot.airport.item.domain.HkScreenLuggageCheckTrendVO">
  45. SELECT record_date AS recordDate,
  46. t1_luggage_check AS t1LuggageCheck,
  47. t2_luggage_check AS t2LuggageCheck
  48. FROM hk_operation_data
  49. <where>
  50. <if test="startDate != null">AND record_date >= #{startDate}</if>
  51. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  52. </where>
  53. ORDER BY record_date ASC
  54. </select>
  55. <!-- 货物过检数趋势(国内货站/国际货站) -->
  56. <select id="getCargoTrend" resultType="com.sundot.airport.item.domain.HkScreenCargoTrendVO">
  57. SELECT record_date AS recordDate,
  58. domestic_cargo AS domesticCargo,
  59. intl_cargo AS intlCargo
  60. FROM hk_operation_data
  61. <where>
  62. <if test="startDate != null">AND record_date >= #{startDate}</if>
  63. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  64. </where>
  65. ORDER BY record_date ASC
  66. </select>
  67. <!-- 车辆过检数趋势(南侧车检/北侧车检) -->
  68. <select id="getVehicleCheckTrend" resultType="com.sundot.airport.item.domain.HkScreenVehicleCheckTrendVO">
  69. SELECT record_date AS recordDate,
  70. south_vehicle_check AS southVehicleCheck,
  71. north_vehicle_check AS northVehicleCheck
  72. FROM hk_operation_data
  73. <where>
  74. <if test="startDate != null">AND record_date >= #{startDate}</if>
  75. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  76. </where>
  77. ORDER BY record_date ASC
  78. </select>
  79. <!-- ============================= 模块二:查获/收缴数据 ============================= -->
  80. <!-- 查获数据各类别合计(T1+T2) -->
  81. <select id="getSeizureCategoryTotal" resultType="com.sundot.airport.item.domain.HkScreenSeizureTotalVO">
  82. SELECT
  83. SUM(t1_fire_source + t2_fire_source) AS fireSource,
  84. SUM(t1_knife + t2_knife) AS knife,
  85. SUM(t1_police_weapon + t2_police_weapon) AS policeWeapon,
  86. SUM(t1_firework + t2_firework) AS firework,
  87. SUM(t1_live_animal + t2_live_animal) AS liveAnimal,
  88. SUM(t1_corrosive + t2_corrosive) AS corrosive,
  89. SUM(t1_fake_id + t2_fake_id) AS fakeId,
  90. SUM(t1_explosive + t2_explosive) AS explosive,
  91. SUM(t1_tool + t2_tool) AS tool,
  92. SUM(t1_gun_ammo + t2_gun_ammo) AS gunAmmo,
  93. SUM(t1_illegal + t2_illegal) AS illegal,
  94. SUM(t1_other + t2_other) AS other
  95. FROM hk_seizure_stat
  96. <where>
  97. <if test="startDate != null">AND record_date >= #{startDate}</if>
  98. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  99. </where>
  100. </select>
  101. <!-- 各大队查获数对比(按班次+大队分组)
  102. 同时提供 T1总数、T2总数、合计,支持3个柱状图:总量对比、T1对比、T2对比 -->
  103. <select id="getBrigadeSeizureCompare" resultType="com.sundot.airport.item.domain.HkScreenBrigadeSeizureVO">
  104. SELECT
  105. shift,
  106. brigade,
  107. SUM(t1_fire_source + t1_knife + t1_police_weapon + t1_firework + t1_live_animal
  108. + t1_corrosive + t1_fake_id + t1_explosive + t1_tool + t1_gun_ammo
  109. + t1_illegal + t1_other) AS t1Total,
  110. SUM(t2_fire_source + t2_knife + t2_police_weapon + t2_firework + t2_live_animal
  111. + t2_corrosive + t2_fake_id + t2_explosive + t2_tool + t2_gun_ammo
  112. + t2_illegal + t2_other) AS t2Total,
  113. SUM(t1_fire_source + t1_knife + t1_police_weapon + t1_firework + t1_live_animal
  114. + t1_corrosive + t1_fake_id + t1_explosive + t1_tool + t1_gun_ammo
  115. + t1_illegal + t1_other
  116. + t2_fire_source + t2_knife + t2_police_weapon + t2_firework + t2_live_animal
  117. + t2_corrosive + t2_fake_id + t2_explosive + t2_tool + t2_gun_ammo
  118. + t2_illegal + t2_other) AS grandTotal
  119. FROM hk_seizure_stat
  120. <where>
  121. <if test="startDate != null">AND record_date >= #{startDate}</if>
  122. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  123. </where>
  124. GROUP BY shift, brigade
  125. ORDER BY shift ASC, brigade ASC
  126. </select>
  127. <!-- 不合规充电宝功能数据汇总 -->
  128. <select id="getPowerBankSummary" resultType="com.sundot.airport.item.domain.HkScreenPowerBankSummaryVO">
  129. SELECT
  130. SUM(t1_mail + t2_mail) AS mailTotal,
  131. SUM(t1_temp_store + t2_temp_store) AS tempStoreTotal,
  132. SUM(t1_abandon + t2_abandon) AS abandonTotal,
  133. SUM(t1_recall + t2_recall) AS recallTotal,
  134. SUM(t1_no3c + t2_no3c) AS no3cTotal,
  135. SUM(t1_unclear_mark + t2_unclear_mark) AS unclearMarkTotal,
  136. SUM(t1_excess_qty + t2_excess_qty) AS excessQtyTotal,
  137. SUM(t1_recall + t1_no3c + t1_unclear_mark + t1_excess_qty + t1_mail + t1_abandon + t1_temp_store
  138. + t2_recall + t2_no3c + t2_unclear_mark + t2_excess_qty + t2_mail + t2_abandon + t2_temp_store) AS bothTotal
  139. FROM hk_persuade_power_bank
  140. <where>
  141. <if test="startDate != null">AND record_date >= #{startDate}</if>
  142. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  143. </where>
  144. </select>
  145. <!-- 待检区收缴禁带物品数据汇总 -->
  146. <select id="getPendingConfiscateSummary" resultType="com.sundot.airport.item.domain.HkScreenPendingConfiscateSummaryVO">
  147. SELECT
  148. SUM(t1_a_fire_source + t1_b_fire_source
  149. + t2_domestic_fire_source + t2_intl_fire_source + t2_transit_fire_source) AS fireSourceTotal,
  150. SUM(t1_a_liquid + t1_b_liquid
  151. + t2_domestic_liquid + t2_intl_liquid + t2_transit_liquid) AS liquidTotal,
  152. SUM(t1_a_other + t1_b_other
  153. + t2_domestic_other + t2_intl_other + t2_transit_other) AS otherTotal
  154. FROM hk_pending_confiscate
  155. <where>
  156. <if test="startDate != null">AND record_date >= #{startDate}</if>
  157. <if test="endDate != null">AND record_date &lt;= #{endDate}</if>
  158. </where>
  159. </select>
  160. </mapper>