<?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="com.miaxis.question.mapper.TAppExamRuleMapper">

    <resultMap type="TAppExamRule" id="TAppExamRuleResult">
        <result property="id"    column="id"    />
        <result property="gs"    column="gs"    />
        <result property="kemu"    column="kemu"    />
        <result property="chapterId"    column="chapter_id"    />
        <result property="totalCount"    column="total_count"    />
        <result property="judgeCount"    column="judge_count"    />
        <result property="choiceCount"    column="choice_count"    />
        <result property="multipleChoiceCount"    column="multiple_choice_count"    />
        <result property="difficultCount"    column="difficult_count"    />
        <result property="areacode"    column="areacode"    />
        <result property="cityId"    column="city_id"    />
    </resultMap>

    <sql id="selectTAppExamRuleVo">
        select * from t_app_exam_rule
    </sql>

    <select id="selectTAppExamRuleList" parameterType="TAppExamRule" resultMap="TAppExamRuleResult">
        <include refid="selectTAppExamRuleVo"/>
        <where>
            <if test="gs != null  and gs != ''"> and gs = #{gs}</if>
            <if test="kemu != null "> and kemu = #{kemu}</if>
            <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
            <if test="totalCount != null "> and total_count = #{totalCount}</if>
            <if test="judgeCount != null "> and judge_count = #{judgeCount}</if>
            <if test="choiceCount != null "> and choice_count = #{choiceCount}</if>
            <if test="multipleChoiceCount != null "> and multiple_choice_count = #{multipleChoiceCount}</if>
            <if test="difficultCount != null "> and difficult_count = #{difficultCount}</if>
            <if test="areacode != null "> and areacode = #{areacode}</if>
            <if test="cityId != null "> and city_id = #{cityId}</if>
        </where>
    </select>

</mapper>
