SELECT t.BAY_NO ,t.ship_cod FROM tos_ship_map t WHERE t.SHIP_COD = #{params.shipCod}
and t.BAY_NO = #{params.bayNo}
GROUP BY t.BAY_NO ,t.ship_cod
SELECT DISTINCT SUBSTR(BAY_NO, 1,3) BAY_NO FROM TOS_SHIP_NCL tsn WHERE tsn.VOYAGE_NO = #{voyageNo}
SELECT t.LAY_NO FROM tos_ship_map t WHERE t.SHIP_COD = #{shipCod} AND t.DECK_ID= #{deck} AND T.bay_no= #{bayNo} GROUP BY t.LAY_NO order by t.lay_no desc
SELECT t.ROW_NO FROM tos_ship_map t WHERE t.SHIP_COD = #{shipCod} AND t.DECK_ID= #{deck} AND T.bay_no= #{bayNo} and T.lay_no= #{layNo} GROUP BY t.ROW_NO
SELECT tsn.*, dag.allow_flag from (
(SELECT t.* FROM TOS_SHIP_NCL t WHERE t.VOYAGE_NO =#{voyageNo} and t.bay_no like '${shortBayNo}%') tsn
LEFT JOIN
dcv_allow_go_ship_lane_tx dag
ON tsn.SHIP_NO = dag.SHIP_NO AND tsn.BAY_NO = dag.BAY_NO)
SELECT tl.VOYAGE_NO as voyageNo,
tl.SHIP_NO as shipNo,
tl.CNTR as cntr,
tl.CNTR_CLASS as cntrClass,
tl.CNTR_SIZ_COD as cntrSizCod,
tl.CNTR_TYP_COD as cntrTypCod,
tl.CNTR_CORP_COD as cntrCorpCod,
tl.TRANS_PORT_COD as cntrCorpCod,
tl.CNTR_PLAC as cntrPlac ,
tl.BAY_NO as bayNo,
tl.COMM_STATUS as commStatus
FROM TOS_SHIP_NCL tl where tl.VOYAGE_NO =#{voyageNo} and tl.bay_no in
(SELECT concat(concat(t.bay_no,t.lay_no),row_no) FROM TOS_SHIP_MAP t where t.ship_cod= #{shipCod} and t.bay_no= #{bayNo} )
SELECT tl.VOYAGE_NO as voyageNo,
tl.SHIP_NO as shipNo,
tl.CNTR as cntr,
tl.CNTR_CLASS as cntrClass,
tl.CNTR_SIZ_COD as cntrSizCod,
tl.CNTR_TYP_COD as cntrTypCod,
tl.CNTR_CORP_COD as cntrCorpCod,
tl.TRANS_PORT_COD as cntrCorpCod,
tl.CNTR_PLAC as cntrPlac ,
tl.BAY_NO as bayNo,
tl.COMM_STATUS as commStatus
FROM TOS_SHIP_NCL tl where tl.cntr = #{cntr}
select t.* from TOS_SHIP_INFO t
1=1
and t.voyage_no LIKE CONCAT(CONCAT('%',#{params.voyageNo}),'%')
and t.SHIP_COD LIKE CONCAT(CONCAT('%',#{params.shipCod}),'%')
and t.berth_cod =#{params.berthCod}
and t.ship_stat_id =#{params.shipStatId}
order by t.eta asc
select t.* from c_cable t order by cast(cable_cod as int) asc
select t.*,
(select c.coor from cable_coor c where cast(c.cable_cod as int)=cast(t.beg_cable as int)) begcoor ,
(select c.coor from cable_coor c where cast(c.cable_cod as int)=cast(t.end_cable as int)) endcoor ,
(cast(t.beg_cable as int)+cast(t.end_cable as int))/2 cenCable,
(select c.coor from cable_coor c where c.cable_cod= ceil((cast(t.end_cable as int)+cast(t.beg_cable as int))/2)) centercoor
from tos_ship_info t where t.ship_stat_id='Y'
UPDATE Dcv_Allow_Go_Ship_Lane_Tx d SET ALLOW_FLAG= #{allowFlag} where SHIP_NO= #{shipNo} and CNTR= #{cntr} and BAY_NO= #{bayNo}
INSERT INTO Dcv_Allow_Go_Ship_Lane_Tx (SHIP_NO,CNTR,BAY_NO,ALLOW_FLAG,REC_USER)
values( #{shipNo}, #{cntr}, #{bayNo}, #{allowFlag}, #{recUser} )
MERGE INTO Dcv_Allow_Go_Ship_Lane_Tx T
USING (
select
#{item.shipNo} as SHIP_NO, #{item.cntr} as CNTR, #{item.bayNo} as BAY_NO, #{item.allowFlag} as ALLOW_FLAG, #{item.recUser} as REC_USER FROM DUAL
) T1
ON (T1.SHIP_NO= T.SHIP_NO AND T1.CNTR= T.CNTR and T1.BAY_NO=T.BAY_NO)
WHEN MATCHED THEN
UPDATE SET T.ALLOW_FLAG=T1.ALLOW_FLAG
WHEN NOT MATCHED THEN
INSERT
(SHIP_NO,CNTR,BAY_NO,ALLOW_FLAG,REC_USER)
VALUES
(T1.SHIP_NO,T1.CNTR,T1.BAY_NO,T1.ALLOW_FLAG,T1.REC_USER)
SELECT tl.VOYAGE_NO as voyageNo,
tl.SHIP_NO as shipNo,
tl.CNTR as cntr,
tl.CNTR_CLASS as cntrClass,
tl.CNTR_SIZ_COD as cntrSizCod,
tl.CNTR_TYP_COD as cntrTypCod,
tl.CNTR_CORP_COD as cntrCorpCod,
tl.TRANS_PORT_COD as cntrCorpCod,
tl.CNTR_PLAC as cntrPlac ,
tl.BAY_NO as bayNo,
tl.COMM_STATUS as commStatus
FROM TOS_SHIP_NCL tl where tl.VOYAGE_NO = #{voyageNo}
select * from TOS_SHIP_MAP t where t.ship_cod= #{shipCod} and t.bay_no= #{bayNo}
select * from DCV_CY_AREA_MACH_VW where MACH_NO= #{portCode}
select f_get_ops_bay_no(#{voyageNo},#{portCode}) from dual
delete from DCV_ALLOW_GO_SHIP_LANE_TX where
SHIP_NO= #{item.shipNo} AND CNTR= #{item.cntr} and BAY_NO=#{item.bayNo}