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

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.huimv.apiservice.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>

    <insert id="batchInsertData">
        insert into mgt_outdoor_environment(date,temperature,humidity,air_quality,collect_time)
        values
        <foreach collection="list" item="item"  separator="," >
            (#{item.date},
            #{item.farmId},
            #{item.temperature},
            #{item.humidity},
            #{item.airQuality},
            #{item.collectTime})
        </foreach>
    </insert>

    <select id="select" resultType="com.huimv.apiservice.entity.vo.OutdoorEnvVo">
        SELECT

        FROM mgt_outdoor_environment
        ${ew.customSqlSegment}
    </select>


</mapper>