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());
注:
原文地址:https://www.cnblogs.com/XJJD/p/8471686.html
时间: 2024-10-11 12:58:09