<?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="org.sxkj.gd.workorder.mapper.GdManageDeviceMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="gdManageDeviceResultMap" type="org.sxkj.gd.workorder.vo.GdManageDeviceVO">
|
<result column="id" property="id"/>
|
<result column="device_sn" property="deviceSn"/>
|
<result column="device_name" property="deviceName"/>
|
<result column="nickname" property="nickname"/>
|
<result column="device_payload" property="devicePayload"/>
|
<result column="longitude" property="longitude"/>
|
<result column="latitude" property="latitude"/>
|
<result column="mode_code" property="modeCode"/>
|
<result column="create_time" property="createTime"/>
|
<result column="device_dept_name" property="deviceDeptName"/>
|
</resultMap>
|
|
|
<select id="selectGdManageDevicePage" resultMap="gdManageDeviceResultMap">
|
select
|
md.*,
|
bd.dept_name as device_dept_name
|
from
|
ja_gd_manage_device md
|
left join
|
blade_dept bd on md.create_dept = bd.id
|
<where>
|
and md.is_deleted = 0
|
<if test="param2.deviceName != null and param2.deviceName != ''">
|
and md.nickname like concat('%',#{param2.deviceName},'%')
|
</if>
|
<if test="param2.deptId != null">
|
and md.create_dept = #{param2.deptId}
|
</if>
|
<if test="param2.location != null and param2.location != ''">
|
and md.location like concat('%',#{param2.location},'%')
|
</if>
|
</where>
|
</select>
|
|
|
<select id="exportGdManageDevice" resultType="org.sxkj.gd.workorder.excel.GdManageDeviceExcel">
|
SELECT
|
*
|
FROM
|
ja_gd_manage_device ${ew.customSqlSegment}
|
</select>
|
|
<select id="selectGdManageDevice" resultType="org.sxkj.gd.workorder.vo.GdManageDeviceVO">
|
select
|
id,
|
device_sn,
|
device_name,
|
nickname,
|
device_payload,
|
longitude,
|
latitude,
|
geom
|
from
|
ja_gd_manage_device
|
<where>
|
<if test="deviceIds != null and deviceIds.size() > 0">
|
and id in
|
<foreach item="item" collection="deviceIds" index="index" open="(" close=")" separator=",">
|
#{item}
|
</foreach>
|
</if>
|
<if test="devicePayload != null and devicePayload != ''">
|
and device_payload like concat('%',#{devicePayload},'%')
|
</if>
|
<if test="geom != null and geom != ''">
|
and ST_Intersects(geom, ST_GeomFromText(#{geom}))
|
</if>
|
and is_deleted = 0
|
</where>
|
</select>
|
|
</mapper>
|