类 QueryParamUtil

java.lang.Object
cn.airfei.aircore.core.utils.QueryParamUtil

public class QueryParamUtil extends Object
  • 构造器详细资料

    • QueryParamUtil

      public QueryParamUtil()
  • 方法详细资料

    • getEntityWrapper

      public static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getEntityWrapper(Map<String,Object> params, Class clz)
    • getEntityWrapper

      public static com.baomidou.mybatisplus.core.conditions.query.QueryWrapper getEntityWrapper(Map<String,Object> params, com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ew, Class clz)
    • 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 - 全部查询条件对应的Po
      defaultPrex - 全部查询条件对应的表的别名,以点号结束,格式: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:实体类PO
      defaultPrex - 默认字段的别名:默认值 t1.
    • getDeclaredField

      public static Field getDeclaredField(Class clazz, String fieldName)
      当前类取不到属性,循环向上(父类)取
    • castType

      public static Object castType(String fieldNameType, Object val, String option)
      查询字段类型的转换 查询字段默认转进来的值都是字符串,需要根据PO类型作转换