ShopMapper.xml 9.91 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.ShopMapper" >
  <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.Shops" >
    <id column="shops_id" property="shopsId" jdbcType="INTEGER" />
    <result column="shop_name" property="shopName" jdbcType="VARCHAR" />
    <result column="shop_domain" property="shopDomain" jdbcType="VARCHAR" />
    <result column="shop_nature" property="shopNature" jdbcType="TINYINT" />
    <result column="shop_logo" property="shopLogo" jdbcType="VARCHAR" />
    <result column="website_url" property="websiteUrl" jdbcType="VARCHAR" />
    <result column="other_url" property="otherUrl" jdbcType="VARCHAR" />
    <result column="shop_address" property="shopAddress" jdbcType="VARCHAR" />
    <result column="create_pid" property="createPid" jdbcType="INTEGER" />
    <result column="shops_type" property="shopsType" jdbcType="TINYINT" />
    <result column="operation_status" property="operationStatus" jdbcType="TINYINT" />
    <result column="examine_status" property="examineStatus" jdbcType="TINYINT" />
    <result column="status" property="status" jdbcType="TINYINT" />
    <result column="check_status" property="checkStatus" jdbcType="SMALLINT" />
    <result column="create_time" property="createTime" jdbcType="INTEGER" />
    <result column="update_time" property="updateTime" jdbcType="INTEGER" />
    <result column="blk_status" property="blkStatus" jdbcType="TINYINT" />
      <result column="shop_intro" property="shopIntro" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    shops_id, shop_name, shop_domain, shop_nature, shop_logo, website_url, other_url, 
    shop_address, create_pid, shops_type, operation_status, examine_status, status, check_status, 
    create_time, update_time, blk_status,shop_intro
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from shops
    where shops_id = #{shopsId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from shops
    where shops_id = #{shopsId,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.yoho.search.dal.model.Shops" >
    insert into shops (shops_id, shop_name, shop_domain, 
      shop_nature, shop_logo, website_url, 
      other_url, shop_address, create_pid, 
      shops_type, operation_status, examine_status, 
      status, check_status, create_time, 
      update_time, blk_status, shop_intro
      )
    values (#{shopsId,jdbcType=INTEGER}, #{shopName,jdbcType=VARCHAR}, #{shopDomain,jdbcType=VARCHAR}, 
      #{shopNature,jdbcType=TINYINT}, #{shopLogo,jdbcType=VARCHAR}, #{websiteUrl,jdbcType=VARCHAR}, 
      #{otherUrl,jdbcType=VARCHAR}, #{shopAddress,jdbcType=VARCHAR}, #{createPid,jdbcType=INTEGER}, 
      #{shopsType,jdbcType=TINYINT}, #{operationStatus,jdbcType=TINYINT}, #{examineStatus,jdbcType=TINYINT}, 
      #{status,jdbcType=TINYINT}, #{checkStatus,jdbcType=SMALLINT}, #{createTime,jdbcType=INTEGER}, 
      #{updateTime,jdbcType=INTEGER}, #{blkStatus,jdbcType=TINYINT}, #{shopIntro,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.yoho.search.dal.model.Shops" >
    insert into shops
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="shopsId != null" >
        shops_id,
      </if>
      <if test="shopName != null" >
        shop_name,
      </if>
      <if test="shopDomain != null" >
        shop_domain,
      </if>
      <if test="shopNature != null" >
        shop_nature,
      </if>
      <if test="shopLogo != null" >
        shop_logo,
      </if>
      <if test="websiteUrl != null" >
        website_url,
      </if>
      <if test="otherUrl != null" >
        other_url,
      </if>
      <if test="shopAddress != null" >
        shop_address,
      </if>
      <if test="createPid != null" >
        create_pid,
      </if>
      <if test="shopsType != null" >
        shops_type,
      </if>
      <if test="operationStatus != null" >
        operation_status,
      </if>
      <if test="examineStatus != null" >
        examine_status,
      </if>
      <if test="status != null" >
        status,
      </if>
      <if test="checkStatus != null" >
        check_status,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="blkStatus != null" >
        blk_status,
      </if>
      <if test="shopIntro != null" >
        shop_intro,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="shopsId != null" >
        #{shopsId,jdbcType=INTEGER},
      </if>
      <if test="shopName != null" >
        #{shopName,jdbcType=VARCHAR},
      </if>
      <if test="shopDomain != null" >
        #{shopDomain,jdbcType=VARCHAR},
      </if>
      <if test="shopNature != null" >
        #{shopNature,jdbcType=TINYINT},
      </if>
      <if test="shopLogo != null" >
        #{shopLogo,jdbcType=VARCHAR},
      </if>
      <if test="websiteUrl != null" >
        #{websiteUrl,jdbcType=VARCHAR},
      </if>
      <if test="otherUrl != null" >
        #{otherUrl,jdbcType=VARCHAR},
      </if>
      <if test="shopAddress != null" >
        #{shopAddress,jdbcType=VARCHAR},
      </if>
      <if test="createPid != null" >
        #{createPid,jdbcType=INTEGER},
      </if>
      <if test="shopsType != null" >
        #{shopsType,jdbcType=TINYINT},
      </if>
      <if test="operationStatus != null" >
        #{operationStatus,jdbcType=TINYINT},
      </if>
      <if test="examineStatus != null" >
        #{examineStatus,jdbcType=TINYINT},
      </if>
      <if test="status != null" >
        #{status,jdbcType=TINYINT},
      </if>
      <if test="checkStatus != null" >
        #{checkStatus,jdbcType=SMALLINT},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=INTEGER},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=INTEGER},
      </if>
      <if test="blkStatus != null" >
        #{blkStatus,jdbcType=TINYINT},
      </if>
      <if test="shopIntro != null" >
        #{shopIntro,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.Shops" >
    update shops
    <set >
      <if test="shopName != null" >
        shop_name = #{shopName,jdbcType=VARCHAR},
      </if>
      <if test="shopDomain != null" >
        shop_domain = #{shopDomain,jdbcType=VARCHAR},
      </if>
      <if test="shopNature != null" >
        shop_nature = #{shopNature,jdbcType=TINYINT},
      </if>
      <if test="shopLogo != null" >
        shop_logo = #{shopLogo,jdbcType=VARCHAR},
      </if>
      <if test="websiteUrl != null" >
        website_url = #{websiteUrl,jdbcType=VARCHAR},
      </if>
      <if test="otherUrl != null" >
        other_url = #{otherUrl,jdbcType=VARCHAR},
      </if>
      <if test="shopAddress != null" >
        shop_address = #{shopAddress,jdbcType=VARCHAR},
      </if>
      <if test="createPid != null" >
        create_pid = #{createPid,jdbcType=INTEGER},
      </if>
      <if test="shopsType != null" >
        shops_type = #{shopsType,jdbcType=TINYINT},
      </if>
      <if test="operationStatus != null" >
        operation_status = #{operationStatus,jdbcType=TINYINT},
      </if>
      <if test="examineStatus != null" >
        examine_status = #{examineStatus,jdbcType=TINYINT},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=TINYINT},
      </if>
      <if test="checkStatus != null" >
        check_status = #{checkStatus,jdbcType=SMALLINT},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=INTEGER},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=INTEGER},
      </if>
      <if test="blkStatus != null" >
        blk_status = #{blkStatus,jdbcType=TINYINT},
      </if>
      <if test="shopIntro != null" >
        shop_intro = #{shopIntro,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where shops_id = #{shopsId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.Shops" >
    update shops
    set shop_name = #{shopName,jdbcType=VARCHAR},
      shop_domain = #{shopDomain,jdbcType=VARCHAR},
      shop_nature = #{shopNature,jdbcType=TINYINT},
      shop_logo = #{shopLogo,jdbcType=VARCHAR},
      website_url = #{websiteUrl,jdbcType=VARCHAR},
      other_url = #{otherUrl,jdbcType=VARCHAR},
      shop_address = #{shopAddress,jdbcType=VARCHAR},
      create_pid = #{createPid,jdbcType=INTEGER},
      shops_type = #{shopsType,jdbcType=TINYINT},
      operation_status = #{operationStatus,jdbcType=TINYINT},
      examine_status = #{examineStatus,jdbcType=TINYINT},
      status = #{status,jdbcType=TINYINT},
      check_status = #{checkStatus,jdbcType=SMALLINT},
      create_time = #{createTime,jdbcType=INTEGER},
      update_time = #{updateTime,jdbcType=INTEGER},
      blk_status = #{blkStatus,jdbcType=TINYINT},
      shop_intro = #{shopIntro,jdbcType=LONGVARCHAR}
    where shops_id = #{shopsId,jdbcType=INTEGER}
  </update>
    <select id="count" resultType="java.lang.Integer" timeout="20000">
        SELECT count(shops_id) FROM shops
    </select>
    <select id="getPageLists" resultMap="BaseResultMap" timeout="20000">
        select
        <include refid="Base_Column_List" />
        from shops limit #{offset},#{pageSize}
    </select>
    <select id="selectByIds" resultMap="BaseResultMap" parameterType="java.lang.Integer">
        SELECT
        <include refid="Base_Column_List"/>
        FROM
        shops
        where shops_id in
        <foreach item="item" index="index" collection="list"
                 open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>
</mapper>