|
@@ -127,6 +127,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN school s ON s.id = g.school_id
|
|
LEFT JOIN school s ON s.id = g.school_id
|
|
|
LEFT JOIN major m ON g.major_id = m.id
|
|
LEFT JOIN major m ON g.major_id = m.id
|
|
|
LEFT JOIN order_input_template ot ON cb.template_status = ot.id
|
|
LEFT JOIN order_input_template ot ON cb.template_status = ot.id
|
|
|
|
|
+ <if test="goodsType ==1 and subjectId >0">
|
|
|
|
|
+ LEFT JOIN goods_course gc ON gc.goods_id = g.goods_id
|
|
|
|
|
+ LEFT JOIN course c ON gc.course_id = c.course_id
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="goodsType ==2 and subjectId >0">
|
|
|
|
|
+ LEFT JOIN goods_attached ga on g.goods_id = ga.goods_id
|
|
|
|
|
+ LEFT JOIN question_business qb on ga.major_id = qb.major_id
|
|
|
|
|
+ </if>
|
|
|
WHERE
|
|
WHERE
|
|
|
1 = 1
|
|
1 = 1
|
|
|
<if test="status != null and status.size()!=0 ">
|
|
<if test="status != null and status.size()!=0 ">
|
|
@@ -171,6 +179,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="studyStartTime != null and studyStartTime != '' and studyEndTime != null and studyEndTime != ''">
|
|
<if test="studyStartTime != null and studyStartTime != '' and studyEndTime != null and studyEndTime != ''">
|
|
|
and #{studyStartTime} BETWEEN g.validity_start_time and g.validity_end_time or #{studyEndTime} BETWEEN g.validity_start_time and g.validity_end_time
|
|
and #{studyStartTime} BETWEEN g.validity_start_time and g.validity_end_time or #{studyEndTime} BETWEEN g.validity_start_time and g.validity_end_time
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="goodsType ==1 and subjectId >0">
|
|
|
|
|
+ AND c.`status` = 1
|
|
|
|
|
+ AND c.subject_id = #{subjectId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="goodsType ==2 and subjectId >0">
|
|
|
|
|
+ AND ((
|
|
|
|
|
+ qb.type = 4
|
|
|
|
|
+ AND ga.type = 1
|
|
|
|
|
+ )
|
|
|
|
|
+ OR ( qb.type = 3 AND ga.type = 2 )
|
|
|
|
|
+ OR ( qb.type = 2 AND ga.type = 3 )) AND qb.subject_id = #{subjectId}
|
|
|
|
|
+ </if>
|
|
|
ORDER BY g.update_time DESC
|
|
ORDER BY g.update_time DESC
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|