<?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="vip.xiaonuo.modular.env.envdevice.mapper.EnvDeviceMapper">

    <select id="page" resultType="vip.xiaonuo.modular.env.envdevice.entity.EnvDevice">
        SELECT d.id,d.device_code,d.device_type,d.device_name,p.build_name AS installPosition,d.status
        FROM `env_device` d LEFT JOIN `base_pigpen` p ON d.install_position = p.id
        ${ew.customSqlSegment}
    </select>
    <select id="detail" resultType="vip.xiaonuo.modular.env.envdevice.entity.EnvDevice">
        SELECT d.id,d.device_code,d.device_type,d.device_name,p.build_name AS installPosition,d.status
        FROM `env_device` d LEFT JOIN `base_pigpen` p ON d.install_position = p.id
        WHERE d.id = #{id}
    </select>
</mapper>