<?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.slodon.b2b2c.dao.write.system.EnquiryWriteMapper">
  <resultMap id="BaseResultMap" type="com.slodon.b2b2c.system.pojo.Enquiry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 14 10:26:21 CST 2022.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="email" jdbcType="VARCHAR" property="email" />
    <result column="phone_code" jdbcType="VARCHAR" property="phoneCode" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="company" jdbcType="VARCHAR" property="company" />
    <result column="quantity" jdbcType="INTEGER" property="quantity" />
    <result column="message" jdbcType="VARCHAR" property="message" />
    <result column="country" jdbcType="VARCHAR" property="country" />
    <result column="region" jdbcType="VARCHAR" property="region" />
    <result column="ip" jdbcType="VARCHAR" property="ip" />
    <result column="page_url" jdbcType="VARCHAR" property="pageUrl" />
    <result column="item_type" jdbcType="VARCHAR" property="itemType" />
    <result column="item_id" jdbcType="BIGINT" property="itemId" />
    <result column="create_uid" jdbcType="INTEGER" property="createUid" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="last_uid" jdbcType="BIGINT" property="lastUid" />
    <result column="last_username" jdbcType="VARCHAR" property="lastUsername" />
    <result column="last_time" jdbcType="TIMESTAMP" property="lastTime" />
    <result column="store_id" jdbcType="BIGINT" property="storeId" />
    <result column="valid_status" jdbcType="INTEGER" property="validStatus" />
  </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 Wed Sep 14 10:26:21 CST 2022.
    -->
    <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 Wed Sep 14 10:26:21 CST 2022.
    -->
    <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 Wed Sep 14 10:26:21 CST 2022.
    -->
    id, name, email, phone_code, phone, quantity,company, message, country, region, ip, page_url,
    item_type, item_id, create_time, status, last_uid, last_username, last_time,store_id,valid_status
  </sql>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 14 10:26:21 CST 2022.
    -->
    delete from enquiry
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.slodon.b2b2c.system.example.EnquiryExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 14 10:26:21 CST 2022.
    -->
    delete from enquiry
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.slodon.b2b2c.system.pojo.Enquiry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 14 10:26:21 CST 2022.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into enquiry (name, email, phone_code,
      phone, quantity,company, message,
      country, region, ip,
      page_url, item_type, item_id,create_uid,
      create_time, status, last_uid,
      last_username, last_time,store_id,valid_status)
    values (#{name,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{phoneCode,jdbcType=VARCHAR},
      #{phone,jdbcType=VARCHAR}, #{quantity,jdbcType=INTEGER}, #{company,jdbcType=VARCHAR}, #{message,jdbcType=VARCHAR},
      #{country,jdbcType=VARCHAR}, #{region,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR},
      #{pageUrl,jdbcType=VARCHAR}, #{itemType,jdbcType=VARCHAR}, #{itemId,jdbcType=BIGINT},#{createUid,jdbcType=INTEGER},
      #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{lastUid,jdbcType=BIGINT},
      #{lastUsername,jdbcType=VARCHAR}, #{lastTime,jdbcType=TIMESTAMP}, #{storeId,jdbcType=BIGINT}, #{validStatus,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.slodon.b2b2c.system.pojo.Enquiry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 14 10:26:21 CST 2022.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into enquiry
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="name != null">
        name,
      </if>
      <if test="email != null">
        email,
      </if>
      <if test="phoneCode != null">
        phone_code,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="quantity != null">
        quantity,
      </if>
      <if test="company != null">
        company,
      </if>
      <if test="message != null">
        message,
      </if>
      <if test="country != null">
        country,
      </if>
      <if test="region != null">
        region,
      </if>
      <if test="ip != null">
        ip,
      </if>
      <if test="pageUrl != null">
        page_url,
      </if>
      <if test="itemType != null">
        item_type,
      </if>
      <if test="itemId != null">
        item_id,
      </if>
      <if test="createUid != null">
        create_uid,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="lastUid != null">
        last_uid,
      </if>
      <if test="lastUsername != null">
        last_username,
      </if>
      <if test="lastTime != null">
        last_time,
      </if>
      <if test="storeId != null">
        store_id,
      </if>
      <if test="isGarbage != null">
        is_garbage,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="phoneCode != null">
        #{phoneCode,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        #{quantity,jdbcType=INTEGER},
      </if>
      <if test="company != null">
        #{company,jdbcType=VARCHAR},
      </if>
      <if test="message != null">
        #{message,jdbcType=VARCHAR},
      </if>
      <if test="country != null">
        #{country,jdbcType=VARCHAR},
      </if>
      <if test="region != null">
        #{region,jdbcType=VARCHAR},
      </if>
      <if test="ip != null">
        #{ip,jdbcType=VARCHAR},
      </if>
      <if test="pageUrl != null">
        #{pageUrl,jdbcType=VARCHAR},
      </if>
      <if test="itemType != null">
        #{itemType,jdbcType=VARCHAR},
      </if>
      <if test="itemId != null">
        #{itemId,jdbcType=BIGINT},
      </if>
      <if test="createUid != null">
       #{createUid,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="lastUid != null">
        #{lastUid,jdbcType=BIGINT},
      </if>
      <if test="lastUsername != null">
        #{lastUsername,jdbcType=VARCHAR},
      </if>
      <if test="lastTime != null">
        #{lastTime,jdbcType=TIMESTAMP},
      </if>
      <if test="storeId != null">
        #{storeId,jdbcType=BIGINT},
      </if>
      <if test="validStatus != null">
        #{validStatus,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>

  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 14 10:26:21 CST 2022.
    -->
    update enquiry
    <set>
      <if test="row.id != null">
        id = #{row.id,jdbcType=BIGINT},
      </if>
      <if test="row.name != null">
        name = #{row.name,jdbcType=VARCHAR},
      </if>
      <if test="row.email != null">
        email = #{row.email,jdbcType=VARCHAR},
      </if>
      <if test="row.phoneCode != null">
        phone_code = #{row.phoneCode,jdbcType=VARCHAR},
      </if>
      <if test="row.phone != null">
        phone = #{row.phone,jdbcType=VARCHAR},
      </if>
      <if test="row.quantity != null">
        quantity = #{row.quantity,jdbcType=INTEGER},
      </if>
      <if test="row.company != null">
        company = #{row.company,jdbcType=VARCHAR},
      </if>
      <if test="row.message != null">
        message = #{row.message,jdbcType=VARCHAR},
      </if>
      <if test="row.country != null">
        country = #{row.country,jdbcType=VARCHAR},
      </if>
      <if test="row.region != null">
        region = #{row.region,jdbcType=VARCHAR},
      </if>
      <if test="row.ip != null">
        ip = #{row.ip,jdbcType=VARCHAR},
      </if>
      <if test="row.pageUrl != null">
        page_url = #{row.pageUrl,jdbcType=VARCHAR},
      </if>
      <if test="row.itemType != null">
        item_type = #{row.itemType,jdbcType=VARCHAR},
      </if>
      <if test="row.itemId != null">
        item_id = #{row.itemId,jdbcType=BIGINT},
      </if>
      <if test="row.createUid != null">
        create_uid = #{row.createUid,jdbcType=INTEGER},
      </if>
      <if test="row.createTime != null">
        create_time = #{row.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="row.status != null">
        status = #{row.status,jdbcType=VARCHAR},
      </if>
      <if test="row.lastUid != null">
        last_uid = #{row.lastUid,jdbcType=BIGINT},
      </if>
      <if test="row.lastUsername != null">
        last_username = #{row.lastUsername,jdbcType=VARCHAR},
      </if>
      <if test="row.lastTime != null">
        last_time = #{row.lastTime,jdbcType=TIMESTAMP},
      </if>
      <if test="row.storeId != null">
        store_id = #{row.storeId,jdbcType=BIGINT},
      </if>
      <if test="row.validStatus != null">
        valid_status = #{row.validStatus,jdbcType=INTEGER},
      </if>
    </set>
    <if test="example != 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 Wed Sep 14 10:26:21 CST 2022.
    -->
    update enquiry
    set id = #{row.id,jdbcType=BIGINT},
      name = #{row.name,jdbcType=VARCHAR},
      email = #{row.email,jdbcType=VARCHAR},
      phone_code = #{row.phoneCode,jdbcType=VARCHAR},
      phone = #{row.phone,jdbcType=VARCHAR},
    quantity = #{row.quantity,jdbcType=INTEGER},
      company = #{row.company,jdbcType=VARCHAR},
      message = #{row.message,jdbcType=VARCHAR},
      country = #{row.country,jdbcType=VARCHAR},
      region = #{row.region,jdbcType=VARCHAR},
      ip = #{row.ip,jdbcType=VARCHAR},
      page_url = #{row.pageUrl,jdbcType=VARCHAR},
      item_type = #{row.itemType,jdbcType=VARCHAR},
      item_id = #{row.itemId,jdbcType=BIGINT},
      create_uid = #{createUid,jdbcType=INTEGER},
      create_time = #{row.createTime,jdbcType=TIMESTAMP},
      status = #{row.status,jdbcType=VARCHAR},
      last_uid = #{row.lastUid,jdbcType=BIGINT},
      last_username = #{row.lastUsername,jdbcType=VARCHAR},
      last_time = #{row.lastTime,jdbcType=TIMESTAMP},
        store_id = #{row.storeId,jdbcType=BIGINT},
    valid_status = #{row.validStatus,jdbcType=INTEGER}
    <if test="example != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.slodon.b2b2c.system.pojo.Enquiry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 14 10:26:21 CST 2022.
    -->
    update enquiry
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        email = #{email,jdbcType=VARCHAR},
      </if>
      <if test="phoneCode != null">
        phone_code = #{phoneCode,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        quantity = #{quantity,jdbcType=INTEGER},
      </if>
      <if test="company != null">
        company = #{company,jdbcType=VARCHAR},
      </if>
      <if test="message != null">
        message = #{message,jdbcType=VARCHAR},
      </if>
      <if test="country != null">
        country = #{country,jdbcType=VARCHAR},
      </if>
      <if test="region != null">
        region = #{region,jdbcType=VARCHAR},
      </if>
      <if test="ip != null">
        ip = #{ip,jdbcType=VARCHAR},
      </if>
      <if test="pageUrl != null">
        page_url = #{pageUrl,jdbcType=VARCHAR},
      </if>
      <if test="itemType != null">
        item_type = #{itemType,jdbcType=VARCHAR},
      </if>
      <if test="itemId != null">
        item_id = #{itemId,jdbcType=BIGINT},
      </if>
      <if test="createUid != null">
        create_uid = #{createUid,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="lastUid != null">
        last_uid = #{lastUid,jdbcType=BIGINT},
      </if>
      <if test="lastUsername != null">
        last_username = #{lastUsername,jdbcType=VARCHAR},
      </if>
      <if test="lastTime != null">
        last_time = #{lastTime,jdbcType=TIMESTAMP},
      </if>
      <if test="storeId != null">
        store_id = #{storeId,jdbcType=BIGINT},
      </if>
      <if test="validStatus != null">
        valid_status = #{validStatus,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.slodon.b2b2c.system.pojo.Enquiry">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 14 10:26:21 CST 2022.
    -->
    update enquiry
    set name = #{name,jdbcType=VARCHAR},
      email = #{email,jdbcType=VARCHAR},
      phone_code = #{phoneCode,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
    quantity = #{quantity,jdbcType=INTEGER},
      company = #{company,jdbcType=VARCHAR},
      message = #{message,jdbcType=VARCHAR},
      country = #{country,jdbcType=VARCHAR},
      region = #{region,jdbcType=VARCHAR},
      ip = #{ip,jdbcType=VARCHAR},
      page_url = #{pageUrl,jdbcType=VARCHAR},
      item_type = #{itemType,jdbcType=VARCHAR},
      item_id = #{itemId,jdbcType=BIGINT},
      create_uid = #{createUid,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      status = #{status,jdbcType=VARCHAR},
      last_uid = #{lastUid,jdbcType=BIGINT},
      last_username = #{lastUsername,jdbcType=VARCHAR},
      last_time = #{lastTime,jdbcType=TIMESTAMP},
    store_id = #{storeId,jdbcType=BIGINT},
    valid_status = #{validStatus,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>
