管道基础大数据平台系统开发-【后端】-Server
13693261870
2025-07-02 ed8c7a5effd0d423ce1118b680ecdca6fe732609
src/main/java/com/lf/server/mapper/all/BasicMapper.java
@@ -1,6 +1,8 @@
package com.lf.server.mapper.all;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lf.server.entity.sys.AttachEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -20,6 +22,34 @@
     * @param value 值
     * @return 结果列表
     */
    @Select("select ${field} from ${tab} where ${field} like #{value} order by ${field} limit 10")
    @Select("select ${field} from ${tab} where upper(${field}) like #{value} order by ${field} limit 10")
    public List<String> selectFieldFuzzy(@Param("tab") String tab, @Param("field") String field, @Param("value") String value);
    /**
     * 自定义批量插入
     * 如果要自动填充,@Param(xx) xx参数名必须是 list/collection/array 3个的其中之一
     *
     * @param list
     * @return
     */
    public int insertBatch(@Param("list") List<T> list);
    /**
     * 自定义批量更新,条件为主键
     * 如果要自动填充,@Param(xx) xx参数名必须是 list/collection/array 3个的其中之一
     *
     * @param list
     * @return
     */
    public int updateBatch(@Param("list") List<T> list);
    /**
     * 查询附件
     *
     * @param tab     表名
     * @param wrapper 查询包装器
     * @return
     */
    @Select("select * from lf.sys_attach where tab = #{tab} and tab_guid in (select eventid from ${tab} ${ew.customSqlSegment})")
    public List<AttachEntity> selectAnnex(@Param("tab") String tab, @Param("ew") QueryWrapper wrapper);
}