<?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.mapper.ZjkLearningMaterialsMapper">
        <select id="selectVoByUserId" resultType="java.lang.String">
            select nick_name from sys_user where user_id = #{createBy}
        </select>

        <select id="selectByAll" resultType="org.dromara.zjk.domain.vo.ZjkLearningMaterialsVo">
            SELECT
                zlm.* ,
                su.nick_name as createName
            FROM
                zjk_learning_materials zlm
                LEFT JOIN sys_user su ON su.user_id = zlm.create_by
            <where>
                <if test="bo.materialsName != null and bo.materialsName != ''">
                    and zlm.materials_name like '%' || #{bo.materialsName} || '%'
                </if>
                <if test="bo.startTime!=null  and bo.endTime != null">
                    and zlm.create_time >= #{bo.startTime}  and zlm.create_time &lt;= #{bo.endTime}
                </if>
            </where>
    </select>
</mapper>
