<?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.ltgk.boat.mapper.DsEnterOutCrewCountryMapper">
    <resultMap id="BaseResultMap" type="com.ltgk.boat.domain.entity.DsEnterOutCrewCountry">
        <!--@mbg.generated-->
        <!--@Table ds_enter_out_crew_country-->
        <id column="id" jdbcType="VARCHAR" property="id"/>
        <result column="number" jdbcType="VARCHAR" property="number"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
        <result column="validity_date" jdbcType="TIMESTAMP" property="validityDate"/>
        <result column="crew_id" jdbcType="VARCHAR" property="crewId"/>
        <result column="certificate_post" jdbcType="VARCHAR" property="certificatePost"/>
        <result column="id_card" jdbcType="VARCHAR" property="idCard"/>
        <result column="certificate_level" jdbcType="VARCHAR" property="certificateLevel"/>
        <result column="area_code" jdbcType="VARCHAR" property="areaCode"/>
        <result column="update_at" jdbcType="TIMESTAMP" property="updateAt"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        id, `number`, `name`, validity_date, crew_id, certificate_post, id_card, certificate_level,
        area_code, update_at
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
        <!--@mbg.generated-->
        select
        <include refid="Base_Column_List"/>
        from ds_enter_out_crew_country
        where id = #{id,jdbcType=VARCHAR}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
        <!--@mbg.generated-->
        delete from ds_enter_out_crew_country
        where id = #{id,jdbcType=VARCHAR}
    </delete>
    <insert id="insert" parameterType="com.ltgk.boat.domain.entity.DsEnterOutCrewCountry">
        <!--@mbg.generated-->
        insert into ds_enter_out_crew_country (id, `number`, `name`,
        validity_date, crew_id, certificate_post,
        id_card, certificate_level, area_code,
        update_at)
        values (#{id,jdbcType=VARCHAR}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
        #{validityDate,jdbcType=TIMESTAMP}, #{crewId,jdbcType=VARCHAR}, #{certificatePost,jdbcType=VARCHAR},
        #{idCard,jdbcType=VARCHAR}, #{certificateLevel,jdbcType=VARCHAR}, #{areaCode,jdbcType=VARCHAR},
        #{updateAt,jdbcType=TIMESTAMP})
    </insert>
    <insert id="insertSelective" parameterType="com.ltgk.boat.domain.entity.DsEnterOutCrewCountry">
        <!--@mbg.generated-->
        insert into ds_enter_out_crew_country
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="number != null">
                `number`,
            </if>
            <if test="name != null">
                `name`,
            </if>
            <if test="validityDate != null">
                validity_date,
            </if>
            <if test="crewId != null">
                crew_id,
            </if>
            <if test="certificatePost != null">
                certificate_post,
            </if>
            <if test="idCard != null">
                id_card,
            </if>
            <if test="certificateLevel != null">
                certificate_level,
            </if>
            <if test="areaCode != null">
                area_code,
            </if>
            <if test="updateAt != null">
                update_at,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=VARCHAR},
            </if>
            <if test="number != null">
                #{number,jdbcType=VARCHAR},
            </if>
            <if test="name != null">
                #{name,jdbcType=VARCHAR},
            </if>
            <if test="validityDate != null">
                #{validityDate,jdbcType=TIMESTAMP},
            </if>
            <if test="crewId != null">
                #{crewId,jdbcType=VARCHAR},
            </if>
            <if test="certificatePost != null">
                #{certificatePost,jdbcType=VARCHAR},
            </if>
            <if test="idCard != null">
                #{idCard,jdbcType=VARCHAR},
            </if>
            <if test="certificateLevel != null">
                #{certificateLevel,jdbcType=VARCHAR},
            </if>
            <if test="areaCode != null">
                #{areaCode,jdbcType=VARCHAR},
            </if>
            <if test="updateAt != null">
                #{updateAt,jdbcType=TIMESTAMP},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.ltgk.boat.domain.entity.DsEnterOutCrewCountry">
        <!--@mbg.generated-->
        update ds_enter_out_crew_country
        <set>
            <if test="number != null">
                number = #{number,jdbcType=VARCHAR},
            </if>
            <if test="name != null">
                name = #{name,jdbcType=VARCHAR},
            </if>
            <if test="validityDate != null">
                validity_date = #{validityDate,jdbcType=TIMESTAMP},
            </if>
            <if test="crewId != null">
                crew_id = #{crewId,jdbcType=VARCHAR},
            </if>
            <if test="certificatePost != null">
                certificate_post = #{certificatePost,jdbcType=VARCHAR},
            </if>
            <if test="idCard != null">
                id_card = #{idCard,jdbcType=VARCHAR},
            </if>
            <if test="certificateLevel != null">
                certificate_level = #{certificateLevel,jdbcType=VARCHAR},
            </if>
            <if test="areaCode != null">
                area_code = #{areaCode,jdbcType=VARCHAR},
            </if>
            <if test="updateAt != null">
                update_at = #{updateAt,jdbcType=TIMESTAMP},
            </if>
        </set>
        where id = #{id,jdbcType=VARCHAR}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.ltgk.boat.domain.entity.DsEnterOutCrewCountry">
        <!--@mbg.generated-->
        update ds_enter_out_crew_country
        set number = #{number,jdbcType=VARCHAR},
        name = #{name,jdbcType=VARCHAR},
        validity_date = #{validityDate,jdbcType=TIMESTAMP},
        crew_id = #{crewId,jdbcType=VARCHAR},
        certificate_post = #{certificatePost,jdbcType=VARCHAR},
        id_card = #{idCard,jdbcType=VARCHAR},
        certificate_level = #{certificateLevel,jdbcType=VARCHAR},
        area_code = #{areaCode,jdbcType=VARCHAR},
        update_at = #{updateAt,jdbcType=TIMESTAMP}
        where id = #{id,jdbcType=VARCHAR}
    </update>
</mapper>