1
0

WEB:分页查询设备列表

This commit is contained in:
2025-07-04 15:42:10 +08:00
parent d456236599
commit 3947f9b6f0
10 changed files with 70 additions and 30 deletions

View File

@ -38,7 +38,7 @@
<!-- 分页查询设备 -->
<select id="findAll" resultType="com.fuyuanshen.equipment.domain.Device">
select d.* ,t.type_name
select d.* , t.type_name
FROM device d
LEFT JOIN device_type t ON d.device_type = t.id
<where>
@ -52,22 +52,23 @@
<if test="criteria.deviceImei != null">
and d.device_imei = #{criteria.deviceImei}
</if>
<if test="criteria.deviceTypeId != null">
and d.device_type = #{criteria.deviceTypeId}
<if test="criteria.deviceType != null">
and d.device_type = #{criteria.deviceType}
</if>
<if test="criteria.deviceStatus != null">
-- and da.active = #{criteria.deviceStatus}
and d.device_status = #{criteria.deviceStatus}
</if>
<if test="criteria.currentOwnerId != null">
d.current_owner_id = #{criteria.currentOwnerId}
and 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 test="criteria.params.beginTime != null and criteria.params.endTime != null">
and d.create_time between #{criteria.params.beginTime} and #{criteria.params.endTime}
</if>
<if test="criteria.tenantId != null">
AND tenant_id = #{criteria.tenantId}
</if>
</where>
order by d.create_time desc
</select>
<select id="findAllDevices" resultType="com.fuyuanshen.equipment.domain.Device">
@ -93,4 +94,12 @@
order by d.id desc
</select>
<!-- 获取分配设备的客户 -->
<select id="getAssignCustomer" resultType="com.fuyuanshen.equipment.domain.Device">
SELECT *
FROM device
WHERE original_owner_id = #{customerId}
AND device_status = 1
</select>
</mapper>