<?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.Warning2Mapper">

    <select id="pageQueryAll" parameterType="java.util.Map" resultType="com.gyee.wisdom.alarm.sharding.entity.Warning2">
        select * from WARNING2 a
        <where>
            1=1
            <if test="modelId !=null and modelId !=''">
                and a.MODELID like '%${modelId}%'
            </if>
            <if test="name !=null and name !=''">
                and a.CHINESETEXT like '%${name}%'
            </if>
            <if test="isLeaf !=null and isLeaf !=''">
                and a.ISLEAF = #{isLeaf}
            </if>
        </where>
    </select>
    <select id="getMaxIdByModelId" parameterType="java.util.Map" resultType="java.lang.String">
        select Max(ID) from WARNING2 a
        <where>
            1=1
            <if test="modelId !=null and modelId !=''">
                and a.ID like '%${modelId}%'
            </if>

        </where>
    </select>

    <select id="selectGroupType" resultType="java.lang.String">
         select warningtypeid  as type from   warning2  group by warningtypeid
    </select>
</mapper>
