| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?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.user.mapper.UserNoteMapper">
- <resultMap type="com.zhongzheng.modules.user.domain.UserNote" id="UserNoteResult">
- <result property="noteId" column="note_id"/>
- <result property="noteText" column="note_text"/>
- <result property="noteDate" column="note_date"/>
- <result property="courseId" column="course_id"/>
- <result property="sectionId" column="section_id"/>
- <result property="goodsId" column="goods_id"/>
- <result property="createTime" column="create_time"/>
- <result property="updateTime" column="update_time"/>
- <result property="moduleId" column="module_id"/>
- <result property="chapterId" column="chapter_id"/>
- <result property="gradeId" column="grade_id"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.user.vo.UserNoteVo" id="UserNoteVo">
- <result property="noteId" column="note_id"/>
- <result property="noteText" column="note_text"/>
- <result property="noteDate" column="note_date"/>
- <result property="courseId" column="course_id"/>
- <result property="sectionId" column="section_id"/>
- <result property="goodsId" column="goods_id"/>
- <result property="createTime" column="create_time"/>
- <result property="moduleId" column="module_id"/>
- <result property="chapterId" column="chapter_id"/>
- <result property="gradeId" column="grade_id"/>
- <result property="sectionName" column="section_name"/>
- <result property="recordingUrl" column="recording_url"/>
- </resultMap>
- <resultMap type="com.zhongzheng.modules.user.vo.UserDateNoteVo" id="UserDateNoteVo">
- <result property="dateNote" column="date_note"/>
- </resultMap>
- <select id="listDate" parameterType="com.zhongzheng.modules.user.bo.UserNoteQueryBo" resultMap="UserDateNoteVo">
- SELECT
- DISTINCT un.note_date as date_note
- FROM
- user_note un
- WHERE 1=1
- AND un.status = 1
- <if test="goodsId != null and goodsId !='' ">
- AND un.goods_id=#{goodsId}
- </if>
- <!-- <if test="moduleId != null and moduleId !='' ">-->
- <!-- AND un.module_id=#{moduleId}-->
- <!-- </if>-->
- <!-- <if test="courseId != null and courseId !='' ">-->
- <!-- AND un.course_id =#{courseId}-->
- <!-- </if>-->
- <!-- <if test="sectionId != null and sectionId !='' ">-->
- <!-- AND un.section_id =#{sectionId}-->
- <!-- </if>-->
- <!-- <if test="chapterId != null and chapterId !='' ">-->
- <!-- AND un.chapter_id =#{chapterId}-->
- <!-- </if>-->
- <if test="gradeId != null and gradeId !='' ">
- AND un.grade_id =#{gradeId}
- </if>
- <if test="userId != null and userId !='' ">
- AND un.user_id =#{userId}
- </if>
- order by un.note_date desc
- </select>
- <select id="listDateSon" parameterType="com.zhongzheng.modules.user.bo.UserNoteQueryBo" resultMap="UserNoteVo">
- SELECT
- un.*,
- (SELECT cs.`name` FROM course_section cs where cs.section_id = un.section_id) as section_name,
- (SELECT cs.recording_url FROM course_section cs where cs.section_id = un.section_id) as recording_url
- FROM
- user_note un
- WHERE 1=1
- AND un.status = 1
- <if test="goodsId != null and goodsId !='' ">
- AND un.goods_id=#{goodsId}
- </if>
- <!-- <if test="moduleId != null and moduleId !='' ">-->
- <!-- AND un.module_id=#{moduleId}-->
- <!-- </if>-->
- <!-- <if test="courseId != null and courseId !='' ">-->
- <!-- AND un.course_id =#{courseId}-->
- <!-- </if>-->
- <!-- <if test="sectionId != null and sectionId !='' ">-->
- <!-- AND un.section_id =#{sectionId}-->
- <!-- </if>-->
- <!-- <if test="chapterId != null and chapterId !='' ">-->
- <!-- AND un.chapter_id =#{chapterId}-->
- <!-- </if>-->
- <if test="gradeId != null and gradeId !='' ">
- AND un.grade_id =#{gradeId}
- </if>
- <if test="userId != null and userId !='' ">
- AND un.user_id =#{userId}
- </if>
- <if test="noteDate != null and noteDate !='' ">
- AND un.note_date =#{noteDate}
- </if>
- order by un.note_date desc
- </select>
- </mapper>
|