status <> 'DST008'
AND organ = #{organ}
AND department = #{department}
AND crime_type = #{crimeType}
AND violation_type = #{violationType}
AND case_num = #{caseNum}
AND crime_name LIKE CONCAT('%', #{crimeName}, '%')
AND occur_table LIKE CONCAT('%', #{occurTable}, '%')
AND arrest_table LIKE CONCAT('%', #{arrestTable}, '%')
AND suspect_table LIKE CONCAT('%', #{suspectTable}, '%')
And crime_awareness_dt = #{crimeAwarenessDt}::DATE
AND case_sent_dt = #{caseSentDt}::DATE
AND ica_key in (
select ica_key
from ica_suspect_info
where process_result = #{processResult}
)
And wrt_dt >= #{startDate}::DATE
AND wrt_dt <= #{endDate}::DATE+1
SELECT a.ica_key,
a.organ,
a.department,
a.case_officer,
a.crime_type,
a.violation_type,
a.crime_name,
a.occur_table,
a.arrest_table,
a.suspect_table,
a.crime_awareness_dt,
a.case_sent_dt,
a.case_num,
a.wrt_organ,
a.wrt_part,
a.wrt_user_grd,
a.wrt_user_nm,
a.wrt_dt
FROM international_crime_arrest a
ORDER BY a.ica_key DESC
LIMIT #{rowCnt} OFFSET #{firstIndex}
SELECT count(*)
FROM international_crime_arrest a
SELECT
s.spi_key,
s.ica_key,
s.sex,
s.age,
s.country,
s.stay_qualification,
s.stay_period_expired_dt,
s.entry_visa
FROM suspect_person_info s
INNER JOIN international_crime_arrest i
ON s.ica_key = i.ica_key
WHERE s.ica_key = #{icaKey}
select a.item_value as crimeType ,
a.item_cd as crimeTypeCd,
b.item_value as violationType,
b.item_cd as violationTypeCd,
coalesce(c.caseCnt, 0) as caseCnt,
coalesce(c.suspectCnt, 0) as suspectCnt,
coalesce(c.arrestCnt, 0) as arrestCnt,
coalesce(c.arrestSuspectCnt, 0) as arrestSuspectCnt,
coalesce(c.pcr001Cnt, 0) as pcr001Cnt,
coalesce(c.pcr002Cnt, 0) as pcr002Cnt,
coalesce(c.pcr003Cnt, 0) as pcr003Cnt,
coalesce(c.pcr004Cnt, 0) as pcr004Cnt,
coalesce(c.pcr005Cnt, 0) as pcr005Cnt,
coalesce(c.pcr006Cnt, 0) as pcr006Cnt
from code_mgt a
inner join code_mgt b on a.category_cd = 'CTH' and a.item_cd = b.category_cd
left outer join (
select aa.crime_type,
aa.violation_type,
count(distinct aa.ica_key) as caseCnt,
count(*) as suspectCnt,
count(distinct case
when ab.process_result = 'PCR001'
or ab.process_result = 'PCR002'
or ab.process_result = 'PCR003' then aa.ica_key
else null
end) as arrestCnt,
sum(case
when ab.process_result = 'PCR001'
or ab.process_result = 'PCR002'
or ab.process_result = 'PCR003' then 1
else 0
end) as arrestSuspectCnt,
sum(case when ab.process_result = 'PCR001' then 1 else 0 end) as pcr001Cnt,
sum(case when ab.process_result = 'PCR002' then 1 else 0 end) as pcr002Cnt,
sum(case when ab.process_result = 'PCR003' then 1 else 0 end) as pcr003Cnt,
sum(case when ab.process_result = 'PCR004' then 1 else 0 end) as pcr004Cnt,
sum(case when ab.process_result = 'PCR005' then 1 else 0 end) as pcr005Cnt,
sum(case when ab.process_result = 'PCR006' then 1 else 0 end) as pcr006Cnt
from international_crime_arrest aa
inner join ica_suspect_info ab on aa.ica_key = ab.ica_key
where
status <> 'DST008'
and department = #{organ}
and EXTRACT(YEAR FROM case_sent_dt) = ${year}
and EXTRACT(MONTH FROM case_sent_dt) = ${month}
group by crime_type, violation_type
) c on a.item_cd = c.crime_type and b.item_cd = c.violation_type
order by a.item_cd, b.item_cd
select distinct EXTRACT(YEAR FROM case_sent_dt)
from international_crime_arrest
where status <> 'DST008'