<?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.nanjing.mapper.TBdStationtypeMapper">

    <resultMap type="TBdStationtype" id="TBdStationtypeResult">
        <result property="ID"    column="ID"    />
        <result property="typeName"    column="Type_Name"    />
        <result property="typeClass"    column="Type_Class"    />
    </resultMap>

    <sql id="selectTBdStationtypeVo">
        select ID, Type_Name, Type_Class from T_BD_StationType
    </sql>

    <select id="selectTBdStationtypeList" parameterType="TBdStationtype" resultMap="TBdStationtypeResult">
        <include refid="selectTBdStationtypeVo"/>
        <where>
            <if test="typeName != null  and typeName != ''"> and Type_Name like ('%' + #{typeName} + '%')</if>
        </where>
    </select>

    <select id="selectTBdStationtypeById" parameterType="Long" resultMap="TBdStationtypeResult">
        <include refid="selectTBdStationtypeVo"/>
        where ID = #{ID}
    </select>

    <insert id="insertTBdStationtype" parameterType="TBdStationtype">
        insert into T_BD_StationType
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="ID != null">ID,</if>
            <if test="typeName != null">Type_Name,</if>
            <if test="typeClass != null">Type_Class,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="ID != null">#{ID},</if>
            <if test="typeName != null">#{typeName},</if>
            <if test="typeClass != null">#{typeClass},</if>
         </trim>
    </insert>

    <update id="updateTBdStationtype" parameterType="TBdStationtype">
        update T_BD_StationType
        <trim prefix="SET" suffixOverrides=",">
            <if test="typeName != null">Type_Name = #{typeName},</if>
            <if test="typeClass != null">Type_Class = #{typeClass},</if>
        </trim>
        where ID = #{ID}
    </update>

    <delete id="deleteTBdStationtypeById" parameterType="Long">
        delete from T_BD_StationType where ID = #{ID}
    </delete>

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

</mapper>
