public class QueryParamUtil extends Object
| 构造器和说明 |
|---|
QueryParamUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
castType(String fieldNameType,
Object val,
String option)
查询字段类型的转换 查询字段默认转进来的值都是字符串,需要根据PO类型作转换
|
static Field |
getDeclaredField(Class clazz,
String fieldName)
当前类取不到属性,循环向上(父类)取
|
static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper |
getEntityWrapper(Map<String,Object> params,
Class clz) |
static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper |
getEntityWrapper(Map<String,Object> params,
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ew,
Class clz) |
static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper |
getMultiEntityWrapper(Map<String,Object> params,
Class entity)
多表的QueryWrapper, 用于条件都在别名为t1.这个表上 对应的sql写法:
|
static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper |
getMultiEntityWrapper(Map<String,Object> params,
Class entity,
String defaultPrex)
多表的QueryWrapper 用于条件都在别名为defaultPrex这个表上
|
static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper |
getMultiEntityWrapper(Map<String,Object> params,
Map<String,String> otherTableFields,
Map<String,Class> entities)
多表的QueryWrapper, 不在otherTableFields里的查询条件,都在别名t1.对应的Po, otherTableFields里的查询条件根据各自的value值(即别名:如:t2.)找到所在的po
|
static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper |
getMultiEntityWrapper(Map<String,Object> params,
Map<String,String> otherTableFields,
Map<String,Class> entities,
String defaultPrex)
多表的QueryWrapper, 不在otherTableFields里的查询条件,都在别名defaultPrex对应的Po, otherTableFields里的查询条件根据各自的value值(即别名:如:t2.)找到所在的po
|
public static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getEntityWrapper(Map<String,Object> params, Class clz)
public static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getEntityWrapper(Map<String,Object> params, com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ew, Class clz)
public static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getMultiEntityWrapper(Map<String,Object> params, Class entity)
params - 全部查询条件entity - 全部查询条件对应的Popublic static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getMultiEntityWrapper(Map<String,Object> params, Class entity, String defaultPrex)
params - 全部查询条件entity - 全部查询条件对应的PodefaultPrex - 全部查询条件对应的表的别名,以点号结束,格式:t2.,默认t1.public static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getMultiEntityWrapper(Map<String,Object> params, Map<String,String> otherTableFields, Map<String,Class> entities)
params - 全部查询条件otherTableFields - 其它表的查询条件:key=camelFieldName,value:表的别名加以点号结束,如:"t2." map.put("camelFieldName","t2.")
,map.put(”filename2“,"t3.")等等entities - 全部查询条件的实体类Map,key为表的别名,以点号结束,格式:"t2.",value为表对应的Po,一定要包括有key:"t1."
map.put("t1.",Prop.class),map.put("t2.",Prop.class),map.put("t3.",PropVal.class)public static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getMultiEntityWrapper(Map<String,Object> params, Map<String,String> otherTableFields, Map<String,Class> entities, String defaultPrex)
params - 全部查询条件otherTableFields - 其它表的查询条件:key=camelFieldName,value:字段前缀(表别名加点,如:t2.)map.put("camelFieldName","t2.")
,map.put(”filename2“,"t3.")等等entities - 实体PO,key:数据表别名,val:实体类POdefaultPrex - 默认字段的别名:默认值 t1.public static Field getDeclaredField(Class clazz, String fieldName)
Copyright © 2022. All rights reserved.