代码语言:javascript复制
//获取面试结果为已通过的
Integer passInterviewList = baseMapper.selectCount(new QueryWrapper<NeoCrmCustomerInterview>()
.and(ele -> ele.eq("interview_status_init", CustomerInterviewEnum.PASS_WAIT_FEEDBACK.getCode()).or()
.eq("interview_status_init", CustomerInterviewEnum.PASS_FEEDBACK.getCode()))
//优化sql,interviewer_json未null或key不存在指定数据时会报错--优化兼容不存在问题
//.last("and interviewer_json -> '$.interviewerId' like '%" id "%'"));
.last("CASE WHEN JSON_VALID(interviewer_json) THEN JSON_UNQUOTE(JSON_EXTRACT(interviewer_json, '$.interviewerId')) like '%" id "%' ELSE null END"));