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

    <select id="obeCourseRequirementReportList" resultType="com.qmth.distributed.print.business.bean.result.ObeCourseRequirementListResult">
        select t.id,
               t.culture_program_id as cultureProgramId,
               ocp.name as obeCultureProgramName,
               bp.name as professionalName,
               t.requirement_degree as requirementDegree
                from obe_course_requirement_report t
        left join obe_culture_program ocp on ocp.id = t.culture_program_id
        left join basic_professional bp on bp.id = ocp.professional_id
        <where>
            <if test="professionalId != null and professionalId != ''">
                and ocp.professional_id = #{professionalId}
            </if>
            <if test="cultureProgramName != null and cultureProgramName != ''">
                and ocp.name like concat('%',#{cultureProgramName},'%')
            </if>
        </where>
    </select>
</mapper>
