MemberMapper.xml 1.6 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.subsidy.mapper.MemberMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.subsidy.model.MemberDO">
        <id column="id" property="id" />
        <result column="create_date" property="createDate" />
        <result column="update_date" property="updateDate" />
        <result column="delete_date" property="deleteDate" />
        <result column="user_name" property="userName" />
        <result column="telephone" property="telephone" />
        <result column="password" property="password" />
        <result column="gender" property="gender" />
        <result column="image" property="image" />
        <result column="id_card" property="idCard" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        create_date,
        update_date,
        delete_date,
        id, user_name, telephone, password, gender, image, id_card
    </sql>

    <select id="studyPage" parameterType="com.subsidy.model.MemberDO" resultType="com.subsidy.vo.member.StudyPageVO">
        SELECT
            t3.id,
            t2.id as classId,
            t3.course_name,
            t2.end_date
        FROM
            class_member_mapping t
            LEFT JOIN class_dict t2 ON t.class_id = t2.id
            left join course_dict t3 on t2.course_id = t3.id
        WHERE
            t.delete_date IS NULL
            AND t2.delete_date IS NULL
            AND t.member_id = #{id}
    </select>

</mapper>