<?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.qmth.distributed.print.business.mapper.ObeCourseTargetMapper">

    <select id="findCourseTargetList"
            resultType="com.qmth.distributed.print.business.bean.result.ObeCourseTargetResult">
        SELECT
            oct.id AS id,
            oct.target_name AS targetName,
            oct.expect_value AS expectValue,
            oct.degree_requirement AS degreeRequirement,
            oct.total_weight AS totalWeight,
            ocpr.id AS obeCultureProgramRequirementId,
            ocpr.name AS obeCultureProgramRequirementName,
            ocpr.content AS obeCultureProgramRequirementContent
        FROM
            obe_course_target oct
                LEFT JOIN
            obe_culture_program_requirement ocpr ON oct.obe_culture_program_requirement_id = ocpr.id
        <where>
            <if test="obeCourseOutlineId != null">
                oct.obe_course_outline_id = #{obeCourseOutlineId}
            </if>
        </where>
    </select>
</mapper>
