<?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.read.system.EnquiryReadMapper">
  <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="quantity" jdbcType="INTEGER" property="quantity" />
    <result column="company" jdbcType="VARCHAR" property="company" />
    <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_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>
  <select id="selectByExample" parameterType="com.slodon.b2b2c.system.example.EnquiryExample" resultMap="BaseResultMap">
    <!--
      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.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from enquiry
    <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.Long" resultMap="BaseResultMap">
    <!--
      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.
    -->
    select
    <include refid="Base_Column_List" />
    from enquiry
    where id = #{id,jdbcType=BIGINT}
  </select>

  <select id="countByExample" parameterType="com.slodon.b2b2c.system.example.EnquiryExample" resultType="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.
    -->
    select count(*) from enquiry
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>

</mapper>
