新增设备

This commit is contained in:
2025-07-02 15:29:09 +08:00
parent 4220428f92
commit 2a81385554
5 changed files with 26 additions and 28 deletions

View File

@ -42,11 +42,8 @@
d.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,t.type_name
-- da.assignee_id AS customerId, da.assignee_name AS customerName, da.active AS deviceStatus,
-- da.assigned_at AS create_time , da.assigner_name AS create_by , da.id AS assignId
from device d
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() != ''">
@ -62,28 +59,18 @@
and d.device_type = #{criteria.deviceType}
</if>
<if test="criteria.deviceStatus != null">
-- and da.active = #{criteria.deviceStatus}
-- and da.active = #{criteria.deviceStatus}
</if>
<if test="criteria.currentOwnerId != null">
d.current_owner_id = #{criteria.currentOwnerId}
</if>
<if test="criteria.createTime != null and criteria.createTime.size() != 0">
and d.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
</if>
<if test="criteria.tenantId != null">
AND tenant_id = #{criteria.tenantId}
</if>
<!-- 下面这两个条件只需满足一个 -->
<!-- <if test="criteria.customerId != null"> -->
<!-- AND ( -->
<!-- tenant_id = #{criteria.tenantId} -->
<!-- OR d.customer_id = #{criteria.customerId} -->
<!-- ) -->
<!-- </if> -->
<!-- <if test="criteria.customerId == null"> -->
<!-- AND tenant_id = #{criteria.tenantId} -->
<!-- </if> -->
</where>
-- ORDER BY create_time DESC
</select>
<select id="findAll1" resultType="com.fuyuanshen.equipment.domain.Device">

View File

@ -28,6 +28,9 @@
<if test="criteria.typeName != null and criteria.typeName.trim() != ''">
and dt.type_name like concat('%', TRIM(#{criteria.typeName}), '%')
</if>
<if test="criteria.deviceTypeId != null">
and dt.id = #{criteria.deviceTypeId}
</if>
<if test="criteria.customerId != null">
and dt.owner_customer_id = #{criteria.customerId}
</if>