|
@@ -117,38 +117,45 @@
|
|
|
decode(g.SENDMSG,1,'已发送','未发送') SENDMSG,
|
|
|
decode(g.RELIEVETYPE,1,'出港',2,'污染物排放',3,'预警超过5天',4,'监管类型变化',5,'人工核对解除',6,'版本切换解除') relieveType ,to_char(g.RELIEVETIME,'yyyy-mm-dd hh24:mi:ss') RELIEVETIME
|
|
|
from (select * from GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_WARNING_S
|
|
|
- where (FILTERSTATE = 1 or warncount >= 3) and deleteflag = 0 and RELIEVETYPE = 0) g
|
|
|
+ where (FILTERSTATE = 1 or warncount >= 3) and deleteflag = 0 and RELIEVETYPE = 0
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and WARNINGTIME >= to_date(#{startTime}|| ' 00:00:00','yyyy-mm-dd hh24:mi:ss')
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and WARNINGTIME <= to_date(#{endTime}|| ' 23:59:59','yyyy-mm-dd hh24:mi:ss')
|
|
|
+ </if>
|
|
|
+ ) g
|
|
|
left join (
|
|
|
- select a.waningcode,a.supervisiontype from ghjg_dynamic.boat_inport_ais_new a
|
|
|
- where a.deleteflag = 0 and a.waningcode is not null
|
|
|
+ select a.waningcode,a.supervisiontype from ghjg_dynamic.boat_inport_ais_new a
|
|
|
+ where a.deleteflag = 0 and a.waningcode is not null
|
|
|
)bia on bia.waningcode = g.code
|
|
|
left join ghjg_basics.boat_short_barge b on b.mmsi = g.mmsi
|
|
|
left join ghjg_basics.mvw_boat_info k on k.mmsi = g.mmsi
|
|
|
left join ghjg_basics.mvw_boat_info kk on kk.ship_name_cn = g.boatname
|
|
|
left join (
|
|
|
- select b1.* from GHJG_BASICS.DICT_DISTRICT_PORT b1
|
|
|
- where b1.valid = '有效'
|
|
|
+ select b1.* from GHJG_BASICS.DICT_DISTRICT_PORT b1
|
|
|
+ where b1.valid = '有效'
|
|
|
) b on g.berthname = b.BERTHNAME
|
|
|
left join (
|
|
|
- select * from (
|
|
|
- select acc.*,row_number() over(partition by acc.ship_name order by acc.first_dtm desc) rn
|
|
|
- from GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_ACCEPT_F acc where acc.SEWAGE_TYPE = 'sewage'
|
|
|
- and acc.First_Dtm >= sysdate - 30
|
|
|
- ) where rn = 1
|
|
|
+ select * from (
|
|
|
+ select acc.*,row_number() over(partition by acc.ship_name order by acc.first_dtm desc) rn
|
|
|
+ from GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_ACCEPT_F acc where acc.SEWAGE_TYPE = 'sewage'
|
|
|
+ and acc.First_Dtm >= sysdate - 10
|
|
|
+ ) where rn = 1
|
|
|
) asw on asw.SHIP_NAME = g.boatname
|
|
|
left join (
|
|
|
- select * from (
|
|
|
- select acc.*,row_number() over(partition by acc.ship_name order by acc.first_dtm desc) rn
|
|
|
- from GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_ACCEPT_F acc where acc.SEWAGE_TYPE = 'rubbish'
|
|
|
- and acc.First_Dtm >= sysdate - 30
|
|
|
- ) where rn = 1
|
|
|
+ select * from (
|
|
|
+ select acc.*,row_number() over(partition by acc.ship_name order by acc.first_dtm desc) rn
|
|
|
+ from GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_ACCEPT_F acc where acc.SEWAGE_TYPE = 'rubbish'
|
|
|
+ and acc.First_Dtm >= sysdate - 10
|
|
|
+ ) where rn = 1
|
|
|
) asl on asl.SHIP_NAME = g.boatname
|
|
|
left join (
|
|
|
- select * from (
|
|
|
- select acc.*,row_number() over(partition by acc.ship_name order by acc.first_dtm desc) rn
|
|
|
- from GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_ACCEPT_F acc where acc.SEWAGE_TYPE = 'oilsewage'
|
|
|
- and acc.First_Dtm >= sysdate - 30
|
|
|
- ) where rn = 1
|
|
|
+ select * from (
|
|
|
+ select acc.*,row_number() over(partition by acc.ship_name order by acc.first_dtm desc) rn
|
|
|
+ from GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_ACCEPT_F acc where acc.SEWAGE_TYPE = 'oilsewage'
|
|
|
+ and acc.First_Dtm >= sysdate - 10
|
|
|
+ ) where rn = 1
|
|
|
) ayw on ayw.SHIP_NAME = g.boatname
|
|
|
where g.relievetype = 0 and g.deleteflag = 0
|
|
|
) tt
|
|
@@ -162,12 +169,6 @@
|
|
|
<if test="mmsi != null and mmsi != ''">
|
|
|
and tt.mmsi = #{mmsi}
|
|
|
</if>
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- and tt.WARNINGTIME >= to_date(#{startTime}|| ' 00:00:00','yyyy-mm-dd hh24:mi:ss')
|
|
|
- </if>
|
|
|
- <if test="endTime != null and endTime != ''">
|
|
|
- and tt.WARNINGTIME <= to_date(#{endTime}|| ' 23:59:59','yyyy-mm-dd hh24:mi:ss')
|
|
|
- </if>
|
|
|
<if test="jurisdiction != null and jurisdiction != ''">
|
|
|
and tt.district like #{jurisdiction} || '%'
|
|
|
</if>
|
|
@@ -208,12 +209,18 @@
|
|
|
decode(g.RELIEVETYPE,1,'离港',2,'已排放',3,'预警超5天',4,'监管类型变化',5,'人工核对解除',6,'版本升级解除','其它')
|
|
|
RELIEVETYPE
|
|
|
from (
|
|
|
- select * from (
|
|
|
- select w.*,row_number() over(partition by w.boatname order by w.warningtime desc) num from
|
|
|
- GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_WARNING_S w
|
|
|
- where w.deleteflag = 0 and decode(w.relievetime,null,1,2) = 2 and (w.FILTERSTATE = 1 or
|
|
|
- w.warncount >= 3)
|
|
|
- ) where num = 1
|
|
|
+ select * from (
|
|
|
+ select w.*,row_number() over(partition by w.boatname order by w.warningtime desc) num from
|
|
|
+ GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_WARNING_S w
|
|
|
+ where w.deleteflag = 0 and decode(w.relievetime,null,1,2) = 2 and (w.FILTERSTATE = 1 or
|
|
|
+ w.warncount >= 3)
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and w.WARNINGTIME >= to_date(#{startTime}|| ' 00:00:00','yyyy-mm-dd hh24:mi:ss')
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and w.WARNINGTIME <= to_date(#{endTime}|| ' 23:59:59','yyyy-mm-dd hh24:mi:ss')
|
|
|
+ </if>
|
|
|
+ ) where num = 1
|
|
|
) g
|
|
|
left join ghjg_dynamic.boat_inport_ais_new bia on bia.waningcode = g.code
|
|
|
left join ghjg_basics.boat_short_barge b on b.mmsi = g.mmsi
|
|
@@ -227,7 +234,12 @@
|
|
|
select * from (
|
|
|
select acc.*,row_number() over(partition by acc.ship_name order by acc.first_dtm desc) rn
|
|
|
from GHJG_BUSSINESS.BOAT_WATER_POLLUTANT_ACCEPT_F acc where acc.SEWAGE_TYPE = 'sewage'
|
|
|
- and acc.First_Dtm >= sysdate - 60
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and acc.first_dtm >= to_date(#{startTime}|| ' 00:00:00','yyyy-mm-dd hh24:mi:ss') - 10
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and acc.first_dtm <= to_date(#{endTime}|| ' 23:59:59','yyyy-mm-dd hh24:mi:ss')
|
|
|
+ </if>
|
|
|
) where rn = 1
|
|
|
) asw on asw.SHIP_NAME = g.boatname
|
|
|
) tt
|
|
@@ -242,12 +254,6 @@
|
|
|
<if test="mmsi != null and mmsi != ''">
|
|
|
and tt.mmsi = #{mmsi}
|
|
|
</if>
|
|
|
- <if test="startTime != null and startTime != ''">
|
|
|
- and tt.WARNINGTIME >= to_date(#{startTime}|| ' 00:00:00','yyyy-mm-dd hh24:mi:ss')
|
|
|
- </if>
|
|
|
- <if test="endTime != null and endTime != ''">
|
|
|
- and tt.WARNINGTIME <= to_date(#{endTime}|| ' 23:59:59','yyyy-mm-dd hh24:mi:ss')
|
|
|
- </if>
|
|
|
<if test="jurisdiction != null and jurisdiction != ''">
|
|
|
and tt.district like #{jurisdiction} || '%'
|
|
|
</if>
|