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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?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.testor.module.environment.dao.TBasicEnvironmentManageDao">
<!-- 开启二级缓存 -->
<!-- <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> -->
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.testor.module.environment.model.domain.TBasicEnvironmentManage">
<id column="org_id" property="orgId"/>
<id column="location" property="location"/>
<id column="troubleshoot" property="troubleshoot"/>
<id column="sensitive_areas" property="sensitiveAreas"/>
<id column="check_case" property="checkCase"/>
<id column="licence" property="licence"/>
<id column="pollution" property="pollution"/>
<id column="risk_point" property="riskPoint"/>
<id column="intake" property="intake"/>
<id column="drain" property="drain"/>
<id column="dust" property="dust"/>
<id column="SO2" property="so2"/>
<id column="NOX" property="nox"/>
<id column="VOCs" property="vocs"/>
<id column="flue_count" property="flueCount"/>
<id column="flue_deal" property="flueDeal"/>
<id column="CODcr" property="codcr"/>
<id column="NH3_N" property="nh3N"/>
<id column="waste_count" property="wasteCount"/>
<id column="waste_deal" property="wasteDeal"/>
<id column="boiler_stage" property="boilerStage"/>
<id column="boiler_ton" property="boilerTon"/>
<id column="then_status" property="thenStatus"/>
<id column="biology_stage" property="biologyStage"/>
<id column="biology_ton" property="biologyTon"/>
<id column="fuel_stage" property="fuelStage"/>
<id column="fuel_ton" property="fuelTon"/>
<id column="major_id" property="majorId"/>
<id column="major_name" property="majorName"/>
<id column="major_phone" property="majorPhone"/>
<id column="branched_leader_id" property="branchedLeaderId"/>
<id column="branched_leader_name" property="branchedLeaderName"/>
<id column="branched_leader_phone" property="branchedLeaderPhone"/>
<id column="dept_person_id" property="deptPersonId"/>
<id column="dept_person_name" property="deptPersonName"/>
<id column="dept_person_phone" property="deptPersonPhone"/>
<id column="environ_person_id" property="environPersonId"/>
<id column="environ_person_name" property="environPersonName"/>
<id column="environ_person_phone" property="environPersonPhone"/>
<id column="org_name" property="orgName"/>
</resultMap>
<select id="getList" parameterType="com.testor.module.environment.model.dto.TBasicEnvironmentManageParam"
resultType="com.testor.module.environment.model.domain.TBasicEnvironmentManage">
select mm.org_id,mm.org_name,basi.*
from t_sys_org mm
left join t_basic_environment_manage basi
on mm.org_id = basi.org_id
where mm.is_dept = '0'
and mm.org_id in (select org.org_id
from t_sys_org org
where org.parent_ids like concat('%', #{orgId}, '%')
or org.org_id = #{orgId})
<if test="companyIds!=null and companyIds.size>0">
AND mm.org_id in
<foreach open="(" close=")" separator="," collection="companyIds" item="item" index="index">
#{item}
</foreach>
</if>
<if test="param.location!=null and param.location!=''">
AND basi.location = #{param.location}
</if>
<if test="param.sensitiveAreas!=null and param.sensitiveAreas!=''">
AND basi.sensitive_areas = #{param.sensitiveAreas}
</if>
<if test="param.checkCase!=null and param.checkCase!=''">
AND basi.check_case = #{param.checkCase}
</if>
<if test="param.licence!=null and param.licence!=''">
AND basi.licence = #{param.licence}
</if>
order by mm.update_date desc
</select>
</mapper>