<?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="cn.com.countrygarden.bi.main.dao.review.ReviewGradeMapper">
	<!-- 通用查询映射结果 -->
	<resultMap id="BaseResultMap"
		type="cn.com.countrygarden.bi.main.model.review.ReviewGrade">
		<id column="id" property="id" />
		<result column="name" property="name" />
		<result column="flag" property="flag" />
		<result column="create_by" property="createBy" />
		<result column="create_time" property="createTime" />
		<result column="update_by" property="updateBy" />
		<result column="update_time" property="updateTime" />
	</resultMap>

	<resultMap id="printreviewscore"
		type="cn.com.countrygarden.bi.main.model.review.ReviewGrade">
		<id property="id" column="id" />
		<result property="name" column="name" />
		<collection property="reviewscorelist"
			ofType="cn.com.countrygarden.bi.main.model.review.ReviewScore"
			javaType="ArrayList">
			<result column="judge_id" property="judgeId" />
			<result column="problem_id" property="problemId" />
			<result column="score" property="score" />
		</collection>
	</resultMap>
     
    <select id="printscore" resultMap="printreviewscore"
	parameterType="java.lang.Integer">
	select rg.name,rs.score
	from review_score rs,review_judge rj,review_investigated ri,review_grade
	rg,review_questionnaire_problem
	rqp,review_questionnaire_problem_classification pqpc
	where rs.judge_id=rj.id and rg.id=rj.grade_id and rs.problem_id=rqp.id and
	pqpc.id=rqp.questionnaire_problem_classification_id
	and rj.investigated_id=#{investigatedid} 
     </select>
</mapper>