|
@@ -42,6 +42,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
+ <resultMap type="com.zhongzheng.modules.goods.vo.GoodsCourseMoreVo" id="CourseMoreResultVo">
|
|
|
+ <result property="goodsId" column="goods_id"/>
|
|
|
+ <collection property="courseList" column="goods_id" select="findCourseList"/>
|
|
|
+ </resultMap>
|
|
|
|
|
|
|
|
|
<select id="getList" parameterType="Long" resultMap="CourseResultVo">
|
|
@@ -66,4 +70,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE
|
|
|
gc.goods_id = #{goodsId} AND c.`status` = 1
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectListMore" parameterType="com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo" resultMap="CourseMoreResultVo">
|
|
|
+ SELECT
|
|
|
+ g.goods_id
|
|
|
+ FROM
|
|
|
+ goods g
|
|
|
+ WHERE
|
|
|
+ 1=1
|
|
|
+ <if test="goodsIds != null and goodsIds.size()!=0 ">
|
|
|
+ AND g.goods_id in
|
|
|
+ <foreach collection="goodsIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findCourseList" resultMap="CourseResultVo">
|
|
|
+ SELECT
|
|
|
+ c.*,
|
|
|
+ cet.education_name,
|
|
|
+ cpt.project_name,
|
|
|
+ cb.business_name,
|
|
|
+ s.school_name,
|
|
|
+ m.category_name,
|
|
|
+ cs.subject_name,
|
|
|
+ gc.sort as g_sort
|
|
|
+ FROM
|
|
|
+ goods_course gc
|
|
|
+ LEFT JOIN course c ON gc.course_id = c.course_id
|
|
|
+ LEFT JOIN course_education_type cet ON c.education_type_id = cet.id
|
|
|
+ LEFT JOIN course_project_type cpt ON c.project_id = cpt.id
|
|
|
+ LEFT JOIN course_business cb ON c.business_id = cb.id
|
|
|
+ LEFT JOIN school s ON s.id = c.school_id
|
|
|
+ LEFT JOIN major m ON c.major_id = m.id
|
|
|
+ LEFT JOIN course_subject cs ON cs.id = c.subject_id
|
|
|
+ WHERE
|
|
|
+ gc.goods_id = #{goods_id} AND c.`status` = 1
|
|
|
+ </select>
|
|
|
</mapper>
|