<?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.system.mapper.DistanceMultiplierMapper">
    
    <resultMap type="DistanceMultiplier" id="DistanceMultiplierResult">
        <result property="id"    column="id"    />
        <result property="multiple"    column="multiple"    />
    </resultMap>

    <sql id="selectDistanceMultiplierVo">
        select id, multiple from distance_multiplier
    </sql>

    <select id="selectDistanceMultiplierList" parameterType="DistanceMultiplier" resultMap="DistanceMultiplierResult">
        <include refid="selectDistanceMultiplierVo"/>
        <where>  
            <if test="multiple != null "> and multiple = #{multiple}</if>
        </where>
    </select>
    
    <select id="selectDistanceMultiplierById" parameterType="Long" resultMap="DistanceMultiplierResult">
        <include refid="selectDistanceMultiplierVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertDistanceMultiplier" parameterType="DistanceMultiplier" useGeneratedKeys="true" keyProperty="id">
        insert into distance_multiplier
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="multiple != null">multiple,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="multiple != null">#{multiple},</if>
         </trim>
    </insert>

    <update id="updateDistanceMultiplier" parameterType="DistanceMultiplier">
        update distance_multiplier
        <trim prefix="SET" suffixOverrides=",">
            <if test="multiple != null">multiple = #{multiple},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteDistanceMultiplierById" parameterType="Long">
        delete from distance_multiplier where id = #{id}
    </delete>

    <delete id="deleteDistanceMultiplierByIds" parameterType="String">
        delete from distance_multiplier where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>