ReportFormConfig.xml
2.87 KB
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
<?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="org.thingsboard.server.dao.yunteng.mapper.ReportFormConfigMapper">
<resultMap id="formConfigDtoMap" type="org.thingsboard.server.common.data.yunteng.dto.ReportFormConfigDTO">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="organizationId" column="organization_id"/>
<result property="executeWay" column="execute_way"/>
<result property="executeContent" column="execute_content"/>
<result property="dataType" column="data_type"/>
<result property="status" column="status"/>
<result property="remark" column="remark"/>
<result property="tenantId" column="tenant_id"/>
<result property="creator" column="creator"/>
<result property="createTime" column="create_time"/>
<result property="updater" column="updater"/>
<result property="updateTime" column="update_time"/>
<result property="createUserName" column="create_user_name"/>
<association property="organizationDTO"
javaType="org.thingsboard.server.common.data.yunteng.dto.OrganizationDTO">
<result property="name" column="organization_name"/>
</association>
</resultMap>
<sql id="columns">
config.id,config.name,config.organization_id,config.execute_way,config.execute_content,
config.data_type,config.status,config.remark,config.create_time,config.creator,
config.updater,config.update_time,config.tenant_id
</sql>
<select id="getReportFormConfigPage" resultMap="formConfigDtoMap">
SELECT
<include refid="columns"/>,io.name as organization_name,su.real_name as create_user_name
FROM tk_report_form_config config
LEFT JOIN tk_organization io ON io.id = config.organization_id
LEFT JOIN sys_user su ON config.creator = su.id
<where>
config.tenant_id = #{queryMap.tenantId}
<if test="queryMap.name !=null and queryMap.name !=''">
AND config.name LIKE concat('%',#{queryMap.name}::TEXT,'%')
</if>
<if test="queryMap.status !=null">
AND config.status = #{queryMap.status}
</if>
<if test="queryMap.organizationIds !=null">
AND config.organization_id IN
<foreach collection="queryMap.organizationIds" item="organizationId" open="(" separator="," close=")">
#{organizationId}
</foreach>
</if>
<if test="queryMap.startTime !=null and queryMap.endTime !=null">
AND config.create_time >= #{queryMap.startTime} AND config.create_time < #{queryMap.endTime}
</if>
</where>
</select>
</mapper>