@Select中忘记使用Script标签了

正确的写法如下:

1
2
3
4
5
6
7
8
9

@Mapper
public interface CommonMaterialMapper extends BaseMapper<CommonMaterial> {

    @Select("<script>select * from t_common_material where id in <foreach collection='ids' item='id' open='(' separator=',' close=')'> #{id} </foreach></script>")
    List<CommonMaterial> selectListWithDelete(@Param("ids") List<String> ids);

}

忘记使用<script>会导致错误。