<?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.QuestionCollectionMapper">

    <resultMap type="QuestionCollection" id="QuestionCollectionResult">
        <result property="id"    column="id"    />
        <result property="userId"    column="user_id"    />
        <result property="questionId"    column="question_id"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectQuestionCollectionVo">
        select * from question_collection
    </sql>

    <select id="selectQuestionCollectionList"  parameterType="QuestionCollectionListDTO" resultMap="QuestionCollectionResult">
        <include refid="selectQuestionCollectionVo"/>
        <where>
            <if test="userId != null and userId !='' "> and user_id = #{userId}</if>
            <if test="questionId != null and questionId !=''  "> and question_id = #{questionId}</if>
            <if test="km != null and km !='' "> and km = #{km}</if>
            <if test="carType != null and carType !='' "> and car_type = #{carType}</if>
        </where>
    </select>

</mapper>
