文章目录
查询聚合函数
//查询
QueryWrapper<[tableObj]> Wrapper = new QueryWrapper<>();
Wrapper.select("min([field])","max([field])");
List<Map<String, Object>> maps = Mapper.selectMapsfWrapper);
//返回json
[{min(wfId)=-3, max(wfId)=-1}]
//获取
(int) maps.get(0).get("min(wfId)");
mapper 层 选装件
CustomInjector
@Configuration
public class CustomInjector extends DefaultSqlInjector {
@Override
public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
//加入选装件
methodList.add(new InsertBatchSomeColumn());
return methodList;
}
}
mapper加入方法
@Repository
public interface []Mapper extends BaseMapper<[tableObj]> {
int insertBatchSomeColumn(List<[tableObj] > entityList);
}