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


    <select id="getDeviceModelsById" parameterType="java.util.Map" resultType="com.gyee.wisdom.alarm.sharding.entity.DeviceModel">
        select * from device_model a
        <where>
            1=1
            <if test="_parameter !=null and _parameter !=''">
                and a.orderno=#{_parameter}
            </if>
        </where>
    </select>

    <select id="getDeviceModelByCode" parameterType="java.util.Map" resultType="com.gyee.wisdom.alarm.sharding.entity.DeviceModel">
        select * from device_model a
        <where>
            1=1
            <if test="deviceid !=null and deviceid !=''">
                and a.deviceid=#{deviceid}
                <if test="code !=null and code !=''">
                    and a.code=#{code}
                </if>
            </if>

        </where>
    </select>

    <select id="getAll" parameterType="java.util.Map" resultType="com.gyee.wisdom.alarm.sharding.entity.DeviceModel">
        select * from  device_model a
    </select>

</mapper>
