|
@@ -1,106 +1,140 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.ems.mapper.EmsDeviceMapper">
|
|
|
|
|
|
<resultMap type="com.ruoyi.ems.domain.EmsDevice" id="EmsDeviceResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="deviceCode" column="device_code" />
|
|
|
- <result property="deviceName" column="device_name" />
|
|
|
- <result property="deviceCategory" column="device_category" />
|
|
|
- <result property="deviceCategoryName" column="device_category_name" />
|
|
|
- <result property="deviceBrand" column="device_brand" />
|
|
|
- <result property="deviceSpec" column="device_spec" />
|
|
|
- <result property="deviceStatus" column="device_status" />
|
|
|
- <result property="location" column="location" />
|
|
|
- <result property="locationRef" column="location_ref" />
|
|
|
- <result property="areaCode" column="area_code" />
|
|
|
- <result property="deviceModel" column="device_model" />
|
|
|
- <result property="psCode" column="ps_code" />
|
|
|
- <result property="psName" column="ps_name" />
|
|
|
- <result property="refFacs" column="ref_facs" />
|
|
|
- <result property="refFacsName" column="ref_facs_name" />
|
|
|
- <result property="subsystemCode" column="subsystem_code" />
|
|
|
- <result property="subsystemName" column="subsystem_name" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="deviceCode" column="device_code"/>
|
|
|
+ <result property="deviceName" column="device_name"/>
|
|
|
+ <result property="deviceCategory" column="device_category"/>
|
|
|
+ <result property="deviceCategoryName" column="device_category_name"/>
|
|
|
+ <result property="deviceBrand" column="device_brand"/>
|
|
|
+ <result property="deviceSpec" column="device_spec"/>
|
|
|
+ <result property="deviceStatus" column="device_status"/>
|
|
|
+ <result property="location" column="location"/>
|
|
|
+ <result property="locationRef" column="location_ref"/>
|
|
|
+ <result property="areaCode" column="area_code"/>
|
|
|
+ <result property="deviceModel" column="device_model"/>
|
|
|
+ <result property="psCode" column="ps_code"/>
|
|
|
+ <result property="psName" column="ps_name"/>
|
|
|
+ <result property="refFacs" column="ref_facs"/>
|
|
|
+ <result property="refFacsName" column="ref_facs_name"/>
|
|
|
+ <result property="subsystemCode" column="subsystem_code"/>
|
|
|
+ <result property="subsystemName" column="subsystem_name"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectDeviceVo">
|
|
|
- select
|
|
|
- d.`id`, d.`device_code`, d.`device_name`, d.`device_brand`, d.`device_spec`, d.`device_status`, d.`location`, d.`location_ref`, d.`area_code`, d.`device_model`, d.`ref_facs`, d.`subsystem_code`, d.`ps_code`, d.`create_time`, d.`update_time`
|
|
|
+ select d.`id`,
|
|
|
+ d.`device_code`,
|
|
|
+ d.`device_name`,
|
|
|
+ d.`device_brand`,
|
|
|
+ d.`device_spec`,
|
|
|
+ d.`device_status`,
|
|
|
+ d.`location`,
|
|
|
+ d.`location_ref`,
|
|
|
+ d.`area_code`,
|
|
|
+ d.`device_model`,
|
|
|
+ d.`ref_facs`,
|
|
|
+ d.`subsystem_code`,
|
|
|
+ d.`ps_code`,
|
|
|
+ d.`create_time`,
|
|
|
+ d.`update_time`
|
|
|
from adm_ems_device d
|
|
|
</sql>
|
|
|
|
|
|
<sql id="selectDetailDeviceVo">
|
|
|
- select
|
|
|
- d.`id`, d.`device_code`, d.`device_name`, d.`device_brand`, d.`device_spec`, d.`device_status`, d.`location`, d.`location_ref`, d.`area_code`, d.`device_model`, d.`ref_facs`, d.`subsystem_code`, d.`ps_code`, d.`create_time`, d.`update_time`,
|
|
|
- dp.`ps_name`,
|
|
|
- s.`system_name` as subsystem_name,
|
|
|
- f.`facs_name` as ref_facs_name,
|
|
|
- f.`facs_subcategory` as device_category,
|
|
|
- sc.`name` as device_category_name
|
|
|
+ select d.`id`,
|
|
|
+ d.`device_code`,
|
|
|
+ d.`device_name`,
|
|
|
+ d.`device_brand`,
|
|
|
+ d.`device_spec`,
|
|
|
+ d.`device_status`,
|
|
|
+ d.`location`,
|
|
|
+ d.`location_ref`,
|
|
|
+ d.`area_code`,
|
|
|
+ d.`device_model`,
|
|
|
+ d.`ref_facs`,
|
|
|
+ d.`subsystem_code`,
|
|
|
+ d.`ps_code`,
|
|
|
+ d.`create_time`,
|
|
|
+ d.`update_time`,
|
|
|
+ dp.`ps_name`,
|
|
|
+ s.`system_name` as subsystem_name,
|
|
|
+ f.`facs_name` as ref_facs_name,
|
|
|
+ f.`facs_subcategory` as device_category,
|
|
|
+ sc.`name` as device_category_name
|
|
|
from adm_ems_device d
|
|
|
- LEFT JOIN dim_ems_dev_process dp ON d.`ps_code` = dp.`ps_code`
|
|
|
- LEFT JOIN adm_ems_subsystem s ON d.`subsystem_code` = s.`system_code`
|
|
|
- LEFT JOIN adm_ems_facs f ON d.`ref_facs` = f.`facs_code`
|
|
|
- LEFT JOIN dim_ems_facs_subcategory sc ON f.`facs_subcategory` = sc.`code`
|
|
|
+ LEFT JOIN dim_ems_dev_process dp ON d.`ps_code` = dp.`ps_code`
|
|
|
+ LEFT JOIN adm_ems_subsystem s ON d.`subsystem_code` = s.`system_code`
|
|
|
+ LEFT JOIN adm_ems_facs f ON d.`ref_facs` = f.`facs_code`
|
|
|
+ LEFT JOIN dim_ems_facs_subcategory sc ON f.`facs_subcategory` = sc.`code`
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectDeviceList" parameterType="com.ruoyi.ems.model.QueryDevice" resultMap="EmsDeviceResult">
|
|
|
<include refid="selectDeviceVo"/>
|
|
|
<where>
|
|
|
- <if test="deviceCode != null and deviceCode != ''"> and d.`device_code` = #{deviceCode}</if>
|
|
|
- <if test="areaCode != null and areaCode != ''"> and d.`area_code` = #{areaCode}</if>
|
|
|
- <if test="deviceName != null and deviceName != ''"> and d.`device_name` like concat('%', #{deviceName}, '%')</if>
|
|
|
- <if test="deviceStatus != null "> and d.`device_status` = #{deviceStatus}</if>
|
|
|
- <if test="locationRef != null and locationRef != ''"> and d.`location_ref` = #{locationRef}</if>
|
|
|
- <if test="refFacs != null and refFacs != ''"> and d.`ref_facs` = #{refFacs}</if>
|
|
|
- <if test="psCode != null and psCode != ''"> and d.`ps_code` = #{psCode}</if>
|
|
|
- <if test="deviceModel != null and deviceModel != ''"> and d.`device_model` = #{deviceModel}</if>
|
|
|
- <if test="subsystemCode != null and subsystemCode != ''"> and d.`subsystem_code` = #{subsystemCode}</if>
|
|
|
+ <if test="deviceCode != null and deviceCode != ''">and d.`device_code` = #{deviceCode}</if>
|
|
|
+ <if test="areaCode != null and areaCode != ''">and d.`area_code` = #{areaCode}</if>
|
|
|
+ <if test="deviceName != null and deviceName != ''">and d.`device_name` like concat('%', #{deviceName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="deviceStatus != null ">and d.`device_status` = #{deviceStatus}</if>
|
|
|
+ <if test="locationRef != null and locationRef != ''">and d.`location_ref` = #{locationRef}</if>
|
|
|
+ <if test="refFacs != null and refFacs != ''">and d.`ref_facs` = #{refFacs}</if>
|
|
|
+ <if test="psCode != null and psCode != ''">and d.`ps_code` = #{psCode}</if>
|
|
|
+ <if test="deviceModel != null and deviceModel != ''">and d.`device_model` = #{deviceModel}</if>
|
|
|
+ <if test="subsystemCode != null and subsystemCode != ''">and d.`subsystem_code` = #{subsystemCode}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByFlowRel" parameterType="com.ruoyi.ems.model.QueryDevice" resultMap="EmsDeviceResult">
|
|
|
select
|
|
|
- d.`id`, d.`device_code`, d.`device_name`, d.`device_brand`, d.`device_spec`, d.`device_status`, d.`location`, d.`location_ref`, d.`area_code`, d.`device_model`, d.`ref_facs`, d.`subsystem_code`, d.`ps_code`, p.`ps_name`, d.`create_time`, d.`update_time`
|
|
|
+ d.`id`, d.`device_code`, d.`device_name`, d.`device_brand`, d.`device_spec`, d.`device_status`, d.`location`,
|
|
|
+ d.`location_ref`, d.`area_code`, d.`device_model`, d.`ref_facs`, d.`subsystem_code`, d.`ps_code`, p.`ps_name`,
|
|
|
+ d.`create_time`, d.`update_time`
|
|
|
from adm_ems_device d
|
|
|
LEFT JOIN adm_ems_flow_rel rel ON d.`device_code` = rel.`input_obj`
|
|
|
LEFT JOIN dim_ems_dev_process p ON p.`ps_code` = d.`ps_code`
|
|
|
<where>
|
|
|
- <if test="areaCode != null and areaCode != ''"> and d.`area_code` = #{areaCode}</if>
|
|
|
- <if test="locationRef != null and locationRef != ''"> and d.`location_ref` = #{locationRef}</if>
|
|
|
- <if test="psCode != null and psCode != ''"> and d.`ps_code` = #{psCode}</if>
|
|
|
- <if test="psCodes != null"> and d.`ps_code` in
|
|
|
+ <if test="areaCode != null and areaCode != ''">and d.`area_code` = #{areaCode}</if>
|
|
|
+ <if test="locationRef != null and locationRef != ''">and d.`location_ref` = #{locationRef}</if>
|
|
|
+ <if test="psCode != null and psCode != ''">and d.`ps_code` = #{psCode}</if>
|
|
|
+ <if test="psCodes != null">and d.`ps_code` in
|
|
|
(
|
|
|
- <foreach collection="psCodes" item="item" index="index" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <foreach collection="psCodes" item="item" index="index" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
)
|
|
|
</if>
|
|
|
- <if test="subsystemCode != null and subsystemCode != ''"> and d.`subsystem_code` = #{subsystemCode}</if>
|
|
|
- <if test="refFacs != null and refFacs != ''"> and d.`ref_facs` = #{refFacs}</if>
|
|
|
- <if test="upstreamObjType != null"> and rel.`export_obj_type` = #{upstreamObjType}</if>
|
|
|
- <if test="upstreamObjCode != null and upstreamObjCode != ''"> and rel.`export_obj` = #{upstreamObjCode}</if>
|
|
|
+ <if test="subsystemCode != null and subsystemCode != ''">and d.`subsystem_code` = #{subsystemCode}</if>
|
|
|
+ <if test="refFacs != null and refFacs != ''">and d.`ref_facs` = #{refFacs}</if>
|
|
|
+ <if test="upstreamObjType != null">and rel.`export_obj_type` = #{upstreamObjType}</if>
|
|
|
+ <if test="upstreamObjCode != null and upstreamObjCode != ''">and rel.`export_obj` = #{upstreamObjCode}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectDetailList" parameterType="com.ruoyi.ems.model.QueryDevice" resultMap="EmsDeviceResult">
|
|
|
<include refid="selectDetailDeviceVo"/>
|
|
|
<where>
|
|
|
- <if test="deviceCode != null and deviceCode != ''"> and d.`device_code` = #{deviceCode}</if>
|
|
|
- <if test="areaCode != null and areaCode != ''"> and d.`area_code` = #{areaCode}</if>
|
|
|
- <if test="deviceName != null and deviceName != ''"> and d.`device_name` like concat('%', #{deviceName}, '%')</if>
|
|
|
- <if test="deviceStatus != null "> and d.`device_status` = #{deviceStatus}</if>
|
|
|
- <if test="locationRef != null and locationRef != ''"> and d.`location_ref` = #{locationRef}</if>
|
|
|
- <if test="refFacs != null and refFacs != ''"> and d.`ref_facs` = #{refFacs}</if>
|
|
|
- <if test="psCode != null and psCode != ''"> and d.`ps_code` = #{psCode}</if>
|
|
|
- <if test="deviceModel != null and deviceModel != ''"> and d.`device_model` = #{device_model}</if>
|
|
|
- <if test="subsystemCode != null and subsystemCode != ''"> and d.`subsystem_code` = #{subsystemCode}</if>
|
|
|
- <if test="deviceCategory != null and deviceCategory !=''"> and sc.`parent_code` = #{deviceCategory}</if>
|
|
|
- <if test="deviceSubCategory != null and deviceSubCategory !=''"> and f.`facs_subcategory` = #{deviceSubCategory}</if>
|
|
|
+ <if test="deviceCode != null and deviceCode != ''">and d.`device_code` = #{deviceCode}</if>
|
|
|
+ <if test="areaCode != null and areaCode != ''">and d.`area_code` = #{areaCode}</if>
|
|
|
+ <if test="deviceName != null and deviceName != ''">and d.`device_name` like concat('%', #{deviceName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="deviceStatus != null ">and d.`device_status` = #{deviceStatus}</if>
|
|
|
+ <if test="locationRef != null and locationRef != ''">and d.`location_ref` = #{locationRef}</if>
|
|
|
+ <if test="refFacs != null and refFacs != ''">and d.`ref_facs` = #{refFacs}</if>
|
|
|
+ <if test="psCode != null and psCode != ''">and d.`ps_code` = #{psCode}</if>
|
|
|
+ <if test="deviceModel != null and deviceModel != ''">and d.`device_model` = #{device_model}</if>
|
|
|
+ <if test="subsystemCode != null and subsystemCode != ''">and d.`subsystem_code` = #{subsystemCode}</if>
|
|
|
+ <if test="deviceCategory != null and deviceCategory !=''">and sc.`parent_code` = #{deviceCategory}</if>
|
|
|
+ <if test="deviceSubCategory != null and deviceSubCategory !=''">and f.`facs_subcategory` =
|
|
|
+ #{deviceSubCategory}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -108,20 +142,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectByAreaTree" parameterType="com.ruoyi.ems.model.QueryDevice" resultMap="EmsDeviceResult">
|
|
|
<include refid="selectDetailDeviceVo"/>
|
|
|
<where>
|
|
|
- <if test="deviceCode != null and deviceCode != ''"> and d.`device_code` = #{deviceCode}</if>
|
|
|
- <if test="deviceName != null and deviceName != ''"> and d.`device_name` like concat('%', #{deviceName}, '%')</if>
|
|
|
- <if test="refFacs != null and refFacs != ''"> and d.`ref_facs` = #{refFacs}</if>
|
|
|
- <if test="psCode != null and psCode != ''"> and d.`ps_code` = #{psCode}</if>
|
|
|
- <if test="deviceModel != null and deviceModel != ''"> and d.`device_model` = #{device_model}</if>
|
|
|
- <if test="subsystemCode != null and subsystemCode != ''"> and d.`subsystem_code` = #{subsystemCode}</if>
|
|
|
+ <if test="deviceCode != null and deviceCode != ''">and d.`device_code` = #{deviceCode}</if>
|
|
|
+ <if test="deviceName != null and deviceName != ''">and d.`device_name` like concat('%', #{deviceName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="refFacs != null and refFacs != ''">and d.`ref_facs` = #{refFacs}</if>
|
|
|
+ <if test="psCode != null and psCode != ''">and d.`ps_code` = #{psCode}</if>
|
|
|
+ <if test="deviceModel != null and deviceModel != ''">and d.`device_model` = #{device_model}</if>
|
|
|
+ <if test="subsystemCode != null and subsystemCode != ''">and d.`subsystem_code` = #{subsystemCode}</if>
|
|
|
<if test="locationRef != null and locationRef != '' and areaCodes != null">
|
|
|
and d.`location_ref` in
|
|
|
<foreach item="areaCode" collection="areaCodes" open="(" separator="," close=")">
|
|
|
#{areaCode}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="deviceCategory != null and deviceCategory !=''"> and sc.`parent_code` = #{deviceCategory}</if>
|
|
|
- <if test="deviceSubCategory != null and deviceSubCategory !=''"> and f.`facs_subcategory` = #{deviceSubCategory}</if>
|
|
|
+ <if test="deviceCategory != null and deviceCategory !=''">and sc.`parent_code` = #{deviceCategory}</if>
|
|
|
+ <if test="deviceSubCategory != null and deviceSubCategory !=''">and f.`facs_subcategory` =
|
|
|
+ #{deviceSubCategory}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
ORDER BY d.`location_ref`
|
|
|
</select>
|
|
@@ -141,7 +179,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where d.`device_code` = #{code}
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertEmsDevice" parameterType="com.ruoyi.ems.domain.EmsDevice" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ <insert id="insertEmsDevice" parameterType="com.ruoyi.ems.domain.EmsDevice" useGeneratedKeys="true"
|
|
|
+ keyProperty="id">
|
|
|
insert into adm_ems_device
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="deviceCode != null and deviceCode != ''">device_code,</if>
|
|
@@ -157,7 +196,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="refFacs != null">ref_facs,</if>
|
|
|
<if test="psCode != null">ps_code,</if>
|
|
|
<if test="subsystemCode != null">subsystem_code,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="deviceCode != null and deviceCode != ''">#{deviceCode},</if>
|
|
|
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
|
@@ -172,7 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="refFacs != null">#{refFacs},</if>
|
|
|
<if test="psCode != null">#{psCode},</if>
|
|
|
<if test="subsystemCode != null">#{subsystemCode},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateEmsDevice" parameterType="com.ruoyi.ems.domain.EmsDevice">
|
|
@@ -196,7 +235,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteEmsDeviceById" parameterType="Long">
|
|
|
- delete from adm_ems_device where id = #{id}
|
|
|
+ delete
|
|
|
+ from adm_ems_device
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteEmsDeviceByIds" parameterType="String">
|
|
@@ -223,23 +264,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="calcDeviceOnlineSummary">
|
|
|
SELECT
|
|
|
- sc.`name` typeName,
|
|
|
- count( devc.id ) total,
|
|
|
- SUM( CASE WHEN device_status = 1 THEN 1 ELSE 0 END ) AS onlineCount
|
|
|
+ sc.`name` typeName,
|
|
|
+ count( devc.id ) total,
|
|
|
+ SUM( CASE WHEN device_status = 1 THEN 1 ELSE 0 END ) AS onlineCount
|
|
|
FROM
|
|
|
- adm_ems_device devc
|
|
|
- LEFT JOIN adm_ems_facs f ON devc.`ref_facs` = f.`facs_code`
|
|
|
- LEFT JOIN dim_ems_facs_subcategory sc ON f.facs_subcategory = sc.`code`
|
|
|
- <if test="areaCode !=null and areaCode!=''">
|
|
|
- LEFT JOIN adm_area area ON devc.location_ref = area.area_code
|
|
|
- </if>
|
|
|
+ adm_ems_device devc
|
|
|
+ LEFT JOIN adm_ems_facs f ON devc.`ref_facs` = f.`facs_code`
|
|
|
+ LEFT JOIN dim_ems_facs_subcategory sc ON f.facs_subcategory = sc.`code`
|
|
|
+ <if test="areaCode !=null and areaCode!=''">
|
|
|
+ LEFT JOIN adm_area area ON devc.location_ref = area.area_code
|
|
|
+ </if>
|
|
|
<where>
|
|
|
<if test="areaCode !=null and areaCode!=''">
|
|
|
area.ancestors like CONCAT('%',#{areaCode},'%')
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY
|
|
|
- facs_subcategory
|
|
|
+ facs_subcategory
|
|
|
</select>
|
|
|
<select id="cntTotalDevice">
|
|
|
SELECT count(1) as total,
|
|
@@ -253,4 +294,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectSubSystemDeviceState" parameterType="EmsDeviceModel" resultType="EmsDeviceModel">
|
|
|
+ select
|
|
|
+ device.device_code ,
|
|
|
+ device.device_name,
|
|
|
+ device.location,
|
|
|
+ JSON_ARRAYAGG(
|
|
|
+ JSON_OBJECT(
|
|
|
+ 'attr_key', aeo.attr_key,
|
|
|
+ 'attr_value', IFNULL(aeoa.attr_value, ''),
|
|
|
+ 'attr_name', aeo.attr_name,
|
|
|
+ 'attr_unit', IFNULL(aeo.attr_unit, '')
|
|
|
+ )
|
|
|
+ ) AS attributes_array
|
|
|
+ from
|
|
|
+ adm_ems_device device
|
|
|
+ left join adm_ems_obj_attr_value aeoa
|
|
|
+ on
|
|
|
+ device.device_model = aeoa.model_code
|
|
|
+ and device.device_code = aeoa.obj_code
|
|
|
+ left join adm_ems_obj_attr aeo on
|
|
|
+ aeo.model_code = aeoa.model_code and aeo.attr_key = aeoa.attr_key
|
|
|
+ <where>
|
|
|
+ <if test="areaCode !=null and areaCode!='' and areaCode != '-1'">
|
|
|
+ and device.area_code = #{areaCode}
|
|
|
+ </if>
|
|
|
+ <if test="subsystemCode !=''">
|
|
|
+ and device.subsystem_code = #{subsystemCode}
|
|
|
+ </if>
|
|
|
+ <if test="attrGroup !=null and attrGroup!=''">
|
|
|
+ and aeo.attr_group = #{attrGroup}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by
|
|
|
+ device.device_code
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|