<?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.gic.haoban.manage.service.dao.mapper.ApplicationMapper" >
  <resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanApplication" >
    <id column="application_id" property="applicationId" jdbcType="VARCHAR" />
    <result column="application_name" property="applicationName" jdbcType="VARCHAR" />
    <result column="app_application_url" property="appApplicationUrl" jdbcType="VARCHAR" />
    <result column="app_application_icon_url" property="appApplicationIconUrl" jdbcType="VARCHAR" />
    <result column="application_url" property="applicationUrl" jdbcType="VARCHAR" />
    <result column="application_path" property="applicationPath" jdbcType="VARCHAR" />
    <result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    application_id, application_name, app_application_url, app_application_icon_url, 
    application_url,application_path, status_flag, create_time, update_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from tab_haoban_application
    where application_id = #{applicationId,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from tab_haoban_application
    where application_id = #{applicationId,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanApplication" >
    insert into tab_haoban_application (application_id, application_name, app_application_url, 
      app_application_icon_url, application_url,application_path, 
      status_flag, create_time, update_time
      )
    values (#{applicationId,jdbcType=VARCHAR}, #{applicationName,jdbcType=VARCHAR}, #{appApplicationUrl,jdbcType=VARCHAR}, 
      #{appApplicationIconUrl,jdbcType=VARCHAR}, #{applicationUrl,jdbcType=VARCHAR}, #{applicationPath,jdbcType=VARCHAR},
      #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanApplication" >
    insert into tab_haoban_application
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="applicationId != null" >
        application_id,
      </if>
      <if test="applicationName != null" >
        application_name,
      </if>
      <if test="appApplicationUrl != null" >
        app_application_url,
      </if>
      <if test="appApplicationIconUrl != null" >
        app_application_icon_url,
      </if>
      <if test="applicationUrl != null" >
        application_url,
      </if>
       <if test="applicationPath != null" >
        application_path,
      </if>
      <if test="statusFlag != null" >
        status_flag,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="applicationId != null" >
        #{applicationId,jdbcType=VARCHAR},
      </if>
      <if test="applicationName != null" >
        #{applicationName,jdbcType=VARCHAR},
      </if>
      <if test="appApplicationUrl != null" >
        #{appApplicationUrl,jdbcType=VARCHAR},
      </if>
      <if test="appApplicationIconUrl != null" >
        #{appApplicationIconUrl,jdbcType=VARCHAR},
      </if>
      <if test="applicationUrl != null" >
        #{applicationUrl,jdbcType=VARCHAR},
      </if>
       <if test="applicationPath != null" >
        #{applicationPath,jdbcType=VARCHAR},
      </if>
      <if test="statusFlag != null" >
        #{statusFlag,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanApplication" >
    update tab_haoban_application
    <set >
      <if test="applicationName != null" >
        application_name = #{applicationName,jdbcType=VARCHAR},
      </if>
      <if test="appApplicationUrl != null" >
        app_application_url = #{appApplicationUrl,jdbcType=VARCHAR},
      </if>
      <if test="appApplicationIconUrl != null" >
        app_application_icon_url = #{appApplicationIconUrl,jdbcType=VARCHAR},
      </if>
      <if test="applicationUrl != null" >
        application_url = #{applicationUrl,jdbcType=VARCHAR},
      </if>
      <if test="applicationPath != null" >
        application_path = #{applicationPath,jdbcType=VARCHAR},
      </if>
      <if test="statusFlag != null" >
        status_flag = #{statusFlag,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where application_id = #{applicationId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanApplication" >
    update tab_haoban_application
    set application_name = #{applicationName,jdbcType=VARCHAR},
      app_application_url = #{appApplicationUrl,jdbcType=VARCHAR},
      app_application_icon_url = #{appApplicationIconUrl,jdbcType=VARCHAR},
      application_url = #{applicationUrl,jdbcType=VARCHAR},
      application_path = #{applicationPath,jdbcType=VARCHAR},
      status_flag = #{statusFlag,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where application_id = #{applicationId,jdbcType=VARCHAR}
  </update>
  <select id="listApplication" resultMap="BaseResultMap" >
    select 
    <include refid="Base_Column_List" />
    from tab_haoban_application
    where status_flag = 1 order by update_time
  </select>
<!--    <select id="listByApplicationIds" resultMap="BaseResultMap" >-->
<!--    select -->
<!--    <include refid="Base_Column_List" />-->
<!--    from tab_haoban_application-->
<!--    where status_flag = 1-->
<!--         <if test="applicationIds != null and applicationIds.size() > 0">-->
<!--	    	and application_id IN -->
<!--		    <foreach collection="applicationIds" item="id" index="index" open="(" close=")" separator=",">-->
<!--		      #{id,jdbcType=VARCHAR}-->
<!--		    </foreach>-->
<!--      	</if>-->
<!--  </select>-->

</mapper>