<?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.koobietech.eas.mbg.mapper.EasArcArctypeMapper">
  <resultMap id="BaseResultMap" type="com.koobietech.eas.mbg.model.EasArcArctype">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="is_views" jdbcType="CHAR" property="isViews" />
    <result column="template" jdbcType="VARCHAR" property="template" />
    <result column="backup" jdbcType="CHAR" property="backup" />
    <result column="suffix" jdbcType="VARCHAR" property="suffix" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
    <result column="create_uid" jdbcType="INTEGER" property="createUid" />
  </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, name, is_views, template, backup, suffix, create_time, modify_time, create_uid
  </sql>
  <select id="selectByExample" parameterType="com.koobietech.eas.mbg.model.EasArcArctypeExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from eas_arc_arctype
    <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.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from eas_arc_arctype
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from eas_arc_arctype
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.koobietech.eas.mbg.model.EasArcArctypeExample">
    delete from eas_arc_arctype
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.koobietech.eas.mbg.model.EasArcArctype">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into eas_arc_arctype (name, is_views, template, 
      backup, suffix, create_time, 
      modify_time, create_uid)
    values (#{name,jdbcType=VARCHAR}, #{isViews,jdbcType=CHAR}, #{template,jdbcType=VARCHAR}, 
      #{backup,jdbcType=CHAR}, #{suffix,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{modifyTime,jdbcType=TIMESTAMP}, #{createUid,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.koobietech.eas.mbg.model.EasArcArctype">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into eas_arc_arctype
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="name != null">
        name,
      </if>
      <if test="isViews != null">
        is_views,
      </if>
      <if test="template != null">
        template,
      </if>
      <if test="backup != null">
        backup,
      </if>
      <if test="suffix != null">
        suffix,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="modifyTime != null">
        modify_time,
      </if>
      <if test="createUid != null">
        create_uid,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="isViews != null">
        #{isViews,jdbcType=CHAR},
      </if>
      <if test="template != null">
        #{template,jdbcType=VARCHAR},
      </if>
      <if test="backup != null">
        #{backup,jdbcType=CHAR},
      </if>
      <if test="suffix != null">
        #{suffix,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyTime != null">
        #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUid != null">
        #{createUid,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.koobietech.eas.mbg.model.EasArcArctypeExample" resultType="java.lang.Long">
    select count(*) from eas_arc_arctype
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update eas_arc_arctype
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.isViews != null">
        is_views = #{record.isViews,jdbcType=CHAR},
      </if>
      <if test="record.template != null">
        template = #{record.template,jdbcType=VARCHAR},
      </if>
      <if test="record.backup != null">
        backup = #{record.backup,jdbcType=CHAR},
      </if>
      <if test="record.suffix != null">
        suffix = #{record.suffix,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifyTime != null">
        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUid != null">
        create_uid = #{record.createUid,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update eas_arc_arctype
    set id = #{record.id,jdbcType=INTEGER},
      name = #{record.name,jdbcType=VARCHAR},
      is_views = #{record.isViews,jdbcType=CHAR},
      template = #{record.template,jdbcType=VARCHAR},
      backup = #{record.backup,jdbcType=CHAR},
      suffix = #{record.suffix,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
      create_uid = #{record.createUid,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.koobietech.eas.mbg.model.EasArcArctype">
    update eas_arc_arctype
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="isViews != null">
        is_views = #{isViews,jdbcType=CHAR},
      </if>
      <if test="template != null">
        template = #{template,jdbcType=VARCHAR},
      </if>
      <if test="backup != null">
        backup = #{backup,jdbcType=CHAR},
      </if>
      <if test="suffix != null">
        suffix = #{suffix,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyTime != null">
        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUid != null">
        create_uid = #{createUid,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.koobietech.eas.mbg.model.EasArcArctype">
    update eas_arc_arctype
    set name = #{name,jdbcType=VARCHAR},
      is_views = #{isViews,jdbcType=CHAR},
      template = #{template,jdbcType=VARCHAR},
      backup = #{backup,jdbcType=CHAR},
      suffix = #{suffix,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
      create_uid = #{createUid,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>