<?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.lightinit.hsdataplatform.mapper.ActivityMapper">
  <resultMap id="BaseResultMap" type="com.lightinit.hsdataplatform.entity.Activity">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="activity_state" jdbcType="VARCHAR" property="activityState" />
    <result column="activity_name" jdbcType="VARCHAR" property="activityName" />
    <result column="activity_type" jdbcType="VARCHAR" property="activityType" />
    <result column="organiger" jdbcType="VARCHAR" property="organiger" />
    <result column="enroll_addr" jdbcType="VARCHAR" property="enrollAddr" />
    <result column="enroll_time" jdbcType="VARCHAR" property="enrollTime" />
    <result column="activity_addr" jdbcType="VARCHAR" property="activityAddr" />
    <result column="activity_time" jdbcType="VARCHAR" property="activityTime" />
    <result column="publish_by" jdbcType="BIGINT" property="publishBy" />
    <result column="publish_at" jdbcType="TIMESTAMP" property="publishAt" />
    <result column="audited_by" jdbcType="BIGINT" property="auditedBy" />
    <result column="audited_at" jdbcType="TIMESTAMP" property="auditedAt" />
    <result column="audit_result" jdbcType="VARCHAR" property="auditResult" />
    <result column="audit_opinion" jdbcType="VARCHAR" property="auditOpinion" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="created_by" jdbcType="BIGINT" property="createdBy" />
    <result column="deleted_at" jdbcType="TIMESTAMP" property="deletedAt" />
    <result column="deleted_by" jdbcType="BIGINT" property="deletedBy" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.lightinit.hsdataplatform.entity.ActivityWithBLOBs">
    <result column="activity_intro" jdbcType="LONGVARCHAR" property="activityIntro" />
    <result column="activity_detail" jdbcType="LONGVARCHAR" property="activityDetail" />
    <result column="thumbnail" jdbcType="LONGVARCHAR" property="thumbnail" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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">
    <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">
    id, activity_state, activity_name, activity_type, organiger, enroll_addr, enroll_time, 
    activity_addr, activity_time, publish_by, publish_at, audited_by, audited_at, audit_result, 
    audit_opinion, created_at, created_by, deleted_at, deleted_by
  </sql>
  <sql id="Blob_Column_List">
    activity_intro, activity_detail, thumbnail
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.lightinit.hsdataplatform.entity.ActivityExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from activity
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="page != null" >
      limit ${page.beginIndex},${page.pageSize}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.lightinit.hsdataplatform.entity.ActivityExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from activity
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="page != null" >
      limit ${page.beginIndex},${page.pageSize}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from activity
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from activity
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.lightinit.hsdataplatform.entity.ActivityExample">
    delete from activity
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.lightinit.hsdataplatform.entity.ActivityWithBLOBs">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into activity (activity_state, activity_name, activity_type, 
      organiger, enroll_addr, enroll_time, 
      activity_addr, activity_time, publish_by, 
      publish_at, audited_by, audited_at, 
      audit_result, audit_opinion, created_at, 
      created_by, deleted_at, deleted_by, 
      activity_intro, activity_detail, 
      thumbnail)
    values (#{activityState,jdbcType=VARCHAR}, #{activityName,jdbcType=VARCHAR}, #{activityType,jdbcType=VARCHAR}, 
      #{organiger,jdbcType=VARCHAR}, #{enrollAddr,jdbcType=VARCHAR}, #{enrollTime,jdbcType=VARCHAR}, 
      #{activityAddr,jdbcType=VARCHAR}, #{activityTime,jdbcType=VARCHAR}, #{publishBy,jdbcType=BIGINT}, 
      #{publishAt,jdbcType=TIMESTAMP}, #{auditedBy,jdbcType=BIGINT}, #{auditedAt,jdbcType=TIMESTAMP}, 
      #{auditResult,jdbcType=VARCHAR}, #{auditOpinion,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, 
      #{createdBy,jdbcType=BIGINT}, #{deletedAt,jdbcType=TIMESTAMP}, #{deletedBy,jdbcType=BIGINT}, 
      #{activityIntro,jdbcType=LONGVARCHAR}, #{activityDetail,jdbcType=LONGVARCHAR}, 
      #{thumbnail,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.lightinit.hsdataplatform.entity.ActivityWithBLOBs">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into activity
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="activityState != null">
        activity_state,
      </if>
      <if test="activityName != null">
        activity_name,
      </if>
      <if test="activityType != null">
        activity_type,
      </if>
      <if test="organiger != null">
        organiger,
      </if>
      <if test="enrollAddr != null">
        enroll_addr,
      </if>
      <if test="enrollTime != null">
        enroll_time,
      </if>
      <if test="activityAddr != null">
        activity_addr,
      </if>
      <if test="activityTime != null">
        activity_time,
      </if>
      <if test="publishBy != null">
        publish_by,
      </if>
      <if test="publishAt != null">
        publish_at,
      </if>
      <if test="auditedBy != null">
        audited_by,
      </if>
      <if test="auditedAt != null">
        audited_at,
      </if>
      <if test="auditResult != null">
        audit_result,
      </if>
      <if test="auditOpinion != null">
        audit_opinion,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="deletedAt != null">
        deleted_at,
      </if>
      <if test="deletedBy != null">
        deleted_by,
      </if>
      <if test="activityIntro != null">
        activity_intro,
      </if>
      <if test="activityDetail != null">
        activity_detail,
      </if>
      <if test="thumbnail != null">
        thumbnail,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="activityState != null">
        #{activityState,jdbcType=VARCHAR},
      </if>
      <if test="activityName != null">
        #{activityName,jdbcType=VARCHAR},
      </if>
      <if test="activityType != null">
        #{activityType,jdbcType=VARCHAR},
      </if>
      <if test="organiger != null">
        #{organiger,jdbcType=VARCHAR},
      </if>
      <if test="enrollAddr != null">
        #{enrollAddr,jdbcType=VARCHAR},
      </if>
      <if test="enrollTime != null">
        #{enrollTime,jdbcType=VARCHAR},
      </if>
      <if test="activityAddr != null">
        #{activityAddr,jdbcType=VARCHAR},
      </if>
      <if test="activityTime != null">
        #{activityTime,jdbcType=VARCHAR},
      </if>
      <if test="publishBy != null">
        #{publishBy,jdbcType=BIGINT},
      </if>
      <if test="publishAt != null">
        #{publishAt,jdbcType=TIMESTAMP},
      </if>
      <if test="auditedBy != null">
        #{auditedBy,jdbcType=BIGINT},
      </if>
      <if test="auditedAt != null">
        #{auditedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="auditResult != null">
        #{auditResult,jdbcType=VARCHAR},
      </if>
      <if test="auditOpinion != null">
        #{auditOpinion,jdbcType=VARCHAR},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="deletedAt != null">
        #{deletedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="deletedBy != null">
        #{deletedBy,jdbcType=BIGINT},
      </if>
      <if test="activityIntro != null">
        #{activityIntro,jdbcType=LONGVARCHAR},
      </if>
      <if test="activityDetail != null">
        #{activityDetail,jdbcType=LONGVARCHAR},
      </if>
      <if test="thumbnail != null">
        #{thumbnail,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.lightinit.hsdataplatform.entity.ActivityExample" resultType="java.lang.Long">
    select count(*) from activity
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update activity
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.activityState != null">
        activity_state = #{record.activityState,jdbcType=VARCHAR},
      </if>
      <if test="record.activityName != null">
        activity_name = #{record.activityName,jdbcType=VARCHAR},
      </if>
      <if test="record.activityType != null">
        activity_type = #{record.activityType,jdbcType=VARCHAR},
      </if>
      <if test="record.organiger != null">
        organiger = #{record.organiger,jdbcType=VARCHAR},
      </if>
      <if test="record.enrollAddr != null">
        enroll_addr = #{record.enrollAddr,jdbcType=VARCHAR},
      </if>
      <if test="record.enrollTime != null">
        enroll_time = #{record.enrollTime,jdbcType=VARCHAR},
      </if>
      <if test="record.activityAddr != null">
        activity_addr = #{record.activityAddr,jdbcType=VARCHAR},
      </if>
      <if test="record.activityTime != null">
        activity_time = #{record.activityTime,jdbcType=VARCHAR},
      </if>
      <if test="record.publishBy != null">
        publish_by = #{record.publishBy,jdbcType=BIGINT},
      </if>
      <if test="record.publishAt != null">
        publish_at = #{record.publishAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.auditedBy != null">
        audited_by = #{record.auditedBy,jdbcType=BIGINT},
      </if>
      <if test="record.auditedAt != null">
        audited_at = #{record.auditedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.auditResult != null">
        audit_result = #{record.auditResult,jdbcType=VARCHAR},
      </if>
      <if test="record.auditOpinion != null">
        audit_opinion = #{record.auditOpinion,jdbcType=VARCHAR},
      </if>
      <if test="record.createdAt != null">
        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createdBy != null">
        created_by = #{record.createdBy,jdbcType=BIGINT},
      </if>
      <if test="record.deletedAt != null">
        deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deletedBy != null">
        deleted_by = #{record.deletedBy,jdbcType=BIGINT},
      </if>
      <if test="record.activityIntro != null">
        activity_intro = #{record.activityIntro,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.activityDetail != null">
        activity_detail = #{record.activityDetail,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.thumbnail != null">
        thumbnail = #{record.thumbnail,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update activity
    set id = #{record.id,jdbcType=BIGINT},
      activity_state = #{record.activityState,jdbcType=VARCHAR},
      activity_name = #{record.activityName,jdbcType=VARCHAR},
      activity_type = #{record.activityType,jdbcType=VARCHAR},
      organiger = #{record.organiger,jdbcType=VARCHAR},
      enroll_addr = #{record.enrollAddr,jdbcType=VARCHAR},
      enroll_time = #{record.enrollTime,jdbcType=VARCHAR},
      activity_addr = #{record.activityAddr,jdbcType=VARCHAR},
      activity_time = #{record.activityTime,jdbcType=VARCHAR},
      publish_by = #{record.publishBy,jdbcType=BIGINT},
      publish_at = #{record.publishAt,jdbcType=TIMESTAMP},
      audited_by = #{record.auditedBy,jdbcType=BIGINT},
      audited_at = #{record.auditedAt,jdbcType=TIMESTAMP},
      audit_result = #{record.auditResult,jdbcType=VARCHAR},
      audit_opinion = #{record.auditOpinion,jdbcType=VARCHAR},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=BIGINT},
      deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{record.deletedBy,jdbcType=BIGINT},
      activity_intro = #{record.activityIntro,jdbcType=LONGVARCHAR},
      activity_detail = #{record.activityDetail,jdbcType=LONGVARCHAR},
      thumbnail = #{record.thumbnail,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update activity
    set id = #{record.id,jdbcType=BIGINT},
      activity_state = #{record.activityState,jdbcType=VARCHAR},
      activity_name = #{record.activityName,jdbcType=VARCHAR},
      activity_type = #{record.activityType,jdbcType=VARCHAR},
      organiger = #{record.organiger,jdbcType=VARCHAR},
      enroll_addr = #{record.enrollAddr,jdbcType=VARCHAR},
      enroll_time = #{record.enrollTime,jdbcType=VARCHAR},
      activity_addr = #{record.activityAddr,jdbcType=VARCHAR},
      activity_time = #{record.activityTime,jdbcType=VARCHAR},
      publish_by = #{record.publishBy,jdbcType=BIGINT},
      publish_at = #{record.publishAt,jdbcType=TIMESTAMP},
      audited_by = #{record.auditedBy,jdbcType=BIGINT},
      audited_at = #{record.auditedAt,jdbcType=TIMESTAMP},
      audit_result = #{record.auditResult,jdbcType=VARCHAR},
      audit_opinion = #{record.auditOpinion,jdbcType=VARCHAR},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=BIGINT},
      deleted_at = #{record.deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{record.deletedBy,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.lightinit.hsdataplatform.entity.ActivityWithBLOBs">
    update activity
    <set>
      <if test="activityState != null">
        activity_state = #{activityState,jdbcType=VARCHAR},
      </if>
      <if test="activityName != null">
        activity_name = #{activityName,jdbcType=VARCHAR},
      </if>
      <if test="activityType != null">
        activity_type = #{activityType,jdbcType=VARCHAR},
      </if>
      <if test="organiger != null">
        organiger = #{organiger,jdbcType=VARCHAR},
      </if>
      <if test="enrollAddr != null">
        enroll_addr = #{enrollAddr,jdbcType=VARCHAR},
      </if>
      <if test="enrollTime != null">
        enroll_time = #{enrollTime,jdbcType=VARCHAR},
      </if>
      <if test="activityAddr != null">
        activity_addr = #{activityAddr,jdbcType=VARCHAR},
      </if>
      <if test="activityTime != null">
        activity_time = #{activityTime,jdbcType=VARCHAR},
      </if>
      <if test="publishBy != null">
        publish_by = #{publishBy,jdbcType=BIGINT},
      </if>
      <if test="publishAt != null">
        publish_at = #{publishAt,jdbcType=TIMESTAMP},
      </if>
      <if test="auditedBy != null">
        audited_by = #{auditedBy,jdbcType=BIGINT},
      </if>
      <if test="auditedAt != null">
        audited_at = #{auditedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="auditResult != null">
        audit_result = #{auditResult,jdbcType=VARCHAR},
      </if>
      <if test="auditOpinion != null">
        audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="deletedAt != null">
        deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="deletedBy != null">
        deleted_by = #{deletedBy,jdbcType=BIGINT},
      </if>
      <if test="activityIntro != null">
        activity_intro = #{activityIntro,jdbcType=LONGVARCHAR},
      </if>
      <if test="activityDetail != null">
        activity_detail = #{activityDetail,jdbcType=LONGVARCHAR},
      </if>
      <if test="thumbnail != null">
        thumbnail = #{thumbnail,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.lightinit.hsdataplatform.entity.ActivityWithBLOBs">
    update activity
    set activity_state = #{activityState,jdbcType=VARCHAR},
      activity_name = #{activityName,jdbcType=VARCHAR},
      activity_type = #{activityType,jdbcType=VARCHAR},
      organiger = #{organiger,jdbcType=VARCHAR},
      enroll_addr = #{enrollAddr,jdbcType=VARCHAR},
      enroll_time = #{enrollTime,jdbcType=VARCHAR},
      activity_addr = #{activityAddr,jdbcType=VARCHAR},
      activity_time = #{activityTime,jdbcType=VARCHAR},
      publish_by = #{publishBy,jdbcType=BIGINT},
      publish_at = #{publishAt,jdbcType=TIMESTAMP},
      audited_by = #{auditedBy,jdbcType=BIGINT},
      audited_at = #{auditedAt,jdbcType=TIMESTAMP},
      audit_result = #{auditResult,jdbcType=VARCHAR},
      audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{deletedBy,jdbcType=BIGINT},
      activity_intro = #{activityIntro,jdbcType=LONGVARCHAR},
      activity_detail = #{activityDetail,jdbcType=LONGVARCHAR},
      thumbnail = #{thumbnail,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.lightinit.hsdataplatform.entity.Activity">
    update activity
    set activity_state = #{activityState,jdbcType=VARCHAR},
      activity_name = #{activityName,jdbcType=VARCHAR},
      activity_type = #{activityType,jdbcType=VARCHAR},
      organiger = #{organiger,jdbcType=VARCHAR},
      enroll_addr = #{enrollAddr,jdbcType=VARCHAR},
      enroll_time = #{enrollTime,jdbcType=VARCHAR},
      activity_addr = #{activityAddr,jdbcType=VARCHAR},
      activity_time = #{activityTime,jdbcType=VARCHAR},
      publish_by = #{publishBy,jdbcType=BIGINT},
      publish_at = #{publishAt,jdbcType=TIMESTAMP},
      audited_by = #{auditedBy,jdbcType=BIGINT},
      audited_at = #{auditedAt,jdbcType=TIMESTAMP},
      audit_result = #{auditResult,jdbcType=VARCHAR},
      audit_opinion = #{auditOpinion,jdbcType=VARCHAR},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      deleted_at = #{deletedAt,jdbcType=TIMESTAMP},
      deleted_by = #{deletedBy,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>