HelperMapper.xml 8.94 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.yoho.search.dal.HelperMapper">
    <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.Helper">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="first_category_id" property="firstCategoryId" jdbcType="INTEGER"/>
        <result column="secend_category_id" property="secendCategoryId" jdbcType="INTEGER"/>
        <result column="caption" property="caption" jdbcType="VARCHAR"/>
        <result column="content" property="content" jdbcType="VARCHAR"/>
        <result column="helper_type" property="helperType" jdbcType="TINYINT"/>
        <result column="is_faq" property="isFaq" jdbcType="CHAR"/>
        <result column="is_robot_qa" property="isRobotQa" jdbcType="CHAR"/>
        <result column="is_customer_service" property="isCustomerService" jdbcType="CHAR"/>
        <result column="show_platform" property="showPlatform" jdbcType="VARCHAR"/>
        <result column="keywords" property="keywords" jdbcType="VARCHAR"/>
        <result column="status" property="status" jdbcType="TINYINT"/>
        <result column="order_by" property="orderBy" jdbcType="INTEGER"/>
        <result column="hits" property="hits" jdbcType="INTEGER"/>
        <result column="create_time" property="createTime" jdbcType="INTEGER"/>
    </resultMap>
    <sql id="Base_Column_List">
    id, first_category_id, secend_category_id, caption, content, helper_type, is_faq, 
    is_robot_qa, is_customer_service, show_platform, keywords, status, order_by, hits, 
    create_time
  </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
        select
        <include refid="Base_Column_List"/>
        from helper
        where id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from helper
    where id = #{id,jdbcType=INTEGER}
  </delete>
    <insert id="insert" parameterType="com.yoho.search.dal.model.Helper">
    insert into helper (id, first_category_id, secend_category_id, 
      caption, content, helper_type, 
      is_faq, is_robot_qa, is_customer_service, 
      show_platform, keywords, status, 
      order_by, hits, create_time
      )
    values (#{id,jdbcType=INTEGER}, #{firstCategoryId,jdbcType=INTEGER}, #{secendCategoryId,jdbcType=INTEGER}, 
      #{caption,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{helperType,jdbcType=TINYINT}, 
      #{isFaq,jdbcType=CHAR}, #{isRobotQa,jdbcType=CHAR}, #{isCustomerService,jdbcType=CHAR}, 
      #{showPlatform,jdbcType=VARCHAR}, #{keywords,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, 
      #{orderBy,jdbcType=INTEGER}, #{hits,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER}
      )
  </insert>
    <insert id="insertSelective" parameterType="com.yoho.search.dal.model.Helper">
        insert into helper
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="firstCategoryId != null">
                first_category_id,
            </if>
            <if test="secendCategoryId != null">
                secend_category_id,
            </if>
            <if test="caption != null">
                caption,
            </if>
            <if test="content != null">
                content,
            </if>
            <if test="helperType != null">
                helper_type,
            </if>
            <if test="isFaq != null">
                is_faq,
            </if>
            <if test="isRobotQa != null">
                is_robot_qa,
            </if>
            <if test="isCustomerService != null">
                is_customer_service,
            </if>
            <if test="showPlatform != null">
                show_platform,
            </if>
            <if test="keywords != null">
                keywords,
            </if>
            <if test="status != null">
                status,
            </if>
            <if test="orderBy != null">
                order_by,
            </if>
            <if test="hits != null">
                hits,
            </if>
            <if test="createTime != null">
                create_time,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="firstCategoryId != null">
                #{firstCategoryId,jdbcType=INTEGER},
            </if>
            <if test="secendCategoryId != null">
                #{secendCategoryId,jdbcType=INTEGER},
            </if>
            <if test="caption != null">
                #{caption,jdbcType=VARCHAR},
            </if>
            <if test="content != null">
                #{content,jdbcType=VARCHAR},
            </if>
            <if test="helperType != null">
                #{helperType,jdbcType=TINYINT},
            </if>
            <if test="isFaq != null">
                #{isFaq,jdbcType=CHAR},
            </if>
            <if test="isRobotQa != null">
                #{isRobotQa,jdbcType=CHAR},
            </if>
            <if test="isCustomerService != null">
                #{isCustomerService,jdbcType=CHAR},
            </if>
            <if test="showPlatform != null">
                #{showPlatform,jdbcType=VARCHAR},
            </if>
            <if test="keywords != null">
                #{keywords,jdbcType=VARCHAR},
            </if>
            <if test="status != null">
                #{status,jdbcType=TINYINT},
            </if>
            <if test="orderBy != null">
                #{orderBy,jdbcType=INTEGER},
            </if>
            <if test="hits != null">
                #{hits,jdbcType=INTEGER},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.Helper">
        update helper
        <set>
            <if test="firstCategoryId != null">
                first_category_id = #{firstCategoryId,jdbcType=INTEGER},
            </if>
            <if test="secendCategoryId != null">
                secend_category_id = #{secendCategoryId,jdbcType=INTEGER},
            </if>
            <if test="caption != null">
                caption = #{caption,jdbcType=VARCHAR},
            </if>
            <if test="content != null">
                content = #{content,jdbcType=VARCHAR},
            </if>
            <if test="helperType != null">
                helper_type = #{helperType,jdbcType=TINYINT},
            </if>
            <if test="isFaq != null">
                is_faq = #{isFaq,jdbcType=CHAR},
            </if>
            <if test="isRobotQa != null">
                is_robot_qa = #{isRobotQa,jdbcType=CHAR},
            </if>
            <if test="isCustomerService != null">
                is_customer_service = #{isCustomerService,jdbcType=CHAR},
            </if>
            <if test="showPlatform != null">
                show_platform = #{showPlatform,jdbcType=VARCHAR},
            </if>
            <if test="keywords != null">
                keywords = #{keywords,jdbcType=VARCHAR},
            </if>
            <if test="status != null">
                status = #{status,jdbcType=TINYINT},
            </if>
            <if test="orderBy != null">
                order_by = #{orderBy,jdbcType=INTEGER},
            </if>
            <if test="hits != null">
                hits = #{hits,jdbcType=INTEGER},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=INTEGER},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.Helper">
    update helper
    set first_category_id = #{firstCategoryId,jdbcType=INTEGER},
      secend_category_id = #{secendCategoryId,jdbcType=INTEGER},
      caption = #{caption,jdbcType=VARCHAR},
      content = #{content,jdbcType=VARCHAR},
      helper_type = #{helperType,jdbcType=TINYINT},
      is_faq = #{isFaq,jdbcType=CHAR},
      is_robot_qa = #{isRobotQa,jdbcType=CHAR},
      is_customer_service = #{isCustomerService,jdbcType=CHAR},
      show_platform = #{showPlatform,jdbcType=VARCHAR},
      keywords = #{keywords,jdbcType=VARCHAR},
      status = #{status,jdbcType=TINYINT},
      order_by = #{orderBy,jdbcType=INTEGER},
      hits = #{hits,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
    <select id="count" resultType="java.lang.Integer" timeout="20000">
        SELECT count(id) FROM helper
    </select>
    <select id="getPageLists" resultMap="BaseResultMap" timeout="20000">
        select
        <include refid="Base_Column_List"/>
        from helper limit #{offset},#{pageSize}
    </select>
</mapper>