|
|
@@ -247,31 +247,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="validityStartTime != null or validityEndTime != null ">
|
|
|
AND (#{validityStartTime} BETWEEN g.validity_start_time and g.validity_end_time or #{validityEndTime} BETWEEN g.validity_start_time and g.validity_end_time)
|
|
|
</if>
|
|
|
- <if test="goodsType ==1 and subjectId >0">
|
|
|
- AND (SELECT count(*) from goods_course gc LEFT JOIN course c ON gc.course_id = c.course_id where gc.goods_id = g.goods_id and c.`status` = 1
|
|
|
- AND c.subject_id = #{subjectId}) >0
|
|
|
+ <if test="subjectId != null and subjectId >0">
|
|
|
+ AND FIND_IN_SET(g.subject_ids, #{subjectId})
|
|
|
</if>
|
|
|
<if test="goodsType ==1 and haveCourse != null and haveCourse == 1">
|
|
|
AND (SELECT count(*) from goods_course gc LEFT JOIN course c ON gc.course_id = c.course_id where gc.goods_id = g.goods_id and c.`status` = 1
|
|
|
) >0
|
|
|
</if>
|
|
|
- <if test="goodsType ==2 and subjectId >0">
|
|
|
- AND g.goods_id in(
|
|
|
- SELECT
|
|
|
- ga.goods_id
|
|
|
- FROM
|
|
|
- goods_attached ga
|
|
|
- LEFT JOIN question_business qb ON ga.major_id = qb.major_id
|
|
|
- WHERE
|
|
|
- ((
|
|
|
- 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>
|
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
|
<if test="sortType != null and sortType == 2">
|
|
|
@@ -373,31 +355,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="validityStartTime != null or validityEndTime != null ">
|
|
|
AND (#{validityStartTime} BETWEEN g.validity_start_time and g.validity_end_time or #{validityEndTime} BETWEEN g.validity_start_time and g.validity_end_time)
|
|
|
</if>
|
|
|
- <if test="goodsType ==1 and subjectId >0">
|
|
|
- AND (SELECT count(*) from goods_course gc LEFT JOIN course c ON gc.course_id = c.course_id where gc.goods_id = g.goods_id and c.`status` = 1
|
|
|
- AND c.subject_id = #{subjectId}) >0
|
|
|
+ <if test="subjectId != null and subjectId >0">
|
|
|
+ AND FIND_IN_SET( g.subject_ids, #{subjectId} )
|
|
|
</if>
|
|
|
<if test="goodsType ==1 and haveCourse != null and haveCourse == 1">
|
|
|
AND (SELECT count(*) from goods_course gc LEFT JOIN course c ON gc.course_id = c.course_id where gc.goods_id = g.goods_id and c.`status` = 1
|
|
|
) >0
|
|
|
</if>
|
|
|
- <if test="goodsType ==2 and subjectId >0">
|
|
|
- AND g.goods_id in(
|
|
|
- SELECT
|
|
|
- ga.goods_id
|
|
|
- FROM
|
|
|
- goods_attached ga
|
|
|
- LEFT JOIN question_business qb ON ga.major_id = qb.major_id
|
|
|
- WHERE
|
|
|
- ((
|
|
|
- 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>
|
|
|
<if test="sortType != null and sortType == 2">
|
|
|
ORDER BY g.stand_price
|
|
|
</if>
|