AND FIND_IN_SET(#{req.subjectCategoryId},( SELECT GROUP_CONCAT( subject_category_id ) FROM sys_subject_specialty WHERE template_details_id = d.id ) )
</if>
<iftest="req.professionalCategoryId != null">
AND FIND_IN_SET(#{req.professionalCategoryId},( SELECT GROUP_CONCAT( professional_category_id ) FROM sys_subject_specialty WHERE template_details_id = d.id ) )
</if>
<iftest="req.majorId != null">
AND FIND_IN_SET(#{req.majorId},( SELECT GROUP_CONCAT( major_id ) FROM sys_subject_specialty WHERE template_details_id = d.id ) )
</if>
<iftest="req.keyWord!=null and req.keyWord!=''">
and d.NAME LIKE CONCAT('%',#{req.keyWord},'%')
</if>
<iftest="req.categoryId != null and req.categoryId != ''">