<?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="top.phrack.ctf.models.dao.RulesMapper" >
  <resultMap id="BaseResultMap" type="top.phrack.ctf.pojo.Rules" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="content" property="content" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    <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" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    <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" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    "id", "content"
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="top.phrack.ctf.pojo.RulesExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from "public"."rules"
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    select 
    <include refid="Base_Column_List" />
    from "public"."rules"
    where "id" = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    delete from "public"."rules"
    where "id" = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="top.phrack.ctf.pojo.RulesExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    delete from "public"."rules"
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="top.phrack.ctf.pojo.Rules" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    insert into "public"."rules" ("id", "content")
    values (#{id,jdbcType=BIGINT}, #{content,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="top.phrack.ctf.pojo.Rules" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    insert into "public"."rules"
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        "id",
      </if>
      <if test="content != null" >
        "content",
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="content != null" >
        #{content,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="top.phrack.ctf.pojo.RulesExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    select count(*) from "public"."rules"
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    update "public"."rules"
    <set >
      <if test="record.id != null" >
        "id" = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.content != null" >
        "content" = #{record.content,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    update "public"."rules"
    set "id" = #{record.id,jdbcType=BIGINT},
      "content" = #{record.content,jdbcType=VARCHAR}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="top.phrack.ctf.pojo.Rules" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    update "public"."rules"
    <set >
      <if test="content != null" >
        "content" = #{content,jdbcType=VARCHAR},
      </if>
    </set>
    where "id" = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="top.phrack.ctf.pojo.Rules" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Mar 31 16:07:59 CST 2016.
    -->
    update "public"."rules"
    set "content" = #{content,jdbcType=VARCHAR}
    where "id" = #{id,jdbcType=BIGINT}
  </update>
</mapper>