<?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.zhongzheng.modules.course.mapper.CoursePhotoLogMapper">

    <resultMap type="com.zhongzheng.modules.course.domain.CoursePhotoLog" id="CoursePhotoLogResult">
        <result property="id" column="id"/>
        <result property="sectionId" column="section_id"/>
        <result property="photo" column="photo"/>
        <result property="photoTime" column="photo_time"/>
        <result property="userId" column="user_id"/>
        <result property="photoNum" column="photo_num"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
        <result property="status" column="status"/>
        <result property="goodsId" column="goods_id"/>
        <result property="photoIndex" column="photo_index"/>
        <result property="gradeId" column="grade_id"/>
    </resultMap>

    <resultMap type="com.zhongzheng.modules.course.vo.CoursePhotoLogVo" id="CoursePhotoLogVoResult">
        <result property="id" column="id"/>
        <result property="sectionId" column="section_id"/>
        <result property="photo" column="photo"/>
        <result property="photoTime" column="photo_time"/>
        <result property="userId" column="user_id"/>
        <result property="photoNum" column="photo_num"/>
        <result property="status" column="status"/>
        <result property="goodsId" column="goods_id"/>
        <result property="photoIndex" column="photo_index"/>
        <result property="gradeId" column="grade_id"/>
    </resultMap>

    <select id="getLastInfo" parameterType="com.zhongzheng.modules.course.bo.CoursePhotoLogQueryBo"  resultMap="CoursePhotoLogVoResult">
        SELECT
            *
        FROM
            course_photo_log
        WHERE
            user_id = #{userId}
          AND goods_id = #{goodsId}
          AND grade_id = #{gradeId}
          AND section_id = #{sectionId}
    </select>

</mapper>
