1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?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.bizmatics.persistence.mapper.DeviceAnalogVariableListMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.bizmatics.model.DeviceAnalogVariableList">
- <id column="id" property="id" />
- <result column="device_code" property="deviceCode" />
- <result column="variable_name" property="variableName" />
- <result column="variable_coding" property="variableCoding" />
- <result column="monitoring_equipment" property="monitoringEquipment" />
- <result column="communication_equipment" property="communicationEquipment" />
- <result column="data_address" property="dataAddress" />
- <result column="data_type" property="dataType" />
- <result column="coefficient" property="coefficient" />
- <result column="save_cycle" property="saveCycle" />
- <result column="create_time" property="createTime" />
- <result column="creator" property="creator" />
- <result column="enable" property="enable" />
- </resultMap>
- <select id="variableList" resultType="com.bizmatics.model.DeviceAnalogVariableList">
- SELECT
- a.*
- FROM
- device_analog_variable_list AS a
- inner JOIN device AS b ON a.device_code = b.device_code
- <where>
- b.enable =1
- and a.enable =1
- <if test="siteId != null and siteId !=0">
- and b.site_id = #{siteId}
- </if>
- <if test="id != null and id !=0">
- and a.id = #{id}
- </if>
- <if test="deviceCode != null and deviceCode !=''">
- and b.device_code = #{deviceCode}
- </if>
- <if test="deviceType != null and deviceType !=0">
- and b.device_type = #{deviceType}
- </if>
- <if test="screen != null and screen !=''">
- and ( a.variable_name LIKE CONCAT(CONCAT('%', #{screen}), '%') or a.variable_coding LIKE
- CONCAT(CONCAT('%', #{screen}), '%'))
- </if>
- </where>
- order by a.id
- <if test="startCurrent != null and startCurrent !=0 and current != null and current !=0">
- LIMIT #{startCurrent},#{current}
- </if>
- </select>
- </mapper>
|