<?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">
<!-- 命名，每一个映射对象不一样
	namespace:必须与对应的接口全类名一致
 -->
<mapper namespace="com.iamberry.wechat.service.mapper.QuestionnaireOptionMapper">
 
	<sql id="allField">
 	  option_id optionId,
	  option_quesion_id optionQuesionId,
	  option_name optionName,
	  option_order optionOrder,
	  option_create_date optionCreateDate,
	  option_create_date optionUpdateDate,
	  option_status optionStatus,
	  option_number optionNumber
	</sql>
 
 	<!-- 查询试卷列表 分页 -->
 	<select id="getOptionByquestionID" resultType="QuestionnaireOption" parameterType="Integer">
 		SELECT 
 			<include refid="allField"></include>
 		FROM tb_iamberry_questionnaire_option 
 		where 
 		option_quesion_id = #{questionID}
 		
		ORDER BY option_order DESC
 	</select>
 	<!-- 查询试卷总数 -->
 	<select id="getQuestionnaireOptionCount" resultType="Integer">
 		SELECT COUNT(1) FROM tb_iamberry_questionnaire_option
 	</select>
 
 
</mapper>