Mapper:
<select id="queryBlackByMac" resultMap="BlackByMac"> SELECT packet_black_mac_id, mac, creator, create_time FROM flnet_system_ota.packet_black_mac <where> <if test=" mac!=null and mac!=‘‘ "> mac LIKE ‘%${mac}%‘ AND </if> state = 0 </where> ORDER BY create_time DESC, packet_black_mac_id DESC LIMIT #{offset}, #{limit} </select>
Dao:
List<BlackMac> queryBlackByMac(@Param(value = "mac") String mac, @Param(value = "offset") int offset, @Param(value = "limit") int limit);
Sevice:
List<BlackMac> blackMacList = blackMacDao.queryBlackByMac(mac,
(pagination.getPage() - 1) * pagination.getPageNum(), pagination.getPageNum());
注: