| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one or more |
| ~ contributor license agreements. See the NOTICE file distributed with |
| ~ this work for additional information regarding copyright ownership. |
| ~ The ASF licenses this file to You under the Apache License, Version 2.0 |
| ~ (the "License"); you may not use this file except in compliance with |
| ~ the License. You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, software |
| ~ distributed under the License is distributed on an "AS IS" BASIS, |
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| ~ See the License for the specific language governing permissions and |
| ~ limitations under the License. |
| --> |
| |
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| <mapper namespace="org.apache.shenyu.admin.mapper.SelectorConditionMapper"> |
| <resultMap id="BaseResultMap" type="org.apache.shenyu.admin.model.entity.SelectorConditionDO"> |
| <id column="id" jdbcType="VARCHAR" property="id"/> |
| <result column="date_created" jdbcType="TIMESTAMP" property="dateCreated"/> |
| <result column="date_updated" jdbcType="TIMESTAMP" property="dateUpdated"/> |
| <result column="selector_id" jdbcType="VARCHAR" property="selectorId"/> |
| <result column="param_type" jdbcType="VARCHAR" property="paramType"/> |
| <result column="operator" jdbcType="VARCHAR" property="operator"/> |
| <result column="param_name" jdbcType="VARCHAR" property="paramName"/> |
| <result column="param_value" jdbcType="VARCHAR" property="paramValue"/> |
| </resultMap> |
| |
| <sql id="Base_Column_List"> |
| id, |
| date_created, |
| date_updated, |
| selector_id, |
| param_type, |
| operator, |
| param_name, |
| param_value |
| </sql> |
| |
| <select id="selectById" parameterType="java.lang.String" resultMap="BaseResultMap"> |
| SELECT |
| <include refid="Base_Column_List"/> |
| FROM selector_condition |
| WHERE id = #{id, jdbcType=VARCHAR} |
| </select> |
| |
| <select id="selectByQuery" parameterType="org.apache.shenyu.admin.model.query.SelectorConditionQuery" |
| resultMap="BaseResultMap"> |
| SELECT |
| <include refid="Base_Column_List"/> |
| FROM selector_condition |
| <if test="selectorId != null"> |
| WHERE selector_id = #{selectorId, jdbcType=VARCHAR} |
| </if> |
| </select> |
| |
| <select id="selectBySelectorIds" resultMap="BaseResultMap"> |
| SELECT |
| <include refid="Base_Column_List"/> |
| FROM selector_condition |
| WHERE selector_id IN |
| <foreach collection="selectorIds" item="selectorId" index="index" |
| open="(" separator="," close=")"> |
| #{selectorId, jdbcType=VARCHAR} |
| </foreach> |
| </select> |
| |
| <insert id="insert" parameterType="org.apache.shenyu.admin.model.entity.SelectorConditionDO"> |
| INSERT INTO selector_condition |
| (id, |
| date_created, |
| date_updated, |
| selector_id, |
| param_type, |
| operator, |
| param_name, |
| param_value) |
| VALUES |
| (#{id, jdbcType=VARCHAR}, |
| #{dateCreated, jdbcType=TIMESTAMP}, |
| #{dateUpdated, jdbcType=TIMESTAMP}, |
| #{selectorId, jdbcType=VARCHAR}, |
| #{paramType, jdbcType=VARCHAR}, |
| #{operator, jdbcType=VARCHAR}, |
| #{paramName, jdbcType=VARCHAR}, |
| #{paramValue, jdbcType=VARCHAR}) |
| </insert> |
| |
| <insert id="insertSelective" parameterType="org.apache.shenyu.admin.model.entity.SelectorConditionDO"> |
| INSERT INTO selector_condition |
| <trim prefix="(" suffix=")" suffixOverrides=","> |
| id, |
| <if test="dateCreated != null"> |
| date_created, |
| </if> |
| <if test="dateUpdated != null"> |
| date_updated, |
| </if> |
| <if test="selectorId != null"> |
| selector_id, |
| </if> |
| <if test="paramType != null"> |
| param_type, |
| </if> |
| <if test="operator != null"> |
| operator, |
| </if> |
| <if test="paramName != null"> |
| param_name, |
| </if> |
| <if test="paramValue != null"> |
| param_value, |
| </if> |
| </trim> |
| <trim prefix="values (" suffix=")" suffixOverrides=","> |
| #{id, jdbcType=VARCHAR}, |
| <if test="dateCreated != null"> |
| #{dateCreated, jdbcType=TIMESTAMP}, |
| </if> |
| <if test="dateUpdated != null"> |
| #{dateUpdated, jdbcType=TIMESTAMP}, |
| </if> |
| <if test="selectorId != null"> |
| #{selectorId, jdbcType=VARCHAR}, |
| </if> |
| <if test="paramType != null"> |
| #{paramType, jdbcType=VARCHAR}, |
| </if> |
| <if test="operator != null"> |
| #{operator, jdbcType=VARCHAR}, |
| </if> |
| <if test="paramName != null"> |
| #{paramName, jdbcType=VARCHAR}, |
| </if> |
| <if test="paramValue != null"> |
| #{paramValue, jdbcType=VARCHAR}, |
| </if> |
| </trim> |
| </insert> |
| |
| <update id="update" parameterType="org.apache.shenyu.admin.model.entity.SelectorConditionDO"> |
| UPDATE selector_condition |
| SET date_created = #{dateCreated, jdbcType=TIMESTAMP}, |
| date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, |
| selector_id = #{selectorId, jdbcType=VARCHAR}, |
| param_type = #{paramType, jdbcType=VARCHAR}, |
| operator = #{operator, jdbcType=VARCHAR}, |
| param_name = #{paramName, jdbcType=VARCHAR}, |
| param_value = #{paramValue, jdbcType=VARCHAR} |
| WHERE id = #{id, jdbcType=VARCHAR} |
| </update> |
| |
| <update id="updateSelective" parameterType="org.apache.shenyu.admin.model.entity.SelectorConditionDO"> |
| UPDATE selector_condition |
| <set> |
| <if test="dateCreated != null"> |
| date_created = #{dateCreated, jdbcType=TIMESTAMP}, |
| </if> |
| <if test="dateUpdated != null"> |
| date_updated = #{dateUpdated, jdbcType=TIMESTAMP}, |
| </if> |
| <if test="selectorId != null"> |
| selector_id = #{selectorId, jdbcType=VARCHAR}, |
| </if> |
| <if test="paramType != null"> |
| param_type = #{paramType, jdbcType=VARCHAR}, |
| </if> |
| <if test="operator != null"> |
| operator = #{operator, jdbcType=VARCHAR}, |
| </if> |
| <if test="paramName != null"> |
| param_name = #{paramName, jdbcType=VARCHAR}, |
| </if> |
| <if test="paramValue != null"> |
| param_value = #{paramValue, jdbcType=VARCHAR}, |
| </if> |
| </set> |
| WHERE id = #{id, jdbcType=VARCHAR} |
| </update> |
| |
| <delete id="delete" parameterType="java.lang.String"> |
| DELETE FROM selector_condition |
| WHERE id = #{id, jdbcType=VARCHAR} |
| </delete> |
| |
| <delete id="deleteBySelectorIds" parameterType="java.util.List"> |
| DELETE FROM selector_condition |
| WHERE selector_id IN |
| <foreach item="selectorId" collection="list" open="(" separator="," close=")"> |
| #{selectorId, jdbcType=VARCHAR} |
| </foreach> |
| </delete> |
| |
| <delete id="deleteByQuery" parameterType="org.apache.shenyu.admin.model.query.SelectorConditionQuery"> |
| DELETE FROM selector_condition |
| WHERE selector_id = #{selectorId, jdbcType=VARCHAR} |
| </delete> |
| </mapper> |