CourseAdministerMappingMapper.xml 1.23 KB
<?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.meishu.mapper.CourseAdministerMappingMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.meishu.model.CourseAdministerMappingDO">
        <id column="id" property="id" />
        <result column="create_date" property="createTime" />
        <result column="update_date" property="updateTime" />
        <result column="delete_date" property="deleteTime" />
        <result column="course_id" property="courseId" />
        <result column="administer_id" property="administerId" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        create_date,
        update_date,
        delete_date,
        id, course_id, administer_id
    </sql>


    <select id="getAdminister" resultType="com.meishu.model.AdministerDO">
        SELECT
            t2.*
        FROM
            course_administer_mapping t
            LEFT JOIN administer t2 ON t.administer_id = t2.id
            where t.delete_date is null
            and t2.delete_date is null
            and t.course_id = #{courseId}
    </select>

</mapper>