|
|
@@ -0,0 +1,332 @@
|
|
|
+<?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.ruoyi.business.mapper.BjDetailMapper">
|
|
|
+ <resultMap id="releasedVoGet" type="com.ruoyi.business.domain.vo.BjReleasedVo">
|
|
|
+ <result property="releasedId" column="released_id"/>
|
|
|
+ <result property="violationNumber" column="violation_number"/>
|
|
|
+ <result property="releasedUnit" column="released_unit"/>
|
|
|
+ <result property="releasedDate" column="released_date"/>
|
|
|
+ <result property="chineseVesselName" column="chinese_vessel_name"/>
|
|
|
+ <result property="englishVesselName" column="english_vessel_name"/>
|
|
|
+ <result property="portOfRegistry" column="port_of_registry"/>
|
|
|
+ <result property="vesselName" column="vessel_name"/>
|
|
|
+ <result property="vesselIdenNumber" column="vessel_iden_number"/>
|
|
|
+ <result property="vesselRegiNumber" column="vessel_regi_number"/>
|
|
|
+ <result property="initialRegiNumber" column="initial_regi_number"/>
|
|
|
+ <result property="shipSRNumber" column="ship_s_r_number"/>
|
|
|
+ <result property="imoNumber" column="imo_number"/>
|
|
|
+ <result property="licensePlateNumber" column="license_plate_number"/>
|
|
|
+ <result property="vesselType" column="vessel_type"/>
|
|
|
+ <result property="buildDate" column="build_date"/>
|
|
|
+ <result property="csnu" column="csnu"/>
|
|
|
+ <result property="createDept" column="create_dept"/>
|
|
|
+ <result property="mmsi" column="mmsi"/>
|
|
|
+ <result property="callSign" column="call_sign"/>
|
|
|
+ <result property="nationality" column="nationality"/>
|
|
|
+ <result property="theShipowner" column="the_shipowner"/>
|
|
|
+ <result property="ePhoneNumbers" column="e_phone_numbers"/>
|
|
|
+ <result property="shipOperators" column="ship_operators"/>
|
|
|
+ <result property="oPhoneNumbers" column="o_phone_numbers"/>
|
|
|
+ <result property="oro" column="oro"/>
|
|
|
+ <result property="tnforo" column="tnforo"/>
|
|
|
+ <result property="sid" column="sid"/>
|
|
|
+ <result property="releasedStatus" column="released_status"/>
|
|
|
+ <result property="receivingUnit" column="deptName"/>
|
|
|
+ <collection property="middleList" ofType="com.ruoyi.business.domain.vo.BjReleasedMiddleVo">
|
|
|
+ <result property="notificationMatters" column="notification_matters"/>
|
|
|
+ <result property="notificationStandards" column="notification_standards"/>
|
|
|
+ <result property="conm" column="conm"/>
|
|
|
+ <result property="notifiedMattersId" column="notified_matters_id"/>
|
|
|
+ <result property="wtis" column="wtis"/>
|
|
|
+ <result property="receivingUnitName" column="deptName"/>
|
|
|
+ <result property="oic" column="oic"/>
|
|
|
+ <result property="oirun" column="oirun"/>
|
|
|
+ <result property="apdFilePath" column="apd_file_path"/>
|
|
|
+ <result property="ertnmFilePath" column="ertnm_file_path"/>
|
|
|
+ <result property="omfnmFilePath" column="omfnm_file_path"/>
|
|
|
+ <result property="smr" column="smr"/>
|
|
|
+ <result property="smraFilePath" column="smra_file_path"/>
|
|
|
+ <result property="wfir" column="wfir"/>
|
|
|
+ </collection>
|
|
|
+ <collection property="middleLogList" ofType="com.ruoyi.business.domain.vo.BjLonmMiddleLogVo">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="notifiedMattersId" column="notified_matters_id"/>
|
|
|
+ <result property="receivingUnit" column="receiving_unit"/>
|
|
|
+ <result property="operationTime" column="operation_time"/>
|
|
|
+ <result property="notificationLink" column="notification_link"/>
|
|
|
+ <result property="par" column="par"/>
|
|
|
+ <result property="operationRecord" column="operation_record"/>
|
|
|
+ <result property="notificationStatus" column="notification_status"/>
|
|
|
+ <result property="todm" column="todm"/>
|
|
|
+ <result property="takeMeasures" column="take_measures"/>
|
|
|
+ <result property="doom" column="doom"/>
|
|
|
+ <result property="rarp" column="rarp"/>
|
|
|
+ <result property="opinions" column="opinions"/>
|
|
|
+ <result property="filePath" column="file_path"/>
|
|
|
+ </collection>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="queryReleased" resultMap="releasedVoGet">
|
|
|
+ SELECT
|
|
|
+ br.released_id,
|
|
|
+ br.violation_number,
|
|
|
+ br.released_unit,
|
|
|
+ br.released_date,
|
|
|
+ br.chinese_vessel_name,
|
|
|
+ br.english_vessel_name,
|
|
|
+ br.port_of_registry,
|
|
|
+ br.vessel_name,
|
|
|
+ br.vessel_iden_number,
|
|
|
+ br.vessel_regi_number,
|
|
|
+ br.initial_regi_number,
|
|
|
+ br.ship_s_r_number,
|
|
|
+ br.imo_number,
|
|
|
+ br.license_plate_number,
|
|
|
+ br.vessel_type,
|
|
|
+ br.build_date,
|
|
|
+ br.create_by,
|
|
|
+ br.create_time,
|
|
|
+ br.update_by,
|
|
|
+ br.update_time,
|
|
|
+ br.del_flag,
|
|
|
+ br.csnu,
|
|
|
+ br.create_dept,
|
|
|
+ br.mmsi,
|
|
|
+ br.call_sign,
|
|
|
+ br.nationality,
|
|
|
+ br.the_shipowner,
|
|
|
+ br.e_phone_numbers,
|
|
|
+ br.ship_operators,
|
|
|
+ br.o_phone_numbers,
|
|
|
+ br.oro,
|
|
|
+ br.tnforo,
|
|
|
+ br.sid,
|
|
|
+ br.released_status,
|
|
|
+ bl.notification_matters,
|
|
|
+ bl.notification_standards,
|
|
|
+ bl.conm,
|
|
|
+ bl.notified_matters_id,
|
|
|
+ brm.wtis,
|
|
|
+ blm.deptName,
|
|
|
+ brm.oic,
|
|
|
+ brm.oirun,
|
|
|
+ brm.apd_file_path,
|
|
|
+ brm.ertnm_file_path,
|
|
|
+ brm.omfnm_file_path,
|
|
|
+ brm.smr,
|
|
|
+ brm.smra_file_path,
|
|
|
+ brm.wfir,
|
|
|
+ blml.id,
|
|
|
+ blml.receiving_unit,
|
|
|
+ blml.operation_time,
|
|
|
+ blml.notification_link,
|
|
|
+ blml.par,
|
|
|
+ blml.operation_record,
|
|
|
+ blml.notification_status,
|
|
|
+ blml.todm,
|
|
|
+ blml.take_measures,
|
|
|
+ blml.doom,
|
|
|
+ blml.rarp,
|
|
|
+ blml.opinions,
|
|
|
+ blml.file_path
|
|
|
+ FROM
|
|
|
+ bj_released br
|
|
|
+ left join bj_released_middle brm on br.released_id = brm.released_id
|
|
|
+ left join bj_lonm bl on brm.notified_matters_id = bl.notified_matters_id
|
|
|
+ left join (select blm.notified_matters_id,LISTAGG(sd.dept_name,',') deptName from bj_lonm_middle blm
|
|
|
+ left join sys_dept sd on blm.receiving_unit = sd.dept_id group by blm.notified_matters_id) blm
|
|
|
+ on blm.notified_matters_id = brm.notified_matters_id
|
|
|
+ left join bj_lonm_middle_log blml on brm.notified_matters_id = blml.notified_matters_id
|
|
|
+ where
|
|
|
+ br.del_flag = '0'and br.released_id = #{releasedId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <resultMap id="releasedVoList" type="com.ruoyi.business.domain.vo.BjReleasedVo">
|
|
|
+ <result property="releasedId" column="released_id"/>
|
|
|
+ <result property="violationNumber" column="violation_number"/>
|
|
|
+ <result property="releasedUnit" column="released_unit"/>
|
|
|
+ <result property="releasedDate" column="released_date"/>
|
|
|
+ <result property="chineseVesselName" column="chinese_vessel_name"/>
|
|
|
+ <result property="englishVesselName" column="english_vessel_name"/>
|
|
|
+ <result property="portOfRegistry" column="port_of_registry"/>
|
|
|
+ <result property="vesselName" column="vessel_name"/>
|
|
|
+ <result property="vesselIdenNumber" column="vessel_iden_number"/>
|
|
|
+ <result property="vesselRegiNumber" column="vessel_regi_number"/>
|
|
|
+ <result property="initialRegiNumber" column="initial_regi_number"/>
|
|
|
+ <result property="shipSRNumber" column="ship_s_r_number"/>
|
|
|
+ <result property="imoNumber" column="imo_number"/>
|
|
|
+ <result property="licensePlateNumber" column="license_plate_number"/>
|
|
|
+ <result property="vesselType" column="vessel_type"/>
|
|
|
+ <result property="buildDate" column="build_date"/>
|
|
|
+ <result property="csnu" column="csnu"/>
|
|
|
+ <result property="callSign" column="call_sign"/>
|
|
|
+ <result property="userPhone" column="userPhone"/>
|
|
|
+ <result property="releasedUnitStr" column="releasedUnitStr"/>
|
|
|
+ <result property="conmStr" column="conmStr"/>
|
|
|
+ <result property="names" column="names"/>
|
|
|
+ <result property="releaseStatusStr" column="releaseStatusStr"/>
|
|
|
+ <result property="wfirStr" column="wfirStr"/>
|
|
|
+ <result property="notificationStatusStr" column="notificationStatusStr"/>
|
|
|
+ <result property="overdueStatusStr" column="overdueStatusStr"/>
|
|
|
+ <result property="takeMeasuresStr" column="takeMeasuresStr"/>
|
|
|
+ <result property="publishers" column="publishers"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="queryReleasedList" resultMap="releasedVoList">
|
|
|
+ select
|
|
|
+ DISTINCT ON
|
|
|
+ (br.released_id)
|
|
|
+ br.released_id,
|
|
|
+ br.violation_number,
|
|
|
+ br.released_unit,
|
|
|
+ br.released_date,
|
|
|
+ br.chinese_vessel_name,
|
|
|
+ br.english_vessel_name,
|
|
|
+ br.port_of_registry,
|
|
|
+ br.vessel_name,
|
|
|
+ br.vessel_iden_number,
|
|
|
+ br.vessel_regi_number,
|
|
|
+ br.initial_regi_number,
|
|
|
+ br.ship_s_r_number,
|
|
|
+ br.imo_number,
|
|
|
+ br.license_plate_number,
|
|
|
+ br.vessel_type,
|
|
|
+ br.build_date,
|
|
|
+ br.create_by,
|
|
|
+ br.create_time,
|
|
|
+ br.update_by,
|
|
|
+ br.update_time,
|
|
|
+ br.del_flag,
|
|
|
+ br.csnu,
|
|
|
+ br.create_dept,
|
|
|
+ br.mmsi,
|
|
|
+ br.call_sign,
|
|
|
+ br.nationality,
|
|
|
+ br.the_shipowner,
|
|
|
+ br.e_phone_numbers,
|
|
|
+ br.ship_operators,
|
|
|
+ br.o_phone_numbers,
|
|
|
+ br.oro,
|
|
|
+ br.tnforo,
|
|
|
+ br.sid,
|
|
|
+ br.released_status,
|
|
|
+ brm.*,
|
|
|
+ sd.dept_name as releasedUnitStr,
|
|
|
+ bl.conmStr,
|
|
|
+ blm.names,
|
|
|
+ sdd.dict_label as releaseStatusStr,
|
|
|
+ sdd2.dict_label as wfirStr,
|
|
|
+ sdd3.dict_label as notificationStatusStr,
|
|
|
+ sdd4.dict_label as takeMeasuresStr,
|
|
|
+ sdd5.dict_label as overdueStatusStr,
|
|
|
+ blm2.publishers
|
|
|
+ from
|
|
|
+ bj_released br
|
|
|
+ left join bj_released_middle brm on
|
|
|
+ br.released_id = brm.released_id
|
|
|
+ left join sys_dict_data sdd2 on
|
|
|
+ sdd2.dict_value = brm.wfir
|
|
|
+ and sdd2.dict_type = 'bj_is_feedback'
|
|
|
+ left join (
|
|
|
+ select
|
|
|
+ bl.*,
|
|
|
+ sdd.dict_label as conmStr
|
|
|
+ from
|
|
|
+ bj_lonm bl
|
|
|
+ left join sys_dict_data sdd on
|
|
|
+ bl.conm = sdd.dict_value
|
|
|
+ and sdd.dict_type = 'bj_category_onm') bl on
|
|
|
+ bl.notified_matters_id = brm.notified_matters_id
|
|
|
+ left join (
|
|
|
+ select
|
|
|
+ notified_matters_id as nmid,
|
|
|
+ LISTAGG(sd.dept_name,
|
|
|
+ ',') as names
|
|
|
+ from
|
|
|
+ bj_lonm_middle blm
|
|
|
+ left join sys_dept sd on
|
|
|
+ blm.receiving_unit = sd.dept_id
|
|
|
+ group by
|
|
|
+ notified_matters_id) blm on
|
|
|
+ bl.notified_matters_id = blm.nmid
|
|
|
+ left join bj_lonm_middle blm2 on
|
|
|
+ bl.notified_matters_id = blm2.notified_matters_id
|
|
|
+ left join sys_dept sd on
|
|
|
+ sd.dept_id = br.released_unit
|
|
|
+ left join (
|
|
|
+ select
|
|
|
+ unit_name,
|
|
|
+ LISTAGG(concat(contact_name,' ',contact_number),',') as userPhone
|
|
|
+ from
|
|
|
+ bj_ntlo
|
|
|
+ where
|
|
|
+ msg_recipient = '1'
|
|
|
+ and ab_status = '1'
|
|
|
+ group by
|
|
|
+ unit_name) bn on
|
|
|
+ bn.unit_name = blm2.receiving_unit
|
|
|
+ left join sys_dict_data sdd on
|
|
|
+ br.released_status = sdd.dict_value
|
|
|
+ and sdd.dict_type = 'bj_notify_os'
|
|
|
+ left join sys_dict_data sdd3 on
|
|
|
+ blm2.notification_status = sdd3.dict_value
|
|
|
+ and sdd3.dict_type = 'bj_notification_status'
|
|
|
+ left join sys_dict_data sdd4 on
|
|
|
+ blm2.take_measures = sdd4.dict_value
|
|
|
+ and sdd2.dict_type = 'bj_take_measures'
|
|
|
+ left join sys_dict_data sdd5 on
|
|
|
+ blm2.overdue_status = sdd5.dict_value
|
|
|
+ and sdd5.dict_type = 'bj_overdue_status'
|
|
|
+ where
|
|
|
+ br.del_flag = '0'
|
|
|
+ <if test="bo.violationNumber != null and bo.violationNumber">
|
|
|
+ and br.violation_number like concat('%',#{bo.violationNumber},'%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.notificationType != null and bo.notificationType != ''">
|
|
|
+ and bl.notification_type = #{bo.notificationType}
|
|
|
+ </if>
|
|
|
+ <if test="bo.conm !=null and bo.conm != ''">
|
|
|
+ and bl.conm = #{bo.conm}
|
|
|
+ </if>
|
|
|
+ <if test="bo.notificationMatters != null and bo.notificationMatters != ''">
|
|
|
+ and bl.notification_matters like concat('%',#{bo.notificationMatters},'%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.releasedUnit != null and bo.releasedUnit != ''">
|
|
|
+ and br.released_unit = #{bo.releasedUnit}
|
|
|
+ </if>
|
|
|
+ <if test="bo.jsdw != null and bo.jsdw != ''">
|
|
|
+ and blm.receiving_unit = #{bo.jsdw}
|
|
|
+ </if>
|
|
|
+ <if test="bo.notificationStatus != null and bo.notificationStatus != ''">
|
|
|
+ and blm.notification_status = #{bo.notificationStatus}
|
|
|
+ </if>
|
|
|
+ <if test="bo.takeMeasures != null and bo.takeMeasures != ''">
|
|
|
+ and blm.take_measures = #{bo.takeMeasures}
|
|
|
+ </if>
|
|
|
+ <if test="bo.overdueStatus != null and bo.overdueStatus != ''">
|
|
|
+ and blm.overdue_status = #{bo.overdueStatus}
|
|
|
+ </if>
|
|
|
+ <if test="bo.vesselName != null and bo.vesselName != ''">
|
|
|
+ and br.vessel_name like concat('%',#{bo.vesselName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.theShipowner != null and bo.theShipowner != ''">
|
|
|
+ and br.the_shipowner like concat('%',#{bo.theShipowner},'%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.shipOperators != null and bo.shipOperators != ''">
|
|
|
+ and br.ship_operators like concat('%',#{bo.shipOperators},'%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.wfir != null and bo.wfir != ''">
|
|
|
+ and brm.wfir = #{bo.wfir}
|
|
|
+ </if>
|
|
|
+ <if test="bo.startReleaseDate != null and bo.endReleaseDate != null">
|
|
|
+ and br.released_date between #{bo.startReleaseDate} and #{bo.endReleaseDate}
|
|
|
+ </if>
|
|
|
+ <if test="bo.startAcceptanceDate != null and bo.endAcceptanceDate != null">
|
|
|
+ and blm.acceptance_date between #{bo.startAcceptanceDate} and #{bo.endAcceptanceDate}
|
|
|
+ </if>
|
|
|
+ order by br.released_id,
|
|
|
+ RANDOM()
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|