forked from dyf/fys-Multi-tenant
分页查询设备:设备类型自动更新
This commit is contained in:
@ -36,48 +36,12 @@
|
||||
d.device_imei, d.longitude, d.latitude, d.tenant_id
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询设备 -->
|
||||
<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
|
||||
<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 d.device_status = #{criteria.deviceStatus}
|
||||
</if>
|
||||
<if test="criteria.currentOwnerId != null">
|
||||
and d.current_owner_id = #{criteria.currentOwnerId}
|
||||
</if>
|
||||
<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="findAll" resultType="com.fuyuanshen.equipment.domain.Device">
|
||||
select
|
||||
da.id AS id,d.device_name,d.bluetooth_name,
|
||||
d.device_pic, d.device_mac, d.device_sn, d.update_by,d.device_imei,
|
||||
d.update_time, dg.id AS device_type, d.remark, d.binding_status,d.type_name AS typeName,
|
||||
d.update_time, dg.id AS device_type, d.remark, d.binding_status,t.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
|
||||
|
Reference in New Issue
Block a user