<?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.jay.monitor.data.server.daos.BackstageRouteMapper">
    <resultMap id="BaseResultMap" type="com.jay.monitor.data.server.models.entity.BackstageRoute">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="project" property="project" jdbcType="VARCHAR"/>
        <result column="url" property="url" jdbcType="VARCHAR"/>
        <result column="method" property="method" jdbcType="VARCHAR"/>
        <result column="module" property="module" jdbcType="VARCHAR"/>
        <result column="consumes" property="consumes" jdbcType="VARCHAR"/>
        <result column="produces" property="produces" jdbcType="VARCHAR"/>
        <result column="remark" property="remark" jdbcType="VARCHAR"/>
        <result column="author" property="author" jdbcType="VARCHAR"/>
        <result column="check_rule" property="checkRule" jdbcType="VARCHAR"/>
        <result column="is_valid" property="isValid" jdbcType="INTEGER"/>
        <result column="status" property="status" jdbcType="INTEGER"/>
        <result column="created" property="created" jdbcType="TIMESTAMP"/>
        <result column="updated" property="updated" jdbcType="TIMESTAMP"/>
        <result column="creator" property="creator" jdbcType="VARCHAR"/>
        <result column="updator" property="updator" jdbcType="VARCHAR"/>
    </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">
    id, project, url, method, module, consumes, produces, remark, author, check_rule, 
    is_valid, status, created, updated, creator, updator
  </sql>
    <select id="selectByExample" resultMap="BaseResultMap"
            parameterType="com.jay.monitor.data.server.models.entity.BackstageRouteExample">
        select
        <if test="distinct">
            distinct
        </if>
        <include refid="Base_Column_List"/>
        from backstage_route
        <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.Integer">
        select
        <include refid="Base_Column_List"/>
        from backstage_route
        where id = #{id,jdbcType=INTEGER}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from backstage_route
    where id = #{id,jdbcType=INTEGER}
  </delete>
    <delete id="deleteByExample" parameterType="com.jay.monitor.data.server.models.entity.BackstageRouteExample">
        delete from backstage_route
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
    </delete>
    <insert id="insert" parameterType="com.jay.monitor.data.server.models.entity.BackstageRoute">
    insert into backstage_route (id, project, url, 
      method, module, consumes, 
      produces, remark, author, 
      check_rule, is_valid, status, 
      created, updated, creator, 
      updator)
    values (#{id,jdbcType=INTEGER}, #{project,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, 
      #{method,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR}, #{consumes,jdbcType=VARCHAR}, 
      #{produces,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR}, 
      #{checkRule,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
      #{created,jdbcType=TIMESTAMP}, #{updated,jdbcType=TIMESTAMP}, #{creator,jdbcType=VARCHAR}, 
      #{updator,jdbcType=VARCHAR})
  </insert>
    <insert id="insertSelective" parameterType="com.jay.monitor.data.server.models.entity.BackstageRoute">
        insert into backstage_route
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="project != null">
                project,
            </if>
            <if test="url != null">
                url,
            </if>
            <if test="method != null">
                method,
            </if>
            <if test="module != null">
                module,
            </if>
            <if test="consumes != null">
                consumes,
            </if>
            <if test="produces != null">
                produces,
            </if>
            <if test="remark != null">
                remark,
            </if>
            <if test="author != null">
                author,
            </if>
            <if test="checkRule != null">
                check_rule,
            </if>
            <if test="isValid != null">
                is_valid,
            </if>
            <if test="status != null">
                status,
            </if>
            <if test="created != null">
                created,
            </if>
            <if test="updated != null">
                updated,
            </if>
            <if test="creator != null">
                creator,
            </if>
            <if test="updator != null">
                updator,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="project != null">
                #{project,jdbcType=VARCHAR},
            </if>
            <if test="url != null">
                #{url,jdbcType=VARCHAR},
            </if>
            <if test="method != null">
                #{method,jdbcType=VARCHAR},
            </if>
            <if test="module != null">
                #{module,jdbcType=VARCHAR},
            </if>
            <if test="consumes != null">
                #{consumes,jdbcType=VARCHAR},
            </if>
            <if test="produces != null">
                #{produces,jdbcType=VARCHAR},
            </if>
            <if test="remark != null">
                #{remark,jdbcType=VARCHAR},
            </if>
            <if test="author != null">
                #{author,jdbcType=VARCHAR},
            </if>
            <if test="checkRule != null">
                #{checkRule,jdbcType=VARCHAR},
            </if>
            <if test="isValid != null">
                #{isValid,jdbcType=INTEGER},
            </if>
            <if test="status != null">
                #{status,jdbcType=INTEGER},
            </if>
            <if test="created != null">
                #{created,jdbcType=TIMESTAMP},
            </if>
            <if test="updated != null">
                #{updated,jdbcType=TIMESTAMP},
            </if>
            <if test="creator != null">
                #{creator,jdbcType=VARCHAR},
            </if>
            <if test="updator != null">
                #{updator,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
    <select id="countByExample" parameterType="com.jay.monitor.data.server.models.entity.BackstageRouteExample"
            resultType="java.lang.Integer">
        select count(*) from backstage_route
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
    </select>
    <update id="updateByExampleSelective" parameterType="map">
        update backstage_route
        <set>
            <if test="record.id != null">
                id = #{record.id,jdbcType=INTEGER},
            </if>
            <if test="record.project != null">
                project = #{record.project,jdbcType=VARCHAR},
            </if>
            <if test="record.url != null">
                url = #{record.url,jdbcType=VARCHAR},
            </if>
            <if test="record.method != null">
                method = #{record.method,jdbcType=VARCHAR},
            </if>
            <if test="record.module != null">
                module = #{record.module,jdbcType=VARCHAR},
            </if>
            <if test="record.consumes != null">
                consumes = #{record.consumes,jdbcType=VARCHAR},
            </if>
            <if test="record.produces != null">
                produces = #{record.produces,jdbcType=VARCHAR},
            </if>
            <if test="record.remark != null">
                remark = #{record.remark,jdbcType=VARCHAR},
            </if>
            <if test="record.author != null">
                author = #{record.author,jdbcType=VARCHAR},
            </if>
            <if test="record.checkRule != null">
                check_rule = #{record.checkRule,jdbcType=VARCHAR},
            </if>
            <if test="record.isValid != null">
                is_valid = #{record.isValid,jdbcType=INTEGER},
            </if>
            <if test="record.status != null">
                status = #{record.status,jdbcType=INTEGER},
            </if>
            <if test="record.created != null">
                created = #{record.created,jdbcType=TIMESTAMP},
            </if>
            <if test="record.updated != null">
                updated = #{record.updated,jdbcType=TIMESTAMP},
            </if>
            <if test="record.creator != null">
                creator = #{record.creator,jdbcType=VARCHAR},
            </if>
            <if test="record.updator != null">
                updator = #{record.updator,jdbcType=VARCHAR},
            </if>
        </set>
        <if test="_parameter != null">
            <include refid="Update_By_Example_Where_Clause"/>
        </if>
    </update>
    <update id="updateByExample" parameterType="map">
        update backstage_route
        set id = #{record.id,jdbcType=INTEGER},
        project = #{record.project,jdbcType=VARCHAR},
        url = #{record.url,jdbcType=VARCHAR},
        method = #{record.method,jdbcType=VARCHAR},
        module = #{record.module,jdbcType=VARCHAR},
        consumes = #{record.consumes,jdbcType=VARCHAR},
        produces = #{record.produces,jdbcType=VARCHAR},
        remark = #{record.remark,jdbcType=VARCHAR},
        author = #{record.author,jdbcType=VARCHAR},
        check_rule = #{record.checkRule,jdbcType=VARCHAR},
        is_valid = #{record.isValid,jdbcType=INTEGER},
        status = #{record.status,jdbcType=INTEGER},
        created = #{record.created,jdbcType=TIMESTAMP},
        updated = #{record.updated,jdbcType=TIMESTAMP},
        creator = #{record.creator,jdbcType=VARCHAR},
        updator = #{record.updator,jdbcType=VARCHAR}
        <if test="_parameter != null">
            <include refid="Update_By_Example_Where_Clause"/>
        </if>
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.jay.monitor.data.server.models.entity.BackstageRoute">
        update backstage_route
        <set>
            <if test="project != null">
                project = #{project,jdbcType=VARCHAR},
            </if>
            <if test="url != null">
                url = #{url,jdbcType=VARCHAR},
            </if>
            <if test="method != null">
                method = #{method,jdbcType=VARCHAR},
            </if>
            <if test="module != null">
                module = #{module,jdbcType=VARCHAR},
            </if>
            <if test="consumes != null">
                consumes = #{consumes,jdbcType=VARCHAR},
            </if>
            <if test="produces != null">
                produces = #{produces,jdbcType=VARCHAR},
            </if>
            <if test="remark != null">
                remark = #{remark,jdbcType=VARCHAR},
            </if>
            <if test="author != null">
                author = #{author,jdbcType=VARCHAR},
            </if>
            <if test="checkRule != null">
                check_rule = #{checkRule,jdbcType=VARCHAR},
            </if>
            <if test="isValid != null">
                is_valid = #{isValid,jdbcType=INTEGER},
            </if>
            <if test="status != null">
                status = #{status,jdbcType=INTEGER},
            </if>
            <if test="created != null">
                created = #{created,jdbcType=TIMESTAMP},
            </if>
            <if test="updated != null">
                updated = #{updated,jdbcType=TIMESTAMP},
            </if>
            <if test="creator != null">
                creator = #{creator,jdbcType=VARCHAR},
            </if>
            <if test="updator != null">
                updator = #{updator,jdbcType=VARCHAR},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.jay.monitor.data.server.models.entity.BackstageRoute">
    update backstage_route
    set project = #{project,jdbcType=VARCHAR},
      url = #{url,jdbcType=VARCHAR},
      method = #{method,jdbcType=VARCHAR},
      module = #{module,jdbcType=VARCHAR},
      consumes = #{consumes,jdbcType=VARCHAR},
      produces = #{produces,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      author = #{author,jdbcType=VARCHAR},
      check_rule = #{checkRule,jdbcType=VARCHAR},
      is_valid = #{isValid,jdbcType=INTEGER},
      status = #{status,jdbcType=INTEGER},
      created = #{created,jdbcType=TIMESTAMP},
      updated = #{updated,jdbcType=TIMESTAMP},
      creator = #{creator,jdbcType=VARCHAR},
      updator = #{updator,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>