<?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="org.dromara.zjk.learning_world.mapper.ZjkLearningCourseMapper">


    <select id="queryById" resultType="org.dromara.zjk.learning_world.domain.vo.ZjkLearningCourseVo">
        SELECT
        zlc."id",
        zlc.course_name,
        zlc.course_classify,
        zlc.teaching_type,
        zlc.course_pic,
        zlc.tenant_id,
        zlc.status,
        course_attachment,
        zlc.takedown_time,
        zlc.course_brief,
        zlc.perform_work_id,
        so.original_name,
        so.url
        FROM
        zjk_learning_course zlc
        LEFT JOIN sys_oss so on so.oss_id = zlc.course_attachment
        <where>
            <if test="id != null">
                and zlc.id=#{id}
            </if>
        </where>
    </select>
    <select id="selectIdsByName" resultType="java.lang.Long">
        select id from zjk_learning_course where course_name like '%' || #{courseName} || '%'
    </select>
</mapper>
