yonge 4 年之前
父节点
当前提交
eda3cc2d49
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

+ 2 - 1
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -186,7 +186,7 @@
 	<!-- 分页查询 -->
 	<select id="queryHomePage" resultMap="SysNewsInformation"
 		parameterType="map">
-		SELECT sni.*,GROUP_CONCAT(s.name_) subject_name_ FROM sys_news_information sni where sni.del_flag_=0
+		SELECT sni.*,GROUP_CONCAT(s.name_) subject_name_ FROM sys_news_information sni left join subject s on find_in_set(s.id_,sni.subject_id_list_) where sni.del_flag_=0
 		<if test="type != null">
 			and sni.type_ = #{type}
 		</if>
@@ -219,6 +219,7 @@
 				</otherwise>
 			</choose>
 		</if>
+		group by sni.id_
 		order by sni.status_ desc,sni.order_ desc,sni.update_time_ desc
 		<include refid="global.limit" />
 	</select>