forked from dyf/fys-Multi-tenant
web:设备管理
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
<?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.fuyuanshen.equipment.mapper.DeviceAssignmentsMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.fuyuanshen.equipment.domain.DeviceAssignments">
|
||||
<id property="id" column="id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="fromCustomerId" column="from_customer_id" />
|
||||
<result property="toCustomerId" column="to_customer_id" />
|
||||
<result property="assignedAt" column="assigned_at" />
|
||||
<result property="deviceTypeGranted" column="device_type_granted" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,device_id,from_customer_id,to_customer_id,assigned_at,device_type_granted
|
||||
</sql>
|
||||
</mapper>
|
@ -37,7 +37,7 @@
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询设备 -->
|
||||
<select id="findAll" resultType="com.fuyuanshen.equipment.domain.Device">
|
||||
<select id="findAll1" resultType="com.fuyuanshen.equipment.domain.Device">
|
||||
select d.* , t.type_name
|
||||
FROM device d
|
||||
LEFT JOIN device_type t ON d.device_type = t.id
|
||||
@ -71,6 +71,44 @@
|
||||
order by d.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 分页查询设备 -->
|
||||
<select id="findAll" resultType="com.fuyuanshen.equipment.domain.Device">
|
||||
select
|
||||
da.id AS id,d.device_name,
|
||||
d.device_pic, d.device_mac, d.device_sn, d.update_by,d.device_imei,
|
||||
d.update_time, d.device_type, d.remark, d.binding_status,d.type_name AS typeName,
|
||||
da.assignee_id AS customerId, da.assignee_name AS customerName, da.active AS deviceStatus,
|
||||
da.create_time AS create_time , da.assigner_name AS createByName , da.id AS assignId
|
||||
from device d
|
||||
LEFT JOIN device_type t ON d.device_type = t.id
|
||||
LEFT JOIN device_assignments da ON da.device_id = d.id
|
||||
<where>
|
||||
<!-- 时间范围等其他条件保持原样 -->
|
||||
<if test="criteria.deviceName != null and criteria.deviceName.trim() != ''">
|
||||
and d.device_name like concat('%', TRIM(#{criteria.deviceName}), '%')
|
||||
</if>
|
||||
<if test="criteria.deviceMac != null">
|
||||
and d.device_mac = #{criteria.deviceMac}
|
||||
</if>
|
||||
<if test="criteria.deviceImei != null">
|
||||
and d.device_imei = #{criteria.deviceImei}
|
||||
</if>
|
||||
<if test="criteria.deviceType != null">
|
||||
and d.device_type = #{criteria.deviceType}
|
||||
</if>
|
||||
<if test="criteria.deviceStatus != null">
|
||||
and da.active = #{criteria.deviceStatus}
|
||||
</if>
|
||||
<if test="criteria.params.beginTime != null and criteria.params.endTime != null">
|
||||
and da.create_time between #{criteria.params.beginTime} and #{criteria.params.endTime}
|
||||
</if>
|
||||
AND da.assignee_id = #{criteria.currentOwnerId}
|
||||
|
||||
</where>
|
||||
ORDER BY da.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="findAllDevices" resultType="com.fuyuanshen.equipment.domain.Device">
|
||||
select
|
||||
d.id, d.customer_id, d.device_name,
|
||||
@ -93,12 +131,18 @@
|
||||
</where>
|
||||
order by d.id desc
|
||||
</select>
|
||||
|
||||
<select id="queryAppDeviceList" resultType="com.fuyuanshen.equipment.domain.vo.AppDeviceVo">
|
||||
select
|
||||
d.id, d.device_name, d.device_mac, d.device_sn,
|
||||
d.device_imei, d.device_mac ,dt.communication_mode
|
||||
from device d inner join device_type dt on d.device_type = dt.id
|
||||
where d.binding_user_id = #{criteria.bindingUserId}
|
||||
select d.id,
|
||||
d.device_name,
|
||||
d.device_mac,
|
||||
d.device_sn,
|
||||
d.device_imei,
|
||||
d.device_mac,
|
||||
dt.communication_mode
|
||||
from device d
|
||||
inner join device_type dt on d.device_type = dt.id
|
||||
where d.binding_user_id = #{criteria.bindingUserId}
|
||||
</select>
|
||||
|
||||
<!-- 获取分配设备的客户 -->
|
||||
|
Reference in New Issue
Block a user