31 lines
1.2 KiB
XML
31 lines
1.2 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.IotCardMapper">
|
||
|
|
<select id="findList" resultType="com.central.device.model.IotCard">
|
||
|
|
select * from iot_card t where t.is_del = 0
|
||
|
|
<if test="p.cardNumber != null and p.cardNumber != ''">
|
||
|
|
and t.card_number like concat('%', #{p.cardNumber}, '%')
|
||
|
|
</if>
|
||
|
|
<if test="p.msisdn != null and p.msisdn != ''">
|
||
|
|
and t.msisdn like concat('%', #{p.msisdn}, '%')
|
||
|
|
</if>
|
||
|
|
<if test="p.deviceSn != null and p.deviceSn != ''">
|
||
|
|
and t.device_sn = #{p.deviceSn}
|
||
|
|
</if>
|
||
|
|
<if test="p.enabled != null and p.enabled != ''">
|
||
|
|
and t.enabled = #{p.enabled}
|
||
|
|
</if>
|
||
|
|
<if test="p.carrier != null and p.carrier != ''">
|
||
|
|
and t.carrier = #{p.carrier}
|
||
|
|
</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>
|