<?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.goafanti.common.dao.ScPublisherMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.ScPublisher">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="type" jdbcType="INTEGER" property="type" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="province" jdbcType="INTEGER" property="province" />
    <result column="city" jdbcType="INTEGER" property="city" />
    <result column="area" jdbcType="INTEGER" property="area" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="zip_code" jdbcType="VARCHAR" property="zipCode" />
    <result column="contacts" jdbcType="VARCHAR" property="contacts" />
    <result column="telephone" jdbcType="VARCHAR" property="telephone" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="introduce" jdbcType="VARCHAR" property="introduce" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    id, type, name, province, city, area, email, zip_code, contacts, telephone, address, 
    introduce, remarks, create_time, delete_sign
  </sql>
  <select id="selectByExample" parameterType="com.goafanti.common.model.ScPublisherExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from sc_publisher
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    select 
    <include refid="Base_Column_List" />
    from sc_publisher
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    delete from sc_publisher
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.goafanti.common.model.ScPublisherExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    delete from sc_publisher
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.ScPublisher">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    insert into sc_publisher (id, type, name, 
      province, city, area, 
      email, zip_code, contacts, 
      telephone, address, introduce, 
      remarks, create_time, delete_sign
      )
    values (#{id,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, 
      #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER}, #{area,jdbcType=INTEGER}, 
      #{email,jdbcType=VARCHAR}, #{zipCode,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, 
      #{telephone,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{introduce,jdbcType=VARCHAR}, 
      #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{deleteSign,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.ScPublisher">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    insert into sc_publisher
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="province != null">
        province,
      </if>
      <if test="city != null">
        city,
      </if>
      <if test="area != null">
        area,
      </if>
      <if test="email != null">
        email,
      </if>
      <if test="zipCode != null">
        zip_code,
      </if>
      <if test="contacts != null">
        contacts,
      </if>
      <if test="telephone != null">
        telephone,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="introduce != null">
        introduce,
      </if>
      <if test="remarks != null">
        remarks,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="deleteSign != null">
        delete_sign,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="province != null">
        #{province,jdbcType=INTEGER},
      </if>
      <if test="city != null">
        #{city,jdbcType=INTEGER},
      </if>
      <if test="area != null">
        #{area,jdbcType=INTEGER},
      </if>
      <if test="email != null">
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="zipCode != null">
        #{zipCode,jdbcType=VARCHAR},
      </if>
      <if test="contacts != null">
        #{contacts,jdbcType=VARCHAR},
      </if>
      <if test="telephone != null">
        #{telephone,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="introduce != null">
        #{introduce,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteSign != null">
        #{deleteSign,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.goafanti.common.model.ScPublisherExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    select count(*) from sc_publisher
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    update sc_publisher
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=INTEGER},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.province != null">
        province = #{record.province,jdbcType=INTEGER},
      </if>
      <if test="record.city != null">
        city = #{record.city,jdbcType=INTEGER},
      </if>
      <if test="record.area != null">
        area = #{record.area,jdbcType=INTEGER},
      </if>
      <if test="record.email != null">
        email = #{record.email,jdbcType=VARCHAR},
      </if>
      <if test="record.zipCode != null">
        zip_code = #{record.zipCode,jdbcType=VARCHAR},
      </if>
      <if test="record.contacts != null">
        contacts = #{record.contacts,jdbcType=VARCHAR},
      </if>
      <if test="record.telephone != null">
        telephone = #{record.telephone,jdbcType=VARCHAR},
      </if>
      <if test="record.address != null">
        address = #{record.address,jdbcType=VARCHAR},
      </if>
      <if test="record.introduce != null">
        introduce = #{record.introduce,jdbcType=VARCHAR},
      </if>
      <if test="record.remarks != null">
        remarks = #{record.remarks,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deleteSign != null">
        delete_sign = #{record.deleteSign,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    update sc_publisher
    set id = #{record.id,jdbcType=VARCHAR},
      type = #{record.type,jdbcType=INTEGER},
      name = #{record.name,jdbcType=VARCHAR},
      province = #{record.province,jdbcType=INTEGER},
      city = #{record.city,jdbcType=INTEGER},
      area = #{record.area,jdbcType=INTEGER},
      email = #{record.email,jdbcType=VARCHAR},
      zip_code = #{record.zipCode,jdbcType=VARCHAR},
      contacts = #{record.contacts,jdbcType=VARCHAR},
      telephone = #{record.telephone,jdbcType=VARCHAR},
      address = #{record.address,jdbcType=VARCHAR},
      introduce = #{record.introduce,jdbcType=VARCHAR},
      remarks = #{record.remarks,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      delete_sign = #{record.deleteSign,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ScPublisher">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    update sc_publisher
    <set>
      <if test="type != null">
        type = #{type,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="province != null">
        province = #{province,jdbcType=INTEGER},
      </if>
      <if test="city != null">
        city = #{city,jdbcType=INTEGER},
      </if>
      <if test="area != null">
        area = #{area,jdbcType=INTEGER},
      </if>
      <if test="email != null">
        email = #{email,jdbcType=VARCHAR},
      </if>
      <if test="zipCode != null">
        zip_code = #{zipCode,jdbcType=VARCHAR},
      </if>
      <if test="contacts != null">
        contacts = #{contacts,jdbcType=VARCHAR},
      </if>
      <if test="telephone != null">
        telephone = #{telephone,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="introduce != null">
        introduce = #{introduce,jdbcType=VARCHAR},
      </if>
      <if test="remarks != null">
        remarks = #{remarks,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteSign != null">
        delete_sign = #{deleteSign,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ScPublisher">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Jun 26 18:28:59 CST 2018.
    -->
    update sc_publisher
    set type = #{type,jdbcType=INTEGER},
      name = #{name,jdbcType=VARCHAR},
      province = #{province,jdbcType=INTEGER},
      city = #{city,jdbcType=INTEGER},
      area = #{area,jdbcType=INTEGER},
      email = #{email,jdbcType=VARCHAR},
      zip_code = #{zipCode,jdbcType=VARCHAR},
      contacts = #{contacts,jdbcType=VARCHAR},
      telephone = #{telephone,jdbcType=VARCHAR},
      address = #{address,jdbcType=VARCHAR},
      introduce = #{introduce,jdbcType=VARCHAR},
      remarks = #{remarks,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      delete_sign = #{deleteSign,jdbcType=INTEGER}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>