TBBaseAirportInfoDao.xml 3.9 KB
<?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.tianbo.analysis.dao.TBBaseAirportInfoDao">
  <resultMap id="BaseResultMap" type="com.tianbo.analysis.model.TBBaseAirportInfo">
    <id column="AIRPORTID" jdbcType="VARCHAR" property="airportid" />
    <result column="INTERNAL" jdbcType="VARCHAR" property="internal" />
    <result column="CITYID" jdbcType="VARCHAR" property="cityid" />
    <result column="AIRPORTDESCCHN" jdbcType="VARCHAR" property="airportdescchn" />
    <result column="AIRPORTDESCENG" jdbcType="VARCHAR" property="airportdesceng" />
  </resultMap>
  <sql id="Base_Column_List">
    AIRPORTID, INTERNAL, CITYID, AIRPORTDESCCHN, AIRPORTDESCENG
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from TB_BASE_AIRPORT_INFO
    where AIRPORTID = #{airportid,jdbcType=VARCHAR}
  </select>
  <select id="checkInternal" resultMap="BaseResultMap">
      select internal
      from tb_base_airport_info
      where airportid = #{airportidOrg,jdbcType=VARCHAR}
      union all
      select internal
      from tb_base_airport_info
      where airportid = #{airportidDes,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from TB_BASE_AIRPORT_INFO
    where AIRPORTID = #{airportid,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" keyColumn="AIRPORTID" keyProperty="airportid" parameterType="com.tianbo.analysis.model.TBBaseAirportInfo" useGeneratedKeys="true">
    insert into TB_BASE_AIRPORT_INFO (INTERNAL, CITYID, AIRPORTDESCCHN,
      AIRPORTDESCENG)
    values (#{internal,jdbcType=VARCHAR}, #{cityid,jdbcType=VARCHAR}, #{airportdescchn,jdbcType=VARCHAR},
      #{airportdesceng,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" keyColumn="AIRPORTID" keyProperty="airportid" parameterType="com.tianbo.analysis.model.TBBaseAirportInfo" useGeneratedKeys="true">
    insert into TB_BASE_AIRPORT_INFO
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="internal != null">
        INTERNAL,
      </if>
      <if test="cityid != null">
        CITYID,
      </if>
      <if test="airportdescchn != null">
        AIRPORTDESCCHN,
      </if>
      <if test="airportdesceng != null">
        AIRPORTDESCENG,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="internal != null">
        #{internal,jdbcType=VARCHAR},
      </if>
      <if test="cityid != null">
        #{cityid,jdbcType=VARCHAR},
      </if>
      <if test="airportdescchn != null">
        #{airportdescchn,jdbcType=VARCHAR},
      </if>
      <if test="airportdesceng != null">
        #{airportdesceng,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.analysis.model.TBBaseAirportInfo">
    update TB_BASE_AIRPORT_INFO
    <set>
      <if test="internal != null">
        INTERNAL = #{internal,jdbcType=VARCHAR},
      </if>
      <if test="cityid != null">
        CITYID = #{cityid,jdbcType=VARCHAR},
      </if>
      <if test="airportdescchn != null">
        AIRPORTDESCCHN = #{airportdescchn,jdbcType=VARCHAR},
      </if>
      <if test="airportdesceng != null">
        AIRPORTDESCENG = #{airportdesceng,jdbcType=VARCHAR},
      </if>
    </set>
    where AIRPORTID = #{airportid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tianbo.analysis.model.TBBaseAirportInfo">
    update TB_BASE_AIRPORT_INFO
    set INTERNAL = #{internal,jdbcType=VARCHAR},
      CITYID = #{cityid,jdbcType=VARCHAR},
      AIRPORTDESCCHN = #{airportdescchn,jdbcType=VARCHAR},
      AIRPORTDESCENG = #{airportdesceng,jdbcType=VARCHAR}
    where AIRPORTID = #{airportid,jdbcType=VARCHAR}
  </update>
</mapper>