BjNotificationInformationMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.business.mapper.BjNotificationInformationMapper">
  6. <resultMap id="releasedVoGet" type="com.ruoyi.business.domain.vo.BjReleasedVo">
  7. <result property="releasedId" column="released_id"/>
  8. <result property="violationNumber" column="violation_number"/>
  9. <result property="releasedUnit" column="released_unit"/>
  10. <result property="releasedDate" column="released_date"/>
  11. <result property="chineseVesselName" column="chinese_vessel_name"/>
  12. <result property="englishVesselName" column="english_vessel_name"/>
  13. <result property="portOfRegistry" column="port_of_registry"/>
  14. <result property="vesselName" column="vessel_name"/>
  15. <result property="vesselIdenNumber" column="vessel_iden_number"/>
  16. <result property="vesselRegiNumber" column="vessel_regi_number"/>
  17. <result property="initialRegiNumber" column="initial_regi_number"/>
  18. <result property="shipSRNumber" column="ship_s_r_number"/>
  19. <result property="imoNumber" column="imo_number"/>
  20. <result property="licensePlateNumber" column="license_plate_number"/>
  21. <result property="vesselType" column="vessel_type"/>
  22. <result property="buildDate" column="build_date"/>
  23. <result property="csnu" column="csnu"/>
  24. <result property="createDept" column="create_dept"/>
  25. <result property="mmsi" column="mmsi"/>
  26. <result property="callSign" column="call_sign"/>
  27. <result property="nationality" column="nationality"/>
  28. <result property="theShipowner" column="the_shipowner"/>
  29. <result property="ePhoneNumbers" column="e_phone_numbers"/>
  30. <result property="shipOperators" column="ship_operators"/>
  31. <result property="oPhoneNumbers" column="o_phone_numbers"/>
  32. <result property="oro" column="oro"/>
  33. <result property="tnforo" column="tnforo"/>
  34. <result property="sid" column="sid"/>
  35. <result property="releasedStatus" column="released_status"/>
  36. <result property="receivingUnit" column="deptName"/>
  37. <collection property="middleList" ofType="com.ruoyi.business.domain.vo.BjReleasedMiddleVo">
  38. <result property="notificationMatters" column="notification_matters"/>
  39. <result property="notificationStandards" column="notification_standards"/>
  40. <result property="conm" column="conm"/>
  41. <result property="notifiedMattersId" column="notified_matters_id"/>
  42. <result property="wtis" column="wtis"/>
  43. <result property="receivingUnitName" column="deptName"/>
  44. <result property="oic" column="oic"/>
  45. <result property="oirun" column="oirun"/>
  46. <result property="apdFilePath" column="apd_file_path"/>
  47. <result property="ertnmFilePath" column="ertnm_file_path"/>
  48. <result property="omfnmFilePath" column="omfnm_file_path"/>
  49. <result property="smr" column="smr"/>
  50. <result property="smraFilePath" column="smra_file_path"/>
  51. <result property="wfir" column="wfir"/>
  52. </collection>
  53. <collection property="middleLogList" ofType="com.ruoyi.business.domain.vo.BjLonmMiddleLogVo">
  54. <result property="id" column="id"/>
  55. <result property="notifiedMattersId" column="notified_matters_id"/>
  56. <result property="receivingUnit" column="receiving_unit"/>
  57. <result property="operationTime" column="operation_time"/>
  58. <result property="notificationLink" column="notification_link"/>
  59. <result property="par" column="par"/>
  60. <result property="operationRecord" column="operation_record"/>
  61. <result property="notificationStatus" column="notification_status"/>
  62. <result property="todm" column="todm"/>
  63. <result property="takeMeasures" column="take_measures"/>
  64. <result property="doom" column="doom"/>
  65. <result property="rarp" column="rarp"/>
  66. <result property="opinions" column="opinions"/>
  67. <result property="filePath" column="file_path"/>
  68. </collection>
  69. </resultMap>
  70. <select id="queryReleased" resultMap="releasedVoGet">
  71. SELECT
  72. br.released_id,
  73. br.violation_number,
  74. br.released_unit,
  75. br.released_date,
  76. br.chinese_vessel_name,
  77. br.english_vessel_name,
  78. br.port_of_registry,
  79. br.vessel_name,
  80. br.vessel_iden_number,
  81. br.vessel_regi_number,
  82. br.initial_regi_number,
  83. br.ship_s_r_number,
  84. br.imo_number,
  85. br.license_plate_number,
  86. br.vessel_type,
  87. br.build_date,
  88. br.create_by,
  89. br.create_time,
  90. br.update_by,
  91. br.update_time,
  92. br.del_flag,
  93. br.csnu,
  94. br.create_dept,
  95. br.mmsi,
  96. br.call_sign,
  97. br.nationality,
  98. br.the_shipowner,
  99. br.e_phone_numbers,
  100. br.ship_operators,
  101. br.o_phone_numbers,
  102. br.oro,
  103. br.tnforo,
  104. br.sid,
  105. br.released_status,
  106. bl.notification_matters,
  107. bl.notification_standards,
  108. bl.conm,
  109. bl.notified_matters_id,
  110. brm.wtis,
  111. blm.deptName,
  112. brm.oic,
  113. brm.oirun,
  114. brm.apd_file_path,
  115. brm.ertnm_file_path,
  116. brm.omfnm_file_path,
  117. brm.smr,
  118. brm.smra_file_path,
  119. brm.wfir,
  120. blml.id,
  121. blml.receiving_unit,
  122. blml.operation_time,
  123. blml.notification_link,
  124. blml.par,
  125. blml.operation_record,
  126. blml.notification_status,
  127. blml.todm,
  128. blml.take_measures,
  129. blml.doom,
  130. blml.rarp,
  131. blml.opinions,
  132. blml.file_path
  133. FROM
  134. bj_released br
  135. left join bj_released_middle brm on br.released_id = brm.released_id
  136. left join bj_lonm bl on brm.notified_matters_id = bl.notified_matters_id
  137. left join (select blm.notified_matters_id,LISTAGG(sd.dept_name,',') deptName from bj_lonm_middle blm
  138. left join sys_dept sd on blm.receiving_unit = sd.dept_id group by blm.notified_matters_id) blm
  139. on blm.notified_matters_id = brm.notified_matters_id
  140. left join bj_lonm_middle_log blml on brm.notified_matters_id = blml.notified_matters_id
  141. where
  142. br.del_flag = '0'and br.released_id = #{releasedId}
  143. </select>
  144. <resultMap id="releasedVoList" type="com.ruoyi.business.domain.vo.BjReleasedVo">
  145. <result property="releasedId" column="released_id"/>
  146. <result property="violationNumber" column="violation_number"/>
  147. <result property="releasedUnit" column="released_unit"/>
  148. <result property="releasedDate" column="released_date"/>
  149. <result property="chineseVesselName" column="chinese_vessel_name"/>
  150. <result property="englishVesselName" column="english_vessel_name"/>
  151. <result property="portOfRegistry" column="port_of_registry"/>
  152. <result property="vesselName" column="vessel_name"/>
  153. <result property="vesselIdenNumber" column="vessel_iden_number"/>
  154. <result property="vesselRegiNumber" column="vessel_regi_number"/>
  155. <result property="initialRegiNumber" column="initial_regi_number"/>
  156. <result property="shipSRNumber" column="ship_s_r_number"/>
  157. <result property="imoNumber" column="imo_number"/>
  158. <result property="licensePlateNumber" column="license_plate_number"/>
  159. <result property="vesselType" column="vessel_type"/>
  160. <result property="buildDate" column="build_date"/>
  161. <result property="csnu" column="csnu"/>
  162. <result property="callSign" column="call_sign"/>
  163. <result property="userPhone" column="userPhone"/>
  164. <result property="releasedUnitStr" column="releasedUnitStr"/>
  165. <result property="conmStr" column="conmStr"/>
  166. <result property="names" column="names"/>
  167. <result property="releaseStatusStr" column="releaseStatusStr"/>
  168. <result property="wfirStr" column="wfirStr"/>
  169. <result property="notificationStatusStr" column="notificationStatusStr"/>
  170. <result property="overdueStatusStr" column="overdueStatusStr"/>
  171. <result property="takeMeasuresStr" column="takeMeasuresStr"/>
  172. <result property="publishers" column="publishers"/>
  173. </resultMap>
  174. <select id="queryReleasedList" resultMap="releasedVoList">
  175. select
  176. DISTINCT ON
  177. (br.released_id)
  178. br.released_id,
  179. br.violation_number,
  180. br.released_unit,
  181. br.released_date,
  182. br.chinese_vessel_name,
  183. br.english_vessel_name,
  184. br.port_of_registry,
  185. br.vessel_name,
  186. br.vessel_iden_number,
  187. br.vessel_regi_number,
  188. br.initial_regi_number,
  189. br.ship_s_r_number,
  190. br.imo_number,
  191. br.license_plate_number,
  192. br.vessel_type,
  193. br.build_date,
  194. br.create_by,
  195. br.create_time,
  196. br.update_by,
  197. br.update_time,
  198. br.del_flag,
  199. br.csnu,
  200. br.create_dept,
  201. br.mmsi,
  202. br.call_sign,
  203. br.nationality,
  204. br.the_shipowner,
  205. br.e_phone_numbers,
  206. br.ship_operators,
  207. br.o_phone_numbers,
  208. br.oro,
  209. br.tnforo,
  210. br.sid,
  211. br.released_status,
  212. brm.*,
  213. sd.dept_name as releasedUnitStr,
  214. bl.conmStr,
  215. blm.names,
  216. sdd.dict_label as releaseStatusStr,
  217. sdd2.dict_label as wfirStr,
  218. sdd3.dict_label as notificationStatusStr,
  219. sdd4.dict_label as takeMeasuresStr,
  220. sdd5.dict_label as overdueStatusStr,
  221. blm2.publishers
  222. from
  223. bj_released br
  224. left join bj_released_middle brm on
  225. br.released_id = brm.released_id
  226. left join sys_dict_data sdd2 on
  227. sdd2.dict_value = brm.wfir
  228. and sdd2.dict_type = 'bj_is_feedback'
  229. left join (
  230. select
  231. bl.*,
  232. sdd.dict_label as conmStr
  233. from
  234. bj_lonm bl
  235. left join sys_dict_data sdd on
  236. bl.conm = sdd.dict_value
  237. and sdd.dict_type = 'bj_category_onm') bl on
  238. bl.notified_matters_id = brm.notified_matters_id
  239. left join (
  240. select
  241. notified_matters_id as nmid,
  242. LISTAGG(sd.dept_name,
  243. ',') as names
  244. from
  245. bj_lonm_middle blm
  246. left join sys_dept sd on
  247. blm.receiving_unit = sd.dept_id
  248. group by
  249. notified_matters_id) blm on
  250. bl.notified_matters_id = blm.nmid
  251. left join bj_lonm_middle blm2 on
  252. bl.notified_matters_id = blm2.notified_matters_id
  253. left join sys_dept sd on
  254. sd.dept_id = br.released_unit
  255. left join (
  256. select
  257. unit_name,
  258. LISTAGG(concat(contact_name,' ',contact_number),',') as userPhone
  259. from
  260. bj_ntlo
  261. where
  262. msg_recipient = '1'
  263. and ab_status = '1'
  264. group by
  265. unit_name) bn on
  266. bn.unit_name = blm2.receiving_unit
  267. left join sys_dict_data sdd on
  268. br.released_status = sdd.dict_value
  269. and sdd.dict_type = 'bj_notify_os'
  270. left join sys_dict_data sdd3 on
  271. blm2.notification_status = sdd3.dict_value
  272. and sdd3.dict_type = 'bj_notification_status'
  273. left join sys_dict_data sdd4 on
  274. blm2.take_measures = sdd4.dict_value
  275. and sdd2.dict_type = 'bj_take_measures'
  276. left join sys_dict_data sdd5 on
  277. blm2.overdue_status = sdd5.dict_value
  278. and sdd5.dict_type = 'bj_overdue_status'
  279. where
  280. br.del_flag = '0'
  281. <if test="bo.violationNumber != null and bo.violationNumber">
  282. and br.violation_number like concat('%',#{bo.violationNumber},'%')
  283. </if>
  284. <if test="bo.notificationType != null and bo.notificationType != ''">
  285. and bl.notification_type = #{bo.notificationType}
  286. </if>
  287. <if test="bo.conm !=null and bo.conm != ''">
  288. and bl.conm = #{bo.conm}
  289. </if>
  290. <if test="bo.notificationMatters != null and bo.notificationMatters != ''">
  291. and bl.notification_matters like concat('%',#{bo.notificationMatters},'%')
  292. </if>
  293. <if test="bo.releasedUnit != null and bo.releasedUnit != ''">
  294. and br.released_unit = #{bo.releasedUnit}
  295. </if>
  296. <if test="bo.jsdw != null and bo.jsdw != ''">
  297. and blm.receiving_unit = #{bo.jsdw}
  298. </if>
  299. <if test="bo.notificationStatus != null and bo.notificationStatus != ''">
  300. and blm.notification_status = #{bo.notificationStatus}
  301. </if>
  302. <if test="bo.takeMeasures != null and bo.takeMeasures != ''">
  303. and blm.take_measures = #{bo.takeMeasures}
  304. </if>
  305. <if test="bo.overdueStatus != null and bo.overdueStatus != ''">
  306. and blm.overdue_status = #{bo.overdueStatus}
  307. </if>
  308. <if test="bo.vesselName != null and bo.vesselName != ''">
  309. and br.vessel_name like concat('%',#{bo.vesselName},'%')
  310. </if>
  311. <if test="bo.theShipowner != null and bo.theShipowner != ''">
  312. and br.the_shipowner like concat('%',#{bo.theShipowner},'%')
  313. </if>
  314. <if test="bo.shipOperators != null and bo.shipOperators != ''">
  315. and br.ship_operators like concat('%',#{bo.shipOperators},'%')
  316. </if>
  317. <if test="bo.wfir != null and bo.wfir != ''">
  318. and brm.wfir = #{bo.wfir}
  319. </if>
  320. <if test="bo.startReleaseDate != null and bo.endReleaseDate != null">
  321. and br.released_date between #{bo.startReleaseDate} and #{bo.endReleaseDate}
  322. </if>
  323. <if test="bo.startAcceptanceDate != null and bo.endAcceptanceDate != null">
  324. and blm.acceptance_date between #{bo.startAcceptanceDate} and #{bo.endAcceptanceDate}
  325. </if>
  326. order by br.released_id,
  327. RANDOM()
  328. </select>
  329. </mapper>