ShopMapper.xml 5.84 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="INTEGER" />
    <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="INTEGER" />
    <result column="operation_status" property="operationStatus" jdbcType="INTEGER" />
    <result column="examine_status" property="examineStatus" jdbcType="INTEGER" />
    <result column="status" property="status" jdbcType="INTEGER" />
    <result column="check_status" property="checkStatus" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="INTEGER" />
    <result column="update_time" property="updateTime" jdbcType="INTEGER" />
    <result column="blk_status" property="blkStatus" jdbcType="INTEGER" />
      <result column="shop_intro" property="shopIntro" jdbcType="LONGVARCHAR" />
      <result column="decorator_template_type" property="decoratorTemplateType" jdbcType="INTEGER" />
  </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,decorator_template_type
  </sql>

    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from shops
    where shops_id = #{shopsId,jdbcType=INTEGER}
    limit 1
  </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,decorator_template_type
      )
    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},#{decoratorTemplateType,jdbcType=INTEGER}
      )
  </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=INTEGER},
      </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=INTEGER},
      </if>
      <if test="operationStatus != null" >
        operation_status = #{operationStatus,jdbcType=INTEGER},
      </if>
      <if test="examineStatus != null" >
        examine_status = #{examineStatus,jdbcType=INTEGER},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="checkStatus != null" >
        check_status = #{checkStatus,jdbcType=INTEGER},
      </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=INTEGER},
      </if>
      <if test="shopIntro != null" >
        shop_intro = #{shopIntro,jdbcType=LONGVARCHAR},
      </if>
        <if test="decoratorTemplateType != null" >
            decorator_template_type = #{decoratorTemplateType,jdbcType=INTEGER},
        </if>
    </set>
    where shops_id = #{shopsId,jdbcType=INTEGER}
  </update>

    <select id="selectCount" resultType="java.lang.Integer" timeout="20000">
        SELECT count(shops_id) FROM shops
    </select>

    <select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
        select
        <include refid="Base_Column_List" />
        from shops limit #{offset},#{pageSize}
    </select>

</mapper>