QuestionMapper.xml 1001 B

1234567891011121314151617
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.dayou.dao.QuestionMapper">
  4. <select id="findChildren" parameterType="java.lang.Long" resultType="com.dayou.entity.Question">
  5. select q.id,q.label,q.parent_id,q.scope,q.min_score,q.max_score,qq.label AS parentLabel from question q left join question qq on q.parent_id = qq.id where q.deleted = 0 and q.parent_id = #{rootId}
  6. </select>
  7. <select id="getFailQuestions" parameterType="java.util.List" resultType="com.dayou.entity.Question">
  8. select q.id,q.label,q.parent_id,q.scope,q.min_score,q.max_score,qq.label AS parentLabel from question q left join question qq on q.parent_id = qq.id where q.deleted = 0
  9. and q.parent_id in (
  10. <foreach collection="parentIds" index="index" item="item" separator=",">
  11. #{item}
  12. </foreach>
  13. )
  14. </select>
  15. </mapper>