|
|
@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="chapterId" column="chapter_id"/>
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
+ <result property="goodsId" column="goods_id"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zhongzheng.modules.user.vo.UserCourseAnswerVo" id="UserCourseAnswerVo">
|
|
|
@@ -31,19 +32,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="assignRealname" column="assign_realname"/>
|
|
|
<result property="assignAvatar" column="assign_avatar"/>
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
+ <result property="goodsId" column="goods_id"/>
|
|
|
+ <result property="educationName" column="education_name"/>
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
+ <result property="businessName" column="business_name"/>
|
|
|
+ <result property="goodsName" column="goods_name"/>
|
|
|
+ <result property="courseName" column="course_name"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectAnswer" parameterType="com.zhongzheng.modules.user.bo.UserCourseAnswerQueryBo" resultMap="UserCourseAnswerVo">
|
|
|
SELECT
|
|
|
- * ,
|
|
|
- (SELECT u.realname FROM `user` u where uca.user_id = u.user_id) realname,
|
|
|
- (SELECT u.realname FROM `user` u where uca.assign_user_id = u.user_id) assign_realname,
|
|
|
- (SELECT u.avatar FROM `user` u where uca.assign_user_id = u.user_id) assign_avatar,
|
|
|
- (SELECT u.avatar FROM `user` u where uca.user_id = u.user_id) avatar
|
|
|
+ uca.*,
|
|
|
+ u.realname,
|
|
|
+ u.avatar,
|
|
|
+ u2.realname assign_realname,
|
|
|
+ u2.avatar assign_avatar
|
|
|
+ <if test="msgType != null">
|
|
|
+ ,g.goods_name,
|
|
|
+ c.course_name,
|
|
|
+ cet.education_name,
|
|
|
+ cpt.project_name,
|
|
|
+ cb.business_name
|
|
|
+ </if>
|
|
|
FROM
|
|
|
- user_course_answer uca
|
|
|
- WHERE 1=1
|
|
|
- AND uca.status=1
|
|
|
+ user_course_answer uca
|
|
|
+ LEFT JOIN `user` u ON uca.user_id = u.user_id
|
|
|
+ LEFT JOIN `user` u2 ON uca.assign_user_id = u2.user_id
|
|
|
+ <if test="msgType != null">
|
|
|
+ LEFT JOIN goods g on uca.goods_id = g.goods_id
|
|
|
+ LEFT JOIN course c on c.course_id = uca.course_id
|
|
|
+ LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
|
|
|
+ LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
|
|
|
+ LEFT JOIN course_business cb ON g.business_id = cb.id
|
|
|
+ </if>
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND uca.STATUS =1
|
|
|
<if test="courseId != null and courseId != ''">
|
|
|
AND uca.course_id = #{courseId}
|
|
|
</if>
|
|
|
@@ -56,5 +80,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="sectionId != null and sectionId != ''">
|
|
|
AND uca.section_id = #{sectionId}
|
|
|
</if>
|
|
|
+ <if test="goodsId != null and goodsId != ''">
|
|
|
+ AND uca.goods_id = #{goodsId}
|
|
|
+ </if>
|
|
|
+ <if test="msgType != null and msgType == 1">
|
|
|
+ AND ISNULL(uca.assign_user_id )
|
|
|
+ </if>
|
|
|
+ <if test="msgType != null and msgType == 2">
|
|
|
+ AND uca.assign_user_id>0
|
|
|
+ </if>
|
|
|
</select>
|
|
|
</mapper>
|