179 lines
6.3 KiB
XML
179 lines
6.3 KiB
XML
<?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.dbnt.faisp.main.faStatistics.unlawfulFishing.mapper.UnlawfulFishingMapper">
|
|
|
|
<select id="selectFishingBoatYearParam" resultType="int">
|
|
select distinct extract(year from napo_dt) as year
|
|
from crackdown_status
|
|
where napo_dt is not null
|
|
</select>
|
|
|
|
<select id="selectCrackdownInfoList" resultType="CrackdownInfo" parameterType="UnlawfulFishingParam">
|
|
select a.cds_key ,
|
|
case_num ,
|
|
napo_dt ,
|
|
napo_sea_point_lon ,
|
|
napo_sea_point_lat ,
|
|
napo_sea_point_detail ,
|
|
invasion_type ,
|
|
nll ,
|
|
case_agency ,
|
|
case_police_officer ,
|
|
crackdown_police ,
|
|
crackdown_boat ,
|
|
mmsi ,
|
|
field_ivsgt ,
|
|
wrt_organ ,
|
|
wrt_part ,
|
|
wrt_user_grd ,
|
|
wrt_user_nm ,
|
|
wrt_dt ,
|
|
violationStr,
|
|
violationCode
|
|
from crackdown_info a
|
|
left outer join (
|
|
select aa.cds_key,
|
|
array_to_string(array_agg(ab.item_value), ', ') as violationStr,
|
|
array_to_string(array_agg(ab.item_cd), ', ') as violationCode
|
|
from violation_info aa
|
|
inner join code_mgt ab on aa.violation = ab.item_cd
|
|
group by aa.cds_key
|
|
) vi on a.cds_key = vi.cds_key
|
|
<include refid="selectCrackdownInfoListWhere"></include>
|
|
order by a.wrt_dt desc
|
|
limit #{rowCnt} offset #{firstIndex}
|
|
</select>
|
|
<select id="selectCrackdownInfoListCnt" resultType="int" parameterType="UnlawfulFishingParam">
|
|
select count(*)
|
|
from crackdown_info a
|
|
left outer join (
|
|
select aa.cds_key,
|
|
array_to_string(array_agg(ab.item_value), ', ') as violationStr,
|
|
array_to_string(array_agg(ab.item_cd), ', ') as violationCode
|
|
from violation_info aa
|
|
inner join code_mgt ab on aa.violation = ab.item_cd
|
|
group by aa.cds_key
|
|
) vi on a.cds_key = vi.cds_key
|
|
<include refid="selectCrackdownInfoListWhere"></include>
|
|
</select>
|
|
<sql id="selectCrackdownInfoListWhere">
|
|
where status <> 'DST008'
|
|
<if test='caseAgency != null and caseAgency != ""'>
|
|
and case_agency = #{caseAgency}
|
|
</if>
|
|
<if test='casePoliceOfficer != null and casePoliceOfficer != ""'>
|
|
and case_police_officer like '%'||#{casePoliceOfficer}||'%'
|
|
</if>
|
|
<if test='crackdownPolice != null and crackdownPolice != ""'>
|
|
and crackdown_police = #{crackdownPolice}
|
|
</if>
|
|
<if test='crackdownBoat != null and crackdownBoat != ""'>
|
|
and crackdown_boat = #{crackdownBoat}
|
|
</if>
|
|
<if test='caseNum != null and caseNum != ""'>
|
|
and case_num like '%'||#{caseNum}||'%'
|
|
</if>
|
|
<if test='mmsi != null and mmsi != ""'>
|
|
and mmsi like '%'||#{mmsi}||'%'
|
|
</if>
|
|
<if test='napoPoint != null and napoPoint != ""'>
|
|
and (napo_sea_point_lon like '%'||#{napoPoint}||'%'
|
|
or napo_sea_point_lat like '%'||#{napoPoint}||'%'
|
|
or napo_sea_point_detail like '%'||#{napoPoint}||'%')
|
|
</if>
|
|
<if test='dateSelector == "napoDt"'>
|
|
<if test='startDate != null and startDate != ""'>
|
|
and napo_dt >= #{startDate}::date
|
|
</if>
|
|
<if test='endDate != null and endDate != ""'>
|
|
and napo_dt <= #{endDate}::date
|
|
</if>
|
|
</if>
|
|
<if test='dateSelector == "wrtDt"'>
|
|
<if test='startDate != null and startDate != ""'>
|
|
and wrt_dt >= #{startDate}::date
|
|
</if>
|
|
<if test='endDate != null and endDate != ""'>
|
|
and wrt_dt <= #{endDate}::date
|
|
</if>
|
|
</if>
|
|
</sql>
|
|
|
|
|
|
<select id="selectIllegalShipInfoList" resultType="IllegalShipInfo" parameterType="UnlawfulFishingParam">
|
|
select fb_key,
|
|
a.cds_key ,
|
|
b.case_num ,
|
|
boat_name_kr,
|
|
permit_num,
|
|
nationality,
|
|
sailor_cnt,
|
|
ton_cnt,
|
|
fishery_type,
|
|
boat_material,
|
|
boat_nny_sung,
|
|
boat_nny_si,
|
|
a.wrt_organ ,
|
|
a.wrt_part ,
|
|
a.wrt_user_grd ,
|
|
a.wrt_user_nm ,
|
|
a.wrt_dt
|
|
from illegal_ship_info a
|
|
left outer join crackdown_info b on a.cds_key = b.cds_key
|
|
<include refid="selectIllegalShipInfoListWhere"></include>
|
|
order by a.wrt_dt desc
|
|
limit #{rowCnt} offset #{firstIndex}
|
|
</select>
|
|
<select id="selectIllegalShipInfoListCnt" resultType="int" parameterType="UnlawfulFishingParam">
|
|
select count(*)
|
|
from illegal_ship_info a
|
|
<include refid="selectIllegalShipInfoListWhere"></include>
|
|
</select>
|
|
<sql id="selectIllegalShipInfoListWhere">
|
|
where a.status <> 'DST008'
|
|
<if test='caseNum != null and caseNum != ""'>
|
|
and b.case_num like '%'||#{caseNum}||'%'
|
|
</if>
|
|
<if test='permitNum != null and permitNum != ""'>
|
|
and a.permit_num like '%'||#{permitNum}||'%'
|
|
</if>
|
|
<if test='boatNny != null and boatNny != ""'>
|
|
and (a.boat_nny_sung like '%'||#{boatNny}||'%' or a.boat_nny_si like '%'||#{boatNny}||'%')
|
|
</if>
|
|
<if test='boatName != null and boatName != ""'>
|
|
and (a.boat_name_kr like '%'||#{boatName}||'%' or a.boat_name_cn like '%'||#{boatName}||'%')
|
|
</if>
|
|
<if test='boatMaterial != null and boatMaterial != ""'>
|
|
and a.boat_material = #{boatMaterial}
|
|
</if>
|
|
<if test='fisheryType != null and fisheryType != ""'>
|
|
and a.fishery_type = #{fisheryType}
|
|
</if>
|
|
<if test='dateSelector == "paymentDt"'>
|
|
<if test='startDate != null and startDate != ""'>
|
|
and a.payment_payment_dt >= #{startDate}::date
|
|
</if>
|
|
<if test='endDate != null and endDate != ""'>
|
|
and a.payment_payment_dt <= #{endDate}::date+1
|
|
</if>
|
|
</if>
|
|
<if test='dateSelector == "wrtDt"'>
|
|
<if test='startDate != null and startDate != ""'>
|
|
and a.wrt_dt >= #{startDate}::date
|
|
</if>
|
|
<if test='endDate != null and endDate != ""'>
|
|
and a.wrt_dt <= #{endDate}::date+1
|
|
</if>
|
|
</if>
|
|
</sql>
|
|
|
|
<select id="selectShipProcessInfoList" resultType="ShipProcessInfo" parameterType="UnlawfulFishingParam">
|
|
|
|
</select>
|
|
<select id="selectShipProcessInfoListCnt" resultType="int" parameterType="UnlawfulFishingParam">
|
|
|
|
</select>
|
|
</mapper> |