浏览代码

xlk品牌商

fuxingfan 4 年前
父节点
当前提交
27b6948853

+ 10
- 0
src/main/java/com/yunzhi/marketing/entity/TaBuilding.java 查看文件

@@ -215,6 +215,16 @@ public class TaBuilding implements Serializable {
215 215
      */
216 216
     private String recordName;
217 217
 
218
+    /**
219
+     * 品牌id
220
+     */
221
+    private String brandId;
222
+
223
+    /**
224
+     * 品牌商名称
225
+     */
226
+    private String brandName;
227
+
218 228
     /**
219 229
      * 地图数据
220 230
      */

+ 149
- 0
src/main/java/com/yunzhi/marketing/xlk/controller/BrandController.java 查看文件

@@ -0,0 +1,149 @@
1
+package com.yunzhi.marketing.xlk.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.marketing.base.BaseController;
7
+import com.yunzhi.marketing.base.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.marketing.xlk.service.IBrandService;
18
+import com.yunzhi.marketing.xlk.entity.Brand;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 品牌开发商表  前端控制器
24
+    * </p>
25
+ *
26
+ * @author jobob
27
+ * @since 2021-05-13
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class BrandController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(BrandController.class);
34
+
35
+    @Autowired
36
+    public IBrandService iBrandService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/brand",method= RequestMethod.GET)
46
+    public ResponseBean brandList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                  @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
48
+        ResponseBean responseBean = new ResponseBean();
49
+        try {
50
+            //使用分页插件
51
+		    IPage<Brand> pg = new Page<>(pageNum, pageSize);
52
+            QueryWrapper<Brand> queryWrapper = new QueryWrapper<>();
53
+            queryWrapper.orderByDesc("create_date");
54
+
55
+            IPage<Brand> result = iBrandService.page(pg, queryWrapper);
56
+            responseBean.addSuccess(result);
57
+        }catch (Exception e){
58
+            e.printStackTrace();
59
+            logger.error("brandList -=- {}",e.toString());
60
+            responseBean.addError(e.getMessage());
61
+        }
62
+        return responseBean;
63
+    }
64
+
65
+    /**
66
+     * 保存对象
67
+     * @param brand 实体对象
68
+     * @return
69
+     */
70
+    @RequestMapping(value="/brand",method= RequestMethod.POST)
71
+    public ResponseBean brandAdd(@RequestBody Brand brand){
72
+        ResponseBean responseBean = new ResponseBean();
73
+        try {
74
+            if (iBrandService.save(brand)){
75
+                responseBean.addSuccess(brand);
76
+            }else {
77
+                responseBean.addError("fail");
78
+            }
79
+        }catch (Exception e){
80
+            e.printStackTrace();
81
+            logger.error("brandAdd -=- {}",e.toString());
82
+            responseBean.addError(e.getMessage());
83
+        }
84
+        return responseBean;
85
+    }
86
+
87
+    /**
88
+     * 根据id删除对象
89
+     * @param id  实体ID
90
+     */
91
+    @ResponseBody
92
+    @RequestMapping(value="/brand/{id}", method= RequestMethod.DELETE)
93
+    public ResponseBean brandDelete(@PathVariable Integer id){
94
+        ResponseBean responseBean = new ResponseBean();
95
+        try {
96
+            if(iBrandService.removeById(id)){
97
+                responseBean.addSuccess("success");
98
+            }else {
99
+                responseBean.addError("fail");
100
+            }
101
+        }catch (Exception e){
102
+            e.printStackTrace();
103
+            logger.error("brandDelete -=- {}",e.toString());
104
+            responseBean.addError(e.getMessage());
105
+        }
106
+        return responseBean;
107
+    }
108
+
109
+    /**
110
+     * 修改对象
111
+     * @param id  实体ID
112
+     * @param brand 实体对象
113
+     * @return
114
+     */
115
+    @RequestMapping(value="/brand/{id}",method= RequestMethod.PUT)
116
+    public ResponseBean brandUpdate(@PathVariable Integer id,
117
+                                        @RequestBody Brand brand){
118
+        ResponseBean responseBean = new ResponseBean();
119
+        try {
120
+            if (iBrandService.updateById(brand)){
121
+                responseBean.addSuccess(brand);
122
+            }else {
123
+                responseBean.addError("fail");
124
+            }
125
+        }catch (Exception e){
126
+            e.printStackTrace();
127
+            logger.error("brandUpdate -=- {}",e.toString());
128
+            responseBean.addError(e.getMessage());
129
+        }
130
+        return responseBean;
131
+    }
132
+
133
+    /**
134
+     * 根据id查询对象
135
+     * @param id  实体ID
136
+     */
137
+    @RequestMapping(value="/brand/{id}",method= RequestMethod.GET)
138
+    public ResponseBean brandGet(@PathVariable Integer id){
139
+        ResponseBean responseBean = new ResponseBean();
140
+        try {
141
+            responseBean.addSuccess(iBrandService.getById(id));
142
+        }catch (Exception e){
143
+            e.printStackTrace();
144
+            logger.error("brandDelete -=- {}",e.toString());
145
+            responseBean.addError(e.getMessage());
146
+        }
147
+        return responseBean;
148
+    }
149
+}

+ 81
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/Brand.java 查看文件

@@ -0,0 +1,81 @@
1
+package com.yunzhi.marketing.xlk.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import java.time.LocalDateTime;
7
+import com.baomidou.mybatisplus.annotation.TableField;
8
+import java.io.Serializable;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 品牌开发商表 
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2021-05-13
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@TableName("xlk_brand")
25
+public class Brand implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    /**
30
+     * 品牌id
31
+     */
32
+    @TableId(type = IdType.UUID)
33
+    private String brandId;
34
+
35
+    /**
36
+     * 索引字母
37
+     */
38
+    @TableField("Index_letter")
39
+    private String indexLetter;
40
+
41
+    /**
42
+     * 品牌商名称
43
+     */
44
+    private String brandName;
45
+
46
+    /**
47
+     * 品牌商宣传图
48
+     */
49
+    private String brandImg;
50
+
51
+    /**
52
+     * 品牌商简介
53
+     */
54
+    private String brandRemark;
55
+
56
+    /**
57
+     * 创建人
58
+     */
59
+    @TableField("CREATED_BY")
60
+    private String createdBy;
61
+
62
+    /**
63
+     * 创建时间
64
+     */
65
+    @TableField("CREATED_TIME")
66
+    private LocalDateTime createdTime;
67
+
68
+    /**
69
+     * 更新人
70
+     */
71
+    @TableField("UPDATED_BY")
72
+    private String updatedBy;
73
+
74
+    /**
75
+     * 更新时间
76
+     */
77
+    @TableField("UPDATED_TIME")
78
+    private LocalDateTime updatedTime;
79
+
80
+
81
+}

+ 18
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/BrandMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.marketing.xlk.mapper;
2
+
3
+import com.yunzhi.marketing.xlk.entity.Brand;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 品牌开发商表  Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2021-05-13
14
+ */
15
+@Mapper
16
+public interface BrandMapper extends BaseMapper<Brand> {
17
+
18
+}

+ 16
- 0
src/main/java/com/yunzhi/marketing/xlk/service/IBrandService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.marketing.xlk.service;
2
+
3
+import com.yunzhi.marketing.xlk.entity.Brand;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 品牌开发商表  服务类
9
+ * </p>
10
+ *
11
+ * @author jobob
12
+ * @since 2021-05-13
13
+ */
14
+public interface IBrandService extends IService<Brand> {
15
+
16
+}

+ 20
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/BrandServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.marketing.xlk.service.impl;
2
+
3
+import com.yunzhi.marketing.xlk.entity.Brand;
4
+import com.yunzhi.marketing.xlk.mapper.BrandMapper;
5
+import com.yunzhi.marketing.xlk.service.IBrandService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 品牌开发商表  服务实现类
12
+ * </p>
13
+ *
14
+ * @author jobob
15
+ * @since 2021-05-13
16
+ */
17
+@Service
18
+public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements IBrandService {
19
+
20
+}

+ 20031
- 0
src/main/resources/db/marketing.pdman.json
文件差异内容过多而无法显示
查看文件


+ 5
- 0
src/main/resources/mapper/xlk/BrandMapper.xml 查看文件

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.yunzhi.marketing.xlk.mapper.BrandMapper">
4
+
5
+</mapper>