<?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.ruoyi.interfaces.mapper.PtServiceParamMapper">
    <resultMap id="BaseResultMap" type="com.ruoyi.interfaces.domain.PtServiceParam">
        <id column="SRV_ID" jdbcType="VARCHAR" property="srvId"/>
        <id column="PARAM_CODE" jdbcType="VARCHAR" property="paramCode"/>
        <result column="PARAM_NAME" jdbcType="VARCHAR" property="paramName"/>
        <result column="PARAM_TYPE" jdbcType="VARCHAR" property="paramType"/>
        <result column="PARAM_VALUE" jdbcType="VARCHAR" property="paramValue"/>
        <result column="PARAM_FORMAT" jdbcType="VARCHAR" property="paramFormat"/>
        <result column="PARAM_NOTE" jdbcType="VARCHAR" property="paramNote"/>
    </resultMap>
    <sql id="Base_Column_List">
        SRV_ID
        , PARAM_CODE, PARAM_NAME, PARAM_TYPE, PARAM_VALUE, PARAM_FORMAT, PARAM_NOTE
    </sql>
    <select id="selectByPrimaryKey" parameterType="com.ruoyi.interfaces.domain.PtServiceParamKey"
            resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from PT_SERVICE_PARAM
        where SRV_ID = #{srvId,jdbcType=VARCHAR}
        and PARAM_CODE = #{paramCode,jdbcType=VARCHAR}
    </select>

    <delete id="deleteByPrimaryKey" parameterType="com.ruoyi.interfaces.domain.PtServiceParamKey">
        delete
        from PT_SERVICE_PARAM
        where SRV_ID = #{srvId,jdbcType=VARCHAR}
          and PARAM_CODE = #{paramCode,jdbcType=VARCHAR}
    </delete>

    <delete id="deleteBySrvId" parameterType="string">
        delete
        from PT_SERVICE_PARAM
        where SRV_ID = #{srvId,jdbcType=VARCHAR}
    </delete>

    <insert id="insert" parameterType="com.ruoyi.interfaces.domain.PtServiceParam">
        insert into PT_SERVICE_PARAM (SRV_ID, PARAM_CODE, PARAM_NAME,
                                      PARAM_TYPE, PARAM_VALUE, PARAM_FORMAT,
                                      PARAM_NOTE)
        values (#{srvId,jdbcType=VARCHAR}, #{paramCode,jdbcType=VARCHAR}, #{paramName,jdbcType=VARCHAR},
                #{paramType,jdbcType=VARCHAR}, #{paramValue,jdbcType=VARCHAR}, #{paramFormat,jdbcType=VARCHAR},
                #{paramNote,jdbcType=VARCHAR})
    </insert>

    <insert id="insertSelective" parameterType="com.ruoyi.interfaces.domain.PtServiceParam">
        insert into PT_SERVICE_PARAM
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="srvId != null">
                SRV_ID,
            </if>
            <if test="paramCode != null">
                PARAM_CODE,
            </if>
            <if test="paramName != null">
                PARAM_NAME,
            </if>
            <if test="paramType != null">
                PARAM_TYPE,
            </if>
            <if test="paramValue != null">
                PARAM_VALUE,
            </if>
            <if test="paramFormat != null">
                PARAM_FORMAT,
            </if>
            <if test="paramNote != null">
                PARAM_NOTE,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="srvId != null">
                #{srvId,jdbcType=VARCHAR},
            </if>
            <if test="paramCode != null">
                #{paramCode,jdbcType=VARCHAR},
            </if>
            <if test="paramName != null">
                #{paramName,jdbcType=VARCHAR},
            </if>
            <if test="paramType != null">
                #{paramType,jdbcType=VARCHAR},
            </if>
            <if test="paramValue != null">
                #{paramValue,jdbcType=VARCHAR},
            </if>
            <if test="paramFormat != null">
                #{paramFormat,jdbcType=VARCHAR},
            </if>
            <if test="paramNote != null">
                #{paramNote,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.interfaces.domain.PtServiceParam">
        update PT_SERVICE_PARAM
        <set>
            <if test="paramName != null">
                PARAM_NAME = #{paramName,jdbcType=VARCHAR},
            </if>
            <if test="paramType != null">
                PARAM_TYPE = #{paramType,jdbcType=VARCHAR},
            </if>
            <if test="paramValue != null">
                PARAM_VALUE = #{paramValue,jdbcType=VARCHAR},
            </if>
            <if test="paramFormat != null">
                PARAM_FORMAT = #{paramFormat,jdbcType=VARCHAR},
            </if>
            <if test="paramNote != null">
                PARAM_NOTE = #{paramNote,jdbcType=VARCHAR},
            </if>
        </set>
        where SRV_ID = #{srvId,jdbcType=VARCHAR}
        and PARAM_CODE = #{paramCode,jdbcType=VARCHAR}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.ruoyi.interfaces.domain.PtServiceParam">
        update PT_SERVICE_PARAM
        set PARAM_NAME   = #{paramName,jdbcType=VARCHAR},
            PARAM_TYPE   = #{paramType,jdbcType=VARCHAR},
            PARAM_VALUE  = #{paramValue,jdbcType=VARCHAR},
            PARAM_FORMAT = #{paramFormat,jdbcType=VARCHAR},
            PARAM_NOTE   = #{paramNote,jdbcType=VARCHAR}
        where SRV_ID = #{srvId,jdbcType=VARCHAR}
          and PARAM_CODE = #{paramCode,jdbcType=VARCHAR}
    </update>

    <!--查询数据列表-->
    <select id="selectAll" parameterType="string" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from PT_SERVICE_PARAM where SRV_ID = #{srvId,jdbcType=VARCHAR}
    </select>

    <select id="listBySrvId" parameterType="string" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM PT_SERVICE_PARAM
        WHERE SRV_ID = #{srvId,jdbcType=VARCHAR}
    </select>

</mapper>
