Commit 11ba99cc by 阳浪

咨询查询所有

parent 80bc6e75
...@@ -25,6 +25,8 @@ public interface InformationMapper extends BaseMapper<Information> { ...@@ -25,6 +25,8 @@ public interface InformationMapper extends BaseMapper<Information> {
List<Information> informationTwoList(InfomationParamVO vo, Page<Information> page); List<Information> informationTwoList(InfomationParamVO vo, Page<Information> page);
List<Information> informationAllList(InfomationParamVO vo, Page<Information> page);
List<Information> informationThreeList(InfomationParamVO vo, Page<Information> page); List<Information> informationThreeList(InfomationParamVO vo, Page<Information> page);
List<AnnouncementVO> selectAnnouncement(Page<AnnouncementVO> page, Map<String, Object> map); List<AnnouncementVO> selectAnnouncement(Page<AnnouncementVO> page, Map<String, Object> map);
......
...@@ -921,19 +921,23 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor ...@@ -921,19 +921,23 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
infomationParamVO.setState(2); infomationParamVO.setState(2);
Page<Information> page = new Page<Information>(vo.getPageNo(), vo.getPageSize()); Page<Information> page = new Page<Information>(vo.getPageNo(), vo.getPageSize());
List<Information> list = Lists.newArrayList(); List<Information> list = Lists.newArrayList();
if (selectById == null) { if(vo.getTypeId()==null||vo.getTypeId()==0L){
return null; list = informationMapper.informationAllList(infomationParamVO, page);
} }else {
if (selectById.getName().equals(SiteConstant.ANNOUNCEMENT) && selectById.getParentId() == 0) { //公告 if (selectById == null) {
list = informationMapper.informationFirstList(infomationParamVO, page); return null;
} else if (selectById.getParentId() == 0) {//新闻所有列表 }
list = informationMapper.informationFirstList(infomationParamVO, page); if (selectById.getName().equals(SiteConstant.ANNOUNCEMENT) && selectById.getParentId() == 0) { //公告
} else { list = informationMapper.informationFirstList(infomationParamVO, page);
DataClassification selectByParentId = dataClassificationService.selectById(selectById.getParentId()); } else if (selectById.getParentId() == 0) {//新闻所有列表
if(selectByParentId==null || selectById.getParentId() == 0){ list = informationMapper.informationFirstList(infomationParamVO, page);
list = informationMapper.informationTwoList(infomationParamVO, page);//新闻分类列表 } else {
}else{ DataClassification selectByParentId = dataClassificationService.selectById(selectById.getParentId());
list = informationMapper.informationThreeList(infomationParamVO, page);//新闻分类列表 if (selectByParentId == null || selectById.getParentId() == 0) {
list = informationMapper.informationTwoList(infomationParamVO, page);//新闻分类列表
} else {
list = informationMapper.informationThreeList(infomationParamVO, page);//新闻分类列表
}
} }
} }
if (list.size() > 0 && list != null) { if (list.size() > 0 && list != null) {
...@@ -985,20 +989,24 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor ...@@ -985,20 +989,24 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
Page<Information> page = new Page<Information>(vo.getPageNo(), vo.getPageSize()); Page<Information> page = new Page<Information>(vo.getPageNo(), vo.getPageSize());
List<Information> list = null; List<Information> list = null;
DataClassification selectById = dataClassificationService.selectById(vo.getTypeId()); if(vo.getTypeId()==null||vo.getTypeId()==0L){
if (selectById == null) { list = informationMapper.informationAllList(vo, page);
return null; }else {
} DataClassification selectById = dataClassificationService.selectById(vo.getTypeId());
if (selectById.getName().equals(SiteConstant.ANNOUNCEMENT) && selectById.getParentId() == 0) { //公告 if (selectById == null) {
list = informationMapper.informationFirstList(vo, page); return null;
} else if (selectById.getParentId() == 0) {//新闻所有列表 }
list = informationMapper.informationFirstList(vo, page); if (selectById.getName().equals(SiteConstant.ANNOUNCEMENT) && selectById.getParentId() == 0) { //公告
} else { list = informationMapper.informationFirstList(vo, page);
DataClassification selectByParentId = dataClassificationService.selectById(selectById.getParentId()); } else if (selectById.getParentId() == 0) {//新闻所有列表
if(selectByParentId==null || selectById.getParentId() == 0){ list = informationMapper.informationFirstList(vo, page);
list = informationMapper.informationTwoList(vo, page);//新闻分类列表 } else {
}else{ DataClassification selectByParentId = dataClassificationService.selectById(selectById.getParentId());
list = informationMapper.informationThreeList(vo, page);//新闻分类列表 if (selectByParentId == null || selectById.getParentId() == 0) {
list = informationMapper.informationTwoList(vo, page);//新闻分类列表
} else {
list = informationMapper.informationThreeList(vo, page);//新闻分类列表
}
} }
} }
if (list.size() > 0 && list != null) { if (list.size() > 0 && list != null) {
......
...@@ -96,6 +96,25 @@ ...@@ -96,6 +96,25 @@
order by a.is_top desc, a.create_time desc order by a.is_top desc, a.create_time desc
</select> </select>
<select id="informationAllList" resultType="com.yizhi.site.application.domain.Information">
<!-- select a.* from information a left join data_classification b on a.type_two=b.id
where 1=1 and a.site_id=#{siteId} and b.site_id=#{siteId} and b.name=#{name} -->
select a.* from information a where 1=1 and a.site_id=#{siteId}
<if test="fileName != null and fileName != ''">
and (a.file_name like CONCAT('%', '${fileName}', '%' ) or a.key_words like CONCAT('%', '${fileName}', '%' ) )
</if>
<!-- <if test="keyWords != null and keyWords != ''">-->
<!-- and a.key_words like CONCAT('%', '${keyWords}', '%' )-->
<!-- </if>-->
<if test="start != null">
and a.release_time >= #{start}
</if>
<if test="end != null">
and #{end} >= a.release_time
</if>
order by a.is_top desc, a.create_time desc
</select>
<select id="informationPageList" resultType="com.yizhi.site.application.vo.site.InformationStudentVO"> <select id="informationPageList" resultType="com.yizhi.site.application.vo.site.InformationStudentVO">
SELECT SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment