zmc
2023-08-07 1fac32e9cc64d7bff76b6647d0007dd3711bcd69
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.job.zsc.mapper.FugitiveDustMapper">
 
    <select id="conditonQueryDustHistoryData" resultType="com.job.zsc.pojo.DustSiteData">
        select *
        from monitor_site
        <where>
            <if test="siteName !=null and siteName != ''">
                Name like concat('%',#{siteName},'%')
            </if>
            <if test="mnCode !=null and mnCode != ''">
                and MN_Code = #{mnCode}
            </if>
            <if test="beginTime != null and endTime != null">
                and Lst between #{beginTime} and #{endTime}
            </if>
 
            <if test="scenarioType != null and scenarioType != '' ">
                and Type_Name in
                <foreach item="item" collection="scenarioType" separator="," open="("  close=")">
                    #{item}
                </foreach>
            </if>
        </where>
<!--    limit 0,1000-->
    </select>
 
<!--分析数据-->
    <select id="analysisdata" resultType="com.job.zsc.pojo.AnalysisDustData">
        select a.* from avg_dust_value as a join ja_t_dust_site_info as b on a.mn_code = b. mn_code
        <where>
            <if test="siteName !=null and siteName != ''">
                b.name = #{siteName}
            </if>
 
            <if test="beginTime != null and endTime != null">
                and a.Lst between #{beginTime} and #{endTime}
            </if>
        </where>
    </select>
</mapper>