Files
gofly-platform-services/zlt-business/device-center/src/main/resources/mapper/AgeDeviceMapper.xml
T

25 lines
1.0 KiB
XML

<?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.central.device.mapper.AgeDeviceMapper">
<select id="findList" resultType="com.central.device.model.AgeDevice">
select * from manage_device t where 1=1
<if test="p.deviceName != null and p.deviceName != ''">
and t.device_name like concat('%', #{p.deviceName}, '%')
</if>
<if test="p.deviceSn != null and p.deviceSn != ''">
and t.device_sn = #{p.deviceSn}
</if>
<if test="p.deviceType != null and p.deviceType != ''">
and t.device_type = #{p.deviceType}
</if>
<if test="p.tenantIds != null and p.tenantIds.size > 0">
AND t.tenant_id IN
<foreach collection="p.tenantIds" item="tid" open="(" separator="," close=")">
#{tid}
</foreach>
</if>
order by t.id desc
</select>
</mapper>