package com.casic.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.casic.entity.Device; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; @Mapper public interface AlarmDeviceMapper extends BaseMapper<Device> { @Select("SELECT DBID " + "FROM ALARM_DEVICE " + "WHERE ACTIVE=1 AND DEVCODE=#{devcode} ") Long getDevcode(@Param("devcode") String devcode); @Select("<script> SELECT DBID as id, DEVCODE as devCode, DEVNAME as devName, FACTORY as factory, SIMID as simid FROM ALARM_DEVICE" + " where ACTIVE=1 and devicetype_id=30 " + "<when test='phone !=null'> AND SIMID like CONCAT(CONCAT('%',#{phone}),'%') " + "</when> </script>") List<Device> getDevices(@Param("phone") String phone); Page<Device> listPage(Page<Device> page, @Param("phone") String phone, @Param("devCode") String devCode, @Param("type") String type, @Param("factory") String factory); }