|
@@ -157,14 +157,16 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="queryPageByIdOrName" resultMap="Subject">
|
|
|
- SELECT * FROM `subject`
|
|
|
+ SELECT *,
|
|
|
+ (select name_ from `subject` s1 where s.parent_subject_id_ = s1.id_) as parentSubjectName
|
|
|
+ FROM `subject` s
|
|
|
<where>
|
|
|
- del_flag_ = 0 AND parent_subject_id_ != 0
|
|
|
+ s.del_flag_ = 0 AND s.parent_subject_id_ != 0
|
|
|
<if test="parentSubjectId != null and parentSubjectId != ''">
|
|
|
- AND parent_subject_id_ = #{parentSubjectId}
|
|
|
+ AND s.parent_subject_id_ = #{parentSubjectId}
|
|
|
</if>
|
|
|
<if test="search != null and search != ''">
|
|
|
- AND (id_ = #{search} or name_ like concat('%', #{search}, '%'))
|
|
|
+ AND (s.id_ = #{search} or s.name_ like concat('%', #{search}, '%'))
|
|
|
</if>
|
|
|
</where>
|
|
|
<include refid="global.limit"/>
|