提交 949eecec 作者: panda 提交者: 余乾开

行业新闻相关接口

上级 4418d203
package com.mmc.csf.release.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.infomation.qo.IndustryCaseQO;
import com.mmc.csf.infomation.qo.IndustryNewsQO;
......@@ -9,14 +15,11 @@ import com.mmc.csf.release.model.group.Create;
import com.mmc.csf.release.model.group.Page;
import com.mmc.csf.release.model.group.Update;
import com.mmc.csf.release.service.IndustryNewsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* @author: zj
......
package com.mmc.csf.release.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.mmc.csf.infomation.qo.IndustryCaseQO;
import com.mmc.csf.infomation.qo.IndustryNewsQO;
import com.mmc.csf.release.entity.information.IndustryNewsDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author: zj
......
package com.mmc.csf.release.service;
import javax.servlet.http.HttpServletRequest;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.infomation.qo.IndustryCaseQO;
import com.mmc.csf.infomation.qo.IndustryNewsQO;
import com.mmc.csf.infomation.vo.IndustryNewsDTO;
import com.mmc.csf.infomation.vo.IndustryNewsVO;
import javax.servlet.http.HttpServletRequest;
/**
* @author: zj
......
package com.mmc.csf.release.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mmc.csf.common.util.page.PageResult;
import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.common.util.web.ResultEnum;
......@@ -12,13 +21,6 @@ import com.mmc.csf.release.dao.IndustryNewsDao;
import com.mmc.csf.release.entity.information.IndustryNewsDO;
import com.mmc.csf.release.feign.UserAppApi;
import com.mmc.csf.release.service.IndustryNewsService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author: zj
......
......@@ -139,6 +139,96 @@
<select id="backgroundListNewsPage" parameterType="com.mmc.csf.infomation.qo.IndustryNewsQO"
resultType="com.mmc.csf.release.entity.information.IndustryNewsDO">
select id,
news_title,
news_author,
user_account_id,
surface_img,
news_contents,
origin,
create_time,
update_time
from industry_news
where is_deleted = 0
and id = #{id}
</select>
<select id="count" resultType="java.lang.Integer" parameterType="com.mmc.csf.release.entity.IndustryNewsDO">
select count(*)
from industry_news
<where>
is_deleted = 0
<if test="newsTitle != null and newsTitle != ''">
and news_title = #{newsTitle}
</if>
<if test="newsAuthor != null and newsAuthor != ''">
and news_author = #{newsAuthor}
</if>
<if test="userAccountId != null">
and user_account_id = #{userAccountId}
</if>
<if test="surfaceImg != null and surfaceImg != ''">
and surface_img = #{surfaceImg}
</if>
<if test="newsContents != null and newsContents != ''">
and news_contents = #{newsContents}
</if>
<if test="origin != null and origin != ''">
and origin = #{origin}
</if>
</where>
</select>
<insert id="insert" parameterType="com.mmc.csf.release.entity.IndustryNewsDO" useGeneratedKeys="true"
keyColumn="id">
insert into industry_news(news_title, news_author, user_account_id, surface_img, news_contents, origin,
create_time)
values (#{newsTitle}, #{newsAuthor}, #{userAccountId}, #{surfaceImg}, #{newsContents}, #{origin}, now())
</insert>
<update id="update" parameterType="com.mmc.csf.release.entity.IndustryNewsDO">
update industry_news
<set>
<if test="newsTitle != null and newsTitle != ''">
news_title = #{newsTitle},
</if>
<if test="newsAuthor != null and newsAuthor != ''">
news_author = #{newsAuthor},
</if>
<if test="userAccountId != null">
user_account_id = #{userAccountId},
</if>
<if test="surfaceImg != null and surfaceImg != ''">
surface_img = #{surfaceImg},
</if>
<if test="newsContents != null">
news_contents = #{newsContents},
</if>
<if test="origin != null and origin != ''">
origin = #{origin},
</if>
</set>
where is_deleted = 0 and id = #{id}
</update>
<select id="countPage" parameterType="com.mmc.csf.infomation.qo.IndustryNewsQO" resultType="java.lang.Integer">
select count(*)
from industry_news
<where>
is_deleted = 0
<if test="newsTitle != null and newsTitle != ''">
and news_title like concat('%',#{newsTitle},'%')
</if>
<if test="startTime != null">
and create_time &gt;= #{startTime}
</if>
<if test="endTime != null">
and create_time &lt;= #{endTime}
</if>
</where>
</select>
<select id="backgroundListNewsPage" parameterType="com.mmc.csf.infomation.qo.IndustryNewsQO"
resultType="com.mmc.csf.release.entity.IndustryNewsDO">
select id,
news_title,
news_author,
user_account_id,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论