<?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.zheng.upms.dao.mapper.UpmsSystemMapper">
  <resultMap id="BaseResultMap" type="com.zheng.upms.dao.model.UpmsSystem">
    <id column="system_id" jdbcType="INTEGER" property="systemId" />
    <result column="icon" jdbcType="VARCHAR" property="icon" />
    <result column="banner" jdbcType="VARCHAR" property="banner" />
    <result column="theme" jdbcType="VARCHAR" property="theme" />
    <result column="basepath" jdbcType="VARCHAR" property="basepath" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="title" jdbcType="VARCHAR" property="title" />
    <result column="description" jdbcType="VARCHAR" property="description" />
    <result column="ctime" jdbcType="BIGINT" property="ctime" />
    <result column="orders" jdbcType="BIGINT" property="orders" />
  </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">
    system_id, icon, banner, theme, basepath, status, name, title, description, ctime, 
    orders
  </sql>
  <select id="selectByExample" parameterType="com.zheng.upms.dao.model.UpmsSystemExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from upms_system
    <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 upms_system
    where system_id = #{systemId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from upms_system
    where system_id = #{systemId,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.zheng.upms.dao.model.UpmsSystemExample">
    delete from upms_system
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zheng.upms.dao.model.UpmsSystem">
    insert into upms_system (system_id, icon, banner, 
      theme, basepath, status, 
      name, title, description, 
      ctime, orders)
    values (#{systemId,jdbcType=INTEGER}, #{icon,jdbcType=VARCHAR}, #{banner,jdbcType=VARCHAR}, 
      #{theme,jdbcType=VARCHAR}, #{basepath,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, 
      #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, 
      #{ctime,jdbcType=BIGINT}, #{orders,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsSystem">
    insert into upms_system
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="systemId != null">
        system_id,
      </if>
      <if test="icon != null">
        icon,
      </if>
      <if test="banner != null">
        banner,
      </if>
      <if test="theme != null">
        theme,
      </if>
      <if test="basepath != null">
        basepath,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="title != null">
        title,
      </if>
      <if test="description != null">
        description,
      </if>
      <if test="ctime != null">
        ctime,
      </if>
      <if test="orders != null">
        orders,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="systemId != null">
        #{systemId,jdbcType=INTEGER},
      </if>
      <if test="icon != null">
        #{icon,jdbcType=VARCHAR},
      </if>
      <if test="banner != null">
        #{banner,jdbcType=VARCHAR},
      </if>
      <if test="theme != null">
        #{theme,jdbcType=VARCHAR},
      </if>
      <if test="basepath != null">
        #{basepath,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=TINYINT},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=VARCHAR},
      </if>
      <if test="ctime != null">
        #{ctime,jdbcType=BIGINT},
      </if>
      <if test="orders != null">
        #{orders,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zheng.upms.dao.model.UpmsSystemExample" resultType="java.lang.Long">
    select count(*) from upms_system
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update upms_system
    <set>
      <if test="record.systemId != null">
        system_id = #{record.systemId,jdbcType=INTEGER},
      </if>
      <if test="record.icon != null">
        icon = #{record.icon,jdbcType=VARCHAR},
      </if>
      <if test="record.banner != null">
        banner = #{record.banner,jdbcType=VARCHAR},
      </if>
      <if test="record.theme != null">
        theme = #{record.theme,jdbcType=VARCHAR},
      </if>
      <if test="record.basepath != null">
        basepath = #{record.basepath,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        status = #{record.status,jdbcType=TINYINT},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.title != null">
        title = #{record.title,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        description = #{record.description,jdbcType=VARCHAR},
      </if>
      <if test="record.ctime != null">
        ctime = #{record.ctime,jdbcType=BIGINT},
      </if>
      <if test="record.orders != null">
        orders = #{record.orders,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update upms_system
    set system_id = #{record.systemId,jdbcType=INTEGER},
      icon = #{record.icon,jdbcType=VARCHAR},
      banner = #{record.banner,jdbcType=VARCHAR},
      theme = #{record.theme,jdbcType=VARCHAR},
      basepath = #{record.basepath,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=TINYINT},
      name = #{record.name,jdbcType=VARCHAR},
      title = #{record.title,jdbcType=VARCHAR},
      description = #{record.description,jdbcType=VARCHAR},
      ctime = #{record.ctime,jdbcType=BIGINT},
      orders = #{record.orders,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.upms.dao.model.UpmsSystem">
    update upms_system
    <set>
      <if test="icon != null">
        icon = #{icon,jdbcType=VARCHAR},
      </if>
      <if test="banner != null">
        banner = #{banner,jdbcType=VARCHAR},
      </if>
      <if test="theme != null">
        theme = #{theme,jdbcType=VARCHAR},
      </if>
      <if test="basepath != null">
        basepath = #{basepath,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=TINYINT},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="title != null">
        title = #{title,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=VARCHAR},
      </if>
      <if test="ctime != null">
        ctime = #{ctime,jdbcType=BIGINT},
      </if>
      <if test="orders != null">
        orders = #{orders,jdbcType=BIGINT},
      </if>
    </set>
    where system_id = #{systemId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zheng.upms.dao.model.UpmsSystem">
    update upms_system
    set icon = #{icon,jdbcType=VARCHAR},
      banner = #{banner,jdbcType=VARCHAR},
      theme = #{theme,jdbcType=VARCHAR},
      basepath = #{basepath,jdbcType=VARCHAR},
      status = #{status,jdbcType=TINYINT},
      name = #{name,jdbcType=VARCHAR},
      title = #{title,jdbcType=VARCHAR},
      description = #{description,jdbcType=VARCHAR},
      ctime = #{ctime,jdbcType=BIGINT},
      orders = #{orders,jdbcType=BIGINT}
    where system_id = #{systemId,jdbcType=INTEGER}
  </update>
  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper>