Commit ccea5ec7 authored by unset's avatar unset

新增banner,咨询,行业应用等信息接口

parent fcab2f44
#\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F
#\u5305\u540D
package=com.upyuns.platform.rs.universal
package=com.upyuns.platform.rs.website
#\u4F5C\u8005
author=libin
author=jiaoruizhen
#Email
email=18178966185@163.com
email=jiaoruizhen@126.com
#\u8868\u524D\u9519\u8BEF\u7684Unicode\u5B57\u7B26\u4E32!
tablePrefix=
#\u524D\u7AEF\u6A21\u5757\u524D\u7F00
......
......@@ -3,7 +3,6 @@ package ${package}.rest;
import com.github.wxiaoqi.security.common.rest.BaseController;
import ${package}.biz.${className}Biz;
import ${package}.entity.${className};
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......
......@@ -28,7 +28,7 @@ public class ${className} implements Serializable {
* $column.comments
*/
@Id
@GeneratedValue(generator = "JDBC")
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("$column.comments")
private $column.attrType $column.attrname;
#else
......
......@@ -10,7 +10,6 @@ import tk.mybatis.mapper.common.Mapper;
* @email ${email}
* @date ${datetime}
*/
@Mapper
public interface ${className}Mapper extends Mapper<${className}> {
}
......@@ -3,11 +3,4 @@
<mapper namespace="${package}.mapper.${className}Mapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="${package}.entity.${className}" id="${classname}Map">
#foreach($column in $columns)
<result property="${column.attrname}" column="${column.columnName}"/>
#end
</resultMap>
</mapper>
\ No newline at end of file
#\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F
#\u5305\u540D
package=com.upyuns.platform.rs.universal
package=com.upyuns.platform.rs.website
#\u4F5C\u8005
author=libin
author=jiaoruizhen
#Email
email=18178966185@163.com
email=jiaoruizhen@126.com
#\u8868\u524D\u9519\u8BEF\u7684Unicode\u5B57\u7B26\u4E32!
tablePrefix=
#\u524D\u7AEF\u6A21\u5757\u524D\u7F00
......
......@@ -3,7 +3,6 @@ package ${package}.rest;
import com.github.wxiaoqi.security.common.rest.BaseController;
import ${package}.biz.${className}Biz;
import ${package}.entity.${className};
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......
......@@ -28,7 +28,7 @@ public class ${className} implements Serializable {
* $column.comments
*/
@Id
@GeneratedValue(generator = "JDBC")
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("$column.comments")
private $column.attrType $column.attrname;
#else
......
......@@ -10,7 +10,6 @@ import tk.mybatis.mapper.common.Mapper;
* @email ${email}
* @date ${datetime}
*/
@Mapper
public interface ${className}Mapper extends Mapper<${className}> {
}
......@@ -3,11 +3,4 @@
<mapper namespace="${package}.mapper.${className}Mapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="${package}.entity.${className}" id="${classname}Map">
#foreach($column in $columns)
<result property="${column.attrname}" column="${column.columnName}"/>
#end
</resultMap>
</mapper>
\ No newline at end of file
......@@ -89,6 +89,13 @@ public class Banner implements Serializable {
@Column(name = "index_show")
@ApiModelProperty(value = "是否首页展示:1、展示,2、不展示")
private Integer indexShow;
//banner位置 0:所有 1:首页
private Integer location;
//跳转类型 0--不跳转;1--商品详情页;2--店铺主页;
private Integer jumpType;
private String jumpId;
}
package com.upyuns.platform.rs.website.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 通用信息
*
* @author jiaoruizhen
* @email jiaoruizhen@126.com
* @date 2020-11-24 14:37:58
*/
@Data
@Table(name = "common_info")
public class CommonInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("")
private Integer id;
/**
* 1、交易保障
*/
@Column(name = "type")
@ApiModelProperty(value = "1、交易保障")
private Integer type;
/**
* 标题
*/
@Column(name = "title")
@ApiModelProperty(value = "标题")
private String title;
/**
* 内容
*/
@Column(name = "detail")
@ApiModelProperty(value = "内容")
private String detail;
/**
* 1、启用,2、禁用
*/
@Column(name = "status")
@ApiModelProperty(value = "1、启用,2、禁用")
private Integer status;
/**
* 是否删除:0、否,1、是
*/
@Column(name = "is_del")
@ApiModelProperty(value = "是否删除:0、否,1、是")
private Integer isDel;
/**
* 标题背景色,16进制
*/
@Column(name = "color")
@ApiModelProperty(value = "标题背景色,16进制")
private String color;
/**
* 创建时间
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true )
private Date crtTime;
/**
* 更新时间
*/
@Column(name = "upd_time")
@ApiModelProperty(value = "更新时间", hidden = true )
private Date updTime;
/**
* 排序
*/
@Column(name = "rank")
@ApiModelProperty(value = "排序")
private Integer rank;
}
......@@ -55,6 +55,7 @@ public class BannerBiz extends BaseBiz<BannerMapper, Banner> {
} else {
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1);
}
example.orderBy("rank");
return ObjectRestResponse.succ(mapper.selectByExample(example));
}
......@@ -68,7 +69,7 @@ public class BannerBiz extends BaseBiz<BannerMapper, Banner> {
Example example = new Example(Banner.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel", 0);
example.orderBy("updTime DESC");
example.orderBy("updTime").desc();
Query query = new Query(bannerDto);
PageDataVO<Banner> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByExample(example));
return ObjectRestResponse.succ(pageDataVO);
......
package com.upyuns.platform.rs.website.biz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import org.springframework.stereotype.Service;
import com.upyuns.platform.rs.website.entity.CommonInfo;
import com.upyuns.platform.rs.website.mapper.CommonInfoMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
/**
* 通用信息
*
* @author jiaoruizhen
* @email jiaoruizhen@126.com
* @date 2020-11-24 14:37:58
*/
@Service
public class CommonInfoBiz extends BaseBiz<CommonInfoMapper,CommonInfo> {
public ObjectRestResponse addUpdate(CommonInfo commonInfo) {
if (commonInfo == null) {
return ObjectRestResponse.paramIsEmpty();
}
return ObjectRestResponse.succ();
}
}
\ No newline at end of file
......@@ -93,6 +93,7 @@ public class IndustryApplicationInfoBiz extends BaseBiz<IndustryApplicationInfoM
Map<Integer, List<IndustryApplicationType>> map = industryApplicationTypeList.stream().collect(Collectors.groupingBy(IndustryApplicationType::getId));
Example example = new Example(IndustryApplicationInfo.class);
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("indexShow", 1).andIn("firstTypeId", map.keySet());
example.orderBy("rank");
List<IndustryApplicationInfo> industryApplicationInfoList = mapper.selectByExample(example);
if (industryApplicationInfoList != null && industryApplicationInfoList.size() > 0) {
industryApplicationInfoList.parallelStream().forEach(industryApplicationInfo -> {
......
......@@ -36,7 +36,7 @@ public class IndustryApplicationTypeBiz extends BaseBiz<IndustryApplicationTypeM
* @return
*/
public ObjectRestResponse add(IndustryApplicationType industryApplicationType) {
if (industryApplicationType != null) {
if (industryApplicationType == null) {
return ObjectRestResponse.paramIsEmpty();
}
if (industryApplicationType.getId() != null) {
......@@ -77,6 +77,7 @@ public class IndustryApplicationTypeBiz extends BaseBiz<IndustryApplicationTypeM
} else {
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1);
}
example.orderBy("rank");
return ObjectRestResponse.succ(mapper.selectByExample(example));
}
......@@ -93,7 +94,7 @@ public class IndustryApplicationTypeBiz extends BaseBiz<IndustryApplicationTypeM
if (StringUtils.isNotBlank(industryApplicationTypeDto.getTitle())) {
criteria.andLike("title", "%" + industryApplicationTypeDto.getTitle() + "%");
}
example.orderBy("updTime DESC");
example.orderBy("updTime").desc();
Query query = new Query(industryApplicationTypeDto);
PageDataVO<IndustryApplicationType> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByExample(example));
return ObjectRestResponse.succ(pageDataVO);
......
......@@ -64,11 +64,8 @@ public class NewsTypeBiz extends BaseBiz<NewsTypeMapper, NewsType> {
*/
public ObjectRestResponse<List<NewsType>> getAll(Integer indexShow) {
Example example = new Example(NewsType.class);
if (indexShow != null) {
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1).andEqualTo("indexShow",indexShow);
} else {
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1);
}
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1);
example.orderBy("rank");
return ObjectRestResponse.succ(mapper.selectByExample(example));
}
......@@ -85,7 +82,7 @@ public class NewsTypeBiz extends BaseBiz<NewsTypeMapper, NewsType> {
if (StringUtils.isNotBlank(newsTypeDto.getName())) {
criteria.andLike("nameCn", "%" + newsTypeDto.getName() + "%");
}
example.orderBy("updTime DESC");
example.orderBy("updTime").desc();
Query query = new Query(newsTypeDto);
PageDataVO<NewsType> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByExample(example));
return ObjectRestResponse.succ(pageDataVO);
......
package com.upyuns.platform.rs.website.controller;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.website.biz.CommonInfoBiz;
import com.upyuns.platform.rs.website.entity.CommonInfo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("commonInfo")
public class CommonInfoController extends BaseController<CommonInfoBiz,CommonInfo> {
}
\ No newline at end of file
......@@ -22,8 +22,8 @@ public class IndustryApplicationTypeController extends BaseController<IndustryAp
}
@GetMapping(value = "getAll")
public ObjectRestResponse getAll() {
return baseBiz.getAll(1);
public ObjectRestResponse getAll(Integer indexShow) {
return baseBiz.getAll(indexShow);
}
......
......@@ -17,8 +17,8 @@ public class NewsTypeController extends BaseController<NewsTypeBiz, NewsType> {
}
@GetMapping(value = "getAll")
public ObjectRestResponse getAll() {
return baseBiz.getAll(1);
public ObjectRestResponse getAll(Integer indexShow) {
return baseBiz.getAll(indexShow);
}
@GetMapping(value = "getList")
......
package com.upyuns.platform.rs.website.mapper;
import com.upyuns.platform.rs.website.entity.CommonInfo;
import tk.mybatis.mapper.common.Mapper;
/**
* 通用信息
*
* @author jiaoruizhen
* @email jiaoruizhen@126.com
* @date 2020-11-24 14:37:58
*/
public interface CommonInfoMapper extends Mapper<CommonInfo> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.upyuns.platform.rs.website.mapper.CommonInfoMapper">
</mapper>
\ No newline at end of file
......@@ -24,7 +24,7 @@
and iai.title like concat('%', #{title}, '%')
</if>
</where>
order by updTime DESC
order by upd_time 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