MybatisPlus QueryWapper 用法参考

官方介绍

MyBatis-Plus

IN 操作符

  1. 对集合进行非空判断,否则mysql 出现" select  * (where colum in ())" 报错
List taskIdList =  resultsMapper.selectObjs(qw);
QueryWrapper qwJiraTotal = new QueryWrapper<>();
Integer taskJiraTotalCount = 0;
if(!taskIdList.isEmpty()){
    qwJiraTotal.select("distinct jira_key").in("result_id", taskIdList);
    taskJiraTotalCount = resultSummaryMapper.selectList(qwJiraTotal).size();
} 
  

你可能感兴趣的:(mybatis)