<?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.expert.expertAwards.mapper.ZjkExpertAwardsMapper">

    <sql id="Base_Column_List">
        zea.id,
        zea.expert_id,
        zea.awards_path,
        zea.awards_content,
        zea.del_flag,
        zea.register_sn,
        zea.tenant_id,
        zea.create_dept,
        zea.create_by,
        zea.create_time,
        zea.update_by,
        zea.update_time
    </sql>

    <select id="selectByExpertId" resultType="org.dromara.zjk.expert.expertAwards.domain.ZjkExpertAwards">

        SELECT
        <include refid="Base_Column_List"/>,
        so.original_name,
        so.file_suffix,
        so.url
        FROM
        zjk_expert_awards zea
        LEFT JOIN sys_oss so ON so.oss_id = zea.awards_path
        <where>
            <if test="expertId != null">
                and zea.expert_id=#{expertId}
            </if>
        </where>
        ORDER BY zea.id
    </select>
</mapper>


