类 QueryParamUtil
java.lang.Object
cn.airfei.aircore.core.utils.QueryParamUtil
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static Object查询字段类型的转换 查询字段默认转进来的值都是字符串,需要根据PO类型作转换static FieldgetDeclaredField(Class clazz, String fieldName) 当前类取不到属性,循环向上(父类)取static com.baomidou.mybatisplus.core.conditions.query.QueryWrappergetEntityWrapper(Map<String, Object> params, com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ew, Class clz) static com.baomidou.mybatisplus.core.conditions.query.QueryWrappergetEntityWrapper(Map<String, Object> params, Class clz) static com.baomidou.mybatisplus.core.conditions.query.QueryWrappergetMultiEntityWrapper(Map<String, Object> params, Class entity) 多表的QueryWrapper, 用于条件都在别名为t1.这个表上 对应的sql写法:static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper多表的QueryWrapper 用于条件都在别名为defaultPrex这个表上static com.baomidou.mybatisplus.core.conditions.query.QueryWrappergetMultiEntityWrapper(Map<String, Object> params, Map<String, String> otherTableFields, Map<String, Class> entities) 多表的QueryWrapper, 不在otherTableFields里的查询条件,都在别名t1.对应的Po, otherTableFields里的查询条件根据各自的value值(即别名:如:t2.)找到所在的postatic com.baomidou.mybatisplus.core.conditions.query.QueryWrappergetMultiEntityWrapper(Map<String, Object> params, Map<String, String> otherTableFields, Map<String, Class> entities, String defaultPrex) 多表的QueryWrapper, 不在otherTableFields里的查询条件,都在别名defaultPrex对应的Po, otherTableFields里的查询条件根据各自的value值(即别名:如:t2.)找到所在的po
-
构造器详细资料
-
QueryParamUtil
public QueryParamUtil()
-
-
方法详细资料
-
getEntityWrapper
-
getEntityWrapper
-
getMultiEntityWrapper
public static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getMultiEntityWrapper(Map<String, Object> params, Class entity) 多表的QueryWrapper, 用于条件都在别名为t1.这个表上 对应的sql写法:- 参数:
params- 全部查询条件entity- 全部查询条件对应的Po
-
getMultiEntityWrapper
public static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getMultiEntityWrapper(Map<String, Object> params, Class entity, String defaultPrex) 多表的QueryWrapper 用于条件都在别名为defaultPrex这个表上- 参数:
params- 全部查询条件entity- 全部查询条件对应的PodefaultPrex- 全部查询条件对应的表的别名,以点号结束,格式:t2.,默认t1.
-
getMultiEntityWrapper
public 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- 参数:
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)
-
getMultiEntityWrapper
public 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- 参数:
params- 全部查询条件otherTableFields- 其它表的查询条件:key=camelFieldName,value:字段前缀(表别名加点,如:t2.)map.put("camelFieldName","t2.") ,map.put(”filename2“,"t3.")等等entities- 实体PO,key:数据表别名,val:实体类POdefaultPrex- 默认字段的别名:默认值 t1.
-
getDeclaredField
当前类取不到属性,循环向上(父类)取 -
castType
查询字段类型的转换 查询字段默认转进来的值都是字符串,需要根据PO类型作转换
-