<?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.ZjkLearningToolMapper">
    <select id="queryById" resultType="org.dromara.zjk.learning_world.domain.vo.ZjkLearningToolVo">
        SELECT
        zlt."id",
        zlt."name",
        zlt.attachment,
        zlt.status,
        zlt.remark,
        zlt.takedown_time,
        so.original_name,
        so.url
        FROM
        zjk_learning_tool zlt
        LEFT JOIN sys_oss so ON so.oss_id = zlt.attachment
        where  zlt.id=#{id}
    </select>

<!--auto generated by MybatisCodeHelper on 2025-01-06-->
    <select id="selectByAll" resultType="org.dromara.zjk.learning_world.domain.vo.ZjkLearningToolVo">
        SELECT
        zlt."id",
        zlt."name",
        zlt.attachment,
        zlt.status,
        zlt.remark,
        zlt.takedown_time,
        so.original_name,
        so.url
        FROM
        zjk_learning_tool zlt
        LEFT JOIN sys_oss so ON so.oss_id = zlt.attachment
        <where>
            <if test="bo.name != null and bo.name !=''">
                and zlt."name" like '%' || #{bo.name} || '%'
            </if>
        </where>
    </select>
</mapper>
