<?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.TabHaobanHelpMapper" >
  <resultMap id="BaseResultMap" type="com.gic.haoban.manage.service.entity.TabHaobanHelp" >
    <id column="help_id" property="helpId" jdbcType="VARCHAR" />
    <result column="help_title" property="helpTitle" jdbcType="VARCHAR" />
    <result column="help_url" property="helpUrl" 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" />
    <result column="open_flag" property="openFlag" jdbcType="INTEGER" />
    <result column="edit_persion" property="editPersion" jdbcType="VARCHAR" />
    <result column="sort" property="sort" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    help_id, help_title, help_url, status_flag, create_time, update_time, open_flag, 
    edit_persion, sort
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from tab_haoban_help
    where help_id = #{helpId,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from tab_haoban_help
    where help_id = #{helpId,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabHaobanHelp" >
    insert into tab_haoban_help (help_id, help_title, help_url, 
      status_flag, create_time, update_time, 
      open_flag, edit_persion, sort
      )
    values (#{helpId,jdbcType=VARCHAR}, #{helpTitle,jdbcType=VARCHAR}, #{helpUrl,jdbcType=VARCHAR}, 
      #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{openFlag,jdbcType=INTEGER}, #{editPersion,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanHelp" >
    insert into tab_haoban_help
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="helpId != null" >
        help_id,
      </if>
      <if test="helpTitle != null" >
        help_title,
      </if>
      <if test="helpUrl != null" >
        help_url,
      </if>
      <if test="statusFlag != null" >
        status_flag,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="openFlag != null" >
        open_flag,
      </if>
      <if test="editPersion != null" >
        edit_persion,
      </if>
      <if test="sort != null" >
        sort,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="helpId != null" >
        #{helpId,jdbcType=VARCHAR},
      </if>
      <if test="helpTitle != null" >
        #{helpTitle,jdbcType=VARCHAR},
      </if>
      <if test="helpUrl != null" >
        #{helpUrl,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>
      <if test="openFlag != null" >
        #{openFlag,jdbcType=INTEGER},
      </if>
      <if test="editPersion != null" >
        #{editPersion,jdbcType=VARCHAR},
      </if>
      <if test="sort != null" >
        #{sort,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanHelp" >
    update tab_haoban_help
    <set >
      <if test="helpTitle != null" >
        help_title = #{helpTitle,jdbcType=VARCHAR},
      </if>
      <if test="helpUrl != null" >
        help_url = #{helpUrl,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>
      <if test="openFlag != null" >
        open_flag = #{openFlag,jdbcType=INTEGER},
      </if>
      <if test="editPersion != null" >
        edit_persion = #{editPersion,jdbcType=VARCHAR},
      </if>
      <if test="sort != null" >
        sort = #{sort,jdbcType=INTEGER},
      </if>
    </set>
    where help_id = #{helpId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabHaobanHelp" >
    update tab_haoban_help
    set help_title = #{helpTitle,jdbcType=VARCHAR},
      help_url = #{helpUrl,jdbcType=VARCHAR},
      status_flag = #{statusFlag,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      open_flag = #{openFlag,jdbcType=INTEGER},
      edit_persion = #{editPersion,jdbcType=VARCHAR},
      sort = #{sort,jdbcType=INTEGER}
    where help_id = #{helpId,jdbcType=VARCHAR}
  </update>
  
    <select id="pageList" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from tab_haoban_help
    where status_flag = 1
    order by update_time desc
  </select>
    <select id="selectByHelpTitle" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from tab_haoban_help
    where help_title =  #{helpTitleitle,jdbcType=VARCHAR}
    	and status_flag = 1
  </select>
 
  <select id="getList" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from tab_haoban_help
    where status_flag = 1
    	and open_flag =1
    order by update_time desc
  </select>
  
</mapper>