Commit 6423c664 authored by 廖旭伟's avatar 廖旭伟

新闻增加视频地址

parent a6881dff
......@@ -88,6 +88,10 @@ public class NewsEntity extends NewsVo {
* 关联公司
*/
private String relatedCompany;
/**
* 视频地址
*/
private String videoUrl;
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -122,5 +126,6 @@ public class NewsEntity extends NewsVo {
this.source = "";
this.remark = "";
this.relatedCompany = "";
this.videoUrl = "";
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ import com.mortals.xhx.module.news.model.NewsEntity;
* 新闻查询对象
*
* @author zxfei
* @date 2025-01-08
* @date 2025-01-09
*/
public class NewsQuery extends NewsEntity {
/** 开始 主键ID,主键,自增长 */
......@@ -213,6 +213,11 @@ public class NewsQuery extends NewsEntity {
/** 关联公司排除列表 */
private List <String> relatedCompanyNotList;
/** 视频地址 */
private List<String> videoUrlList;
/** 视频地址排除列表 */
private List <String> videoUrlNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<NewsQuery> orConditionList;
......@@ -1366,6 +1371,38 @@ public class NewsQuery extends NewsEntity {
this.relatedCompanyNotList = relatedCompanyNotList;
}
/**
* 获取 视频地址
* @return videoUrlList
*/
public List<String> getVideoUrlList(){
return this.videoUrlList;
}
/**
* 设置 视频地址
* @param videoUrlList
*/
public void setVideoUrlList(List<String> videoUrlList){
this.videoUrlList = videoUrlList;
}
/**
* 获取 视频地址
* @return videoUrlNotList
*/
public List<String> getVideoUrlNotList(){
return this.videoUrlNotList;
}
/**
* 设置 视频地址
* @param videoUrlNotList
*/
public void setVideoUrlNotList(List<String> videoUrlNotList){
this.videoUrlNotList = videoUrlNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
......@@ -2045,6 +2082,25 @@ public class NewsQuery extends NewsEntity {
return this;
}
/**
* 设置 视频地址
* @param videoUrl
*/
public NewsQuery videoUrl(String videoUrl){
setVideoUrl(videoUrl);
return this;
}
/**
* 设置 视频地址
* @param videoUrlList
*/
public NewsQuery videoUrlList(List<String> videoUrlList){
this.videoUrlList = videoUrlList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
......@@ -27,6 +27,7 @@
<result property="source" column="source" />
<result property="remark" column="remark" />
<result property="relatedCompany" column="relatedCompany" />
<result property="videoUrl" column="videoUrl" />
</resultMap>
<!-- 表所有列 -->
......@@ -98,23 +99,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('relatedCompany') or colPickMode == 1 and data.containsKey('relatedCompany')))">
a.relatedCompany,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('videoUrl') or colPickMode == 1 and data.containsKey('videoUrl')))">
a.videoUrl,
</if>
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="NewsEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_news
(categoryId,categoryName,title,titleLogoPath,content,top,viewNums,publishTime,createUserId,createTime,updateUserId,updateTime,upNums,editor,shareNums,deptId,deptName,statement,source,remark,relatedCompany)
(categoryId,categoryName,title,titleLogoPath,content,top,viewNums,publishTime,createUserId,createTime,updateUserId,updateTime,upNums,editor,shareNums,deptId,deptName,statement,source,remark,relatedCompany,videoUrl)
VALUES
(#{categoryId},#{categoryName},#{title},#{titleLogoPath},#{content},#{top},#{viewNums},#{publishTime},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{upNums},#{editor},#{shareNums},#{deptId},#{deptName},#{statement},#{source},#{remark},#{relatedCompany})
(#{categoryId},#{categoryName},#{title},#{titleLogoPath},#{content},#{top},#{viewNums},#{publishTime},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{upNums},#{editor},#{shareNums},#{deptId},#{deptName},#{statement},#{source},#{remark},#{relatedCompany},#{videoUrl})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_news
(categoryId,categoryName,title,titleLogoPath,content,top,viewNums,publishTime,createUserId,createTime,updateUserId,updateTime,upNums,editor,shareNums,deptId,deptName,statement,source,remark,relatedCompany)
(categoryId,categoryName,title,titleLogoPath,content,top,viewNums,publishTime,createUserId,createTime,updateUserId,updateTime,upNums,editor,shareNums,deptId,deptName,statement,source,remark,relatedCompany,videoUrl)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.categoryId},#{item.categoryName},#{item.title},#{item.titleLogoPath},#{item.content},#{item.top},#{item.viewNums},#{item.publishTime},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.upNums},#{item.editor},#{item.shareNums},#{item.deptId},#{item.deptName},#{item.statement},#{item.source},#{item.remark},#{item.relatedCompany})
(#{item.categoryId},#{item.categoryName},#{item.title},#{item.titleLogoPath},#{item.content},#{item.top},#{item.viewNums},#{item.publishTime},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.upNums},#{item.editor},#{item.shareNums},#{item.deptId},#{item.deptName},#{item.statement},#{item.source},#{item.remark},#{item.relatedCompany},#{item.videoUrl})
</foreach>
</insert>
......@@ -211,6 +215,9 @@
<if test="(colPickMode==0 and data.containsKey('relatedCompany')) or (colPickMode==1 and !data.containsKey('relatedCompany'))">
a.relatedCompany=#{data.relatedCompany},
</if>
<if test="(colPickMode==0 and data.containsKey('videoUrl')) or (colPickMode==1 and !data.containsKey('videoUrl'))">
a.videoUrl=#{data.videoUrl},
</if>
</trim>
<trim suffixOverrides="where" suffix="">
where
......@@ -410,6 +417,13 @@
</if>
</foreach>
</trim>
<trim prefix="videoUrl=(case" suffix="ELSE videoUrl end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('videoUrl')) or (colPickMode==1 and !item.containsKey('videoUrl'))">
when a.id=#{item.id} then #{item.videoUrl}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
......@@ -1028,6 +1042,27 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('videoUrl')">
<if test="conditionParamRef.videoUrl != null and conditionParamRef.videoUrl != ''">
${_conditionType_} a.videoUrl like #{${_conditionParam_}.videoUrl}
</if>
<if test="conditionParamRef.videoUrl == null">
${_conditionType_} a.videoUrl is null
</if>
</if>
<if test="conditionParamRef.containsKey('videoUrlList') and conditionParamRef.videoUrlList.size() > 0">
${_conditionType_} a.videoUrl in
<foreach collection="conditionParamRef.videoUrlList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('videoUrlNotList') and conditionParamRef.videoUrlNotList.size() > 0">
${_conditionType_} a.videoUrl not in
<foreach collection="conditionParamRef.videoUrlNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql>
<sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()">
......@@ -1277,6 +1312,11 @@
<if test='orderCol.relatedCompany != null and "DESC".equalsIgnoreCase(orderCol.relatedCompany)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('videoUrl')">
a.videoUrl
<if test='orderCol.videoUrl != null and "DESC".equalsIgnoreCase(orderCol.videoUrl)'>DESC</if>
,
</if>
</trim>
</if>
......
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