<?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="cn.cecep.talroad.mapper.analysis.SRaSelfMonitoringDataMapper">

    <resultMap type="cn.cecep.talroad.domain.analysis.SRaSelfMonitoringData" id="SRaSelfMonitoringDataResult">
        <result property="dataId"    column="data_id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="factoryName"    column="factory_name"    />
        <result property="industryCategoryName"    column="industry_category_name"    />
        <result property="industryCategoryCode"    column="industry_category_code"    />
        <result property="districtName"    column="district_name"    />
        <result property="districtCode"    column="district_code"    />
        <result property="pollutantsName"    column="pollutants_name"    />
        <result property="pollutantsCode"    column="pollutants_code"    />
        <result property="monitorTime"    column="monitor_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="monitorId"    column="monitor_id"    />
        <result property="monitoringName"    column="monitoring_name"    />
        <result property="flow"    column="flow"    />
        <result property="temperatureHumidity"    column="temperature_humidity"    />
        <result property="oxygenContent"    column="oxygen_content"    />
        <result property="velocity"    column="velocity"    />
        <result property="productionLoad"    column="production_load"    />
        <result property="actualConcentration"    column="actual_concentration"    />
        <result property="obversionConcentration"    column="obversion_concentration"    />
        <result property="upperValue"    column="upper_value"    />
        <result property="lowerValue"    column="lower_value"    />
        <result property="frequencyUnit"    column="frequency_unit"    />
        <result property="exceedingStandard"    column="exceeding_standard"    />
        <result property="exceedingMultiple"    column="exceeding_multiple"    />
        <result property="humidity"    column="humidity"    />
        <result property="frequencyValue"    column="frequency_value"    />
        <result property="reason"    column="reason"    />
    </resultMap>


    <sql id="selectSRaSelfMonitoringDataVo">
        select data_id, factory_id, factory_name, industry_category_name, industry_category_code, district_name, district_code, pollutants_name, pollutants_code, monitor_time,  create_time, monitor_id, monitoring_name, flow, temperature_humidity, oxygen_content, velocity, production_load, actual_concentration, obversion_concentration, upper_value, lower_value, frequency_unit, exceeding_standard, exceeding_multiple, humidity, frequency_value, reason from s_ra_self_monitoring_data
    </sql>

    <select id="selectSRaSelfMonitoringDataList" resultMap="SRaSelfMonitoringDataResult">
        <include refid="selectSRaSelfMonitoringDataVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="factoryName != null  and factoryName != ''"> and factory_name like concat('%', #{factoryName}, '%')</if>
            <if test="industryCategoryName != null  and industryCategoryName != ''"> and industry_category_name like concat('%', #{industryCategoryName}, '%')</if>
            <if test="industryCategoryCode != null  and industryCategoryCode != ''"> and industry_category_code = #{industryCategoryCode}</if>
            <if test="districtName != null  and districtName != ''"> and district_name like concat('%', #{districtName}, '%')</if>
            <if test="districtCode != null  and districtCode != ''"> and district_code = #{districtCode}</if>
            <if test="pollutantsName != null  and pollutantsName != ''"> and pollutants_name like concat('%', #{pollutantsName}, '%')</if>
            <if test="pollutantsCode != null  and pollutantsCode != ''"> and pollutants_code = #{pollutantsCode}</if>
            <if test="analyseStartTime != null  and analyseStartTime != ''"> and monitor_time >=CAST(#{analyseStartTime} AS timestamp) </if>
            <if test="analyseEndTime != null  and analyseEndTime != ''"> and monitor_time &lt;=CAST(#{analyseEndTime} AS timestamp) </if>
            <if test="monitorId != null  and monitorId != ''"> and monitor_id = #{monitorId}</if>
            <if test="monitoringName != null  and monitoringName != ''"> and monitoring_name like concat('%', #{monitoringName}, '%')</if>
            <if test="flow != null  and flow != ''"> and flow = #{flow}</if>
            <if test="temperatureHumidity != null  and temperatureHumidity != ''"> and temperature_humidity = #{temperatureHumidity}</if>
            <if test="oxygenContent != null  and oxygenContent != ''"> and oxygen_content = #{oxygenContent}</if>
            <if test="velocity != null  and velocity != ''"> and velocity = #{velocity}</if>
            <if test="productionLoad != null  and productionLoad != ''"> and production_load = #{productionLoad}</if>
            <if test="actualConcentration != null  and actualConcentration != ''"> and actual_concentration = #{actualConcentration}</if>
            <if test="obversionConcentration != null  and obversionConcentration != ''"> and obversion_concentration = #{obversionConcentration}</if>
            <if test="upperValue != null  and upperValue != ''"> and upper_value = #{upperValue}</if>
            <if test="lowerValue != null  and lowerValue != ''"> and lower_value = #{lowerValue}</if>
            <if test="frequencyUnit != null  and frequencyUnit != ''"> and frequency_unit = #{frequencyUnit}</if>
            <if test="exceedingStandard != null  and exceedingStandard != ''"> and exceeding_standard = #{exceedingStandard}</if>
            <if test="exceedingMultiple != null  and exceedingMultiple != ''"> and exceeding_multiple = #{exceedingMultiple}</if>
            <if test="humidity != null  and humidity != ''"> and humidity = #{humidity}</if>
            <if test="frequencyValue != null  and frequencyValue != ''"> and frequency_value = #{frequencyValue}</if>
            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
            <if test="pollutantsType != null  and pollutantsType != ''"> and pollutants_type = #{pollutantsType}</if>
            <if test="regionCodes != null and regionCodes.size() != 0">
                and district_code IN
                <foreach collection="regionCodes" separator="," item="item" close=")" open="(">
                    #{item,jdbcType=VARCHAR}
                </foreach>
            </if>
        </where>
    </select>

    <select id="pullPollutantNameOptions" resultType="java.util.Map">
        select
            pollutants_name AS label,
            pollutants_code AS value
        from
            s_ra_self_monitoring_data
            <where>
                <if test="name != null  and name != ''"> and pollutants_name like concat('%', #{name}, '%')</if>
            </where>
        group by pollutants_code, pollutants_name
    </select>
    <!-- 通过ID查询单条数据 -->
    <select id="queryById" resultMap="SRaSelfMonitoringDataResult">
        select
            data_id,factory_id,factory_name,industry_category_name,industry_category_code,district_name,district_code,pollutants_name,pollutants_code,monitor_time,create_time,monitor_id,monitoring_name,flow,temperature_humidity,oxygen_content,velocity,production_load,actual_concentration,obversion_concentration,upper_value,lower_value,frequency_unit,exceeding_standard,exceeding_multiple,humidity,frequency_value,reason
        from s_ra_self_monitoring_data
        where data_id = #{dataId}
    </select>

    <!--分页查询指定行数据-->
    <select id="queryAllByLimit" resultMap="SRaSelfMonitoringDataResult">
        select
        data_id,factory_id,factory_name,industry_category_name,industry_category_code,district_name,district_code,pollutants_name,pollutants_code,monitor_time,create_time,monitor_id,monitoring_name,flow,temperature_humidity,oxygen_content,velocity,production_load,actual_concentration,obversion_concentration,upper_value,lower_value,frequency_unit,exceeding_standard,exceeding_multiple,humidity,frequency_value,reason
        from s_ra_self_monitoring_data
        <where>
            <if test="dataId != null and dataId != ''">
                and data_id = #{dataId}
            </if>
            <if test="factoryId != null and factoryId != ''">
                and factory_id = #{factoryId}
            </if>
            <if test="factoryName != null and factoryName != ''">
                and factory_name = #{factoryName}
            </if>
            <if test="industryCategoryName != null and industryCategoryName != ''">
                and industry_category_name = #{industryCategoryName}
            </if>
            <if test="industryCategoryCode != null and industryCategoryCode != ''">
                and industry_category_code = #{industryCategoryCode}
            </if>
            <if test="districtName != null and districtName != ''">
                and district_name = #{districtName}
            </if>
            <if test="districtCode != null and districtCode != ''">
                and district_code = #{districtCode}
            </if>
            <if test="pollutantsName != null and pollutantsName != ''">
                and pollutants_name = #{pollutantsName}
            </if>
            <if test="pollutantsCode != null and pollutantsCode != ''">
                and pollutants_code = #{pollutantsCode}
            </if>
            <if test="monitorTime != null and monitorTime != ''">
                and monitor_time = #{monitorTime}
            </if>
            <if test="createTime != null and createTime != ''">
                and create_time = #{createTime}
            </if>
            <if test="monitorId != null and monitorId != ''">
                and monitor_id = #{monitorId}
            </if>
            <if test="monitoringName != null and monitoringName != ''">
                and monitoring_name = #{monitoringName}
            </if>
            <if test="flow != null and flow != ''">
                and flow = #{flow}
            </if>
            <if test="temperatureHumidity != null and temperatureHumidity != ''">
                and temperature_humidity = #{temperatureHumidity}
            </if>
            <if test="oxygenContent != null and oxygenContent != ''">
                and oxygen_content = #{oxygenContent}
            </if>
            <if test="velocity != null and velocity != ''">
                and velocity = #{velocity}
            </if>
            <if test="productionLoad != null and productionLoad != ''">
                and production_load = #{productionLoad}
            </if>
            <if test="actualConcentration != null and actualConcentration != ''">
                and actual_concentration = #{actualConcentration}
            </if>
            <if test="obversionConcentration != null and obversionConcentration != ''">
                and obversion_concentration = #{obversionConcentration}
            </if>
            <if test="upperValue != null and upperValue != ''">
                and upper_value = #{upperValue}
            </if>
            <if test="lowerValue != null and lowerValue != ''">
                and lower_value = #{lowerValue}
            </if>
            <if test="frequencyUnit != null and frequencyUnit != ''">
                and frequency_unit = #{frequencyUnit}
            </if>
            <if test="exceedingStandard != null and exceedingStandard != ''">
                and exceeding_standard = #{exceedingStandard}
            </if>
            <if test="exceedingMultiple != null and exceedingMultiple != ''">
                and exceeding_multiple = #{exceedingMultiple}
            </if>
            <if test="humidity != null and humidity != ''">
                and humidity = #{humidity}
            </if>
            <if test="frequencyValue != null and frequencyValue != ''">
                and frequency_value = #{frequencyValue}
            </if>
            <if test="reason != null and reason != ''">
                and reason = #{reason}
            </if>
        </where>
        limit #{pageable.offset}, #{pageable.pageSize}
    </select>

    <!--统计总行数-->
    <select id="count" resultType="java.lang.Long">
        select count(1)
        from s_ra_self_monitoring_data
        <where>
            <if test="dataId != null and dataId != ''">
                and data_id = #{dataId}
            </if>
            <if test="factoryId != null and factoryId != ''">
                and factory_id = #{factoryId}
            </if>
            <if test="factoryName != null and factoryName != ''">
                and factory_name = #{factoryName}
            </if>
            <if test="industryCategoryName != null and industryCategoryName != ''">
                and industry_category_name = #{industryCategoryName}
            </if>
            <if test="industryCategoryCode != null and industryCategoryCode != ''">
                and industry_category_code = #{industryCategoryCode}
            </if>
            <if test="districtName != null and districtName != ''">
                and district_name = #{districtName}
            </if>
            <if test="districtCode != null and districtCode != ''">
                and district_code = #{districtCode}
            </if>
            <if test="pollutantsName != null and pollutantsName != ''">
                and pollutants_name = #{pollutantsName}
            </if>
            <if test="pollutantsCode != null and pollutantsCode != ''">
                and pollutants_code = #{pollutantsCode}
            </if>
            <if test="monitorTime != null and monitorTime != ''">
                and monitor_time = #{monitorTime}
            </if>
            <if test="createTime != null and createTime != ''">
                and create_time = #{createTime}
            </if>
            <if test="monitorId != null and monitorId != ''">
                and monitor_id = #{monitorId}
            </if>
            <if test="monitoringName != null and monitoringName != ''">
                and monitoring_name = #{monitoringName}
            </if>
            <if test="flow != null and flow != ''">
                and flow = #{flow}
            </if>
            <if test="temperatureHumidity != null and temperatureHumidity != ''">
                and temperature_humidity = #{temperatureHumidity}
            </if>
            <if test="oxygenContent != null and oxygenContent != ''">
                and oxygen_content = #{oxygenContent}
            </if>
            <if test="velocity != null and velocity != ''">
                and velocity = #{velocity}
            </if>
            <if test="productionLoad != null and productionLoad != ''">
                and production_load = #{productionLoad}
            </if>
            <if test="actualConcentration != null and actualConcentration != ''">
                and actual_concentration = #{actualConcentration}
            </if>
            <if test="obversionConcentration != null and obversionConcentration != ''">
                and obversion_concentration = #{obversionConcentration}
            </if>
            <if test="upperValue != null and upperValue != ''">
                and upper_value = #{upperValue}
            </if>
            <if test="lowerValue != null and lowerValue != ''">
                and lower_value = #{lowerValue}
            </if>
            <if test="frequencyUnit != null and frequencyUnit != ''">
                and frequency_unit = #{frequencyUnit}
            </if>
            <if test="exceedingStandard != null and exceedingStandard != ''">
                and exceeding_standard = #{exceedingStandard}
            </if>
            <if test="exceedingMultiple != null and exceedingMultiple != ''">
                and exceeding_multiple = #{exceedingMultiple}
            </if>
            <if test="humidity != null and humidity != ''">
                and humidity = #{humidity}
            </if>
            <if test="frequencyValue != null and frequencyValue != ''">
                and frequency_value = #{frequencyValue}
            </if>
            <if test="reason != null and reason != ''">
                and reason = #{reason}
            </if>
        </where>
    </select>
    <select id="queryList" resultType="cn.cecep.talroad.domain.analysis.SRaSelfMonitoringData">
        select * from s_ra_self_monitoring_data
        where monitor_time >= #{startDate} and monitor_time &lt;= #{endDate}
    </select>
    <select id="selectAllLastDayGasData" resultMap="SRaSelfMonitoringDataResult">
        <![CDATA[
        select
            sd.factory_id,
            po.id as monitor_id,
            sd.monitor_time,
            sd.pollutants_code,
            sd.pollutants_name,
            "replace"(sd.actual_concentration,'<','') as actual_concentration
        from s_ra_self_monitoring_data sd
                 inner join pc_outlet po on sd.factory_id = po.factory_id and sd.monitoring_name = po.monitoring_point_name
        where po.pollutant_type='4' and po.pollutant_outlet_type = '1' and sd.monitor_time between #{startDate} and #{endDate}
          and sd.pollutants_type = '2' order by sd.monitor_time
        ]]>
    </select>
    <select id="selectLastDayGasData" resultMap="SRaSelfMonitoringDataResult">
        <![CDATA[
        select
            sd.factory_id,
            po.id as monitor_id,
            sd.monitor_time,
            sd.pollutants_code,
            sd.pollutants_name,
            "replace"(sd.actual_concentration,'<','') as actual_concentration
        from s_ra_self_monitoring_data sd
        inner join pc_outlet po on sd.factory_id = po.factory_id and sd.monitoring_name = po.monitoring_point_name
        where po.pollutant_type='4' and po.pollutant_outlet_type = '1' and sd.monitor_time between #{startDate} and #{endDate}
        and sd.pollutants_type = '2' AND exceeding_standard  ='1' order by sd.monitor_time
        ]]>
    </select>

    <select id="selectAllLastDayWaterData" resultMap="SRaSelfMonitoringDataResult">
        <![CDATA[
        select
            sd.factory_id,
            po.id as monitor_id,
            sd.monitor_time,
            sd.pollutants_code,
            sd.pollutants_name,
            "replace"(sd.actual_concentration,'<','') as actual_concentration
        from s_ra_self_monitoring_data sd
                 inner join pc_outlet po on sd.factory_id = po.factory_id and sd.monitoring_name = po.monitoring_point_name
        where po.pollutant_type='4' and po.pollutant_outlet_type = '2' and sd.monitor_time between #{startDate} and #{endDate}
          and sd.pollutants_type = '1' order by sd.monitor_time
        ]]>
    </select>

    <select id="selectLastDayWaterData" resultMap="SRaSelfMonitoringDataResult">
        <![CDATA[
        select
            sd.factory_id,
            po.id as monitor_id,
            sd.monitor_time,
            sd.pollutants_code,
            sd.pollutants_name,
            "replace"(sd.actual_concentration,'<','') as actual_concentration
        from s_ra_self_monitoring_data sd
                 inner join pc_outlet po on sd.factory_id = po.factory_id and sd.monitoring_name = po.monitoring_point_name
        where po.pollutant_type='4' and po.pollutant_outlet_type = '2' and sd.monitor_time between #{startDate} and #{endDate}
          and sd.pollutants_type = '1' AND exceeding_standard  ='1' order by sd.monitor_time
        ]]>
    </select>

    <!--新增数据-->
    <insert id="insert" keyProperty="data_id" useGeneratedKeys="true">
        insert into s_ra_self_monitoring_data(data_id,factory_id,factory_name,industry_category_name,industry_category_code,district_name,district_code,pollutants_name,pollutants_code,monitor_time,create_time,monitor_id,monitoring_name,flow,temperature_humidity,oxygen_content,velocity,production_load,actual_concentration,obversion_concentration,upper_value,lower_value,frequency_unit,exceeding_standard,exceeding_multiple,humidity,frequency_value,reason)
        values (#{dataId},#{factoryId},#{factoryName},#{industryCategoryName},#{industryCategoryCode},#{districtName},#{districtCode},#{pollutantsName},#{pollutantsCode},#{monitorTime},#{createTime},#{monitorId},#{monitoringName},#{flow},#{temperatureHumidity},#{oxygenContent},#{velocity},#{productionLoad},#{actualConcentration},#{obversionConcentration},#{upperValue},#{lowerValue},#{frequencyUnit},#{exceedingStandard},#{exceedingMultiple},#{humidity},#{frequencyValue},#{reason})
    </insert>

    <!-- 批量新增数据 -->
    <insert id="insertBatch" keyProperty="data_id" useGeneratedKeys="true">
        insert into s_ra_self_monitoring_data(data_id,factory_id,factory_name,industry_category_name,industry_category_code,district_name,district_code,pollutants_name,pollutants_code,monitor_time,create_time,monitor_id,monitoring_name,flow,temperature_humidity,oxygen_content,velocity,production_load,actual_concentration,obversion_concentration,upper_value,lower_value,frequency_unit,exceeding_standard,exceeding_multiple,humidity,frequency_value,reason)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.dataId},#{entity.factoryId},#{entity.factoryName},#{entity.industryCategoryName},#{entity.industryCategoryCode},#{entity.districtName},#{entity.districtCode},#{entity.pollutantsName},#{entity.pollutantsCode},#{entity.monitorTime},#{entity.createTime},#{entity.monitorId},#{entity.monitoringName},#{entity.flow},#{entity.temperatureHumidity},#{entity.oxygenContent},#{entity.velocity},#{entity.productionLoad},#{entity.actualConcentration},#{entity.obversionConcentration},#{entity.upperValue},#{entity.lowerValue},#{entity.frequencyUnit},#{entity.exceedingStandard},#{entity.exceedingMultiple},#{entity.humidity},#{entity.frequencyValue},#{entity.reason})
        </foreach>
    </insert>

    <!-- 批量新增或按主键更新数据 -->
    <insert id="insertOrUpdateBatch" keyProperty="data_id" useGeneratedKeys="true">
        insert into s_ra_self_monitoring_data(data_id,factory_id,factory_name,industry_category_name,industry_category_code,district_name,district_code,pollutants_name,pollutants_code,monitor_time,create_time,monitor_id,monitoring_name,flow,temperature_humidity,oxygen_content,velocity,production_load,actual_concentration,obversion_concentration,upper_value,lower_value,frequency_unit,exceeding_standard,exceeding_multiple,humidity,frequency_value,reason)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.dataId},#{entity.factoryId},#{entity.factoryName},#{entity.industryCategoryName},#{entity.industryCategoryCode},#{entity.districtName},#{entity.districtCode},#{entity.pollutantsName},#{entity.pollutantsCode},#{entity.monitorTime},#{entity.createTime},#{entity.monitorId},#{entity.monitoringName},#{entity.flow},#{entity.temperatureHumidity},#{entity.oxygenContent},#{entity.velocity},#{entity.productionLoad},#{entity.actualConcentration},#{entity.obversionConcentration},#{entity.upperValue},#{entity.lowerValue},#{entity.frequencyUnit},#{entity.exceedingStandard},#{entity.exceedingMultiple},#{entity.humidity},#{entity.frequencyValue},#{entity.reason})
        </foreach>
        on duplicate key update
        data_id=values(data_id),
        factory_id=values(factory_id),
        factory_name=values(factory_name),
        industry_category_name=values(industry_category_name),
        industry_category_code=values(industry_category_code),
        district_name=values(district_name),
        district_code=values(district_code),
        pollutants_name=values(pollutants_name),
        pollutants_code=values(pollutants_code),
        monitor_time=values(monitor_time),
        create_time=values(create_time),
        monitor_id=values(monitor_id),
        monitoring_name=values(monitoring_name),
        flow=values(flow),
        temperature_humidity=values(temperature_humidity),
        oxygen_content=values(oxygen_content),
        velocity=values(velocity),
        production_load=values(production_load),
        actual_concentration=values(actual_concentration),
        obversion_concentration=values(obversion_concentration),
        upper_value=values(upper_value),
        lower_value=values(lower_value),
        frequency_unit=values(frequency_unit),
        exceeding_standard=values(exceeding_standard),
        exceeding_multiple=values(exceeding_multiple),
        humidity=values(humidity),
        frequency_value=values(frequency_value),
        reason=values(reason)
    </insert>

    <!-- 更新数据 -->
    <update id="update">
        update s_ra_self_monitoring_data
        <set>
            <if test="dataId != null and dataId != ''">
                data_id = #{dataId},
            </if>
            <if test="factoryId != null and factoryId != ''">
                factory_id = #{factoryId},
            </if>
            <if test="factoryName != null and factoryName != ''">
                factory_name = #{factoryName},
            </if>
            <if test="industryCategoryName != null and industryCategoryName != ''">
                industry_category_name = #{industryCategoryName},
            </if>
            <if test="industryCategoryCode != null and industryCategoryCode != ''">
                industry_category_code = #{industryCategoryCode},
            </if>
            <if test="districtName != null and districtName != ''">
                district_name = #{districtName},
            </if>
            <if test="districtCode != null and districtCode != ''">
                district_code = #{districtCode},
            </if>
            <if test="pollutantsName != null and pollutantsName != ''">
                pollutants_name = #{pollutantsName},
            </if>
            <if test="pollutantsCode != null and pollutantsCode != ''">
                pollutants_code = #{pollutantsCode},
            </if>
            <if test="monitorTime != null and monitorTime != ''">
                monitor_time = #{monitorTime},
            </if>
            <if test="createTime != null and createTime != ''">
                create_time = #{createTime},
            </if>
            <if test="monitorId != null and monitorId != ''">
                monitor_id = #{monitorId},
            </if>
            <if test="monitoringName != null and monitoringName != ''">
                monitoring_name = #{monitoringName},
            </if>
            <if test="flow != null and flow != ''">
                flow = #{flow},
            </if>
            <if test="temperatureHumidity != null and temperatureHumidity != ''">
                temperature_humidity = #{temperatureHumidity},
            </if>
            <if test="oxygenContent != null and oxygenContent != ''">
                oxygen_content = #{oxygenContent},
            </if>
            <if test="velocity != null and velocity != ''">
                velocity = #{velocity},
            </if>
            <if test="productionLoad != null and productionLoad != ''">
                production_load = #{productionLoad},
            </if>
            <if test="actualConcentration != null and actualConcentration != ''">
                actual_concentration = #{actualConcentration},
            </if>
            <if test="obversionConcentration != null and obversionConcentration != ''">
                obversion_concentration = #{obversionConcentration},
            </if>
            <if test="upperValue != null and upperValue != ''">
                upper_value = #{upperValue},
            </if>
            <if test="lowerValue != null and lowerValue != ''">
                lower_value = #{lowerValue},
            </if>
            <if test="frequencyUnit != null and frequencyUnit != ''">
                frequency_unit = #{frequencyUnit},
            </if>
            <if test="exceedingStandard != null and exceedingStandard != ''">
                exceeding_standard = #{exceedingStandard},
            </if>
            <if test="exceedingMultiple != null and exceedingMultiple != ''">
                exceeding_multiple = #{exceedingMultiple},
            </if>
            <if test="humidity != null and humidity != ''">
                humidity = #{humidity},
            </if>
            <if test="frequencyValue != null and frequencyValue != ''">
                frequency_value = #{frequencyValue},
            </if>
            <if test="reason != null and reason != ''">
                reason = #{reason},
            </if>
        </set>
        where data_id = #{dataId}
    </update>

    <!--通过主键删除-->
    <delete id="deleteById">
        delete from s_ra_self_monitoring_data where data_id = #{dataId}
    </delete>
</mapper>
