@Select("<script>select count(1) from table_123 where tenant = #{tenant} " +
" <when test='statusList != null'> " +
" and status in " +
" <foreach collection='statusList' item='status' open='(' separator=',' close=')'>" +
" #{status}" +
" </foreach>" +
" </when> " +
" <when test='keyword != null'> " +
" and LOCATE(#{keyword},task_name) > 0 " +
" </when> " +
" </script>")
Integer getTaskCounts(String tenant, String keyword, List<Integer> statusList);
Mybatis的注解方式@Select进行条件判断和循环
最新推荐文章于 2024-10-28 17:34:28 发布
4268

被折叠的 条评论
为什么被折叠?



