|
|
|
@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.ruoyi.device.mapper.BaseInfoMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="BaseInfo" id="BaseInfoResult">
|
|
|
|
|
<resultMap type="com.ruoyi.device.domain.BaseInfo" id="BaseInfoResult">
|
|
|
|
|
<result property="objId" column="obj_id" />
|
|
|
|
|
<result property="deviceCode" column="device_code" />
|
|
|
|
|
<result property="deviceName" column="device_name" />
|
|
|
|
@ -17,6 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="openPassword" column="open_password" />
|
|
|
|
|
|
|
|
|
|
<result property="typeName" column="device_type_name" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectBaseInfoVo">
|
|
|
|
@ -24,15 +26,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseInfoList" parameterType="BaseInfo" resultMap="BaseInfoResult">
|
|
|
|
|
<include refid="selectBaseInfoVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
|
|
|
|
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
|
|
|
|
<if test="deviceType != null "> and device_type = #{deviceType}</if>
|
|
|
|
|
<if test="useState != null and useState != ''"> and use_state = #{useState}</if>
|
|
|
|
|
<if test="deviceState != null and deviceState != ''"> and device_state = #{deviceState}</if>
|
|
|
|
|
<if test="locationName != null and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if>
|
|
|
|
|
<if test="openPassword != null and openPassword != ''"> and open_password = #{openPassword}</if>
|
|
|
|
|
select info.obj_id,
|
|
|
|
|
device_code,
|
|
|
|
|
device_name,
|
|
|
|
|
device_type,
|
|
|
|
|
use_state,
|
|
|
|
|
device_state,
|
|
|
|
|
location_name,
|
|
|
|
|
info.create_by,
|
|
|
|
|
info.create_time,
|
|
|
|
|
info.update_by,
|
|
|
|
|
info.update_time,
|
|
|
|
|
open_password,
|
|
|
|
|
dbt.device_type_name
|
|
|
|
|
from device_base_info info
|
|
|
|
|
left join no_power_control.device_base_type dbt on info.device_type = dbt.obj_id
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
|
|
|
|
|
<if test="deviceName != null and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deviceType != null ">and device_type = #{deviceType}</if>
|
|
|
|
|
<if test="useState != null and useState != ''">and use_state = #{useState}</if>
|
|
|
|
|
<if test="deviceState != null and deviceState != ''">and device_state = #{deviceState}</if>
|
|
|
|
|
<if test="locationName != null and locationName != ''">and location_name like concat('%', #{locationName},
|
|
|
|
|
'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="openPassword != null and openPassword != ''">and open_password = #{openPassword}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -99,5 +119,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
#{objId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
<select id="checkDeviceCode" resultMap="BaseInfoResult">
|
|
|
|
|
<include refid="selectBaseInfoVo"/>
|
|
|
|
|
where device_code = #{deviceCode} limit 1
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|