随笔分类 - Mybatis & Mybatis-Plus
摘要:背景 项目中有些MybatisSQL莫名的加上了limit,怀疑是使用PageHelper出现分页信息线程间冲突,有的线程使用完分页之后,并没有清除TheadLocal中的分页信息,导致新的请求使用旧的线程使用了旧的分页信息,导致SQL报错 版本 <dependency> <groupId>com.
阅读全文
摘要:背景 项目使用Mybatis-Plus,开启了全局结果集字段转驼峰map-underscore-to-camel-case: true。开启之后如果需要返回下划线需要自定义resultMap 现需要返回List<Map>,且返回的字段是动态变化,需要返回原Sql中的AS后的字段 版本 <depend
阅读全文
摘要:背景 主表index_dict_data 内容表index_dict_cn_name 期望输出数据结构:即联表之后根据indexId聚合,然后将cnName字段聚合到一个**List<String>**中 [ { "indexId": "pageCrashNum", "cnNames": ["崩溃数
阅读全文
摘要:直接调用 <sql id="headFilter"> <if test="headFilter != null and headFilter.size != 0"> <foreach collection="headFilter.entrySet()" separator=" " index="co
阅读全文