<?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.xmomen.module.wx.entity.mapper.WxAppSettingMapper" >
  <resultMap id="BaseResultMap" type="com.xmomen.module.wx.entity.WxAppSetting" >
    <id column="uid" property="uid" jdbcType="VARCHAR" />
    <result column="public_uid" property="publicUid" jdbcType="VARCHAR" />
    <result column="is_service_account" property="isServiceAccount" jdbcType="INTEGER" />
    <result column="app_id" property="appId" jdbcType="VARCHAR" />
    <result column="app_secret" property="appSecret" jdbcType="VARCHAR" />
    <result column="token" property="token" jdbcType="VARCHAR" />
    <result column="company_name" property="companyName" jdbcType="VARCHAR" />
    <result column="application_name" property="applicationName" jdbcType="VARCHAR" />
    <result column="custom_assembly_name" property="customAssemblyName" jdbcType="VARCHAR" />
    <result column="custom_class_name" property="customClassName" jdbcType="VARCHAR" />
    <result column="domain_name" property="domainName" jdbcType="VARCHAR" />
    <result column="record_status" property="recordStatus" jdbcType="INTEGER" />
    <result column="access_token" property="accessToken" jdbcType="VARCHAR" />
    <result column="expires_in" property="expiresIn" jdbcType="INTEGER" />
    <result column="last_get_time" property="lastGetTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause" >
    <where >
      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    uid, public_uid, is_service_account, app_id, app_secret, token, company_name, application_name, 
    custom_assembly_name, custom_class_name, domain_name, record_status, access_token, 
    expires_in, last_get_time
  </sql>
  <sql id="Blob_Column_List" >
    remark
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.xmomen.module.wx.entity.WxAppSettingExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from wx_app_setting
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <delete id="deleteByExample" parameterType="com.xmomen.module.wx.entity.WxAppSettingExample" >
    delete from wx_app_setting
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insertSelective" parameterType="com.xmomen.module.wx.entity.WxAppSetting" useGeneratedKeys="true" keyProperty="uid" keyColumn="uid" >
    insert into wx_app_setting
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="uid != null" >
        uid,
      </if>
      <if test="publicUid != null" >
        public_uid,
      </if>
      <if test="isServiceAccount != null" >
        is_service_account,
      </if>
      <if test="appId != null" >
        app_id,
      </if>
      <if test="appSecret != null" >
        app_secret,
      </if>
      <if test="token != null" >
        token,
      </if>
      <if test="companyName != null" >
        company_name,
      </if>
      <if test="applicationName != null" >
        application_name,
      </if>
      <if test="customAssemblyName != null" >
        custom_assembly_name,
      </if>
      <if test="customClassName != null" >
        custom_class_name,
      </if>
      <if test="domainName != null" >
        domain_name,
      </if>
      <if test="recordStatus != null" >
        record_status,
      </if>
      <if test="accessToken != null" >
        access_token,
      </if>
      <if test="expiresIn != null" >
        expires_in,
      </if>
      <if test="lastGetTime != null" >
        last_get_time,
      </if>
      <if test="remark != null" >
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="uid != null" >
        #{uid,jdbcType=VARCHAR},
      </if>
      <if test="publicUid != null" >
        #{publicUid,jdbcType=VARCHAR},
      </if>
      <if test="isServiceAccount != null" >
        #{isServiceAccount,jdbcType=INTEGER},
      </if>
      <if test="appId != null" >
        #{appId,jdbcType=VARCHAR},
      </if>
      <if test="appSecret != null" >
        #{appSecret,jdbcType=VARCHAR},
      </if>
      <if test="token != null" >
        #{token,jdbcType=VARCHAR},
      </if>
      <if test="companyName != null" >
        #{companyName,jdbcType=VARCHAR},
      </if>
      <if test="applicationName != null" >
        #{applicationName,jdbcType=VARCHAR},
      </if>
      <if test="customAssemblyName != null" >
        #{customAssemblyName,jdbcType=VARCHAR},
      </if>
      <if test="customClassName != null" >
        #{customClassName,jdbcType=VARCHAR},
      </if>
      <if test="domainName != null" >
        #{domainName,jdbcType=VARCHAR},
      </if>
      <if test="recordStatus != null" >
        #{recordStatus,jdbcType=INTEGER},
      </if>
      <if test="accessToken != null" >
        #{accessToken,jdbcType=VARCHAR},
      </if>
      <if test="expiresIn != null" >
        #{expiresIn,jdbcType=INTEGER},
      </if>
      <if test="lastGetTime != null" >
        #{lastGetTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.xmomen.module.wx.entity.WxAppSettingExample" resultType="java.lang.Integer" >
    select count(*) from wx_app_setting
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update wx_app_setting
    <set >
      <if test="record.uid != null" >
        uid = #{record.uid,jdbcType=VARCHAR},
      </if>
      <if test="record.publicUid != null" >
        public_uid = #{record.publicUid,jdbcType=VARCHAR},
      </if>
      <if test="record.isServiceAccount != null" >
        is_service_account = #{record.isServiceAccount,jdbcType=INTEGER},
      </if>
      <if test="record.appId != null" >
        app_id = #{record.appId,jdbcType=VARCHAR},
      </if>
      <if test="record.appSecret != null" >
        app_secret = #{record.appSecret,jdbcType=VARCHAR},
      </if>
      <if test="record.token != null" >
        token = #{record.token,jdbcType=VARCHAR},
      </if>
      <if test="record.companyName != null" >
        company_name = #{record.companyName,jdbcType=VARCHAR},
      </if>
      <if test="record.applicationName != null" >
        application_name = #{record.applicationName,jdbcType=VARCHAR},
      </if>
      <if test="record.customAssemblyName != null" >
        custom_assembly_name = #{record.customAssemblyName,jdbcType=VARCHAR},
      </if>
      <if test="record.customClassName != null" >
        custom_class_name = #{record.customClassName,jdbcType=VARCHAR},
      </if>
      <if test="record.domainName != null" >
        domain_name = #{record.domainName,jdbcType=VARCHAR},
      </if>
      <if test="record.recordStatus != null" >
        record_status = #{record.recordStatus,jdbcType=INTEGER},
      </if>
      <if test="record.accessToken != null" >
        access_token = #{record.accessToken,jdbcType=VARCHAR},
      </if>
      <if test="record.expiresIn != null" >
        expires_in = #{record.expiresIn,jdbcType=INTEGER},
      </if>
      <if test="record.lastGetTime != null" >
        last_get_time = #{record.lastGetTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.remark != null" >
        remark = #{record.remark,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
</mapper>