You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.1 KiB
32 lines
1.1 KiB
package com.mh.user.mapper; |
|
|
|
import com.mh.user.entity.MqttSubscriptionEntity; |
|
import org.apache.ibatis.annotations.Mapper; |
|
import org.apache.ibatis.annotations.Param; |
|
import org.apache.ibatis.annotations.Select; |
|
import tk.mybatis.mapper.common.BaseMapper; |
|
|
|
import java.util.List; |
|
|
|
/** |
|
* @author LJF |
|
* @version 1.0 |
|
* @project EEMCS |
|
* @description mqtt订阅mapper类 |
|
* @date 2025-02-14 14:00:58 |
|
*/ |
|
@Mapper |
|
public interface MqttSubscriptionMapper extends BaseMapper<MqttSubscriptionEntity> { |
|
|
|
@Select("<script>" + |
|
"SELECT * FROM mqtt_subscription WHERE 1=1 " + |
|
"<if test='topic != null and topic != \"\"'>AND topic = #{topic}</if>" + |
|
"<if test='status != null and status != \"\"'>AND status = #{status}</if>" + |
|
"ORDER BY crate_time DESC " + |
|
"</script>") |
|
List<MqttSubscriptionEntity> selectListByTopic(@Param("topic") String topic, |
|
@Param("status") String status); |
|
|
|
@Select("SELECT top 1 * FROM mqtt_subscription WHERE id = #{id}") |
|
MqttSubscriptionEntity selectById(@Param("id") String id); |
|
}
|
|
|