Commit fe0e9419 by 吴迪

Merge remote-tracking branch 'origin/master'

parents ac5f58cd 54ec490a
......@@ -666,4 +666,32 @@ public class NewsController extends AbstractController {
NewsMovieEntity newsMovie = newsMovieService.getById(id);
return R.ok().put("data", newsMovie);
}
/***********************************应用领域*********************************/
/**
*应用领域栏目接口
*/
@RequestMapping("/columnList")
// @RequiresPermissions("manage:newsmovie:info")
public R columnList(){
List<Map<String,Object>> retList = this.newsService.columnList();
return R.ok().put("data", retList);
}
/**
*应用领域列表
*/
@PostMapping("/yylyList")
// @RequiresPermissions("manage:news:list")
public R yylyList(@RequestBody NewsParams newsParams) {
Page<NewsEntity> page = this.newsService.selectYylyList(newsParams,
new Page(newsParams.getPage(), newsParams.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
}
......@@ -103,4 +103,8 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewtopicEntity> sdztList(NewsParams newsParams, Page page);
List<NewsMovieEntity> jcspList(NewsParams newsParams, Page page);
List<Map<String, Object>> columnList();
List<NewsEntity> selectYylyList(@Param("newsParams") NewsParams newsParams, Page page);
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......@@ -182,6 +183,7 @@ public class ProductEntity implements Serializable {
*/
private String auditor;
@TableField(exist = false)
private String categoryName;
}
......@@ -101,5 +101,9 @@ public interface NewsService extends IService<NewsEntity> {
Page<NewtopicEntity> sdztList(NewsParams newsParams, Page page);
Page<NewsMovieEntity> jcspList(NewsParams newsParams, Page page);
List<Map<String, Object>> columnList();
Page<NewsEntity> selectYylyList(NewsParams newsParams, Page page);
}
......@@ -598,5 +598,21 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return page;
}
@Override
public List<Map<String, Object>> columnList() {
List<Map<String, Object>> retList = this.newsDao.columnList();
retList.stream().forEach(item->{
item.put("name",String.valueOf(item.get("name")).trim());
});
return retList;
}
@Override
public Page<NewsEntity> selectYylyList(NewsParams newsParams, Page page) {
List<NewsEntity> list = this.newsDao.selectYylyList(newsParams,page);
page.setRecords(list);
return page;
}
}
\ No newline at end of file
......@@ -123,7 +123,7 @@
and auditor =#{newsParams.auditor}
</if>
ORDER BY
releasedate DESC
id desc ,releasedate DESC
</select>
......@@ -658,5 +658,58 @@ ORDER BY
id DESC
</select>
<select id="columnList" resultType="java.util.Map">
select * from newsclass where p_id=2
</select>
<select id="selectYylyList" resultMap="newsMap">
SELECT
*
FROM
news
WHERE
(
classid IN (
SELECT
id
FROM
newsclass
WHERE
p_id = 2
)
)
<choose>
<when test="newsParams.levels !=null and newsParams.levels !=''">
AND levels = #{newsParams.levels}
</when>
<otherwise>
AND levels > 0
</otherwise>
</choose>
<if test="newsParams.releaseTimeStart !=null and newsParams.releaseTimeEnd !=null">
and releasedate BETWEEN #{newsParams.releaseTimeStart} AND #{newsParams.releaseTimeEnd}
</if>
<if test="newsParams.updateTimeStart !=null and newsParams.updateTimeEnd !=null">
and updatedate BETWEEN #{newsParams.updateTimeStart} AND #{newsParams.updateTimeEnd}
</if>
<if test="newsParams.keyword !=null and newsParams.keyword !=''">
and keyword like concat('%',#{newsParams.keyword},'%')
</if>
<if test="newsParams.title !=null and newsParams.title !=''">
and title like concat('%',#{newsParams.title},'%')
</if>
<if test="newsParams.author !=null and newsParams.author !=''">
and author like concat('%',#{newsParams.author},'%')
</if>
<if test="newsParams.status !=null">
and status =#{newsParams.status}
</if>
<if test="newsParams.auditor !=null and newsParams.auditor !=''">
and auditor =#{newsParams.auditor}
</if>
<if test="newsParams.editor !=null and newsParams.editor !=''">
and editor =#{newsParams.editor}
</if>
order by id desc
</select>
</mapper>
\ No newline at end of file
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