You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.3 KiB

3 months ago
<?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.techsor.datacenter.business.dao.ex.DeviceConfigInfoExtMapper">
<select id="getListPage" resultType="com.techsor.datacenter.business.vo.device.DeviceConfigVO" >
select
id, `name`, description, device_type, device_data_src, origin_json_format, expression_map,
expression_variable_map, target_json_format, target_forward_id, target_foward_code, company_id,dbm_id,name_zh,name_en,
device_category_id,`unit`
from `type`
<where>
<!-- <if test="companyIdList != null and companyIdList.size() > 0">-->
<!-- and company_id in-->
<!-- <foreach collection="companyIdList" item="companyId" open="(" separator="," close=")">-->
<!-- #{companyId}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="spaceIdList != null and spaceIdList.size() > 0">
and space_id in
<foreach collection="spaceIdList" item="spaceId" open="(" separator="," close=")">
#{spaceId}
</foreach>
</if>
<if test="deviceTypeName != null and deviceTypeName !=''">
and `name` like concat('%',#{deviceTypeName},'%')
</if>
<if test="deviceTypeDesc != null and deviceTypeDesc !=''">
and description like concat('%',#{deviceTypeDesc},'%')
</if>
and flag = 0
</where>
</select>
<select id="getDeviceCategoryListByTypeName" resultType="com.techsor.datacenter.business.vo.device.DeviceTypeVO">
select
id, `name`
from `type`
<where>
<if test="name != null || name !=''">
and `name` like concat('%',#{name},'%')
</if>
<!-- and company_id = #{companyId}-->
and flag = 0
</where>
</select>
<select id="selectByDeviceId" resultType="com.techsor.datacenter.business.vo.device.DeviceConfigVO">
select * from type,device_info where type.id=device_info.type_id and device_info.device_id=#{deviceId} and device_info.flag!=1
</select>
</mapper>