| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?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.xunmei.iot.mapper.IotCommonSensorMapper">
- <select id="selectPageData" resultType="com.xunmei.iot.vo.sensor.SensorPageVo">
- select s.id, org_id, org_name, device_name, device_type, infos as info,device_code, update_time,state
- from iot_sensor s
- where s.deleted=0
- <if test="request.orgId!= null">
- and s.org_id=#{request.orgId}
- </if>
- <if test="request.orgPath!= null">
- and s.org_path like CONCAT(#{request.orgPath}, '%')
- </if>
- <if test="request.deviceName != null and request.deviceName!= ''">
- and s.device_name like CONCAT('%',#{request.deviceName},'%')
- </if>
- <if test="request.state!= null">
- and s.state = #{request.state}
- </if>
- <if test="request.deviceType!= null">
- and s.device_type = #{request.deviceType}
- </if>
- <if test="request.startTime!= null">
- and s.state_update_time >=#{request.startTime}
- </if>
- <if test="request.endTime!= null">
- and s.state_update_time <![CDATA[<=]]> #{request.endTime}
- </if>
- </select>
- <select id="selectSensorLogDataPage" resultType="com.xunmei.iot.vo.sensor.SensorPageVo">
- select s.id, org_id, org_name, device_name, category_id, infos as info,device_code, update_time from
- iot_sensor_log s
- <where>
- <if test="request.orgId!= null">
- and s.org_id=#{request.orgId}
- </if>
- <if test="request.orgPath!= null">
- and s.org_path like CONCAT(#{request.orgPath}, '%')
- </if>
- <if test="request.deviceName != null and request.deviceName!= ''">
- and s.device_name like CONCAT('%',#{request.deviceName},'%')
- </if>
- <if test="request.deviceCode != null and request.deviceCode!= ''">
- and s.device_code =#{request.deviceCode}
- </if>
- <if test="request.startTime!= null">
- and s.state_update_time >=#{request.startTime}
- </if>
- <if test="request.endTime!= null">
- and s.state_update_time <![CDATA[<=]]> #{request.endTime}
- </if>
- </where>
- order by s.state_update_time desc
- </select>
- <select id="selectByIds" resultType="com.xunmei.common.core.domain.iot.domain.IotSensor">
- SELECT
- org_id,
- CONCAT(b.affiliated_area,'-',b.affiliated_bank,'-',b.short_name) as org_name,
- device_name,
- infos AS info,
- device_code
- FROM
- iot_sensor a
- LEFT JOIN sys_org b ON a.org_id = b.id
- where device_code in
- <foreach collection="deviceIds" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- </mapper>
|