北京经济技术开发区经开区虚拟城市项目-【后端】-服务,Poi,企业,地块等定制接口
13693261870
2023-10-05 da30aeabac71e08d866d504b908a032763794e3e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.smartearth.poiexcel.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
 
/**
 * 基础Mapper
 * @author WWW
 * @param <T> 泛型
 */
public interface BasicMapper<T> extends BaseMapper<T> {
    /**
     * 模糊搜索字段
     *
     * @param tab   表名
     * @param field 字段
     * @param value 值
     * @return 结果列表
     */
    @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);
}