<?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.hxhq.business.mapper.StudyMethodMapper">
    <select id="queryList" resultType="com.hxhq.business.domain.StudyMethod">
        SELECT m.*, IFNULL(r.id, 0) AS zt FROM t_study_method m
        LEFT JOIN ( SELECT * FROM t_study_method_read WHERE qmr_id = #{qmrId}) r ON m.id = r.study_method_id
        <if test="ew.sqlSegment != '' and ew.sqlSegment != null">
            <where>
                ${ew.sqlSegment}
            </where>
        </if>
    </select>
</mapper>