<?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.xt.hb.data.cbyj.mapper.CbyjMapper" >
  <resultMap id="BaseResultMap" type="com.xt.hb.data.cbyj.model.Cbyj" >
    <id column="ID" property="id" jdbcType="VARCHAR" />
    <result column="CM" property="cm" jdbcType="VARCHAR" />
    <result column="LX" property="lx" jdbcType="CHAR" />
    <result column="MMSI" property="mmsi" jdbcType="VARCHAR" />
    <result column="YJSJ" property="yjsj" jdbcType="OTHER" />
    <result column="AREA" property="area" jdbcType="VARCHAR" />
  </resultMap>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from T_GIS_CBYJ
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.xt.hb.data.cbyj.model.Cbyj" >
    insert into T_GIS_CBYJ (ID, CM, LX, MMSI, 
      YJSJ,AREA)
    values (#{id,jdbcType=VARCHAR}, #{cm,jdbcType=VARCHAR}, #{lx,jdbcType=CHAR}, #{mmsi,jdbcType=VARCHAR}, 
      #{yjsj,jdbcType=OTHER}, #{area,jdbcType=VARCHAR})
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.xt.hb.data.cbyj.model.Cbyj" >
    update T_GIS_CBYJ
    set CM = #{cm,jdbcType=VARCHAR},
      LX = #{lx,jdbcType=CHAR},
      MMSI = #{mmsi,jdbcType=VARCHAR},
      YJSJ = #{yjsj,jdbcType=OTHER},
      AREA = #{area,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select ID, CM, LX, MMSI, YJSJ, AREA
    from T_GIS_CBYJ
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <select id="selectAll" resultMap="BaseResultMap" >
    select ID, CM, LX, MMSI, YJSJ, AREA
    from T_GIS_CBYJ
  </select>
  <!-- 根据船舶英文名称检索船舶中文名称列表 -->
  <select id="selectCbmcByEnName" resultType="string" parameterType="java.lang.String">
    select SHIP_NAME_CN	from T_SHIP_INFO where SHIP_NAME_EN2=#{ywcm,jdbcType=VARCHAR}
   </select>
</mapper>