<?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.gyee.wisdom.alarm.sharding.mapper.StopTypeMapper">

    <select id="queryStopTypeList" resultType="com.gyee.wisdom.alarm.sharding.entity.StopType">
        select * from stoptype
        <where>
            <if test="parentid !=null and parentid !=''">
                and parentid = #{parentid}
            </if>
                and id != 'gzbmq'
        </where>

    </select>
    <select id="queryStopTypeById" resultType="com.gyee.wisdom.alarm.sharding.entity.StopType">

        select * from stoptype
        <where>
            <if test="id !=null and id !=''">
                id = #{id}
            </if>
        </where>

    </select>
    <select id="queryStopTypeRoot" resultType="com.gyee.wisdom.alarm.sharding.entity.StopType">
        select * from stoptype where parentid = '' or parentid is null
    </select>
    <select id="queryStopTypeParent" resultType="java.util.Map">
        select id as lable,name as value from stoptype
        <where>
            <if test="parentid !=null and parentid !=''">
                parentid = #{parentid}
            </if>
        </where>

    </select>
</mapper>
