|
@@ -22,8 +22,9 @@
|
|
|
|
|
|
|
|
|
<select id="getDetailByModule" parameterType="java.util.Map" resultMap="BaseResultMap">
|
|
|
- select DISTINCT t1.* from
|
|
|
- icss_module_detail t1 left join icss_question_info t2 on (t1.question_id = t2.id or t1.question_id is null)
|
|
|
+ select t3.* from
|
|
|
+ (select DISTINCT t1.* from
|
|
|
+ icss_module_detail t1 left join icss_question_info t2 on t1.question_id = t2.id
|
|
|
where t1.is_deleted = 'N' and t2.is_deleted = 'N'
|
|
|
and t1.module_id in
|
|
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
@@ -36,7 +37,14 @@
|
|
|
<![CDATA[ and t2.age_begin <= #{age} ]]>
|
|
|
<![CDATA[ and t2.age_end >= #{age} ]]>
|
|
|
</if>
|
|
|
- order by t1.module_id, t1.order_no
|
|
|
+ union
|
|
|
+ select DISTINCT t1.* from
|
|
|
+ icss_module_detail t1 where t1.question_id is null and t1.is_deleted = 'N'
|
|
|
+ and t1.module_id in
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>) t3
|
|
|
+ order by t3.module_id, t3.order_no
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|