<?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.huimv.management.dao.OutdoorEnvironmentDao">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.huimv.management.entity.OutdoorEnvironmentEntity" id="outdoorEnvironmentMap">
        <result property="id" column="id"/>
        <result property="date" column="date"/>
        <result property="collectTime" column="collect_time"/>
        <result property="deleted" column="deleted"/>
        <result property="gmtCreate" column="gmt_create"/>
        <result property="gmtModified" column="gmt_modified"/>
    </resultMap>

    <select id="page" resultType="com.huimv.management.entity.vo.OutdoorEnvironmentVo">
        SELECT
          env.id,
          env.date,
          env.farm_id,
          farm.name farmName,
          env.temperature,
          env.humidity,
          env.air_quality,
          env.collect_time
        FROM mgt_outdoor_environment env
          JOIN mgt_farm farm ON env.farm_id = farm.id
        ${ew.customSqlSegment}
    </select>


</mapper>