<?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.faStatistics.crackdownStatus.mapper.CrackdownStatusMapper">
    <sql id="selectCrackdownStatusListWhere">
        <where>

        </where>
    </sql>

    <select id="selectCrackdownStatusList" resultType="CrackdownStatus" parameterType="CrackdownStatus">
    SELECT
        c.cds_key
        , c.case_num
        , c.napo_dt
        , c.napo_sea_point_lon
        , c.napo_sea_point_lat
        , c.napo_sea_point_detail
        , c.invasion_type
        , c.nll
        , c.case_agency
        , c.case_police_officer
        , c.crackdown_boat
        , c.crackdown_police
        , c.mmsi
        , c.field_ivsgt
        , c.obstr_exspd_cnt
        , c.person_damage_cnt
        , c.person_damage_amount
        , c.person_damage_detail
        , c.material_damage_cnt
        , c.material_damage_amount
        , c.material_damage_detail
        , c.field_ivsgt_napo_dt
        , c.field_ivsgt_release_dt
        , c.field_ivsgt_time_taken
        , c.pressurized_start_dt
        , c.pressurized_end_dt
        , c.distance
        , c.wrt_organ
        , c.wrt_user_seq
        , c.wrt_nm
        , c.wrt_dt
    FROM crackdown_status c
    <include refid="selectCrackdownStatusListWhere"></include>
    ORDER BY c.cds_key DESC
    LIMIT #{rowCnt} OFFSET #{firstIndex}
    </select>

    <select id="selectCrackdownStatusListCnt" resultType="int" parameterType="CrackdownStatus">
    SELECT count(*)
    FROM crackdown_status
    <include refid="selectCrackdownStatusListWhere"></include>
    </select>
</mapper>