<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="dnn.exam.QuestionMapper">
<select id="getQuestionList" resultType="dnn.exam.Question">
SELECT * FROM (SELECT * FROM question
<where> 1 = 1
<if test="null != questionids and questionids.size() > 0">
AND
<foreach collection="questionids" index="index" item="item" open="(" separator="and" close=")">
id != #{item}
</foreach>
</if>
</where>
ORDER BY question.count ASC LIMIT 5) tab ORDER BY RAND()
</select>
</mapper>
Mybatis的Mapper.xml文件中集合遍历
最新推荐文章于 2025-04-17 19:10:53 发布