<?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.QuestionnaireQuestionMapper">
 
	<sql id="allField">
 	  question_id questionId,
	  question_name questionName,
	  question_pic questionPic,
	  question_desc questionDesc,
	  question_type questionType,
	  question_create_date questionUpdateDate,
	  question_create_date questionCreateDate,
	  question_statu questionStatu
	</sql>
 
 	<!-- 查询试卷列表 分页 -->
 	<select id="getQuestionnaireQuestionList" resultType="QuestionnaireQuestion">
 		SELECT 
 			<include refid="allField"></include>
 		FROM tb_iamberry_questionnaire_question
 		WHERE 
 		question_paper_id  is null
		ORDER BY question_create_date DESC
 	</select>
 	<!-- 查询试卷总数 -->
 	<select id="getQuestionnaireQuestionCount" resultType="Integer">
 		SELECT COUNT(1) FROM tb_iamberry_questionnaire_question
 	</select>
 	
</mapper>