This commit is contained in:
zy 2024-06-22 19:15:35 +08:00
parent 3f101d6faf
commit c72ffffbfe
138 changed files with 11525 additions and 3267 deletions

2
.gitignore vendored
View File

@ -43,3 +43,5 @@ nbdist/
!*/build/*.html
!*/build/*.xml
rebel.xml
/source-admin/src/main/resources/*.yml

123
README.md Normal file

File diff suppressed because one or more lines are too long

17
doc/README.md Normal file
View File

@ -0,0 +1,17 @@
### 在线体验
* 官网地址https://sourcebyte.vip
* 演示地址http://boot.sourcebyte.vip
* 开发文档http://doc.sourcebyte.vip
### 友情提示
* 数据库文件(SQL)默认使用MySql数据库首次运行执行source-vue.sql进行初始化
* 配置文件(yml):首次运行将配置文件拷贝到项目中
* 管理员密码:
![输入图片说明](https://sourcebyte.vip/web-api/profile/upload/2022/10/18/bce03408-ee8e-4dd7-b54d-60a571d2bb2a.jpg)
微信扫一扫,回复“ **管理员密码** ”,获取密码

BIN
doc/about.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1024 KiB

BIN
doc/qq01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
doc/qq02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
doc/qq03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

View File

File diff suppressed because it is too large Load Diff

View File

View File

@ -0,0 +1,57 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/source-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password:
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true

View File

@ -0,0 +1,145 @@
# 项目相关配置
ruoyi:
# 名称
name: 开源字节(https://sourcebyte.vip)
# 版本
version: 4.0.0
# 版权年份
copyrightYear: 2023
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置C:/source-vue/static/uploadPathLinux配置 /home/source-vue/uploadPath
profile: C:/source-vue/static/uploadPath
# 获取ip地址开关
addressEnabled: true
# 验证码类型 math 数组计算 char 字符验证
captchaType: math
# 域名图片url前缀
domain: https://sourcebyte.vip
# 开发环境配置
server:
# 服务器的HTTP端口默认为8088
port: 8088
servlet:
# 应用的访问路径
context-path: /
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# 连接数满后的排队数默认为100
accept-count: 1000
threads:
# tomcat最大线程数默认为200
max: 800
# Tomcat启动初始化的线程数默认值10
min-spare: 100
# 日志配置
logging:
level:
cn.source: debug
org.springframework: warn
# Spring配置
spring:
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
# 服务模块
devtools:
restart:
# 热部署开关
enabled: true
# redis 配置
redis:
# 地址
host: 换你自己的
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# token配置
token:
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 30
# MyBatis配置
mybatis:
# 搜索指定包别名
typeAliasesPackage: cn.source.**.domain
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
# Swagger配置
swagger:
# 是否开启swagger
enabled: true
# 请求前缀
pathMapping: /dev-api
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice,/system/item,/system/article,/system/goods
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
# sms 短信
sms:
id: 换你自己的
pwd: 换你自己的
template: 换你自己的
# wechat 微信
wechat:
# 公众号
mp:
# 生活助手
appId: 换你自己的
secret: 换你自己的
accessTokenKey: MP-ACCESS-TOKEN-AUTH
# 小程序
mini:
appId: 换你自己的
secret: 换你自己的
accessTokenKey: MINI-ACCESS-TOKEN-AUTH

16
pom.xml
View File

@ -228,10 +228,10 @@
<version>${source.version}</version>
</dependency>
<!-- 旅居模块-->
<!-- house模块-->
<dependency>
<groupId>cn.source</groupId>
<artifactId>source-travel</artifactId>
<artifactId>source-house</artifactId>
<version>${source.version}</version>
</dependency>
@ -242,6 +242,12 @@
<version>${source.version}</version>
</dependency>
<!-- 商城模块-->
<dependency>
<groupId>cn.source</groupId>
<artifactId>source-mall</artifactId>
<version>${source.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -254,10 +260,12 @@
<module>source-common</module>
<!--新增CMS模块-->
<module>source-cms</module>
<!--新增旅居模块-->
<module>source-travel</module>
<!--新增租房模块-->
<module>source-house</module>
<!--新增IM模块-->
<module>source-im</module>
<!--新增mall模块-->
<module>source-mall</module>
</modules>
<packaging>pom</packaging>

View File

@ -37,7 +37,7 @@
<version>1.6.2</version>
</dependency>
<!-- Mysql驱动包 -->
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
@ -79,16 +79,21 @@
<groupId>cn.source</groupId>
<artifactId>source-cms</artifactId>
</dependency>
<!-- 旅居模块-->
<!-- 租房-->
<dependency>
<groupId>cn.source</groupId>
<artifactId>source-travel</artifactId>
<artifactId>source-house</artifactId>
</dependency>
<!-- 即时通讯-->
<dependency>
<groupId>cn.source</groupId>
<artifactId>source-im</artifactId>
</dependency>
<!-- 购物-->
<dependency>
<groupId>cn.source</groupId>
<artifactId>source-mall</artifactId>
</dependency>
</dependencies>
<build>
@ -116,7 +121,7 @@
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>

View File

@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://43.139.148.109:3306/source-travel?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://43.139.148.109:3306/source-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: admin!@#$
# 从库数据源

View File

@ -145,7 +145,7 @@
<el-table-column label="${comment}" align="center" prop="${javaField}" />
#end
#end
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
<template slot-scope="scope">
<el-button
size="mini"

View File

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>source-travel</artifactId>
<artifactId>source-house</artifactId>
<description>
租房管理

View File

@ -0,0 +1,199 @@
package cn.source.system.controller;
import cn.source.common.constant.HttpStatus;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.domain.entity.SysUser;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.utils.DateUtils;
import cn.source.common.utils.StringUtils;
import cn.source.system.domain.HouseEvaluate;
import cn.source.system.domain.HouseRoom;
import cn.source.system.domain.HouseUser;
import cn.source.system.domain.HouseVillage;
import cn.source.system.service.*;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description: house api控制类
* @author: 詹Sir
*/
@RestController
@RequestMapping("/api/houseApi")
public class HouseApiController extends BaseController {
@Autowired
private IHouseVillageService houseVillageService;
@Autowired
private IHouseRoomService houseRoomService;
@Autowired
private IHouseEvaluateService houseEvaluateService;
@Autowired
private ISysUserService userService;
@Autowired
private IHouseUserService houseUserService;
/**
* @Description: 获取小区列表
*/
@GetMapping("/findVillageList")
public TableDataInfo findVillageList(HouseVillage houseVillage)
{
startPage();
List<HouseVillage> list = houseVillageService.selectHouseVillageList(houseVillage);
return getDataTable(list);
}
/**
* @Description: 获取房源列表
*/
@GetMapping("/findHouseRoomList")
public TableDataInfo findHouseRoomList(HouseRoom houseRoom)
{
startPage();
List<HouseRoom> list = houseRoomService.findHouseRoomList(houseRoom);
return getDataTable(list);
}
/**
* @Description: 添加房源信息
*/
@PostMapping("/saveHouse")
public AjaxResult saveHouse(@RequestBody HouseRoom houseRoom)
{
String msg = "房源添加成功";
houseRoomService.apiInsertHouseRoom(houseRoom);
AjaxResult ajaxResult = new AjaxResult(HttpStatus.SUCCESS,msg,houseRoom);
return ajaxResult;
}
/**
* @Description: 修改房源信息
*/
@PostMapping("/updateHouse")
public AjaxResult updateHouse(@RequestBody HouseRoom houseRoom)
{
String msg = "房源修改成功";
houseRoomService.updateHouseRoom(houseRoom);
AjaxResult ajaxResult = new AjaxResult(HttpStatus.SUCCESS,msg,houseRoom);
return ajaxResult;
}
/**
* @Description: 获取房源信息by id
*/
@GetMapping("/findHouseById")
public AjaxResult findHouseById(@RequestParam Long id)
{
String msg = "房源查找成功";
HouseRoom houseRoom = houseRoomService.selectHouseRoomById(id);
houseRoom = houseRoomService.selectDetailHouseRoom(houseRoom);
AjaxResult ajaxResult = new AjaxResult(HttpStatus.SUCCESS,msg,houseRoom);
return ajaxResult;
}
/**
* @Description: 收藏/取消收藏
*/
@PostMapping("/saveHeart")
public AjaxResult saveHeart(@RequestBody JSONObject json)
{
boolean heart = json.getBoolean("heart");
Long userId = json.getLong("userId");
String houseId = json.getString("houseId");
String msg = houseRoomService.saveHeart(heart,userId,houseId);
AjaxResult ajaxResult = new AjaxResult(HttpStatus.SUCCESS,msg);
return ajaxResult;
}
/**
* @Description: 判断是否收藏
*/
@GetMapping("/selectHouseHeart")
public AjaxResult selectHouseHeart(Long userId,String houseId)
{
String msg = "是否收藏";
Map<String,Object> houseMap=new HashMap<String,Object>();
houseMap.put("houseId",houseId);
houseMap.put("userId",userId);
// 判断是否点赞
Long id = houseRoomService.selectHouseHeart(houseMap);
AjaxResult ajaxResult = new AjaxResult(HttpStatus.SUCCESS,msg, StringUtils.isNotNull(id)?true:false);
return ajaxResult;
}
/**
* @Description: 获取收藏房源列表
*/
@GetMapping("/findHouseHeartList")
public TableDataInfo findHouseHeartList(Long userId)
{
startPage();
List<HouseRoom> list = houseRoomService.findHouseHeartList(userId);
return getDataTable(list);
}
/**
* 查询房源评价列表
* @param houseId
* @return
*/
@GetMapping("/selectHouseEvals")
public TableDataInfo selectHouseEvals(Long houseId)
{
HouseEvaluate houseEvaluate = new HouseEvaluate();
houseEvaluate.setHouseId(houseId);
houseEvaluate.setState(1);//只查询显示的
startPage();
List<HouseEvaluate> list = houseEvaluateService.selectHouseEvaluateList(houseEvaluate);
return getDataTable(list);
}
/**
* 新增评价
* @param houseId
* @param evalu
* @return
*/
@GetMapping("/saveHouseEvals")
public AjaxResult saveHouseEvals(Long houseId,String evalu,Long userId)
{
HouseEvaluate houseEvaluate = new HouseEvaluate();
houseEvaluate.setHouseId(houseId);
houseEvaluate.setEvaluate(evalu);
houseEvaluate.setState(1);//只查询显示的
houseEvaluate.setCreateTime(DateUtils.getNowDate());
houseEvaluate.setEvalUserId(userId);
SysUser sysUser = userService.selectUserById(userId);
houseEvaluate.setEvalUser(sysUser.getUserName());
houseEvaluateService.insertHouseEvaluate(houseEvaluate);
return AjaxResult.success(houseEvaluate);
}
/**
* 评价鉴权只有历史租客才能评价
* @param houseId
* @param userId
* @return
*/
@GetMapping("/checkAuthEvals")
public AjaxResult checkAuthEvals(Long houseId,Long userId)
{
HouseUser houseUser = new HouseUser();
houseUser.setHouseId(houseId);
houseUser.setUserId(userId);
List<HouseUser> list = houseUserService.selectHouseUserList(houseUser);
return AjaxResult.success(list);
}
}

View File

@ -0,0 +1,106 @@
package cn.source.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.enums.BusinessType;
import cn.source.system.domain.HouseEvaluate;
import cn.source.system.service.IHouseEvaluateService;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.common.core.page.TableDataInfo;
/**
* 房源评价Controller
*
* @author wind
* @date 2023-04-14
*/
@RestController
@RequestMapping("/system/evaluate")
public class HouseEvaluateController extends BaseController
{
@Autowired
private IHouseEvaluateService houseEvaluateService;
/**
* 查询房源评价列表
*/
@PreAuthorize("@ss.hasPermi('system:evaluate:list')")
@GetMapping("/list")
public TableDataInfo list(HouseEvaluate houseEvaluate)
{
startPage();
List<HouseEvaluate> list = houseEvaluateService.selectHouseEvaluateList(houseEvaluate);
return getDataTable(list);
}
/**
* 导出房源评价列表
*/
@PreAuthorize("@ss.hasPermi('system:evaluate:export')")
@Log(title = "房源评价", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, HouseEvaluate houseEvaluate)
{
List<HouseEvaluate> list = houseEvaluateService.selectHouseEvaluateList(houseEvaluate);
ExcelUtil<HouseEvaluate> util = new ExcelUtil<HouseEvaluate>(HouseEvaluate.class);
util.exportExcel(response, list, "房源评价数据");
}
/**
* 获取房源评价详细信息
*/
@PreAuthorize("@ss.hasPermi('system:evaluate:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(houseEvaluateService.selectHouseEvaluateById(id));
}
/**
* 新增房源评价
*/
@PreAuthorize("@ss.hasPermi('system:evaluate:add')")
@Log(title = "房源评价", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody HouseEvaluate houseEvaluate)
{
houseEvaluate.setEvalUserId(getUserId());
houseEvaluate.setEvalUser(getUsername());
return toAjax(houseEvaluateService.insertHouseEvaluate(houseEvaluate));
}
/**
* 修改房源评价
*/
@PreAuthorize("@ss.hasPermi('system:evaluate:edit')")
@Log(title = "房源评价", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody HouseEvaluate houseEvaluate)
{
return toAjax(houseEvaluateService.updateHouseEvaluate(houseEvaluate));
}
/**
* 删除房源评价
*/
@PreAuthorize("@ss.hasPermi('system:evaluate:remove')")
@Log(title = "房源评价", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(houseEvaluateService.deleteHouseEvaluateByIds(ids));
}
}

View File

@ -0,0 +1,98 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.HouseFeature;
import cn.source.system.service.IHouseFeatureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 房源特色Controller
*
* @author 詹Sir
* @date 2022-03-27
*/
@RestController
@RequestMapping("/system/houseFeature")
public class HouseFeatureController extends BaseController
{
@Autowired
private IHouseFeatureService houseFeatureService;
/**
* 查询房源特色列表
*/
@PreAuthorize("@ss.hasPermi('system:houseFeature:list')")
@GetMapping("/list")
public TableDataInfo list(HouseFeature houseFeature)
{
startPage();
List<HouseFeature> list = houseFeatureService.selectHouseFeatureList(houseFeature);
return getDataTable(list);
}
/**
* 导出房源特色列表
*/
@PreAuthorize("@ss.hasPermi('system:houseFeature:export')")
@Log(title = "房源特色", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, HouseFeature houseFeature)
{
List<HouseFeature> list = houseFeatureService.selectHouseFeatureList(houseFeature);
ExcelUtil<HouseFeature> util = new ExcelUtil<HouseFeature>(HouseFeature.class);
util.exportExcel(response, list, "房源特色数据");
}
/**
* 获取房源特色详细信息
*/
@PreAuthorize("@ss.hasPermi('system:houseFeature:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(houseFeatureService.selectHouseFeatureById(id));
}
/**
* 新增房源特色
*/
@PreAuthorize("@ss.hasPermi('system:houseFeature:add')")
@Log(title = "房源特色", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody HouseFeature houseFeature)
{
return toAjax(houseFeatureService.insertHouseFeature(houseFeature));
}
/**
* 修改房源特色
*/
@PreAuthorize("@ss.hasPermi('system:houseFeature:edit')")
@Log(title = "房源特色", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody HouseFeature houseFeature)
{
return toAjax(houseFeatureService.updateHouseFeature(houseFeature));
}
/**
* 删除房源特色
*/
@PreAuthorize("@ss.hasPermi('system:houseFeature:remove')")
@Log(title = "房源特色", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(houseFeatureService.deleteHouseFeatureByIds(ids));
}
}

View File

@ -0,0 +1,98 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.HouseImage;
import cn.source.system.service.IHouseImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 房源图片Controller
*
* @author 詹Sir
* @date 2022-03-27
*/
@RestController
@RequestMapping("/system/houseImage")
public class HouseImageController extends BaseController
{
@Autowired
private IHouseImageService houseImageService;
/**
* 查询房源图片列表
*/
@PreAuthorize("@ss.hasPermi('system:houseImage:list')")
@GetMapping("/list")
public TableDataInfo list(HouseImage houseImage)
{
startPage();
List<HouseImage> list = houseImageService.selectHouseImageList(houseImage);
return getDataTable(list);
}
/**
* 导出房源图片列表
*/
@PreAuthorize("@ss.hasPermi('system:houseImage:export')")
@Log(title = "房源图片", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, HouseImage houseImage)
{
List<HouseImage> list = houseImageService.selectHouseImageList(houseImage);
ExcelUtil<HouseImage> util = new ExcelUtil<HouseImage>(HouseImage.class);
util.exportExcel(response, list, "房源图片数据");
}
/**
* 获取房源图片详细信息
*/
@PreAuthorize("@ss.hasPermi('system:houseImage:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(houseImageService.selectHouseImageById(id));
}
/**
* 新增房源图片
*/
@PreAuthorize("@ss.hasPermi('system:houseImage:add')")
@Log(title = "房源图片", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody HouseImage houseImage)
{
return toAjax(houseImageService.insertHouseImage(houseImage));
}
/**
* 修改房源图片
*/
@PreAuthorize("@ss.hasPermi('system:houseImage:edit')")
@Log(title = "房源图片", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody HouseImage houseImage)
{
return toAjax(houseImageService.updateHouseImage(houseImage));
}
/**
* 删除房源图片
*/
@PreAuthorize("@ss.hasPermi('system:houseImage:remove')")
@Log(title = "房源图片", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(houseImageService.deleteHouseImageByIds(ids));
}
}

View File

@ -0,0 +1,197 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.domain.entity.SysUser;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.HouseRoom;
import cn.source.system.enums.HouseStatus;
import cn.source.system.service.IHouseRoomService;
import cn.source.system.service.ISysUserService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 房源详情Controller
*
* @author 詹Sir
* @date 2022-03-27
*/
@RestController
@RequestMapping("/system/houseRoom")
public class HouseRoomController extends BaseController
{
@Autowired
private IHouseRoomService houseRoomService;
@Autowired
private ISysUserService userService;
/**
* 查询房源详情列表
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:list')")
@GetMapping("/list")
public TableDataInfo list(HouseRoom houseRoom)
{
startPage();
List<HouseRoom> list = houseRoomService.selectHouseRoomList(houseRoom);
return getDataTable(list);
}
/**
* 下载房源导入模板
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:export')")
@Log(title = "房源详情", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, HouseRoom houseRoom)
{
PageHelper.orderBy("create_time desc");
List<HouseRoom> list = houseRoomService.selectHouseRoomList(houseRoom);
ExcelUtil<HouseRoom> util = new ExcelUtil<HouseRoom>(HouseRoom.class);
util.exportExcel(response, list, "房源详情数据");
}
/**
* 导出房源详情列表
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:export')")
@Log(title = "房源模板", businessType = BusinessType.EXPORT)
@PostMapping("/templete")
public void templete(HttpServletResponse response, HouseRoom houseRoom)
{
ExcelUtil<HouseRoom> util = new ExcelUtil<HouseRoom>(HouseRoom.class);
util.exportExcel(response, null, "房源模板");
}
/**
* 房源管理
*/
@Log(title = "房源管理", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<HouseRoom> util = new ExcelUtil<HouseRoom>(HouseRoom.class);
List<HouseRoom> houseList = util.importExcel(file.getInputStream());
String message = houseRoomService.importHouse(houseList,updateSupport);
return AjaxResult.success(message);
}
/**
* 获取房源详情详细信息
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(houseRoomService.selectHouseRoomById(id));
}
/**
* 新增房源详情
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:add')")
@Log(title = "房源详情", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody HouseRoom houseRoom)
{
return toAjax(houseRoomService.insertHouseRoom(houseRoom));
}
/**
* 修改房源详情
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:edit')")
@Log(title = "房源详情", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody HouseRoom houseRoom)
{
return toAjax(houseRoomService.updateHouseRoom(houseRoom));
}
/**
* 删除房源详情
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:remove')")
@Log(title = "房源详情", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(houseRoomService.deleteHouseRoomByIds(ids));
}
/**
* 审核
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:more')")
@Log(title = "房源审核", businessType = BusinessType.UPDATE)
@PutMapping("handleAudit/{ids}")
public AjaxResult handleAudit(@PathVariable Long[] ids)
{
return toAjax(houseRoomService.updateHouseRoomByIds(ids, HouseStatus.SALEING.getCode()));
}
/**
* 出租
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:more')")
@Log(title = "房源出租", businessType = BusinessType.UPDATE)
@PutMapping("handlePush/{ids}")
public AjaxResult handlePush(@PathVariable Long[] ids)
{
return toAjax(houseRoomService.updateHouseRoomByIds(ids,HouseStatus.SALEED.getCode()));
}
/**
* 下架
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:more')")
@Log(title = "房源下架", businessType = BusinessType.UPDATE)
@PutMapping("handleClose/{ids}")
public AjaxResult handleClose(@PathVariable Long[] ids)
{
return toAjax(houseRoomService.updateHouseRoomByIds(ids,HouseStatus.CLOSE.getCode()));
}
/**
* 上架
*/
@PreAuthorize("@ss.hasPermi('system:houseRoom:more')")
@Log(title = "房源上架", businessType = BusinessType.UPDATE)
@PutMapping("handleOpen/{ids}")
public AjaxResult handleOpen(@PathVariable Long[] ids)
{
return toAjax(houseRoomService.updateHouseRoomByIds(ids,HouseStatus.SALEING.getCode()));
}
/**
* 查询用户列表
*/
@GetMapping("/userList")
public TableDataInfo userList(SysUser user)
{
startPage();
List<SysUser> list = userService.selectUserList(user);
return getDataTable(list);
}
/**
* 批量选择用户授权
*/
@Log(title = "房源授权", businessType = BusinessType.GRANT)
@PutMapping("/authUser/{ids}")
public AjaxResult authUser(@PathVariable Long[] ids,Long userId)
{
return toAjax(houseRoomService.updateHouseAgent(ids,userId));
}
}

View File

@ -0,0 +1,98 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.HouseUser;
import cn.source.system.service.IHouseUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 出租信息Controller
*
* @author 詹Sir
* @date 2022-03-27
*/
@RestController
@RequestMapping("/system/houseUser")
public class HouseUserController extends BaseController
{
@Autowired
private IHouseUserService houseUserService;
/**
* 查询出租信息列表
*/
@PreAuthorize("@ss.hasPermi('system:houseUser:list')")
@GetMapping("/list")
public TableDataInfo list(HouseUser houseUser)
{
startPage();
List<HouseUser> list = houseUserService.selectHouseUserList(houseUser);
return getDataTable(list);
}
/**
* 导出出租信息列表
*/
@PreAuthorize("@ss.hasPermi('system:houseUser:export')")
@Log(title = "出租信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, HouseUser houseUser)
{
List<HouseUser> list = houseUserService.selectHouseUserList(houseUser);
ExcelUtil<HouseUser> util = new ExcelUtil<HouseUser>(HouseUser.class);
util.exportExcel(response, list, "出租信息数据");
}
/**
* 获取出租信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:houseUser:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(houseUserService.selectHouseUserById(id));
}
/**
* 新增出租信息
*/
@PreAuthorize("@ss.hasPermi('system:houseUser:add')")
@Log(title = "出租信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody HouseUser houseUser)
{
return toAjax(houseUserService.insertHouseUser(houseUser));
}
/**
* 修改出租信息
*/
@PreAuthorize("@ss.hasPermi('system:houseUser:edit')")
@Log(title = "出租信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody HouseUser houseUser)
{
return toAjax(houseUserService.updateHouseUser(houseUser));
}
/**
* 删除出租信息
*/
@PreAuthorize("@ss.hasPermi('system:houseUser:remove')")
@Log(title = "出租信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(houseUserService.deleteHouseUserByIds(ids));
}
}

View File

@ -0,0 +1,98 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.HouseVillage;
import cn.source.system.service.IHouseVillageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 房源小区Controller
*
* @author 詹Sir
* @date 2022-03-27
*/
@RestController
@RequestMapping("/system/houseVillage")
public class HouseVillageController extends BaseController
{
@Autowired
private IHouseVillageService houseVillageService;
/**
* 查询房源小区列表
*/
@PreAuthorize("@ss.hasPermi('system:houseVillage:list')")
@GetMapping("/list")
public TableDataInfo list(HouseVillage houseVillage)
{
startPage();
List<HouseVillage> list = houseVillageService.selectHouseVillageList(houseVillage);
return getDataTable(list);
}
/**
* 导出房源小区列表
*/
@PreAuthorize("@ss.hasPermi('system:houseVillage:export')")
@Log(title = "房源小区", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, HouseVillage houseVillage)
{
List<HouseVillage> list = houseVillageService.selectHouseVillageList(houseVillage);
ExcelUtil<HouseVillage> util = new ExcelUtil<HouseVillage>(HouseVillage.class);
util.exportExcel(response, list, "房源小区数据");
}
/**
* 获取房源小区详细信息
*/
@PreAuthorize("@ss.hasPermi('system:houseVillage:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(houseVillageService.selectHouseVillageById(id));
}
/**
* 新增房源小区
*/
@PreAuthorize("@ss.hasPermi('system:houseVillage:add')")
@Log(title = "房源小区", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody HouseVillage houseVillage)
{
return toAjax(houseVillageService.insertHouseVillage(houseVillage));
}
/**
* 修改房源小区
*/
@PreAuthorize("@ss.hasPermi('system:houseVillage:edit')")
@Log(title = "房源小区", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody HouseVillage houseVillage)
{
return toAjax(houseVillageService.updateHouseVillage(houseVillage));
}
/**
* 删除房源小区
*/
@PreAuthorize("@ss.hasPermi('system:houseVillage:remove')")
@Log(title = "房源小区", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(houseVillageService.deleteHouseVillageByIds(ids));
}
}

View File

@ -0,0 +1,112 @@
package cn.source.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
/**
* 房源评价对象 house_evaluate
*
* @author wind
* @date 2023-04-14
*/
public class HouseEvaluate extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 房屋id */
@Excel(name = "房屋id")
private Long houseId;
/** 评价人id */
@Excel(name = "评价人id")
private Long evalUserId;
/** 评价人 */
@Excel(name = "评价人")
private String evalUser;
/** 评价 */
@Excel(name = "评价")
private String evaluate;
/** 状态 1显示 2删除 */
@Excel(name = "状态 1显示 2删除")
private Integer state;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setHouseId(Long houseId)
{
this.houseId = houseId;
}
public Long getHouseId()
{
return houseId;
}
public void setEvalUserId(Long evalUserId)
{
this.evalUserId = evalUserId;
}
public Long getEvalUserId()
{
return evalUserId;
}
public void setEvalUser(String evalUser)
{
this.evalUser = evalUser;
}
public String getEvalUser()
{
return evalUser;
}
public void setEvaluate(String evaluate)
{
this.evaluate = evaluate;
}
public String getEvaluate()
{
return evaluate;
}
public void setState(Integer state)
{
this.state = state;
}
public Integer getState()
{
return state;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("houseId", getHouseId())
.append("evalUserId", getEvalUserId())
.append("evalUser", getEvalUser())
.append("evaluate", getEvaluate())
.append("state", getState())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,59 @@
package cn.source.system.domain;
import cn.source.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 房源特色对象 house_feature
*
* @author 詹Sir
* @date 2022-03-27
*/
public class HouseFeature extends BaseEntity
{
private static final long serialVersionUID = 1L;
private Long id;
private Long houseId;
private String feature;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setHouseId(Long houseId)
{
this.houseId = houseId;
}
public Long getHouseId()
{
return houseId;
}
public void setFeature(String feature)
{
this.feature = feature;
}
public String getFeature()
{
return feature;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("houseId", getHouseId())
.append("feature", getFeature())
.toString();
}
}

View File

@ -0,0 +1,97 @@
package cn.source.system.domain;
import cn.source.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 房源图片对象 house_image
*
* @author 詹Sir
* @date 2022-03-27
*/
public class HouseImage extends BaseEntity
{
private static final long serialVersionUID = 1L;
private Long id;
private Long houseId;
private String imageName;
private String imagePath;
private String imgUrl;
private BigDecimal imageSize;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setHouseId(Long houseId)
{
this.houseId = houseId;
}
public Long getHouseId()
{
return houseId;
}
public void setImageName(String imageName)
{
this.imageName = imageName;
}
public String getImageName()
{
return imageName;
}
public void setImagePath(String imagePath)
{
this.imagePath = imagePath;
}
public String getImagePath()
{
return imagePath;
}
public void setImgUrl(String imgUrl)
{
this.imgUrl = imgUrl;
}
public String getImgUrl()
{
return imgUrl;
}
public void setImageSize(BigDecimal imageSize)
{
this.imageSize = imageSize;
}
public BigDecimal getImageSize()
{
return imageSize;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("houseId", getHouseId())
.append("imageName", getImageName())
.append("imagePath", getImagePath())
.append("imgUrl", getImgUrl())
.append("imageSize", getImageSize())
.toString();
}
}

View File

@ -0,0 +1,566 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 房源详情对象 house_room
*
* @author 詹Sir
* @date 2022-03-27
*/
public class HouseRoom extends BaseEntity
{
private static final long serialVersionUID = 1L;
private Long id;
/** 0整租/1合租 */
@Excel(name = "类型",readConverterExp="0=整租,1=合租")
private Integer type;
/** 居室 */
@Excel(name = "居室")
private String houseNum;
/** 厅室 */
@Excel(name = "厅室")
private String houseHall;
/** 卫生间 */
@Excel(name = "卫生间")
private String toiletNum;
// @Excel(name = "户型")
private String houseCode;
/** 整套面积 */
@Excel(name = "整套面积")
private BigDecimal houseArea;
/** 0主卧,1次卧 */
@Excel(name = "出租房间",readConverterExp="0=主卧,1=次卧")
private Integer roomType;
/** 房屋面积 */
@Excel(name = "房屋面积")
private Long roomArea;
/** 朝向 */
@Excel(name = "朝向")
private String direction;
@Excel(name = "装修")
private String decoration;
/** 租金 */
@Excel(name = "租金")
private BigDecimal price;
/** 起租日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "起租日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date startDate;
/** 0待审核1待出租,2:已出租,3:已下架 */
// @Excel(name = "状态",readConverterExp="0=待审核,1=待出租,2=已出租,3=已下架")
private Integer state;
/** 楼层 */
private String floor;
/** 楼房类型 */
private String stepType;
/** 房源描述 */
private String introduce;
/** 小区id */
private Long villageId;
/** 小区名称 */
@Excel(name = "小区名称")
private String villageName;
/** 小区城市 */
private String villageCity;
/** 详细地址,小区楼栋 */
@Excel(name = "详细地址")
private String address;
/** 门牌号 */
@Excel(name = "门牌号")
private String roomCode;
/** 房牌号 */
@Excel(name = "房牌号")
private String houseNo;
// @Excel(name = "房源代号")
private String code;
/** 付款方式 */
// @Excel(name = "付款方式")
private String payType;
/** 发布人id */
private Long publishId;
// @Excel(name = "经纪人")
private String agentName;
// @Excel(name = "经纪人电话")
private String agentPhone;
// @Excel(name = "经纪人头像")
private String agentAvatar;
/** 经纪人id */
private Long agentUserId;
@Excel(name = "房东")
private String ownerName;
@Excel(name = "房东电话")
private String owerPhone;
private String createName;
private String updateName;
private String faceUrl;
private List<HouseImage> imageList;
private List<HouseFeature> featureList;
private HouseVillage village;
/** 接收房源亮点查询条件 */
private String feature;
/** 是否点赞,true为点赞了 */
private boolean heart;
/** 精度 */
private String longitude;
/** 纬度 */
private String latitude;
public HouseVillage getVillage() {
return village;
}
public void setVillage(HouseVillage village) {
this.village = village;
}
public List<HouseFeature> getFeatureList() {
return featureList;
}
public void setFeatureList(List<HouseFeature> featureList) {
this.featureList = featureList;
}
public String getFeature() {
return feature;
}
public void setFeature(String feature) {
this.feature = feature;
}
public List<HouseImage> getImageList() {
return imageList;
}
public void setImageList(List<HouseImage> imageList) {
this.imageList = imageList;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setType(Integer type)
{
this.type = type;
}
public Integer getType()
{
return type;
}
public void setHouseNum(String houseNum)
{
this.houseNum = houseNum;
}
public String getHouseNum()
{
return houseNum;
}
public void setToiletNum(String toiletNum)
{
this.toiletNum = toiletNum;
}
public String getToiletNum()
{
return toiletNum;
}
public void setHouseArea(BigDecimal houseArea)
{
this.houseArea = houseArea;
}
public BigDecimal getHouseArea()
{
return houseArea;
}
public void setRoomType(Integer roomType)
{
this.roomType = roomType;
}
public Integer getRoomType()
{
return roomType;
}
public void setRoomCode(String roomCode)
{
this.roomCode = roomCode;
}
public String getRoomCode()
{
return roomCode;
}
public void setRoomArea(Long roomArea)
{
this.roomArea = roomArea;
}
public Long getRoomArea()
{
return roomArea;
}
public void setDirection(String direction)
{
this.direction = direction;
}
public String getDirection()
{
return direction;
}
public void setPrice(BigDecimal price)
{
this.price = price;
}
public BigDecimal getPrice()
{
return price;
}
public void setFloor(String floor)
{
this.floor = floor;
}
public String getFloor()
{
return floor;
}
public void setStepType(String stepType)
{
this.stepType = stepType;
}
public String getStepType()
{
return stepType;
}
public void setStartDate(Date startDate)
{
this.startDate = startDate;
}
public Date getStartDate()
{
return startDate;
}
public void setIntroduce(String introduce)
{
this.introduce = introduce;
}
public String getIntroduce()
{
return introduce;
}
public void setOwnerName(String ownerName)
{
this.ownerName = ownerName;
}
public String getOwnerName()
{
return ownerName;
}
public void setOwerPhone(String owerPhone)
{
this.owerPhone = owerPhone;
}
public String getOwerPhone()
{
return owerPhone;
}
public void setVillageId(Long villageId)
{
this.villageId = villageId;
}
public Long getVillageId()
{
return villageId;
}
public void setVillageName(String villageName)
{
this.villageName = villageName;
}
public String getVillageName()
{
return villageName;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setHouseNo(String houseNo)
{
this.houseNo = houseNo;
}
public String getHouseNo()
{
return houseNo;
}
public void setPayType(String payType)
{
this.payType = payType;
}
public String getPayType()
{
return payType;
}
public void setPublishId(Long publishId)
{
this.publishId = publishId;
}
public Long getPublishId()
{
return publishId;
}
public void setState(Integer state)
{
this.state = state;
}
public Integer getState()
{
return state;
}
public void setCreateName(String createName)
{
this.createName = createName;
}
public String getCreateName()
{
return createName;
}
public void setUpdateName(String updateName)
{
this.updateName = updateName;
}
public String getUpdateName()
{
return updateName;
}
public void setHouseHall(String houseHall)
{
this.houseHall = houseHall;
}
public String getHouseHall()
{
return houseHall;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setFaceUrl(String faceUrl)
{
this.faceUrl = faceUrl;
}
public String getFaceUrl()
{
return faceUrl;
}
public String getHouseCode() {
return houseCode;
}
public void setHouseCode(String houseCode) {
this.houseCode = houseCode;
}
public String getDecoration() {
return decoration;
}
public void setDecoration(String decoration) {
this.decoration = decoration;
}
public String getAgentName() {
return agentName;
}
public void setAgentName(String agentName) {
this.agentName = agentName;
}
public String getAgentPhone() {
return agentPhone;
}
public void setAgentPhone(String agentPhone) {
this.agentPhone = agentPhone;
}
public Long getAgentUserId() {
return agentUserId;
}
public void setAgentUserId(Long agentUserId) {
this.agentUserId = agentUserId;
}
public String getAgentAvatar() {
return agentAvatar;
}
public void setAgentAvatar(String agentAvatar) {
this.agentAvatar = agentAvatar;
}
public String getVillageCity() {
return villageCity;
}
public void setVillageCity(String villageCity) {
this.villageCity = villageCity;
}
public boolean isHeart() {
return heart;
}
public void setHeart(boolean heart) {
this.heart = heart;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("type", getType())
.append("houseNum", getHouseNum())
.append("toiletNum", getToiletNum())
.append("houseArea", getHouseArea())
.append("roomType", getRoomType())
.append("roomCode", getRoomCode())
.append("roomArea", getRoomArea())
.append("direction", getDirection())
.append("price", getPrice())
.append("floor", getFloor())
.append("stepType", getStepType())
.append("startDate", getStartDate())
.append("introduce", getIntroduce())
.append("ownerName", getOwnerName())
.append("owerPhone", getOwerPhone())
.append("villageId", getVillageId())
.append("villageName", getVillageName())
.append("address", getAddress())
.append("houseNo", getHouseNo())
.append("payType", getPayType())
.append("publishId", getPublishId())
.append("state", getState())
.append("createTime", getCreateTime())
.append("createName", getCreateName())
.append("updateTime", getUpdateTime())
.append("updateName", getUpdateName())
.append("remark", getRemark())
.append("houseHall", getHouseHall())
.append("code", getCode())
.append("faceUrl", getFaceUrl())
.append("decoration", getDecoration())
.append("agentName", getAgentName())
.append("agentPhone", getAgentPhone())
.append("agentUserId", getAgentUserId())
.append("villageCity", getVillageCity())
.toString();
}
}

View File

@ -0,0 +1,114 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 出租信息对象 house_user
*
* @author 詹Sir
* @date 2022-03-27
*/
public class HouseUser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long houseId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long userId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long publishId;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private BigDecimal actualPrice;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Integer state;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setHouseId(Long houseId)
{
this.houseId = houseId;
}
public Long getHouseId()
{
return houseId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setPublishId(Long publishId)
{
this.publishId = publishId;
}
public Long getPublishId()
{
return publishId;
}
public void setActualPrice(BigDecimal actualPrice)
{
this.actualPrice = actualPrice;
}
public BigDecimal getActualPrice()
{
return actualPrice;
}
public void setState(Integer state)
{
this.state = state;
}
public Integer getState()
{
return state;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("houseId", getHouseId())
.append("userId", getUserId())
.append("publishId", getPublishId())
.append("actualPrice", getActualPrice())
.append("state", getState())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,265 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 房源小区对象 house_village
*
* @author 詹Sir
* @date 2022-03-27
*/
public class HouseVillage extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 省 */
@Excel(name = "")
private String province;
/** 市 */
@Excel(name = "")
private String city;
/** 区 */
@Excel(name = "")
private String area;
/** 区域,便于显示城市信息 */
private String areaCode;
/** 名称 */
@Excel(name = "名称")
private String name;
/** 代号 */
@Excel(name = "代号")
private String code;
/** 年份 */
@Excel(name = "年份")
private Integer year;
/** 建筑类型 */
@Excel(name = "建筑类型")
private String type;
/** 绿化率 */
@Excel(name = "绿化率")
private BigDecimal green;
/** 介绍 */
@Excel(name = "介绍")
private String introduce;
/** 靠近地铁 */
@Excel(name = "靠近地铁")
private Integer wayState;
/** 地铁线路 */
@Excel(name = "地铁线路")
private String wayCode;
/** 地铁距离 */
@Excel(name = "地铁距离")
private Integer waySpace;
/** 经度 */
@Excel(name = "经度")
private BigDecimal lon;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal lat;
/** 状态 */
@Excel(name = "状态")
private Integer state;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setProvince(String province)
{
this.province = province;
}
public String getProvince()
{
return province;
}
public void setCity(String city)
{
this.city = city;
}
public String getCity()
{
return city;
}
public void setArea(String area)
{
this.area = area;
}
public String getArea()
{
return area;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setYear(Integer year)
{
this.year = year;
}
public Integer getYear()
{
return year;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setGreen(BigDecimal green)
{
this.green = green;
}
public BigDecimal getGreen()
{
return green;
}
public void setIntroduce(String introduce)
{
this.introduce = introduce;
}
public String getIntroduce()
{
return introduce;
}
public void setWayState(Integer wayState)
{
this.wayState = wayState;
}
public Integer getWayState()
{
return wayState;
}
public void setWayCode(String wayCode)
{
this.wayCode = wayCode;
}
public String getWayCode()
{
return wayCode;
}
public void setWaySpace(Integer waySpace)
{
this.waySpace = waySpace;
}
public Integer getWaySpace()
{
return waySpace;
}
public void setLon(BigDecimal lon)
{
this.lon = lon;
}
public BigDecimal getLon()
{
return lon;
}
public void setLat(BigDecimal lat)
{
this.lat = lat;
}
public BigDecimal getLat()
{
return lat;
}
public void setState(Integer state)
{
this.state = state;
}
public Integer getState()
{
return state;
}
public String getAreaCode() {
return areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("province", getProvince())
.append("city", getCity())
.append("area", getArea())
.append("name", getName())
.append("code", getCode())
.append("year", getYear())
.append("type", getType())
.append("green", getGreen())
.append("introduce", getIntroduce())
.append("wayState", getWayState())
.append("wayCode", getWayCode())
.append("waySpace", getWaySpace())
.append("lon", getLon())
.append("lat", getLat())
.append("state", getState())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,29 @@
package cn.source.system.enums;
/**
* 操作人类别
*
* @author 詹Sir
*/
public enum HouseStatus
{
AUDIT(0, "待审核") , SALEING(1, "待出租"), SALEED(2, "已出租"), CLOSE(3, "已下架");
private final Integer code;
private final String info;
HouseStatus(Integer code, String info)
{
this.code = code;
this.info = info;
}
public Integer getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@ -0,0 +1,63 @@
package cn.source.system.mapper;
import java.util.List;
import cn.source.system.domain.HouseEvaluate;
/**
* 房源评价Mapper接口
*
* @author wind
* @date 2023-04-14
*/
public interface HouseEvaluateMapper
{
/**
* 查询房源评价
*
* @param id 房源评价主键
* @return 房源评价
*/
public HouseEvaluate selectHouseEvaluateById(Long id);
/**
* 查询房源评价列表
*
* @param houseEvaluate 房源评价
* @return 房源评价集合
*/
public List<HouseEvaluate> selectHouseEvaluateList(HouseEvaluate houseEvaluate);
/**
* 新增房源评价
*
* @param houseEvaluate 房源评价
* @return 结果
*/
public int insertHouseEvaluate(HouseEvaluate houseEvaluate);
/**
* 修改房源评价
*
* @param houseEvaluate 房源评价
* @return 结果
*/
public int updateHouseEvaluate(HouseEvaluate houseEvaluate);
/**
* 删除房源评价
*
* @param id 房源评价主键
* @return 结果
*/
public int deleteHouseEvaluateById(Long id);
/**
* 批量删除房源评价
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteHouseEvaluateByIds(Long[] ids);
public int updateEvalState(Long[] ids);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.mapper;
import cn.source.system.domain.HouseFeature;
import java.util.List;
/**
* 房源特色Mapper接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface HouseFeatureMapper
{
/**
* 查询房源特色
*
* @param id 房源特色主键
* @return 房源特色
*/
public HouseFeature selectHouseFeatureById(Long id);
/**
* 查询房源特色列表
*
* @param houseFeature 房源特色
* @return 房源特色集合
*/
public List<HouseFeature> selectHouseFeatureList(HouseFeature houseFeature);
/**
* 新增房源特色
*
* @param houseFeature 房源特色
* @return 结果
*/
public int insertHouseFeature(HouseFeature houseFeature);
/**
* 修改房源特色
*
* @param houseFeature 房源特色
* @return 结果
*/
public int updateHouseFeature(HouseFeature houseFeature);
/**
* 删除房源特色
*
* @param id 房源特色主键
* @return 结果
*/
public int deleteHouseFeatureById(Long id);
/**
* 批量删除房源特色
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteHouseFeatureByIds(Long[] ids);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.mapper;
import cn.source.system.domain.HouseImage;
import java.util.List;
/**
* 房源图片Mapper接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface HouseImageMapper
{
/**
* 查询房源图片
*
* @param id 房源图片主键
* @return 房源图片
*/
public HouseImage selectHouseImageById(Long id);
/**
* 查询房源图片列表
*
* @param houseImage 房源图片
* @return 房源图片集合
*/
public List<HouseImage> selectHouseImageList(HouseImage houseImage);
/**
* 新增房源图片
*
* @param houseImage 房源图片
* @return 结果
*/
public int insertHouseImage(HouseImage houseImage);
/**
* 修改房源图片
*
* @param houseImage 房源图片
* @return 结果
*/
public int updateHouseImage(HouseImage houseImage);
/**
* 删除房源图片
*
* @param id 房源图片主键
* @return 结果
*/
public int deleteHouseImageById(Long id);
/**
* 批量删除房源图片
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteHouseImageByIds(Long[] ids);
}

View File

@ -0,0 +1,163 @@
package cn.source.system.mapper;
import cn.source.system.domain.HouseFeature;
import cn.source.system.domain.HouseImage;
import cn.source.system.domain.HouseRoom;
import java.util.List;
import java.util.Map;
/**
* 房源详情Mapper接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface HouseRoomMapper
{
/**
* 查询房源详情
*
* @param id 房源详情主键
* @return 房源详情
*/
public HouseRoom selectHouseRoomById(Long id);
/**
* 查询房源详情
*
* @param code 代号
* @return 房源详情
*/
public HouseRoom selectHouseRoomByCode(String code);
/**
* 查询房源详情列表
*
* @param houseRoom 房源详情
* @return 房源详情集合
*/
public List<HouseRoom> selectHouseRoomList(HouseRoom houseRoom);
/**
* 新增房源详情
*
* @param houseRoom 房源详情
* @return 结果
*/
public int insertHouseRoom(HouseRoom houseRoom);
/**
* 修改房源详情
*
* @param houseRoom 房源详情
* @return 结果
*/
public int updateHouseRoom(HouseRoom houseRoom);
/**
* 设置房源经纪人
*/
public int updateHouseAgent(Map<String,Object> houseMap);
/**
* 修改房源详情
*
* @param houseMap 房源详情
* @return 结果
*/
public int updateHouseRoomByIds(Map<String,Object> houseMap);
/**
* 删除房源详情
*
* @param id 房源详情主键
* @return 结果
*/
public int deleteHouseRoomById(Long id);
/**
* 批量删除房源详情
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteHouseRoomByIds(Long[] ids);
/**
* 新增房源图片
*
* @param houseRoom 房源详情
* @return 结果
*/
public int insertHouseImage(HouseRoom houseRoom);
/**
* 删除房源图片
*
* @param id 房源详情主键
* @return 结果
*/
public int deleteHouseImageByHouseId(Long id);
/**
* 删除收藏记录
*
* @param id 房源详情主键
* @return 结果
*/
public int deleteHouseHeartByHouseId(Long id);
/**
* 新增房源特色
*
* @param houseRoom 房源详情
* @return 结果
*/
public int insertHouseFeature(HouseRoom houseRoom);
/**
* 删除房源亮点
*
* @param id 房源详情主键
* @return 结果
*/
public int deleteHouseFeatureByHouseId(Long id);
/**
* 查询房源图片详情
*
* @param houseRoom 房源详情
* @return 房源详情
*/
public List<HouseImage> selectHouseImage(HouseRoom houseRoom);
/**
* 查询房源亮点详情
*
* @param houseRoom 房源详情
* @return 房源详情
*/
public List<HouseFeature> selectHouseFeature(HouseRoom houseRoom);
/**
* 房源收藏
*/
public int saveHeart(Map<String,Object> houseMap);
/**
* 房源取消收藏
*/
public int cancelHeart(Map<String,Object> houseMap);
/**
* 查询收藏数据
*/
public Long selectHouseHeart(Map<String,Object> houseMap);
/**
* 获取收藏房源列表
*/
public List<HouseRoom> findHouseHeartList(Long userId);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.mapper;
import cn.source.system.domain.HouseUser;
import java.util.List;
/**
* 出租信息Mapper接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface HouseUserMapper
{
/**
* 查询出租信息
*
* @param id 出租信息主键
* @return 出租信息
*/
public HouseUser selectHouseUserById(Long id);
/**
* 查询出租信息列表
*
* @param houseUser 出租信息
* @return 出租信息集合
*/
public List<HouseUser> selectHouseUserList(HouseUser houseUser);
/**
* 新增出租信息
*
* @param houseUser 出租信息
* @return 结果
*/
public int insertHouseUser(HouseUser houseUser);
/**
* 修改出租信息
*
* @param houseUser 出租信息
* @return 结果
*/
public int updateHouseUser(HouseUser houseUser);
/**
* 删除出租信息
*
* @param id 出租信息主键
* @return 结果
*/
public int deleteHouseUserById(Long id);
/**
* 批量删除出租信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteHouseUserByIds(Long[] ids);
}

View File

@ -0,0 +1,70 @@
package cn.source.system.mapper;
import cn.source.system.domain.HouseVillage;
import java.util.List;
/**
* 房源小区Mapper接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface HouseVillageMapper
{
/**
* 查询房源小区
*
* @param id 房源小区主键
* @return 房源小区
*/
public HouseVillage selectHouseVillageById(Long id);
/**
* 查询房源小区列表
*
* @param houseVillage 房源小区
* @return 房源小区集合
*/
public List<HouseVillage> selectHouseVillageList(HouseVillage houseVillage);
/**
* 新增房源小区
*
* @param houseVillage 房源小区
* @return 结果
*/
public int insertHouseVillage(HouseVillage houseVillage);
/**
* 修改房源小区
*
* @param houseVillage 房源小区
* @return 结果
*/
public int updateHouseVillage(HouseVillage houseVillage);
/**
* 删除房源小区
*
* @param id 房源小区主键
* @return 结果
*/
public int deleteHouseVillageById(Long id);
/**
* 批量删除房源小区
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteHouseVillageByIds(Long[] ids);
/**
* 查询房源小区
*
* @param houseVillage 房源小区
* @return 房源小区集合
*/
public HouseVillage selectHouseVillage(HouseVillage houseVillage);
}

View File

@ -0,0 +1,61 @@
package cn.source.system.service;
import java.util.List;
import cn.source.system.domain.HouseEvaluate;
/**
* 房源评价Service接口
*
* @author wind
* @date 2023-04-14
*/
public interface IHouseEvaluateService
{
/**
* 查询房源评价
*
* @param id 房源评价主键
* @return 房源评价
*/
public HouseEvaluate selectHouseEvaluateById(Long id);
/**
* 查询房源评价列表
*
* @param houseEvaluate 房源评价
* @return 房源评价集合
*/
public List<HouseEvaluate> selectHouseEvaluateList(HouseEvaluate houseEvaluate);
/**
* 新增房源评价
*
* @param houseEvaluate 房源评价
* @return 结果
*/
public int insertHouseEvaluate(HouseEvaluate houseEvaluate);
/**
* 修改房源评价
*
* @param houseEvaluate 房源评价
* @return 结果
*/
public int updateHouseEvaluate(HouseEvaluate houseEvaluate);
/**
* 批量删除房源评价
*
* @param ids 需要删除的房源评价主键集合
* @return 结果
*/
public int deleteHouseEvaluateByIds(Long[] ids);
/**
* 删除房源评价信息
*
* @param id 房源评价主键
* @return 结果
*/
public int deleteHouseEvaluateById(Long id);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.service;
import cn.source.system.domain.HouseFeature;
import java.util.List;
/**
* 房源特色Service接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface IHouseFeatureService
{
/**
* 查询房源特色
*
* @param id 房源特色主键
* @return 房源特色
*/
public HouseFeature selectHouseFeatureById(Long id);
/**
* 查询房源特色列表
*
* @param houseFeature 房源特色
* @return 房源特色集合
*/
public List<HouseFeature> selectHouseFeatureList(HouseFeature houseFeature);
/**
* 新增房源特色
*
* @param houseFeature 房源特色
* @return 结果
*/
public int insertHouseFeature(HouseFeature houseFeature);
/**
* 修改房源特色
*
* @param houseFeature 房源特色
* @return 结果
*/
public int updateHouseFeature(HouseFeature houseFeature);
/**
* 批量删除房源特色
*
* @param ids 需要删除的房源特色主键集合
* @return 结果
*/
public int deleteHouseFeatureByIds(Long[] ids);
/**
* 删除房源特色信息
*
* @param id 房源特色主键
* @return 结果
*/
public int deleteHouseFeatureById(Long id);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.service;
import cn.source.system.domain.HouseImage;
import java.util.List;
/**
* 房源图片Service接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface IHouseImageService
{
/**
* 查询房源图片
*
* @param id 房源图片主键
* @return 房源图片
*/
public HouseImage selectHouseImageById(Long id);
/**
* 查询房源图片列表
*
* @param houseImage 房源图片
* @return 房源图片集合
*/
public List<HouseImage> selectHouseImageList(HouseImage houseImage);
/**
* 新增房源图片
*
* @param houseImage 房源图片
* @return 结果
*/
public int insertHouseImage(HouseImage houseImage);
/**
* 修改房源图片
*
* @param houseImage 房源图片
* @return 结果
*/
public int updateHouseImage(HouseImage houseImage);
/**
* 批量删除房源图片
*
* @param ids 需要删除的房源图片主键集合
* @return 结果
*/
public int deleteHouseImageByIds(Long[] ids);
/**
* 删除房源图片信息
*
* @param id 房源图片主键
* @return 结果
*/
public int deleteHouseImageById(Long id);
}

View File

@ -0,0 +1,119 @@
package cn.source.system.service;
import cn.source.system.domain.HouseRoom;
import java.util.List;
import java.util.Map;
/**
* 房源详情Service接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface IHouseRoomService
{
/**
* 查询房源详情
*
* @param id 房源详情主键
* @return 房源详情
*/
public HouseRoom selectHouseRoomById(Long id);
/**
* 查询房源详情列表
*
* @param houseRoom 房源详情
* @return 房源详情集合
*/
public List<HouseRoom> findHouseRoomList(HouseRoom houseRoom);
/**
* 查询房源详情列表
*
* @param houseRoom 房源详情
* @return 房源详情集合
*/
public List<HouseRoom> selectHouseRoomList(HouseRoom houseRoom);
/**
* 新增房源详情
*
* @param houseRoom 房源详情
* @return 结果
*/
public int insertHouseRoom(HouseRoom houseRoom);
/**
* 修改房源详情
*
* @param houseRoom 房源详情
* @return 结果
*/
public int updateHouseRoom(HouseRoom houseRoom);
/**
* 设置房源经纪人
*/
public int updateHouseAgent(Long[] ids,Long userId);
/**
* 批量删除房源详情
*
* @param ids 需要删除的房源详情主键集合
* @return 结果
*/
public int deleteHouseRoomByIds(Long[] ids);
/**
* 批量修改房源详情
*
* @param ids 需要删除的房源详情主键集合
*/
public int updateHouseRoomByIds(Long[] ids,Integer state);
/**
* 删除房源详情信息
*
* @param id 房源详情主键
* @return 结果
*/
public int deleteHouseRoomById(Long id);
/**
* api新增房源详情
*
* @param houseRoom 房源详情
* @return 结果
*/
public int apiInsertHouseRoom(HouseRoom houseRoom);
/**
* 查询房源相关详情信息
*
* @param houseRoom 房源
* @return 房源详情
*/
public HouseRoom selectDetailHouseRoom(HouseRoom houseRoom);
/**
* 导入房源
*/
public String importHouse(List<HouseRoom> houseList, Boolean isUpdateSupport);
/**
* 收藏/取消收藏
*/
public String saveHeart(boolean heart,Long userId,String houseId);
/**
* 查询收藏数据
*/
public Long selectHouseHeart(Map<String,Object> houseMap);
/**
* 获取收藏房源列表
*/
public List<HouseRoom> findHouseHeartList(Long userId);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.service;
import cn.source.system.domain.HouseUser;
import java.util.List;
/**
* 出租信息Service接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface IHouseUserService
{
/**
* 查询出租信息
*
* @param id 出租信息主键
* @return 出租信息
*/
public HouseUser selectHouseUserById(Long id);
/**
* 查询出租信息列表
*
* @param houseUser 出租信息
* @return 出租信息集合
*/
public List<HouseUser> selectHouseUserList(HouseUser houseUser);
/**
* 新增出租信息
*
* @param houseUser 出租信息
* @return 结果
*/
public int insertHouseUser(HouseUser houseUser);
/**
* 修改出租信息
*
* @param houseUser 出租信息
* @return 结果
*/
public int updateHouseUser(HouseUser houseUser);
/**
* 批量删除出租信息
*
* @param ids 需要删除的出租信息主键集合
* @return 结果
*/
public int deleteHouseUserByIds(Long[] ids);
/**
* 删除出租信息信息
*
* @param id 出租信息主键
* @return 结果
*/
public int deleteHouseUserById(Long id);
}

View File

@ -0,0 +1,70 @@
package cn.source.system.service;
import cn.source.system.domain.HouseVillage;
import java.util.List;
/**
* 房源小区Service接口
*
* @author 詹Sir
* @date 2022-03-27
*/
public interface IHouseVillageService
{
/**
* 查询房源小区
*
* @param id 房源小区主键
* @return 房源小区
*/
public HouseVillage selectHouseVillageById(Long id);
/**
* 查询房源小区列表
*
* @param houseVillage 房源小区
* @return 房源小区集合
*/
public List<HouseVillage> selectHouseVillageList(HouseVillage houseVillage);
/**
* 新增房源小区
*
* @param houseVillage 房源小区
* @return 结果
*/
public int insertHouseVillage(HouseVillage houseVillage);
/**
* 修改房源小区
*
* @param houseVillage 房源小区
* @return 结果
*/
public int updateHouseVillage(HouseVillage houseVillage);
/**
* 批量删除房源小区
*
* @param ids 需要删除的房源小区主键集合
* @return 结果
*/
public int deleteHouseVillageByIds(Long[] ids);
/**
* 删除房源小区信息
*
* @param id 房源小区主键
* @return 结果
*/
public int deleteHouseVillageById(Long id);
/**
* 通过小区名称查询房源小区
*
* @param houseVillage 房源小区
* @return 房源小区集合
*/
public HouseVillage selectHouseVillage(HouseVillage houseVillage);
}

View File

@ -0,0 +1,98 @@
package cn.source.system.service.impl;
import java.util.List;
import cn.source.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.source.system.mapper.HouseEvaluateMapper;
import cn.source.system.domain.HouseEvaluate;
import cn.source.system.service.IHouseEvaluateService;
/**
* 房源评价Service业务层处理
*
* @author wind
* @date 2023-04-14
*/
@Service
public class HouseEvaluateServiceImpl implements IHouseEvaluateService
{
@Autowired
private HouseEvaluateMapper houseEvaluateMapper;
/**
* 查询房源评价
*
* @param id 房源评价主键
* @return 房源评价
*/
@Override
public HouseEvaluate selectHouseEvaluateById(Long id)
{
return houseEvaluateMapper.selectHouseEvaluateById(id);
}
/**
* 查询房源评价列表
*
* @param houseEvaluate 房源评价
* @return 房源评价
*/
@Override
public List<HouseEvaluate> selectHouseEvaluateList(HouseEvaluate houseEvaluate)
{
return houseEvaluateMapper.selectHouseEvaluateList(houseEvaluate);
}
/**
* 新增房源评价
*
* @param houseEvaluate 房源评价
* @return 结果
*/
@Override
public int insertHouseEvaluate(HouseEvaluate houseEvaluate)
{
houseEvaluate.setCreateTime(DateUtils.getNowDate());
houseEvaluate.setState(1);
return houseEvaluateMapper.insertHouseEvaluate(houseEvaluate);
}
/**
* 修改房源评价
*
* @param houseEvaluate 房源评价
* @return 结果
*/
@Override
public int updateHouseEvaluate(HouseEvaluate houseEvaluate)
{
houseEvaluate.setUpdateTime(DateUtils.getNowDate());
return houseEvaluateMapper.updateHouseEvaluate(houseEvaluate);
}
/**
* 批量删除房源评价
*
* @param ids 需要删除的房源评价主键
* @return 结果
*/
@Override
public int deleteHouseEvaluateByIds(Long[] ids)
{
//改写为状态更新
return houseEvaluateMapper.updateEvalState(ids);
}
/**
* 删除房源评价信息
*
* @param id 房源评价主键
* @return 结果
*/
@Override
public int deleteHouseEvaluateById(Long id)
{
return houseEvaluateMapper.deleteHouseEvaluateById(id);
}
}

View File

@ -0,0 +1,94 @@
package cn.source.system.service.impl;
import cn.source.system.domain.HouseFeature;
import cn.source.system.mapper.HouseFeatureMapper;
import cn.source.system.service.IHouseFeatureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 房源特色Service业务层处理
*
* @author 詹Sir
* @date 2022-03-27
*/
@Service
public class HouseFeatureServiceImpl implements IHouseFeatureService
{
@Autowired
private HouseFeatureMapper houseFeatureMapper;
/**
* 查询房源特色
*
* @param id 房源特色主键
* @return 房源特色
*/
@Override
public HouseFeature selectHouseFeatureById(Long id)
{
return houseFeatureMapper.selectHouseFeatureById(id);
}
/**
* 查询房源特色列表
*
* @param houseFeature 房源特色
* @return 房源特色
*/
@Override
public List<HouseFeature> selectHouseFeatureList(HouseFeature houseFeature)
{
return houseFeatureMapper.selectHouseFeatureList(houseFeature);
}
/**
* 新增房源特色
*
* @param houseFeature 房源特色
* @return 结果
*/
@Override
public int insertHouseFeature(HouseFeature houseFeature)
{
return houseFeatureMapper.insertHouseFeature(houseFeature);
}
/**
* 修改房源特色
*
* @param houseFeature 房源特色
* @return 结果
*/
@Override
public int updateHouseFeature(HouseFeature houseFeature)
{
return houseFeatureMapper.updateHouseFeature(houseFeature);
}
/**
* 批量删除房源特色
*
* @param ids 需要删除的房源特色主键
* @return 结果
*/
@Override
public int deleteHouseFeatureByIds(Long[] ids)
{
return houseFeatureMapper.deleteHouseFeatureByIds(ids);
}
/**
* 删除房源特色信息
*
* @param id 房源特色主键
* @return 结果
*/
@Override
public int deleteHouseFeatureById(Long id)
{
return houseFeatureMapper.deleteHouseFeatureById(id);
}
}

View File

@ -0,0 +1,94 @@
package cn.source.system.service.impl;
import cn.source.system.domain.HouseImage;
import cn.source.system.mapper.HouseImageMapper;
import cn.source.system.service.IHouseImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 房源图片Service业务层处理
*
* @author 詹Sir
* @date 2022-03-27
*/
@Service
public class HouseImageServiceImpl implements IHouseImageService
{
@Autowired
private HouseImageMapper houseImageMapper;
/**
* 查询房源图片
*
* @param id 房源图片主键
* @return 房源图片
*/
@Override
public HouseImage selectHouseImageById(Long id)
{
return houseImageMapper.selectHouseImageById(id);
}
/**
* 查询房源图片列表
*
* @param houseImage 房源图片
* @return 房源图片
*/
@Override
public List<HouseImage> selectHouseImageList(HouseImage houseImage)
{
return houseImageMapper.selectHouseImageList(houseImage);
}
/**
* 新增房源图片
*
* @param houseImage 房源图片
* @return 结果
*/
@Override
public int insertHouseImage(HouseImage houseImage)
{
return houseImageMapper.insertHouseImage(houseImage);
}
/**
* 修改房源图片
*
* @param houseImage 房源图片
* @return 结果
*/
@Override
public int updateHouseImage(HouseImage houseImage)
{
return houseImageMapper.updateHouseImage(houseImage);
}
/**
* 批量删除房源图片
*
* @param ids 需要删除的房源图片主键
* @return 结果
*/
@Override
public int deleteHouseImageByIds(Long[] ids)
{
return houseImageMapper.deleteHouseImageByIds(ids);
}
/**
* 删除房源图片信息
*
* @param id 房源图片主键
* @return 结果
*/
@Override
public int deleteHouseImageById(Long id)
{
return houseImageMapper.deleteHouseImageById(id);
}
}

View File

@ -0,0 +1,381 @@
package cn.source.system.service.impl;
import cn.source.common.core.domain.entity.SysRole;
import cn.source.common.core.domain.entity.SysUser;
import cn.source.common.core.domain.model.LoginUser;
import cn.source.common.exception.ServiceException;
import cn.source.common.utils.DateUtils;
import cn.source.common.utils.SecurityUtils;
import cn.source.common.utils.StringUtils;
import cn.source.common.utils.uuid.CodeUtil;
import cn.source.system.domain.HouseRoom;
import cn.source.system.domain.HouseVillage;
import cn.source.system.enums.HouseStatus;
import cn.source.system.mapper.HouseRoomMapper;
import cn.source.system.service.IHouseRoomService;
import cn.source.system.service.IHouseVillageService;
import cn.source.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 房源详情Service业务层处理
*
* @author 詹Sir
* @date 2022-03-27
*/
@Service
public class HouseRoomServiceImpl implements IHouseRoomService
{
@Autowired
private ISysUserService userService;
@Autowired
private IHouseVillageService houseVillageService;
@Autowired
private HouseRoomMapper houseRoomMapper;
/**
* 数据权限过滤关键字
*/
public static final String DATA_SCOPE = "dataScope";
/**
* 仅本人数据权限
*/
public static final String DATA_SCOPE_SELF = "5";
/**
* 查询房源详情
*
* @param id 房源详情主键
* @return 房源详情
*/
@Override
public HouseRoom selectHouseRoomById(Long id)
{
HouseRoom houseRoom = houseRoomMapper.selectHouseRoomById(id);
houseRoom.setFeatureList(houseRoomMapper.selectHouseFeature(houseRoom));
houseRoom.setImageList(houseRoomMapper.selectHouseImage(houseRoom));
return houseRoom;
}
/**
* 查询房源详情列表
*
* @param houseRoom 房源详情
* @return 房源详情
*/
@Override
public List<HouseRoom> findHouseRoomList(HouseRoom houseRoom)
{
return houseRoomMapper.selectHouseRoomList(houseRoom);
}
/**
* 查询房源详情列表
*
* @param houseRoom 房源详情
* @return 房源详情
*/
@Override
public List<HouseRoom> selectHouseRoomList(HouseRoom houseRoom)
{
// 获取当前的用户
LoginUser loginUser = SecurityUtils.getLoginUser();
if (StringUtils.isNotNull(loginUser))
{
SysUser currentUser = loginUser.getUser();
// 如果是超级管理员则不过滤数据
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
{
for (SysRole role : currentUser.getRoles())
{
String dataScope = role.getDataScope();
// 仅有查询自己的数据权限时将本人的房源与负责的房源(经纪人)都查询出来
if (DATA_SCOPE_SELF.equals(dataScope))
{
String appendSql = StringUtils.format("house.agent_User_Id = {} ", currentUser.getUserId());
appendSql += StringUtils.format(" OR house.publish_id = {} ", currentUser.getUserId());
houseRoom.getParams().put(DATA_SCOPE, " AND (" + appendSql + ")");
}
}
}
}
return houseRoomMapper.selectHouseRoomList(houseRoom);
}
/**
* 新增房源详情
*
* @param houseRoom 房源详情
* @return 结果
*/
@Override
public int insertHouseRoom(HouseRoom houseRoom)
{
return insertRoom(houseRoom);
}
/**
* 修改房源详情
*
* @param houseRoom 房源详情
* @return 结果
*/
@Override
public int updateHouseRoom(HouseRoom houseRoom)
{
houseRoom.setUpdateTime(DateUtils.getNowDate());
if(StringUtils.isNotNull(houseRoom.getFeatureList()) && houseRoom.getFeatureList().size()>0){
// 先删除再插入
houseRoomMapper.deleteHouseFeatureByHouseId(houseRoom.getId());
houseRoomMapper.insertHouseFeature(houseRoom);
}
if(StringUtils.isNotNull(houseRoom.getImageList()) && houseRoom.getImageList().size()>0){
// 先删除再插入
houseRoomMapper.deleteHouseImageByHouseId(houseRoom.getId());
houseRoom.setFaceUrl(houseRoom.getImageList().get(0).getImgUrl());
houseRoomMapper.insertHouseImage(houseRoom);
}
return houseRoomMapper.updateHouseRoom(houseRoom);
}
/**
* 设置房源经纪人
* @param userId 选中经纪人ID
*/
@Override
public int updateHouseAgent(Long[] ids,Long userId)
{
Map<String,Object> houseMap=new HashMap<String,Object>();
houseMap.put("ids",ids);
SysUser sysUser = userService.selectUserById(userId);
houseMap.put("agentUserId",userId);
houseMap.put("agentName",sysUser.getNickName());
houseMap.put("agentPhone",sysUser.getPhonenumber());
houseMap.put("agentAvatar",sysUser.getAvatar());
return houseRoomMapper.updateHouseAgent(houseMap);
}
/**
* 修改房源详情
*
* @param houseRoom 房源详情
* @return 结果
*/
@Override
public int updateHouseRoomByIds(Long[] ids,Integer state)
{
Map<String,Object> houseMap=new HashMap<String,Object>();
houseMap.put("ids",ids);
houseMap.put("state",state);
return houseRoomMapper.updateHouseRoomByIds(houseMap);
}
/**
* 批量删除房源详情
*
* @param ids 需要删除的房源详情主键
* @return 结果
*/
@Override
public int deleteHouseRoomByIds(Long[] ids)
{
for (Long id : ids) {
houseRoomMapper.deleteHouseFeatureByHouseId(id);
houseRoomMapper.deleteHouseImageByHouseId(id);
}
return houseRoomMapper.deleteHouseRoomByIds(ids);
}
/**
* 删除房源详情信息
*
* @param id 房源详情主键
* @return 结果
*/
@Override
public int deleteHouseRoomById(Long id)
{
houseRoomMapper.deleteHouseFeatureByHouseId(id);
houseRoomMapper.deleteHouseImageByHouseId(id);
houseRoomMapper.deleteHouseHeartByHouseId(id);
return houseRoomMapper.deleteHouseRoomById(id);
}
/**
* API新增房源详情
*
* @param houseRoom 房源详情
* @return 结果
*/
@Override
public int apiInsertHouseRoom(HouseRoom houseRoom)
{
return insertRoom(houseRoom);
}
/**
* 查询房源相关详情信息
*
* @param houseRoom 房源
* @return 房源详情
*/
@Override
public HouseRoom selectDetailHouseRoom(HouseRoom houseRoom) {
houseRoom.setVillage(houseVillageService.selectHouseVillageById(houseRoom.getVillageId()));
// houseRoom.setImageList(houseRoomMapper.selectHouseImage(houseRoom));
// houseRoom.setFeatureList(houseRoomMapper.selectHouseFeature(houseRoom));
return houseRoom;
}
/**
* @Description: 将保存房源的方法统一到此方法中
* @author: 詹Sir
*/
public int insertRoom(HouseRoom houseRoom){
// 待审核
houseRoom.setState(HouseStatus.AUDIT.getCode());
houseRoom.setCreateTime(DateUtils.getNowDate());
if(StringUtils.isNull(houseRoom.getPublishId())){
houseRoom.setPublishId(SecurityUtils.getUserId());
}
if(StringUtils.isNull(houseRoom.getStartDate())){
houseRoom.setStartDate(new Date());
}
if(StringUtils.isEmpty(houseRoom.getVillageName())){
HouseVillage houseVillage = houseVillageService.selectHouseVillageById(houseRoom.getVillageId());
houseRoom.setVillageName(houseVillage.getName());
}
if(StringUtils.isNull(houseRoom.getVillageId())){
HouseVillage houseVillage = new HouseVillage();
houseVillage.setName(houseRoom.getVillageName());
houseVillage = houseVillageService.selectHouseVillage(houseVillage);
houseRoom.setVillageId(houseVillage.getId());
}
houseRoom.setCode(CodeUtil.getCodeByUUId());
// 封面图设置默认值
houseRoom.setFaceUrl("https://sourcebyte.vip/profile/customer/file/loading.png");
houseRoomMapper.insertHouseRoom(houseRoom);
if(StringUtils.isNotNull(houseRoom.getFeatureList()) && houseRoom.getFeatureList().size()>0){
houseRoomMapper.insertHouseFeature(houseRoom);
}
if(StringUtils.isNotNull(houseRoom.getImageList()) && houseRoom.getImageList().size()>0){
houseRoom.setFaceUrl(houseRoom.getImageList().get(0).getImgUrl());
houseRoomMapper.insertHouseImage(houseRoom);
}
return houseRoomMapper.updateHouseRoom(houseRoom);
}
/**
* 导入房源数据
*
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @return 结果
*/
@Override
public String importHouse(List<HouseRoom> houseList, Boolean isUpdateSupport)
{
if (StringUtils.isNull(houseList) || houseList.size() == 0)
{
throw new ServiceException("导入数据不能为空!");
}
int execlSortNo = 1;
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (HouseRoom houseRoom : houseList)
{
execlSortNo++;
try{
if(StringUtils.isNull(houseRoom.getType())){
failureNum++;
failureMsg.append("<br/>Execl第 "+execlSortNo+" 行类型不能为空,需填写整租/合租");
}
if(StringUtils.isEmpty(houseRoom.getHouseNum())){
failureNum++;
failureMsg.append("<br/>Execl第 "+execlSortNo+" 行居室不能为空");
}
if(StringUtils.isEmpty(houseRoom.getHouseHall())){
failureNum++;
failureMsg.append("<br/>Execl第 "+execlSortNo+" 行厅室不能为空");
}
if(StringUtils.isEmpty(houseRoom.getCode())){
successNum++;
successMsg.append("<br/>Execl第 "+execlSortNo+" 行新增成功");
insertRoom(houseRoom);
}else{
HouseRoom house = houseRoomMapper.selectHouseRoomByCode(houseRoom.getCode());
if(StringUtils.isNotNull(house) && isUpdateSupport){
successNum++;
successMsg.append("<br/>Execl第 "+execlSortNo+" 行更新成功");
houseRoom.setId(house.getId());
updateHouseRoom(houseRoom);
}else{
failureNum++;
failureMsg.append("<br/>Execl第 "+execlSortNo+" 行房源已存在,如需覆盖请勾选确认更新");
}
}
}catch (Exception e){
failureNum++;
String msg = "<br/>Execl第 "+execlSortNo+" 行导入失败:";
failureMsg.append(msg + e.getMessage());
}
}
if (failureNum > 0){
failureMsg.insert(0, "很抱歉,导入出现错误!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
}else{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
/**
* 收藏/取消收藏
*/
@Override
public String saveHeart(boolean heart,Long userId,String houseId)
{
String msg = "收藏成功";
Map<String,Object> houseMap=new HashMap<String,Object>();
houseMap.put("houseId",houseId);
houseMap.put("userId",userId);
if(!heart){
// 收藏
houseRoomMapper.saveHeart(houseMap);
}else {
// 取消收藏
houseRoomMapper.cancelHeart(houseMap);
msg = "取消收藏";
}
return msg;
}
/**
* 查询收藏数据
*/
@Override
public Long selectHouseHeart(Map<String,Object> houseMap)
{
return houseRoomMapper.selectHouseHeart(houseMap);
}
/**
* 获取收藏房源列表
*/
@Override
public List<HouseRoom> findHouseHeartList(Long userId)
{
return houseRoomMapper.findHouseHeartList(userId);
}
}

View File

@ -0,0 +1,97 @@
package cn.source.system.service.impl;
import cn.source.common.utils.DateUtils;
import cn.source.system.domain.HouseUser;
import cn.source.system.mapper.HouseUserMapper;
import cn.source.system.service.IHouseUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 出租信息Service业务层处理
*
* @author 詹Sir
* @date 2022-03-27
*/
@Service
public class HouseUserServiceImpl implements IHouseUserService
{
@Autowired
private HouseUserMapper houseUserMapper;
/**
* 查询出租信息
*
* @param id 出租信息主键
* @return 出租信息
*/
@Override
public HouseUser selectHouseUserById(Long id)
{
return houseUserMapper.selectHouseUserById(id);
}
/**
* 查询出租信息列表
*
* @param houseUser 出租信息
* @return 出租信息
*/
@Override
public List<HouseUser> selectHouseUserList(HouseUser houseUser)
{
return houseUserMapper.selectHouseUserList(houseUser);
}
/**
* 新增出租信息
*
* @param houseUser 出租信息
* @return 结果
*/
@Override
public int insertHouseUser(HouseUser houseUser)
{
houseUser.setCreateTime(DateUtils.getNowDate());
return houseUserMapper.insertHouseUser(houseUser);
}
/**
* 修改出租信息
*
* @param houseUser 出租信息
* @return 结果
*/
@Override
public int updateHouseUser(HouseUser houseUser)
{
houseUser.setUpdateTime(DateUtils.getNowDate());
return houseUserMapper.updateHouseUser(houseUser);
}
/**
* 批量删除出租信息
*
* @param ids 需要删除的出租信息主键
* @return 结果
*/
@Override
public int deleteHouseUserByIds(Long[] ids)
{
return houseUserMapper.deleteHouseUserByIds(ids);
}
/**
* 删除出租信息信息
*
* @param id 出租信息主键
* @return 结果
*/
@Override
public int deleteHouseUserById(Long id)
{
return houseUserMapper.deleteHouseUserById(id);
}
}

View File

@ -0,0 +1,109 @@
package cn.source.system.service.impl;
import cn.source.common.utils.DateUtils;
import cn.source.system.domain.HouseVillage;
import cn.source.system.mapper.HouseVillageMapper;
import cn.source.system.service.IHouseVillageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 房源小区Service业务层处理
*
* @author 詹Sir
* @date 2022-03-27
*/
@Service
public class HouseVillageServiceImpl implements IHouseVillageService
{
@Autowired
private HouseVillageMapper houseVillageMapper;
/**
* 查询房源小区
*
* @param id 房源小区主键
* @return 房源小区
*/
@Override
public HouseVillage selectHouseVillageById(Long id)
{
return houseVillageMapper.selectHouseVillageById(id);
}
/**
* 查询房源小区列表
*
* @param houseVillage 房源小区
* @return 房源小区
*/
@Override
public List<HouseVillage> selectHouseVillageList(HouseVillage houseVillage)
{
return houseVillageMapper.selectHouseVillageList(houseVillage);
}
/**
* 新增房源小区
*
* @param houseVillage 房源小区
* @return 结果
*/
@Override
public int insertHouseVillage(HouseVillage houseVillage)
{
houseVillage.setCreateTime(DateUtils.getNowDate());
return houseVillageMapper.insertHouseVillage(houseVillage);
}
/**
* 修改房源小区
*
* @param houseVillage 房源小区
* @return 结果
*/
@Override
public int updateHouseVillage(HouseVillage houseVillage)
{
houseVillage.setUpdateTime(DateUtils.getNowDate());
return houseVillageMapper.updateHouseVillage(houseVillage);
}
/**
* 批量删除房源小区
*
* @param ids 需要删除的房源小区主键
* @return 结果
*/
@Override
public int deleteHouseVillageByIds(Long[] ids)
{
return houseVillageMapper.deleteHouseVillageByIds(ids);
}
/**
* 删除房源小区信息
*
* @param id 房源小区主键
* @return 结果
*/
@Override
public int deleteHouseVillageById(Long id)
{
return houseVillageMapper.deleteHouseVillageById(id);
}
/**
* 查询房源小区
*
* @param houseVillage 房源小区
* @return 房源小区
*/
@Override
public HouseVillage selectHouseVillage(HouseVillage houseVillage)
{
return houseVillageMapper.selectHouseVillage(houseVillage);
}
}

View File

@ -0,0 +1,106 @@
<?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="cn.source.system.mapper.HouseEvaluateMapper">
<resultMap type="HouseEvaluate" id="HouseEvaluateResult">
<result property="id" column="id" />
<result property="houseId" column="house_id" />
<result property="evalUserId" column="eval_user_id" />
<result property="evalUser" column="eval_user" />
<result property="evaluate" column="evaluate" />
<result property="state" column="state" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHouseEvaluateVo">
select id, house_id, eval_user_id, eval_user, evaluate, state, create_time, create_by, update_time, update_by, remark from house_evaluate
</sql>
<select id="selectHouseEvaluateList" parameterType="HouseEvaluate" resultMap="HouseEvaluateResult">
<include refid="selectHouseEvaluateVo"/>
<where>
<if test="houseId != null "> and house_id = #{houseId}</if>
<if test="evalUserId != null "> and eval_user_id = #{evalUserId}</if>
<if test="evalUser != null and evalUser != ''"> and eval_user = #{evalUser}</if>
<if test="evaluate != null and evaluate != ''"> and evaluate = #{evaluate}</if>
<if test="state != null and state != ''"> and state = #{state}</if>
</where>
</select>
<select id="selectHouseEvaluateById" parameterType="Long" resultMap="HouseEvaluateResult">
<include refid="selectHouseEvaluateVo"/>
where id = #{id}
</select>
<insert id="insertHouseEvaluate" parameterType="HouseEvaluate">
insert into house_evaluate
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="houseId != null">house_id,</if>
<if test="evalUserId != null">eval_user_id,</if>
<if test="evalUser != null">eval_user,</if>
<if test="evaluate != null and evaluate != ''">evaluate,</if>
<if test="state != null and state != ''">state,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="houseId != null">#{houseId},</if>
<if test="evalUserId != null">#{evalUserId},</if>
<if test="evalUser != null">#{evalUser},</if>
<if test="evaluate != null and evaluate != ''">#{evaluate},</if>
<if test="state != null and state != ''">#{state},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHouseEvaluate" parameterType="HouseEvaluate">
update house_evaluate
<trim prefix="SET" suffixOverrides=",">
<if test="houseId != null">house_id = #{houseId},</if>
<if test="evalUserId != null">eval_user_id = #{evalUserId},</if>
<if test="evalUser != null">eval_user = #{evalUser},</if>
<if test="evaluate != null and evaluate != ''">evaluate = #{evaluate},</if>
<if test="state != null and state != ''">state = #{state},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHouseEvaluateById" parameterType="Long">
delete from house_evaluate where id = #{id}
</delete>
<delete id="deleteHouseEvaluateByIds" parameterType="String">
delete from house_evaluate where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateEvalState" parameterType="String">
update house_evaluate
set state = 2
where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@ -0,0 +1,61 @@
<?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="cn.source.system.mapper.HouseFeatureMapper">
<resultMap type="HouseFeature" id="HouseFeatureResult">
<result property="id" column="id" />
<result property="houseId" column="house_id" />
<result property="feature" column="feature" />
</resultMap>
<sql id="selectHouseFeatureVo">
select id, house_id, feature from house_feature
</sql>
<select id="selectHouseFeatureList" parameterType="HouseFeature" resultMap="HouseFeatureResult">
<include refid="selectHouseFeatureVo"/>
<where>
<if test="houseId != null "> and house_id = #{houseId}</if>
<if test="feature != null and feature != ''"> and feature = #{feature}</if>
</where>
</select>
<select id="selectHouseFeatureById" parameterType="Long" resultMap="HouseFeatureResult">
<include refid="selectHouseFeatureVo"/>
where id = #{id}
</select>
<insert id="insertHouseFeature" parameterType="HouseFeature" useGeneratedKeys="true" keyProperty="id">
insert into house_feature
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="houseId != null">house_id,</if>
<if test="feature != null">feature,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="houseId != null">#{houseId},</if>
<if test="feature != null">#{feature},</if>
</trim>
</insert>
<update id="updateHouseFeature" parameterType="HouseFeature">
update house_feature
<trim prefix="SET" suffixOverrides=",">
<if test="houseId != null">house_id = #{houseId},</if>
<if test="feature != null">feature = #{feature},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHouseFeatureById" parameterType="Long">
delete from house_feature where id = #{id}
</delete>
<delete id="deleteHouseFeatureByIds" parameterType="String">
delete from house_feature where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,76 @@
<?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="cn.source.system.mapper.HouseImageMapper">
<resultMap type="HouseImage" id="HouseImageResult">
<result property="id" column="id" />
<result property="houseId" column="house_id" />
<result property="imageName" column="image_name" />
<result property="imagePath" column="image_path" />
<result property="imgUrl" column="img_url" />
<result property="imageSize" column="image_size" />
</resultMap>
<sql id="selectHouseImageVo">
select id, house_id, image_name, image_path, img_url, image_size from house_image
</sql>
<select id="selectHouseImageList" parameterType="HouseImage" resultMap="HouseImageResult">
<include refid="selectHouseImageVo"/>
<where>
<if test="houseId != null "> and house_id = #{houseId}</if>
<if test="imageName != null and imageName != ''"> and image_name like concat('%', #{imageName}, '%')</if>
<if test="imagePath != null and imagePath != ''"> and image_path = #{imagePath}</if>
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
<if test="imageSize != null "> and image_size = #{imageSize}</if>
</where>
</select>
<select id="selectHouseImageById" parameterType="Long" resultMap="HouseImageResult">
<include refid="selectHouseImageVo"/>
where id = #{id}
</select>
<insert id="insertHouseImage" parameterType="HouseImage" useGeneratedKeys="true" keyProperty="id">
insert into house_image
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="houseId != null">house_id,</if>
<if test="imageName != null">image_name,</if>
<if test="imagePath != null">image_path,</if>
<if test="imgUrl != null">img_url,</if>
<if test="imageSize != null">image_size,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="houseId != null">#{houseId},</if>
<if test="imageName != null">#{imageName},</if>
<if test="imagePath != null">#{imagePath},</if>
<if test="imgUrl != null">#{imgUrl},</if>
<if test="imageSize != null">#{imageSize},</if>
</trim>
</insert>
<update id="updateHouseImage" parameterType="HouseImage">
update house_image
<trim prefix="SET" suffixOverrides=",">
<if test="houseId != null">house_id = #{houseId},</if>
<if test="imageName != null">image_name = #{imageName},</if>
<if test="imagePath != null">image_path = #{imagePath},</if>
<if test="imgUrl != null">img_url = #{imgUrl},</if>
<if test="imageSize != null">image_size = #{imageSize},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHouseImageById" parameterType="Long">
delete from house_image where id = #{id}
</delete>
<delete id="deleteHouseImageByIds" parameterType="String">
delete from house_image where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,408 @@
<?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="cn.source.system.mapper.HouseRoomMapper">
<resultMap type="HouseRoom" id="HouseRoomResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="houseNum" column="house_num" />
<result property="toiletNum" column="toilet_num" />
<result property="houseArea" column="house_area" />
<result property="roomType" column="room_type" />
<result property="roomCode" column="room_code" />
<result property="roomArea" column="room_area" />
<result property="direction" column="direction" />
<result property="price" column="price" />
<result property="floor" column="floor" />
<result property="stepType" column="step_type" />
<result property="startDate" column="start_date" />
<result property="introduce" column="introduce" />
<result property="ownerName" column="owner_name" />
<result property="owerPhone" column="ower_phone" />
<result property="villageId" column="village_id" />
<result property="villageName" column="village_name" />
<result property="address" column="address" />
<result property="houseNo" column="house_no" />
<result property="payType" column="pay_type" />
<result property="publishId" column="publish_id" />
<result property="state" column="state" />
<result property="createTime" column="create_time" />
<result property="createName" column="create_name" />
<result property="updateTime" column="update_time" />
<result property="updateName" column="update_name" />
<result property="remark" column="remark" />
<result property="houseHall" column="house_Hall" />
<result property="code" column="code" />
<result property="faceUrl" column="face_Url" />
<result property="decoration" column="decoration" />
<result property="agentName" column="agent_Name" />
<result property="agentPhone" column="agent_Phone" />
<result property="agentUserId" column="agent_User_Id" />
<result property="agentAvatar" column="agent_Avatar" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
</resultMap>
<resultMap type="HouseImage" id="HouseImageResult">
<result property="id" column="id" />
<result property="imageName" column="image_Name" />
<result property="imagePath" column="image_Path" />
<result property="imgUrl" column="img_Url" />
<result property="imageSize" column="image_Size" />
</resultMap>
<resultMap type="HouseFeature" id="HouseFeatureResult">
<result property="id" column="id" />
<result property="feature" column="feature" />
</resultMap>
<sql id="selectHouseRoomVo">
select id, type, house_Hall,house_num,concat(house_num,house_Hall,toilet_num) as houseCode,toilet_num, house_area, room_type, room_code, room_area, direction, price, floor, step_type, start_date, introduce, owner_name, ower_phone, village_id, village_name, address, house_no, pay_type, publish_id, state, create_time, create_name, update_time, update_name, remark, code, face_Url,
decoration,agent_Name,agent_Phone,agent_User_Id,agent_Avatar,longitude,latitude from house_room
</sql>
<select id="selectHouseRoomList" parameterType="HouseRoom" resultMap="HouseRoomResult">
SELECT DISTINCT
house.id,
house.type,
house_Hall,
house_num,
concat(
house_num,house_Hall,toilet_num
) AS houseCode,
toilet_num,
house_area,
room_type,
room_code,
room_area,
direction,
price,
floor,
step_type,
start_date,
house.introduce,
owner_name,
ower_phone,
village_id,
village_name,
address,
house_no,
pay_type,
publish_id,
house.state,
house.create_time,
house.create_name,
house.update_time,
house.update_name,
house.remark,
house.CODE,
face_Url,
decoration,
agent_Name,
agent_Phone,
agent_User_Id,agent_Avatar,
longitude,latitude
FROM
house_room AS house
INNER JOIN house_feature feature ON house.id = feature.house_id
INNER JOIN house_village village on house.village_id=village.id
<where>
<if test="type != null "> and house.type = #{type}</if>
<if test="houseNum != null and houseNum != ''"> and house_num = #{houseNum}</if>
<if test="toiletNum != null and toiletNum != ''"> and toilet_num = #{toiletNum}</if>
<if test="houseArea != null "> and house_area = #{houseArea}</if>
<if test="roomType != null "> and room_type = #{roomType}</if>
<if test="roomCode != null and roomCode != ''"> and room_code = #{roomCode}</if>
<if test="roomArea != null "> and room_area = #{roomArea}</if>
<if test="direction != null and direction != ''"> and direction = #{direction}</if>
<if test="price != null "> and price &lt;= #{price}</if>
<if test="floor != null and floor != ''"> and floor = #{floor}</if>
<if test="stepType != null and stepType != ''"> and step_type = #{stepType}</if>
<if test="startDate != null "> and start_date = #{startDate}</if>
<if test="introduce != null and introduce != ''"> and house.introduce = #{introduce}</if>
<if test="ownerName != null and ownerName != ''"> and owner_name like concat('%', #{ownerName}, '%')</if>
<if test="owerPhone != null and owerPhone != ''"> and ower_phone = #{owerPhone}</if>
<if test="villageId != null "> and village_id = #{villageId}</if>
<if test="villageName != null and villageName != ''"> and village_name like concat('%', #{villageName}, '%')</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="houseNo != null and houseNo != ''"> and house_no = #{houseNo}</if>
<if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
<if test="publishId != null "> and publish_id = #{publishId}</if>
<if test="state != null "> and house.state = #{state}</if>
<if test="createName != null and createName != ''"> and house.create_name like concat('%', #{createName}, '%')</if>
<if test="updateName != null and updateName != ''"> and house.update_name like concat('%', #{updateName}, '%')</if>
<if test="houseHall != null and houseHall != ''"> and house_Hall = #{houseHall}</if>
<if test="code != null and code != ''"> and house.code = #{code}</if>
<if test="faceUrl != null and faceUrl != ''"> and face_Url = #{faceUrl}</if>
<if test="decoration != null and decoration != ''"> and decoration = #{decoration}</if>
<if test="agentName != null and agentName != ''"> and agent_Name = #{agentName}</if>
<if test="agentPhone != null and agentPhone != ''"> and agent_Phone = #{agentPhone}</if>
<if test="feature != null and feature != ''"> and feature = #{feature}</if>
<if test="villageCity != null and villageCity != ''"> and village.city = #{villageCity}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>
<select id="selectHouseRoomById" parameterType="Long" resultMap="HouseRoomResult">
<include refid="selectHouseRoomVo"/>
where id = #{id}
</select>
<select id="selectHouseRoomByCode" parameterType="String" resultMap="HouseRoomResult">
<include refid="selectHouseRoomVo"/>
where code = #{code}
</select>
<insert id="insertHouseRoom" parameterType="HouseRoom" useGeneratedKeys="true" keyProperty="id">
insert into house_room
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
<if test="houseNum != null">house_num,</if>
<if test="toiletNum != null">toilet_num,</if>
<if test="houseArea != null">house_area,</if>
<if test="roomType != null">room_type,</if>
<if test="roomCode != null">room_code,</if>
<if test="roomArea != null">room_area,</if>
<if test="direction != null">direction,</if>
<if test="price != null">price,</if>
<if test="floor != null">floor,</if>
<if test="stepType != null">step_type,</if>
<if test="startDate != null">start_date,</if>
<if test="introduce != null">introduce,</if>
<if test="ownerName != null">owner_name,</if>
<if test="owerPhone != null">ower_phone,</if>
<if test="villageId != null">village_id,</if>
<if test="villageName != null">village_name,</if>
<if test="address != null">address,</if>
<if test="houseNo != null">house_no,</if>
<if test="payType != null">pay_type,</if>
<if test="publishId != null">publish_id,</if>
<if test="state != null">state,</if>
<if test="createTime != null">create_time,</if>
<if test="createName != null">create_name,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateName != null">update_name,</if>
<if test="remark != null">remark,</if>
<if test="houseHall != null">house_Hall,</if>
<if test="code != null">code,</if>
<if test="faceUrl != null">face_Url,</if>
<if test="decoration != null">decoration,</if>
<if test="agentName != null">agent_Name,</if>
<if test="agentPhone != null">agent_Phone,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="houseNum != null">#{houseNum},</if>
<if test="toiletNum != null">#{toiletNum},</if>
<if test="houseArea != null">#{houseArea},</if>
<if test="roomType != null">#{roomType},</if>
<if test="roomCode != null">#{roomCode},</if>
<if test="roomArea != null">#{roomArea},</if>
<if test="direction != null">#{direction},</if>
<if test="price != null">#{price},</if>
<if test="floor != null">#{floor},</if>
<if test="stepType != null">#{stepType},</if>
<if test="startDate != null">#{startDate},</if>
<if test="introduce != null">#{introduce},</if>
<if test="ownerName != null">#{ownerName},</if>
<if test="owerPhone != null">#{owerPhone},</if>
<if test="villageId != null">#{villageId},</if>
<if test="villageName != null">#{villageName},</if>
<if test="address != null">#{address},</if>
<if test="houseNo != null">#{houseNo},</if>
<if test="payType != null">#{payType},</if>
<if test="publishId != null">#{publishId},</if>
<if test="state != null">#{state},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createName != null">#{createName},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateName != null">#{updateName},</if>
<if test="remark != null">#{remark},</if>
<if test="houseHall != null">#{houseHall},</if>
<if test="code != null">#{code},</if>
<if test="faceUrl != null">#{faceUrl},</if>
<if test="decoration != null">#{decoration},</if>
<if test="agentName != null">#{agentName},</if>
<if test="agentPhone != null">#{agentPhone},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
</trim>
</insert>
<update id="updateHouseRoom" parameterType="HouseRoom">
update house_room
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type = #{type},</if>
<if test="houseNum != null">house_num = #{houseNum},</if>
<if test="toiletNum != null">toilet_num = #{toiletNum},</if>
<if test="houseArea != null">house_area = #{houseArea},</if>
<if test="roomType != null">room_type = #{roomType},</if>
<if test="roomCode != null">room_code = #{roomCode},</if>
<if test="roomArea != null">room_area = #{roomArea},</if>
<if test="direction != null">direction = #{direction},</if>
<if test="price != null">price = #{price},</if>
<if test="floor != null">floor = #{floor},</if>
<if test="stepType != null">step_type = #{stepType},</if>
<if test="startDate != null">start_date = #{startDate},</if>
<if test="introduce != null">introduce = #{introduce},</if>
<if test="ownerName != null">owner_name = #{ownerName},</if>
<if test="owerPhone != null">ower_phone = #{owerPhone},</if>
<if test="villageId != null">village_id = #{villageId},</if>
<if test="villageName != null">village_name = #{villageName},</if>
<if test="address != null">address = #{address},</if>
<if test="houseNo != null">house_no = #{houseNo},</if>
<if test="payType != null">pay_type = #{payType},</if>
<if test="publishId != null">publish_id = #{publishId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createName != null">create_name = #{createName},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateName != null">update_name = #{updateName},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="houseHall != null">house_Hall = #{houseHall},</if>
<if test="code != null">code = #{code},</if>
<if test="faceUrl != null">face_Url = #{faceUrl},</if>
<if test="decoration != null">decoration = #{decoration},</if>
<if test="agentName != null">agent_Name = #{agentName},</if>
<if test="agentPhone != null">agent_Phone = #{agentPhone},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
</trim>
where id = #{id}
</update>
<update id="updateHouseAgent" parameterType="Map">
update house_room set agent_User_Id = #{agentUserId},
agent_Name = #{agentName},agent_Phone = #{agentPhone},agent_Avatar = #{agentAvatar}
where id in
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updateHouseRoomByIds" parameterType="Map">
update house_room set state = #{state}
where id in
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="deleteHouseRoomById" parameterType="Long">
delete from house_room where id = #{id}
</delete>
<delete id="deleteHouseRoomByIds" parameterType="String">
delete from house_room where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertHouseImage" parameterType="HouseRoom">
insert into house_image(house_id,image_name,image_path,img_url,image_size) VALUES
<foreach collection ="imageList" item="houseImage" separator =",">
(#{id}, #{houseImage.imageName}, #{houseImage.imagePath}, #{houseImage.imgUrl}, #{houseImage.imageSize})
</foreach >
</insert>
<insert id="insertHouseFeature" parameterType="HouseRoom">
insert into house_feature(house_id,feature) VALUES
<foreach collection ="featureList" item="houseFeature" separator =",">
(#{id}, #{houseFeature.feature})
</foreach >
</insert>
<select id="selectHouseImage" parameterType="HouseRoom" resultMap="HouseImageResult">
select * from house_image
<where>
and house_id = #{id}
</where>
</select>
<select id="selectHouseFeature" parameterType="HouseRoom" resultMap="HouseFeatureResult">
select * from house_feature
<where>
and house_id = #{id}
</where>
</select>
<delete id="deleteHouseImageByHouseId" parameterType="Long">
delete from house_image where house_id = #{id}
</delete>
<delete id="deleteHouseHeartByHouseId" parameterType="Long">
delete from house_heart where house_id = #{id}
</delete>
<delete id="deleteHouseFeatureByHouseId" parameterType="Long">
delete from house_feature where house_id = #{id}
</delete>
<insert id="saveHeart" parameterType="Map" useGeneratedKeys="true" keyProperty="id">
INSERT house_heart set house_id=#{houseId},user_id=#{userId},create_time=now()
</insert>
<delete id="cancelHeart" parameterType="Map">
delete from house_heart where house_id = #{houseId} and user_id = #{userId}
</delete>
<select id="selectHouseHeart" parameterType="Map" resultType="long">
select id from house_heart where house_id = #{houseId} and user_id = #{userId}
</select>
<select id="findHouseHeartList" parameterType="long" resultMap="HouseRoomResult">
SELECT DISTINCT
house.id,
house.type,
house_Hall,
house_num,
concat(
house_num,house_Hall,toilet_num
) AS houseCode,
toilet_num,
house_area,
room_type,
room_code,
room_area,
direction,
price,
floor,
step_type,
start_date,
house.introduce,
owner_name,
ower_phone,
village_id,
village_name,
address,
house_no,
pay_type,
publish_id,
house.state,
house.create_time,
house.create_name,
house.update_time,
house.update_name,
house.remark,
house.CODE,
face_Url,
decoration,
agent_Name,
agent_Phone,
agent_User_Id,agent_Avatar,
longitude,latitude
FROM
house_room AS house
INNER JOIN house_feature feature ON house.id = feature.house_id
INNER JOIN house_village village on house.village_id=village.id
INNER JOIN house_heart heart on house.id=heart.house_id
where user_id = #{userId}
</select>
</mapper>

View File

@ -0,0 +1,98 @@
<?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="cn.source.system.mapper.HouseUserMapper">
<resultMap type="HouseUser" id="HouseUserResult">
<result property="id" column="id" />
<result property="houseId" column="house_id" />
<result property="userId" column="user_id" />
<result property="publishId" column="publish_id" />
<result property="actualPrice" column="actual_price" />
<result property="state" column="state" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHouseUserVo">
select id, house_id, user_id, publish_id, actual_price, state, create_time, create_by, update_time, update_by, remark from house_user
</sql>
<select id="selectHouseUserList" parameterType="HouseUser" resultMap="HouseUserResult">
<include refid="selectHouseUserVo"/>
<where>
<if test="houseId != null "> and house_id = #{houseId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="publishId != null "> and publish_id = #{publishId}</if>
<if test="actualPrice != null "> and actual_price = #{actualPrice}</if>
<if test="state != null "> and state = #{state}</if>
</where>
</select>
<select id="selectHouseUserById" parameterType="Long" resultMap="HouseUserResult">
<include refid="selectHouseUserVo"/>
where id = #{id}
</select>
<insert id="insertHouseUser" parameterType="HouseUser">
insert into house_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="houseId != null">house_id,</if>
<if test="userId != null">user_id,</if>
<if test="publishId != null">publish_id,</if>
<if test="actualPrice != null">actual_price,</if>
<if test="state != null">state,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="houseId != null">#{houseId},</if>
<if test="userId != null">#{userId},</if>
<if test="publishId != null">#{publishId},</if>
<if test="actualPrice != null">#{actualPrice},</if>
<if test="state != null">#{state},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHouseUser" parameterType="HouseUser">
update house_user
<trim prefix="SET" suffixOverrides=",">
<if test="houseId != null">house_id = #{houseId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="publishId != null">publish_id = #{publishId},</if>
<if test="actualPrice != null">actual_price = #{actualPrice},</if>
<if test="state != null">state = #{state},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHouseUserById" parameterType="Long">
delete from house_user where id = #{id}
</delete>
<delete id="deleteHouseUserByIds" parameterType="String">
delete from house_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,156 @@
<?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="cn.source.system.mapper.HouseVillageMapper">
<resultMap type="HouseVillage" id="HouseVillageResult">
<result property="id" column="id" />
<result property="province" column="province" />
<result property="city" column="city" />
<result property="area" column="area" />
<result property="name" column="name" />
<result property="code" column="code" />
<result property="year" column="year" />
<result property="type" column="type" />
<result property="green" column="green" />
<result property="introduce" column="introduce" />
<result property="wayState" column="way_state" />
<result property="wayCode" column="way_code" />
<result property="waySpace" column="way_space" />
<result property="lon" column="lon" />
<result property="lat" column="Lat" />
<result property="state" column="state" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectHouseVillageVo">
select id, province, city, area,
concat_ws('-',province, city, area) as areaCode
,name, code, year, type, green, introduce, way_state, way_code, way_space, lon, Lat, state, create_time, create_by, update_time, update_by, remark from house_village
</sql>
<select id="selectHouseVillageList" parameterType="HouseVillage" resultMap="HouseVillageResult">
<include refid="selectHouseVillageVo"/>
<where>
<if test="province != null and province != ''"> and province = #{province}</if>
<if test="city != null and city != ''"> and city = #{city}</if>
<if test="area != null and area != ''"> and area = #{area}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="year != null "> and year = #{year}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="green != null "> and green = #{green}</if>
<if test="introduce != null and introduce != ''"> and introduce = #{introduce}</if>
<if test="wayState != null "> and way_state = #{wayState}</if>
<if test="wayCode != null and wayCode != ''"> and way_code = #{wayCode}</if>
<if test="waySpace != null "> and way_space = #{waySpace}</if>
<if test="lon != null "> and lon = #{lon}</if>
<if test="lat != null "> and Lat = #{lat}</if>
<if test="state != null "> and state = #{state}</if>
</where>
</select>
<select id="selectHouseVillageById" parameterType="Long" resultMap="HouseVillageResult">
<include refid="selectHouseVillageVo"/>
where id = #{id}
</select>
<insert id="insertHouseVillage" parameterType="HouseVillage" useGeneratedKeys="true" keyProperty="id">
insert into house_village
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="province != null and province != ''">province,</if>
<if test="city != null and city != ''">city,</if>
<if test="area != null and area != ''">area,</if>
<if test="name != null and name != ''">name,</if>
<if test="code != null">code,</if>
<if test="year != null">year,</if>
<if test="type != null">type,</if>
<if test="green != null">green,</if>
<if test="introduce != null">introduce,</if>
<if test="wayState != null">way_state,</if>
<if test="wayCode != null">way_code,</if>
<if test="waySpace != null">way_space,</if>
<if test="lon != null">lon,</if>
<if test="lat != null">Lat,</if>
<if test="state != null">state,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="province != null and province != ''">#{province},</if>
<if test="city != null and city != ''">#{city},</if>
<if test="area != null and area != ''">#{area},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="code != null">#{code},</if>
<if test="year != null">#{year},</if>
<if test="type != null">#{type},</if>
<if test="green != null">#{green},</if>
<if test="introduce != null">#{introduce},</if>
<if test="wayState != null">#{wayState},</if>
<if test="wayCode != null">#{wayCode},</if>
<if test="waySpace != null">#{waySpace},</if>
<if test="lon != null">#{lon},</if>
<if test="lat != null">#{lat},</if>
<if test="state != null">#{state},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateHouseVillage" parameterType="HouseVillage">
update house_village
<trim prefix="SET" suffixOverrides=",">
<if test="province != null and province != ''">province = #{province},</if>
<if test="city != null and city != ''">city = #{city},</if>
<if test="area != null and area != ''">area = #{area},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="code != null">code = #{code},</if>
<if test="year != null">year = #{year},</if>
<if test="type != null">type = #{type},</if>
<if test="green != null">green = #{green},</if>
<if test="introduce != null">introduce = #{introduce},</if>
<if test="wayState != null">way_state = #{wayState},</if>
<if test="wayCode != null">way_code = #{wayCode},</if>
<if test="waySpace != null">way_space = #{waySpace},</if>
<if test="lon != null">lon = #{lon},</if>
<if test="lat != null">Lat = #{lat},</if>
<if test="state != null">state = #{state},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHouseVillageById" parameterType="Long">
delete from house_village where id = #{id}
</delete>
<delete id="deleteHouseVillageByIds" parameterType="String">
delete from house_village where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectHouseVillage" parameterType="HouseVillage" resultMap="HouseVillageResult">
<include refid="selectHouseVillageVo"/>
<where>
<if test="name != null and name != ''"> and name = #{name}</if>
<if test="code != null and code != ''"> and code = #{code}</if>
</where>
</select>
</mapper>

28
source-mall/pom.xml Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>source</artifactId>
<groupId>cn.source</groupId>
<version>4.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>source-mall</artifactId>
<description>
私域商城
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>cn.source</groupId>
<artifactId>source-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,122 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.SecurityUtils;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.MallAddress;
import cn.source.system.service.IMallAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 收货地址Controller
*
* @author 詹Sir
* @date 2022-06-19
*/
@RestController
@RequestMapping("/system/address")
public class MallAddressController extends BaseController
{
@Autowired
private IMallAddressService mallAddressService;
/**
* 查询收货地址列表
*/
@PreAuthorize("@ss.hasPermi('system:address:list')")
@GetMapping("/list")
public TableDataInfo list(MallAddress mallAddress)
{
startPage();
List<MallAddress> list = mallAddressService.selectMallAddressList(mallAddress);
return getDataTable(list);
}
/**
* 导出收货地址列表
*/
@PreAuthorize("@ss.hasPermi('system:address:export')")
@Log(title = "收货地址", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MallAddress mallAddress)
{
List<MallAddress> list = mallAddressService.selectMallAddressList(mallAddress);
ExcelUtil<MallAddress> util = new ExcelUtil<MallAddress>(MallAddress.class);
util.exportExcel(response, list, "收货地址数据");
}
/**
* 获取收货地址详细信息
*/
@PreAuthorize("@ss.hasPermi('system:address:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallAddressService.selectMallAddressById(id));
}
/**
* 新增收货地址
*/
@PreAuthorize("@ss.hasPermi('system:address:add')")
@Log(title = "收货地址", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallAddress mallAddress)
{
return toAjax(mallAddressService.insertMallAddress(mallAddress));
}
/**
* 修改收货地址
*/
@PreAuthorize("@ss.hasPermi('system:address:edit')")
@Log(title = "收货地址", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallAddress mallAddress)
{
mallAddress.setUpdateBy(SecurityUtils.getUsername());
return toAjax(mallAddressService.updateMallAddress(mallAddress));
}
/**
* 删除收货地址
*/
@PreAuthorize("@ss.hasPermi('system:address:remove')")
@Log(title = "收货地址", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallAddressService.deleteMallAddressByIds(ids));
}
/**
* 设置默认地址isDefault
*/
@PreAuthorize("@ss.hasPermi('system:address:edit')")
@Log(title = "收货地址", businessType = BusinessType.UPDATE)
@PutMapping("/changeIsDefaultStatus")
public AjaxResult changeIsDefaultStatus(@RequestBody MallAddress mallAddress)
{
return toAjax(mallAddressService.updateMallAddress(mallAddress));
}
/**
* 设置是否启用normalDisable
*/
@PreAuthorize("@ss.hasPermi('system:address:edit')")
@Log(title = "收货地址", businessType = BusinessType.UPDATE)
@PutMapping("/changeNormalDisableStatus")
public AjaxResult changeNormalDisableStatus(@RequestBody MallAddress mallAddress)
{
return toAjax(mallAddressService.updateMallAddress(mallAddress));
}
}

View File

@ -0,0 +1,98 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.MallAdvert;
import cn.source.system.service.IMallAdvertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 广告管理Controller
*
* @author Mr Sir
* @date 2022-05-02
*/
@RestController
@RequestMapping("/system/advert")
public class MallAdvertController extends BaseController
{
@Autowired
private IMallAdvertService mallAdvertService;
/**
* 查询广告管理列表
*/
@PreAuthorize("@ss.hasPermi('system:advert:list')")
@GetMapping("/list")
public TableDataInfo list(MallAdvert mallAdvert)
{
startPage();
List<MallAdvert> list = mallAdvertService.selectMallAdvertList(mallAdvert);
return getDataTable(list);
}
/**
* 导出广告管理列表
*/
@PreAuthorize("@ss.hasPermi('system:advert:export')")
@Log(title = "广告管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MallAdvert mallAdvert)
{
List<MallAdvert> list = mallAdvertService.selectMallAdvertList(mallAdvert);
ExcelUtil<MallAdvert> util = new ExcelUtil<MallAdvert>(MallAdvert.class);
util.exportExcel(response, list, "广告管理数据");
}
/**
* 获取广告管理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:advert:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallAdvertService.selectMallAdvertById(id));
}
/**
* 新增广告管理
*/
@PreAuthorize("@ss.hasPermi('system:advert:add')")
@Log(title = "广告管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallAdvert mallAdvert)
{
return toAjax(mallAdvertService.insertMallAdvert(mallAdvert));
}
/**
* 修改广告管理
*/
@PreAuthorize("@ss.hasPermi('system:advert:edit')")
@Log(title = "广告管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallAdvert mallAdvert)
{
return toAjax(mallAdvertService.updateMallAdvert(mallAdvert));
}
/**
* 删除广告管理
*/
@PreAuthorize("@ss.hasPermi('system:advert:remove')")
@Log(title = "广告管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallAdvertService.deleteMallAdvertByIds(ids));
}
}

View File

@ -0,0 +1,158 @@
package cn.source.system.controller;
import cn.source.common.constant.HttpStatus;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.system.domain.*;
import cn.source.system.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Description: mall api控制类
* @author: 詹Sir
*/
@RestController
@RequestMapping("/api/mallApi")
public class MallApiController extends BaseController {
@Autowired
private IMallClassifyService mallClassifyService;
@Autowired
private IMallGoodsService mallGoodsService;
@Autowired
private IMallNavigateService mallNavigateService;
@Autowired
private IMallAdvertService mallAdvertService;
@Autowired
private IMallAddressService mallAddressService;
@Autowired
private IMallOrderService mallOrderService;
/**
* @Description: 获取首页初始化数据MallIndex
*/
@GetMapping("/findMallIndexList")
public AjaxResult findMallIndexList(MallAdvert mallAdvert, MallNavigate mallNavigate, MallGoods mallGoods)
{
MallIndex mllIndex = new MallIndex();
/**广告*/
mllIndex.setAdvertList(mallAdvertService.selectMallAdvertList(mallAdvert));
/**导航*/
mllIndex.setNavigateList(mallNavigateService.selectMallNavigateList(mallNavigate));
// 分页
startPage();
/**商品*/
mllIndex.setGoodsList(mallGoodsService.selectMallGoodsList(mallGoods));
return AjaxResult.success(mllIndex);
}
/**
* @Description: 获取首页初始化数据MallIndex
*/
@GetMapping("/findGoodsList")
public TableDataInfo findGoodsList(MallGoods mallGoods)
{
// 分页
startPage();
/**商品*/
List<MallGoods> goodsList = mallGoodsService.selectMallGoodsList(mallGoods);
return getDataTable(goodsList);
}
/**
* @Description: 获取分类数据
*/
@GetMapping("/findClassifyList")
public TableDataInfo findClassifyList(MallClassify mallClassify)
{
// 分页
startPage();
/**分类*/
mallClassify.setParentId(0L);
List<MallClassify> classifyList = mallClassifyService.selectMallClassifyList(mallClassify);
for(MallClassify classify:classifyList){
MallClassify child = new MallClassify();
child.setParentId(classify.getId());
classify.setChildren(mallClassifyService.selectMallClassifyList(child));
}
return getDataTable(classifyList);
}
/**
* @Description: 获取商品信息by id
*/
@GetMapping("/findGoodsById")
public AjaxResult findGoodsById(@RequestParam Long id)
{
String msg = "商品查找成功";
MallGoods mallGoods = mallGoodsService.selectMallGoodsById(id);
AjaxResult ajaxResult = new AjaxResult(HttpStatus.SUCCESS,msg,mallGoods);
return ajaxResult;
}
/**
* @Description: 获取地址列表
*/
@GetMapping("/findAddressList")
public TableDataInfo findAddressList(MallAddress mallAddress)
{
startPage();
List<MallAddress> list = mallAddressService.selectApiMallAddressList(mallAddress);
return getDataTable(list);
}
/**
* @Description: 新增收货地址
*/
@PostMapping("/insertAddress")
public AjaxResult insertAddress(@RequestBody MallAddress mallAddress)
{
return toAjax(mallAddressService.insertMallAddress(mallAddress));
}
/**
* @Description: 修改收货地址
*/
@PostMapping("/updateAddress")
public AjaxResult updateAddress(@RequestBody MallAddress mallAddress)
{
return toAjax(mallAddressService.updateMallAddress(mallAddress));
}
/**
* @Description: 删除收货地址by id
*/
@DeleteMapping("deleteAddress/{id}")
public AjaxResult deleteAddress(@PathVariable Long id)
{
return toAjax(mallAddressService.deleteMallAddressById(id));
}
/**
* @Description: 获取收货地址by id
*/
@GetMapping("/findAddressById")
public AjaxResult findAddressById(@RequestParam Long id)
{
String msg = "收货地址查找成功";
MallAddress mallAddress = mallAddressService.selectMallAddressById(id);
AjaxResult ajaxResult = new AjaxResult(HttpStatus.SUCCESS,msg,mallAddress);
return ajaxResult;
}
/**
* @Description: 新增订单
*/
@PostMapping("/insertMallOrder")
public AjaxResult insertMallOrder(@RequestBody MallOrder mallOrder)
{
return toAjax(mallOrderService.insertMallOrder(mallOrder));
}
}

View File

@ -0,0 +1,96 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.MallClassify;
import cn.source.system.service.IMallClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 分类管理Controller
*
* @author Mr Sir
* @date 2022-05-02
*/
@RestController
@RequestMapping("/system/classify")
public class MallClassifyController extends BaseController
{
@Autowired
private IMallClassifyService mallClassifyService;
/**
* 查询分类管理列表
*/
@PreAuthorize("@ss.hasPermi('system:classify:list')")
@GetMapping("/list")
public AjaxResult list(MallClassify mallClassify)
{
List<MallClassify> list = mallClassifyService.selectMallClassifyList(mallClassify);
return AjaxResult.success(list);
}
/**
* 导出分类管理列表
*/
@PreAuthorize("@ss.hasPermi('system:classify:export')")
@Log(title = "分类管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MallClassify mallClassify)
{
List<MallClassify> list = mallClassifyService.selectMallClassifyList(mallClassify);
ExcelUtil<MallClassify> util = new ExcelUtil<MallClassify>(MallClassify.class);
util.exportExcel(response, list, "分类管理数据");
}
/**
* 获取分类管理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:classify:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallClassifyService.selectMallClassifyById(id));
}
/**
* 新增分类管理
*/
@PreAuthorize("@ss.hasPermi('system:classify:add')")
@Log(title = "分类管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallClassify mallClassify)
{
return toAjax(mallClassifyService.insertMallClassify(mallClassify));
}
/**
* 修改分类管理
*/
@PreAuthorize("@ss.hasPermi('system:classify:edit')")
@Log(title = "分类管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallClassify mallClassify)
{
return toAjax(mallClassifyService.updateMallClassify(mallClassify));
}
/**
* 删除分类管理
*/
@PreAuthorize("@ss.hasPermi('system:classify:remove')")
@Log(title = "分类管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallClassifyService.deleteMallClassifyByIds(ids));
}
}

View File

@ -0,0 +1,112 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.MallGoods;
import cn.source.system.service.IMallGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 商品管理Controller
*
* @author Mr Sir
* @date 2022-05-02
*/
@RestController
@RequestMapping("/system/goods")
public class MallGoodsController extends BaseController
{
@Autowired
private IMallGoodsService mallGoodsService;
/**
* 查询商品管理列表
*/
@PreAuthorize("@ss.hasPermi('system:goods:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoods mallGoods)
{
startPage();
List<MallGoods> list = mallGoodsService.selectMallGoodsList(mallGoods);
return getDataTable(list);
}
/**
* 导出商品管理列表
*/
@PreAuthorize("@ss.hasPermi('system:goods:export')")
@Log(title = "商品管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MallGoods mallGoods)
{
List<MallGoods> list = mallGoodsService.selectMallGoodsList(mallGoods);
ExcelUtil<MallGoods> util = new ExcelUtil<MallGoods>(MallGoods.class);
util.exportExcel(response, list, "商品管理数据");
}
/**
* 获取商品管理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:goods:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsService.selectMallGoodsById(id));
}
/**
* 新增商品管理
*/
@PreAuthorize("@ss.hasPermi('system:goods:add')")
@Log(title = "商品管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoods mallGoods)
{
mallGoods.setCreateBy(getUsername());
return toAjax(mallGoodsService.insertMallGoods(mallGoods));
}
/**
* 修改商品管理
*/
@PreAuthorize("@ss.hasPermi('system:goods:edit')")
@Log(title = "商品管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoods mallGoods)
{
mallGoods.setUpdateBy(getUsername());
return toAjax(mallGoodsService.updateMallGoods(mallGoods));
}
/**
* 删除商品管理
*/
@PreAuthorize("@ss.hasPermi('system:goods:remove')")
@Log(title = "商品管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsService.deleteMallGoodsByIds(ids));
}
/**
* 状态修改
*/
@PreAuthorize("@ss.hasPermi('system:goods:edit')")
@Log(title = "商品管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody MallGoods mallGoods)
{
mallGoods.setUpdateBy(getUsername());
return toAjax(mallGoodsService.changeStatus(mallGoods));
}
}

View File

@ -0,0 +1,98 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.MallGoodsSpec;
import cn.source.system.service.IMallGoodsSpecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 商品规格Controller
*
* @author Mr Sir
* @date 2022-05-02
*/
@RestController
@RequestMapping("/system/spec")
public class MallGoodsSpecController extends BaseController
{
@Autowired
private IMallGoodsSpecService mallGoodsSpecService;
/**
* 查询商品规格列表
*/
@PreAuthorize("@ss.hasPermi('system:spec:list')")
@GetMapping("/list")
public TableDataInfo list(MallGoodsSpec mallGoodsSpec)
{
startPage();
List<MallGoodsSpec> list = mallGoodsSpecService.selectMallGoodsSpecList(mallGoodsSpec);
return getDataTable(list);
}
/**
* 导出商品规格列表
*/
@PreAuthorize("@ss.hasPermi('system:spec:export')")
@Log(title = "商品规格", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MallGoodsSpec mallGoodsSpec)
{
List<MallGoodsSpec> list = mallGoodsSpecService.selectMallGoodsSpecList(mallGoodsSpec);
ExcelUtil<MallGoodsSpec> util = new ExcelUtil<MallGoodsSpec>(MallGoodsSpec.class);
util.exportExcel(response, list, "商品规格数据");
}
/**
* 获取商品规格详细信息
*/
@PreAuthorize("@ss.hasPermi('system:spec:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallGoodsSpecService.selectMallGoodsSpecById(id));
}
/**
* 新增商品规格
*/
@PreAuthorize("@ss.hasPermi('system:spec:add')")
@Log(title = "商品规格", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallGoodsSpec mallGoodsSpec)
{
return toAjax(mallGoodsSpecService.insertMallGoodsSpec(mallGoodsSpec));
}
/**
* 修改商品规格
*/
@PreAuthorize("@ss.hasPermi('system:spec:edit')")
@Log(title = "商品规格", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallGoodsSpec mallGoodsSpec)
{
return toAjax(mallGoodsSpecService.updateMallGoodsSpec(mallGoodsSpec));
}
/**
* 删除商品规格
*/
@PreAuthorize("@ss.hasPermi('system:spec:remove')")
@Log(title = "商品规格", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallGoodsSpecService.deleteMallGoodsSpecByIds(ids));
}
}

View File

@ -0,0 +1,98 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.MallNavigate;
import cn.source.system.service.IMallNavigateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 导航管理Controller
*
* @author Mr Sir
* @date 2022-05-02
*/
@RestController
@RequestMapping("/system/navigate")
public class MallNavigateController extends BaseController
{
@Autowired
private IMallNavigateService mallNavigateService;
/**
* 查询导航管理列表
*/
@PreAuthorize("@ss.hasPermi('system:navigate:list')")
@GetMapping("/list")
public TableDataInfo list(MallNavigate mallNavigate)
{
startPage();
List<MallNavigate> list = mallNavigateService.selectMallNavigateList(mallNavigate);
return getDataTable(list);
}
/**
* 导出导航管理列表
*/
@PreAuthorize("@ss.hasPermi('system:navigate:export')")
@Log(title = "导航管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MallNavigate mallNavigate)
{
List<MallNavigate> list = mallNavigateService.selectMallNavigateList(mallNavigate);
ExcelUtil<MallNavigate> util = new ExcelUtil<MallNavigate>(MallNavigate.class);
util.exportExcel(response, list, "导航管理数据");
}
/**
* 获取导航管理详细信息
*/
@PreAuthorize("@ss.hasPermi('system:navigate:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallNavigateService.selectMallNavigateById(id));
}
/**
* 新增导航管理
*/
@PreAuthorize("@ss.hasPermi('system:navigate:add')")
@Log(title = "导航管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallNavigate mallNavigate)
{
return toAjax(mallNavigateService.insertMallNavigate(mallNavigate));
}
/**
* 修改导航管理
*/
@PreAuthorize("@ss.hasPermi('system:navigate:edit')")
@Log(title = "导航管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallNavigate mallNavigate)
{
return toAjax(mallNavigateService.updateMallNavigate(mallNavigate));
}
/**
* 删除导航管理
*/
@PreAuthorize("@ss.hasPermi('system:navigate:remove')")
@Log(title = "导航管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallNavigateService.deleteMallNavigateByIds(ids));
}
}

View File

@ -0,0 +1,98 @@
package cn.source.system.controller;
import cn.source.common.annotation.Log;
import cn.source.common.core.controller.BaseController;
import cn.source.common.core.domain.AjaxResult;
import cn.source.common.core.page.TableDataInfo;
import cn.source.common.enums.BusinessType;
import cn.source.common.utils.poi.ExcelUtil;
import cn.source.system.domain.MallOrder;
import cn.source.system.service.IMallOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 订单信息Controller
*
* @author 詹Sir
* @date 2022-06-19
*/
@RestController
@RequestMapping("/system/order")
public class MallOrderController extends BaseController
{
@Autowired
private IMallOrderService mallOrderService;
/**
* 查询订单信息列表
*/
@PreAuthorize("@ss.hasPermi('system:order:list')")
@GetMapping("/list")
public TableDataInfo list(MallOrder mallOrder)
{
startPage();
List<MallOrder> list = mallOrderService.selectMallOrderList(mallOrder);
return getDataTable(list);
}
/**
* 导出订单信息列表
*/
@PreAuthorize("@ss.hasPermi('system:order:export')")
@Log(title = "订单信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MallOrder mallOrder)
{
List<MallOrder> list = mallOrderService.selectMallOrderList(mallOrder);
ExcelUtil<MallOrder> util = new ExcelUtil<MallOrder>(MallOrder.class);
util.exportExcel(response, list, "订单信息数据");
}
/**
* 获取订单信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:order:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mallOrderService.selectMallOrderById(id));
}
/**
* 新增订单信息
*/
@PreAuthorize("@ss.hasPermi('system:order:add')")
@Log(title = "订单信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MallOrder mallOrder)
{
return toAjax(mallOrderService.insertMallOrder(mallOrder));
}
/**
* 修改订单信息
*/
@PreAuthorize("@ss.hasPermi('system:order:edit')")
@Log(title = "订单信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MallOrder mallOrder)
{
return toAjax(mallOrderService.updateMallOrder(mallOrder));
}
/**
* 删除订单信息
*/
@PreAuthorize("@ss.hasPermi('system:order:remove')")
@Log(title = "订单信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(mallOrderService.deleteMallOrderByIds(ids));
}
}

View File

@ -0,0 +1,138 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 收货地址对象 mall_address
*
* @author 詹Sir
* @date 2022-06-19
*/
public class MallAddress extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 用户id */
private Long userId;
/** 收货人 */
@Excel(name = "收货人")
private String userName;
/** 手机号 */
@Excel(name = "手机号")
private String phone;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 默认地址 */
@Excel(name = "默认地址")
private String isDefault;
/** 是否启用 */
@Excel(name = "是否启用")
private String normalDisable;
/** 排序 */
private Integer sortNo;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setIsDefault(String isDefault)
{
this.isDefault = isDefault;
}
public String getIsDefault()
{
return isDefault;
}
public void setNormalDisable(String normalDisable)
{
this.normalDisable = normalDisable;
}
public String getNormalDisable()
{
return normalDisable;
}
public void setSortNo(Integer sortNo)
{
this.sortNo = sortNo;
}
public Integer getSortNo()
{
return sortNo;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("userName", getUserName())
.append("phone", getPhone())
.append("address", getAddress())
.append("isDefault", getIsDefault())
.append("normalDisable", getNormalDisable())
.append("sortNo", getSortNo())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,126 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 广告管理对象 mall-advert
*
* @author Mr Sir
* @date 2022-05-02
*/
public class MallAdvert extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 广告类别 */
@Excel(name = "广告类别")
private Integer advertType;
/** 广告名称 */
@Excel(name = "广告名称")
private String advertName;
/** 链接地址 */
@Excel(name = "链接地址")
private String advertAddress;
/** 广告图片 */
@Excel(name = "广告图片")
private String advertUrl;
/** 排序 */
@Excel(name = "排序")
private Integer sortNo;
/** 是否启用 */
@Excel(name = "是否启用")
private String normalDisable;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setAdvertType(Integer advertType)
{
this.advertType = advertType;
}
public Integer getAdvertType()
{
return advertType;
}
public void setAdvertName(String advertName)
{
this.advertName = advertName;
}
public String getAdvertName()
{
return advertName;
}
public void setAdvertAddress(String advertAddress)
{
this.advertAddress = advertAddress;
}
public String getAdvertAddress()
{
return advertAddress;
}
public void setAdvertUrl(String advertUrl)
{
this.advertUrl = advertUrl;
}
public String getAdvertUrl()
{
return advertUrl;
}
public void setSortNo(Integer sortNo)
{
this.sortNo = sortNo;
}
public Integer getSortNo()
{
return sortNo;
}
public void setNormalDisable(String normalDisable)
{
this.normalDisable = normalDisable;
}
public String getNormalDisable()
{
return normalDisable;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("advertType", getAdvertType())
.append("advertName", getAdvertName())
.append("advertAddress", getAdvertAddress())
.append("advertUrl", getAdvertUrl())
.append("sortNo", getSortNo())
.append("normalDisable", getNormalDisable())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,100 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.TreeEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 分类管理对象 mall_classify
*
* @author Mr Sir
* @date 2022-05-02
*/
public class MallClassify extends TreeEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 分类名称 */
@Excel(name = "分类名称")
private String classifyName;
/** 分类图片 */
@Excel(name = "分类图片")
private String classifyUrl;
/** 排序 */
@Excel(name = "排序")
private Integer sortNo;
/** 是否启用 */
@Excel(name = "是否启用")
private String normalDisable;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setClassifyName(String classifyName)
{
this.classifyName = classifyName;
}
public String getClassifyName()
{
return classifyName;
}
public void setClassifyUrl(String classifyUrl)
{
this.classifyUrl = classifyUrl;
}
public String getClassifyUrl()
{
return classifyUrl;
}
public void setSortNo(Integer sortNo)
{
this.sortNo = sortNo;
}
public Integer getSortNo()
{
return sortNo;
}
public void setNormalDisable(String normalDisable)
{
this.normalDisable = normalDisable;
}
public String getNormalDisable()
{
return normalDisable;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("parentId", getParentId())
.append("ancestors", getAncestors())
.append("classifyName", getClassifyName())
.append("classifyUrl", getClassifyUrl())
.append("sortNo", getSortNo())
.append("normalDisable", getNormalDisable())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,233 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.List;
/**
* 商品管理对象 mall_goods
*
* @author Mr Sir
* @date 2022-05-02
*/
public class MallGoods extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 商品分类 */
@Excel(name = "商品分类")
private String goodsClassify;
/** 商品名称 */
@Excel(name = "商品名称")
private String goodsName;
/** 卖点 */
@Excel(name = "卖点")
private String goodsFeature;
/** 销售价 */
@Excel(name = "销售价")
private BigDecimal newPrice;
/** 划线价 */
@Excel(name = "划线价")
private BigDecimal oldPrice;
/** 库存 */
@Excel(name = "库存")
private Integer goodsStock;
/** 主图 */
@Excel(name = "主图")
private String goodsFaceUrl;
/** 轮播图 */
private String goodsItemUrl;
/** 图文详情 */
private String articleContent;
/** 排序 */
private Integer sortNo;
/** 是否上架 */
@Excel(name = "是否上架")
private String status;
/** 是否上架 */
@Excel(name = "是否热点")
private String hotStatus;
/** 浏览量 */
private Integer goodsView;
/** 商品规格信息 */
private List<MallGoodsSpec> mallGoodsSpecList;
public String getHotStatus() {
return hotStatus;
}
public void setHotStatus(String hotStatus) {
this.hotStatus = hotStatus;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setGoodsClassify(String goodsClassify)
{
this.goodsClassify = goodsClassify;
}
public String getGoodsClassify()
{
return goodsClassify;
}
public void setGoodsName(String goodsName)
{
this.goodsName = goodsName;
}
public String getGoodsName()
{
return goodsName;
}
public void setGoodsFeature(String goodsFeature)
{
this.goodsFeature = goodsFeature;
}
public String getGoodsFeature()
{
return goodsFeature;
}
public void setNewPrice(BigDecimal newPrice)
{
this.newPrice = newPrice;
}
public BigDecimal getNewPrice()
{
return newPrice;
}
public void setOldPrice(BigDecimal oldPrice)
{
this.oldPrice = oldPrice;
}
public BigDecimal getOldPrice()
{
return oldPrice;
}
public void setGoodsStock(Integer goodsStock)
{
this.goodsStock = goodsStock;
}
public Integer getGoodsStock()
{
return goodsStock;
}
public void setGoodsFaceUrl(String goodsFaceUrl)
{
this.goodsFaceUrl = goodsFaceUrl;
}
public String getGoodsFaceUrl()
{
return goodsFaceUrl;
}
public void setGoodsItemUrl(String goodsItemUrl)
{
this.goodsItemUrl = goodsItemUrl;
}
public String getGoodsItemUrl()
{
return goodsItemUrl;
}
public void setArticleContent(String articleContent)
{
this.articleContent = articleContent;
}
public String getArticleContent()
{
return articleContent;
}
public void setSortNo(Integer sortNo)
{
this.sortNo = sortNo;
}
public Integer getSortNo()
{
return sortNo;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public List<MallGoodsSpec> getMallGoodsSpecList()
{
return mallGoodsSpecList;
}
public void setMallGoodsSpecList(List<MallGoodsSpec> mallGoodsSpecList)
{
this.mallGoodsSpecList = mallGoodsSpecList;
}
public Integer getGoodsView() {
return goodsView;
}
public void setGoodsView(Integer goodsView) {
this.goodsView = goodsView;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("goodsClassify", getGoodsClassify())
.append("goodsName", getGoodsName())
.append("goodsFeature", getGoodsFeature())
.append("newPrice", getNewPrice())
.append("oldPrice", getOldPrice())
.append("goodsStock", getGoodsStock())
.append("goodsFaceUrl", getGoodsFaceUrl())
.append("goodsItemUrl", getGoodsItemUrl())
.append("articleContent", getArticleContent())
.append("sortNo", getSortNo())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("mallGoodsSpecList", getMallGoodsSpecList())
.toString();
}
}

View File

@ -0,0 +1,141 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
* 商品规格对象 mall_goods_spec
*
* @author Mr Sir
* @date 2022-05-02
*/
public class MallGoodsSpec extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 父id */
private Long parentId;
/** 规格名称 */
@Excel(name = "规格名称")
private String specName;
/** 规格图片 */
@Excel(name = "规格图片")
private String specUrl;
/** 销售价 */
@Excel(name = "销售价")
private BigDecimal specPrice;
/** 库存 */
@Excel(name = "库存")
private Integer specStock;
/** 排序 */
@Excel(name = "排序")
private Integer sortNo;
/** 是否启用 */
@Excel(name = "是否启用")
private String normalDisable;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
public Long getParentId()
{
return parentId;
}
public void setSpecName(String specName)
{
this.specName = specName;
}
public String getSpecName()
{
return specName;
}
public void setSpecUrl(String specUrl)
{
this.specUrl = specUrl;
}
public String getSpecUrl()
{
return specUrl;
}
public void setSpecPrice(BigDecimal specPrice)
{
this.specPrice = specPrice;
}
public BigDecimal getSpecPrice()
{
return specPrice;
}
public void setSpecStock(Integer specStock)
{
this.specStock = specStock;
}
public Integer getSpecStock()
{
return specStock;
}
public void setSortNo(Integer sortNo)
{
this.sortNo = sortNo;
}
public Integer getSortNo()
{
return sortNo;
}
public void setNormalDisable(String normalDisable)
{
this.normalDisable = normalDisable;
}
public String getNormalDisable()
{
return normalDisable;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("parentId", getParentId())
.append("specName", getSpecName())
.append("specUrl", getSpecUrl())
.append("specPrice", getSpecPrice())
.append("specStock", getSpecStock())
.append("sortNo", getSortNo())
.append("normalDisable", getNormalDisable())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,44 @@
package cn.source.system.domain;
import java.util.List;
/**
* @Description: 定义首页数据类型返回封装好的数据
* @author: 詹sir
* @date: 2022年05月03日 10:39
*/
public class MallIndex {
/**广告*/
private List<MallAdvert> advertList;
/**导航*/
private List<MallNavigate> navigateList;
/**商品*/
private List<MallGoods> goodsList;
public List<MallAdvert> getAdvertList() {
return advertList;
}
public void setAdvertList(List<MallAdvert> advertList) {
this.advertList = advertList;
}
public List<MallNavigate> getNavigateList() {
return navigateList;
}
public void setNavigateList(List<MallNavigate> navigateList) {
this.navigateList = navigateList;
}
public List<MallGoods> getGoodsList() {
return goodsList;
}
public void setGoodsList(List<MallGoods> goodsList) {
this.goodsList = goodsList;
}
}

View File

@ -0,0 +1,112 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 导航管理对象 mall-navigate
*
* @author Mr Sir
* @date 2022-05-02
*/
public class MallNavigate extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 导航名称 */
@Excel(name = "导航名称")
private String navigateName;
/** 链接地址 */
@Excel(name = "链接地址")
private String navigateAddress;
/** 导航图标 */
@Excel(name = "导航图标")
private String navigateUrl;
/** 排序 */
@Excel(name = "排序")
private Integer sortNo;
/** 是否启用 */
@Excel(name = "是否启用")
private String normalDisable;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setNavigateName(String navigateName)
{
this.navigateName = navigateName;
}
public String getNavigateName()
{
return navigateName;
}
public void setNavigateAddress(String navigateAddress)
{
this.navigateAddress = navigateAddress;
}
public String getNavigateAddress()
{
return navigateAddress;
}
public void setNavigateUrl(String navigateUrl)
{
this.navigateUrl = navigateUrl;
}
public String getNavigateUrl()
{
return navigateUrl;
}
public void setSortNo(Integer sortNo)
{
this.sortNo = sortNo;
}
public Integer getSortNo()
{
return sortNo;
}
public void setNormalDisable(String normalDisable)
{
this.normalDisable = normalDisable;
}
public String getNormalDisable()
{
return normalDisable;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("navigateName", getNavigateName())
.append("navigateAddress", getNavigateAddress())
.append("navigateUrl", getNavigateUrl())
.append("sortNo", getSortNo())
.append("normalDisable", getNormalDisable())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,236 @@
package cn.source.system.domain;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 订单信息对象 mall_order
*
* @author 詹Sir
* @date 2022-06-19
*/
public class MallOrder extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 订单号 */
@Excel(name = "订单号")
private String orderCode;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderCreateTime;
/** 收货人 */
@Excel(name = "收货人")
private String receiver;
/** 收货人电话 */
@Excel(name = "联系方式")
private String receiverPhone;
/** 收货地址 */
@Excel(name = "收货地址")
private String receiverAddress;
/** 支付金额 */
@Excel(name = "支付金额")
private BigDecimal payAmount;
/** 支付方式 */
@Excel(name = "支付方式",dictType = "mall_pay_method")
private String payMethod;
/** 支付时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date payTime;
/** 支持状态 */
@Excel(name = "支持状态",dictType = "mall_pay_status")
private String payStatus;
/** 优惠金额 */
private Long disAmount;
/** 订单状态 */
@Excel(name = "订单状态",dictType = "mall_order_status")
private String orderStatus;
/** 排序 */
private Integer sortNo;
/** 用户id */
private Long userId;
/** 订单商品信息 */
private List<MallOrderGoods> mallOrderGoodsList;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setOrderCode(String orderCode)
{
this.orderCode = orderCode;
}
public String getOrderCode()
{
return orderCode;
}
public void setOrderCreateTime(Date orderCreateTime)
{
this.orderCreateTime = orderCreateTime;
}
public Date getOrderCreateTime()
{
return orderCreateTime;
}
public void setPayAmount(BigDecimal payAmount)
{
this.payAmount = payAmount;
}
public BigDecimal getPayAmount()
{
return payAmount;
}
public void setPayMethod(String payMethod)
{
this.payMethod = payMethod;
}
public String getPayMethod()
{
return payMethod;
}
public void setPayTime(Date payTime)
{
this.payTime = payTime;
}
public Date getPayTime()
{
return payTime;
}
public void setPayStatus(String payStatus)
{
this.payStatus = payStatus;
}
public String getPayStatus()
{
return payStatus;
}
public void setDisAmount(Long disAmount)
{
this.disAmount = disAmount;
}
public Long getDisAmount()
{
return disAmount;
}
public void setOrderStatus(String orderStatus)
{
this.orderStatus = orderStatus;
}
public String getOrderStatus()
{
return orderStatus;
}
public void setSortNo(Integer sortNo)
{
this.sortNo = sortNo;
}
public Integer getSortNo()
{
return sortNo;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
public String getReceiverPhone() {
return receiverPhone;
}
public void setReceiverPhone(String receiverPhone) {
this.receiverPhone = receiverPhone;
}
public String getReceiverAddress() {
return receiverAddress;
}
public void setReceiverAddress(String receiverAddress) {
this.receiverAddress = receiverAddress;
}
public List<MallOrderGoods> getMallOrderGoodsList() {
return mallOrderGoodsList;
}
public void setMallOrderGoodsList(List<MallOrderGoods> mallOrderGoodsList) {
this.mallOrderGoodsList = mallOrderGoodsList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderCode", getOrderCode())
.append("orderCreateTime", getOrderCreateTime())
.append("payAmount", getPayAmount())
.append("payMethod", getPayMethod())
.append("payTime", getPayTime())
.append("payStatus", getPayStatus())
.append("disAmount", getDisAmount())
.append("orderStatus", getOrderStatus())
.append("sortNo", getSortNo())
.append("userId", getUserId())
.append("receiver", getReceiver())
.append("receiverPhone", getReceiverPhone())
.append("receiverAddress", getReceiverAddress())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,126 @@
package cn.source.system.domain;
import cn.source.common.core.domain.BaseEntity;
import java.math.BigDecimal;
/**
* 商品结算对象 mall_order_goods
*
* @author Mr Sir
* @date 2022-08-02
*/
public class MallOrderGoods extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 订单id */
private Long orderId;
/** 商品id */
private Long goodsId;
/** 商品名称 */
private String title;
/** 卖点 */
private String desc;
/** 价格 */
private BigDecimal price;
/** 数量 */
private Integer value;
/** 主图 */
private String image;
/** 是否选中商品 */
private Boolean check;
/** 是否显示删除 */
private Boolean show;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getOrderId() {
return orderId;
}
public void setOrderId(Long orderId) {
this.orderId = orderId;
}
public Long getGoodsId() {
return goodsId;
}
public void setGoodsId(Long goodsId) {
this.goodsId = goodsId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public Boolean getCheck() {
return check;
}
public void setCheck(Boolean check) {
this.check = check;
}
public Boolean getShow() {
return show;
}
public void setShow(Boolean show) {
this.show = show;
}
}

View File

@ -0,0 +1,78 @@
package cn.source.system.mapper;
import cn.source.system.domain.MallAddress;
import java.util.List;
/**
* 收货地址Mapper接口
*
* @author 詹Sir
* @date 2022-06-19
*/
public interface MallAddressMapper
{
/**
* 查询收货地址
*
* @param id 收货地址主键
* @return 收货地址
*/
public MallAddress selectMallAddressById(Long id);
/**
* 查询收货地址列表
*
* @param mallAddress 收货地址
* @return 收货地址集合
*/
public List<MallAddress> selectMallAddressList(MallAddress mallAddress);
/**
* api查询收货地址列表,不同于pc的aop,使用用户id查询
*
* @param mallAddress 收货地址
* @return 收货地址集合
*/
public List<MallAddress> selectApiMallAddressList(MallAddress mallAddress);
/**
* 新增收货地址
*
* @param mallAddress 收货地址
* @return 结果
*/
public int insertMallAddress(MallAddress mallAddress);
/**
* 修改收货地址
*
* @param mallAddress 收货地址
* @return 结果
*/
public int updateMallAddress(MallAddress mallAddress);
/**
* 取消其他收货的默认状态
*
* @param mallAddress 收货地址
* @return 结果
*/
public int updateAddressDefault(MallAddress mallAddress);
/**
* 删除收货地址
*
* @param id 收货地址主键
* @return 结果
*/
public int deleteMallAddressById(Long id);
/**
* 批量删除收货地址
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMallAddressByIds(Long[] ids);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.mapper;
import cn.source.system.domain.MallAdvert;
import java.util.List;
/**
* 广告管理Mapper接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface MallAdvertMapper
{
/**
* 查询广告管理
*
* @param id 广告管理主键
* @return 广告管理
*/
public MallAdvert selectMallAdvertById(Long id);
/**
* 查询广告管理列表
*
* @param mallAdvert 广告管理
* @return 广告管理集合
*/
public List<MallAdvert> selectMallAdvertList(MallAdvert mallAdvert);
/**
* 新增广告管理
*
* @param mallAdvert 广告管理
* @return 结果
*/
public int insertMallAdvert(MallAdvert mallAdvert);
/**
* 修改广告管理
*
* @param mallAdvert 广告管理
* @return 结果
*/
public int updateMallAdvert(MallAdvert mallAdvert);
/**
* 删除广告管理
*
* @param id 广告管理主键
* @return 结果
*/
public int deleteMallAdvertById(Long id);
/**
* 批量删除广告管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMallAdvertByIds(Long[] ids);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.mapper;
import cn.source.system.domain.MallClassify;
import java.util.List;
/**
* 分类管理Mapper接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface MallClassifyMapper
{
/**
* 查询分类管理
*
* @param id 分类管理主键
* @return 分类管理
*/
public MallClassify selectMallClassifyById(Long id);
/**
* 查询分类管理列表
*
* @param mallClassify 分类管理
* @return 分类管理集合
*/
public List<MallClassify> selectMallClassifyList(MallClassify mallClassify);
/**
* 新增分类管理
*
* @param mallClassify 分类管理
* @return 结果
*/
public int insertMallClassify(MallClassify mallClassify);
/**
* 修改分类管理
*
* @param mallClassify 分类管理
* @return 结果
*/
public int updateMallClassify(MallClassify mallClassify);
/**
* 删除分类管理
*
* @param id 分类管理主键
* @return 结果
*/
public int deleteMallClassifyById(Long id);
/**
* 批量删除分类管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMallClassifyByIds(Long[] ids);
}

View File

@ -0,0 +1,96 @@
package cn.source.system.mapper;
import cn.source.system.domain.MallGoods;
import cn.source.system.domain.MallGoodsSpec;
import java.util.List;
/**
* 商品管理Mapper接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface MallGoodsMapper
{
/**
* 查询商品管理
*
* @param id 商品管理主键
* @return 商品管理
*/
public MallGoods selectMallGoodsById(Long id);
/**
* 查询商品管理列表
*
* @param mallGoods 商品管理
* @return 商品管理集合
*/
public List<MallGoods> selectMallGoodsList(MallGoods mallGoods);
/**
* 新增商品管理
*
* @param mallGoods 商品管理
* @return 结果
*/
public int insertMallGoods(MallGoods mallGoods);
/**
* 修改商品管理
*
* @param mallGoods 商品管理
* @return 结果
*/
public int updateMallGoods(MallGoods mallGoods);
/**
* 删除商品管理
*
* @param id 商品管理主键
* @return 结果
*/
public int deleteMallGoodsById(Long id);
/**
* 批量删除商品管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMallGoodsByIds(Long[] ids);
/**
* 批量删除商品规格
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMallGoodsSpecByParentIds(Long[] ids);
/**
* 批量新增商品规格
*
* @param mallGoodsSpecList 商品规格列表
* @return 结果
*/
public int batchMallGoodsSpec(List<MallGoodsSpec> mallGoodsSpecList);
/**
* 通过商品管理主键删除商品规格信息
*
* @param id 商品管理ID
* @return 结果
*/
public int deleteMallGoodsSpecByParentId(Long id);
/**
* 修改商品管理
*
* @param mallGoods 商品管理
* @return 结果
*/
public int changeStatus(MallGoods mallGoods);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.mapper;
import cn.source.system.domain.MallGoodsSpec;
import java.util.List;
/**
* 商品规格Mapper接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface MallGoodsSpecMapper
{
/**
* 查询商品规格
*
* @param id 商品规格主键
* @return 商品规格
*/
public MallGoodsSpec selectMallGoodsSpecById(Long id);
/**
* 查询商品规格列表
*
* @param mallGoodsSpec 商品规格
* @return 商品规格集合
*/
public List<MallGoodsSpec> selectMallGoodsSpecList(MallGoodsSpec mallGoodsSpec);
/**
* 新增商品规格
*
* @param mallGoodsSpec 商品规格
* @return 结果
*/
public int insertMallGoodsSpec(MallGoodsSpec mallGoodsSpec);
/**
* 修改商品规格
*
* @param mallGoodsSpec 商品规格
* @return 结果
*/
public int updateMallGoodsSpec(MallGoodsSpec mallGoodsSpec);
/**
* 删除商品规格
*
* @param id 商品规格主键
* @return 结果
*/
public int deleteMallGoodsSpecById(Long id);
/**
* 批量删除商品规格
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMallGoodsSpecByIds(Long[] ids);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.mapper;
import cn.source.system.domain.MallNavigate;
import java.util.List;
/**
* 导航管理Mapper接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface MallNavigateMapper
{
/**
* 查询导航管理
*
* @param id 导航管理主键
* @return 导航管理
*/
public MallNavigate selectMallNavigateById(Long id);
/**
* 查询导航管理列表
*
* @param mallNavigate 导航管理
* @return 导航管理集合
*/
public List<MallNavigate> selectMallNavigateList(MallNavigate mallNavigate);
/**
* 新增导航管理
*
* @param mallNavigate 导航管理
* @return 结果
*/
public int insertMallNavigate(MallNavigate mallNavigate);
/**
* 修改导航管理
*
* @param mallNavigate 导航管理
* @return 结果
*/
public int updateMallNavigate(MallNavigate mallNavigate);
/**
* 删除导航管理
*
* @param id 导航管理主键
* @return 结果
*/
public int deleteMallNavigateById(Long id);
/**
* 批量删除导航管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMallNavigateByIds(Long[] ids);
}

View File

@ -0,0 +1,71 @@
package cn.source.system.mapper;
import cn.source.system.domain.MallOrder;
import cn.source.system.domain.MallOrderGoods;
import java.util.List;
/**
* 订单信息Mapper接口
*
* @author 詹Sir
* @date 2022-06-19
*/
public interface MallOrderMapper
{
/**
* 查询订单信息
*
* @param id 订单信息主键
* @return 订单信息
*/
public MallOrder selectMallOrderById(Long id);
/**
* 查询订单信息列表
*
* @param mallOrder 订单信息
* @return 订单信息集合
*/
public List<MallOrder> selectMallOrderList(MallOrder mallOrder);
/**
* 新增订单信息
*
* @param mallOrder 订单信息
* @return 结果
*/
public int insertMallOrder(MallOrder mallOrder);
/**
* 新增订单保存商品信息
*
* @param mallOrderGoodsList
* @return 结果
*/
public int insertMallOrderGoods(List<MallOrderGoods> mallOrderGoodsList);
/**
* 修改订单信息
*
* @param mallOrder 订单信息
* @return 结果
*/
public int updateMallOrder(MallOrder mallOrder);
/**
* 删除订单信息
*
* @param id 订单信息主键
* @return 结果
*/
public int deleteMallOrderById(Long id);
/**
* 批量删除订单信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteMallOrderByIds(Long[] ids);
}

View File

@ -0,0 +1,70 @@
package cn.source.system.service;
import cn.source.system.domain.MallAddress;
import java.util.List;
/**
* 收货地址Service接口
*
* @author 詹Sir
* @date 2022-06-19
*/
public interface IMallAddressService
{
/**
* 查询收货地址
*
* @param id 收货地址主键
* @return 收货地址
*/
public MallAddress selectMallAddressById(Long id);
/**
* 查询收货地址列表
*
* @param mallAddress 收货地址
* @return 收货地址集合
*/
public List<MallAddress> selectMallAddressList(MallAddress mallAddress);
/**
* api查询收货地址列表,不同于pc的aop,使用用户id查询
*
* @param mallAddress 收货地址
* @return 收货地址集合
*/
public List<MallAddress> selectApiMallAddressList(MallAddress mallAddress);
/**
* 新增收货地址
*
* @param mallAddress 收货地址
* @return 结果
*/
public int insertMallAddress(MallAddress mallAddress);
/**
* 修改收货地址
*
* @param mallAddress 收货地址
* @return 结果
*/
public int updateMallAddress(MallAddress mallAddress);
/**
* 批量删除收货地址
*
* @param ids 需要删除的收货地址主键集合
* @return 结果
*/
public int deleteMallAddressByIds(Long[] ids);
/**
* 删除收货地址信息
*
* @param id 收货地址主键
* @return 结果
*/
public int deleteMallAddressById(Long id);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.service;
import cn.source.system.domain.MallAdvert;
import java.util.List;
/**
* 广告管理Service接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface IMallAdvertService
{
/**
* 查询广告管理
*
* @param id 广告管理主键
* @return 广告管理
*/
public MallAdvert selectMallAdvertById(Long id);
/**
* 查询广告管理列表
*
* @param mallAdvert 广告管理
* @return 广告管理集合
*/
public List<MallAdvert> selectMallAdvertList(MallAdvert mallAdvert);
/**
* 新增广告管理
*
* @param mallAdvert 广告管理
* @return 结果
*/
public int insertMallAdvert(MallAdvert mallAdvert);
/**
* 修改广告管理
*
* @param mallAdvert 广告管理
* @return 结果
*/
public int updateMallAdvert(MallAdvert mallAdvert);
/**
* 批量删除广告管理
*
* @param ids 需要删除的广告管理主键集合
* @return 结果
*/
public int deleteMallAdvertByIds(Long[] ids);
/**
* 删除广告管理信息
*
* @param id 广告管理主键
* @return 结果
*/
public int deleteMallAdvertById(Long id);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.service;
import cn.source.system.domain.MallClassify;
import java.util.List;
/**
* 分类管理Service接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface IMallClassifyService
{
/**
* 查询分类管理
*
* @param id 分类管理主键
* @return 分类管理
*/
public MallClassify selectMallClassifyById(Long id);
/**
* 查询分类管理列表
*
* @param mallClassify 分类管理
* @return 分类管理集合
*/
public List<MallClassify> selectMallClassifyList(MallClassify mallClassify);
/**
* 新增分类管理
*
* @param mallClassify 分类管理
* @return 结果
*/
public int insertMallClassify(MallClassify mallClassify);
/**
* 修改分类管理
*
* @param mallClassify 分类管理
* @return 结果
*/
public int updateMallClassify(MallClassify mallClassify);
/**
* 批量删除分类管理
*
* @param ids 需要删除的分类管理主键集合
* @return 结果
*/
public int deleteMallClassifyByIds(Long[] ids);
/**
* 删除分类管理信息
*
* @param id 分类管理主键
* @return 结果
*/
public int deleteMallClassifyById(Long id);
}

View File

@ -0,0 +1,70 @@
package cn.source.system.service;
import cn.source.system.domain.MallGoods;
import java.util.List;
/**
* 商品管理Service接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface IMallGoodsService
{
/**
* 查询商品管理
*
* @param id 商品管理主键
* @return 商品管理
*/
public MallGoods selectMallGoodsById(Long id);
/**
* 查询商品管理列表
*
* @param mallGoods 商品管理
* @return 商品管理集合
*/
public List<MallGoods> selectMallGoodsList(MallGoods mallGoods);
/**
* 新增商品管理
*
* @param mallGoods 商品管理
* @return 结果
*/
public int insertMallGoods(MallGoods mallGoods);
/**
* 修改商品管理
*
* @param mallGoods 商品管理
* @return 结果
*/
public int updateMallGoods(MallGoods mallGoods);
/**
* 批量删除商品管理
*
* @param ids 需要删除的商品管理主键集合
* @return 结果
*/
public int deleteMallGoodsByIds(Long[] ids);
/**
* 删除商品管理信息
*
* @param id 商品管理主键
* @return 结果
*/
public int deleteMallGoodsById(Long id);
/**
* 改变商品状态
*
* @param mallGoods 商品管理
* @return 结果
*/
public int changeStatus(MallGoods mallGoods);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.service;
import cn.source.system.domain.MallGoodsSpec;
import java.util.List;
/**
* 商品规格Service接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface IMallGoodsSpecService
{
/**
* 查询商品规格
*
* @param id 商品规格主键
* @return 商品规格
*/
public MallGoodsSpec selectMallGoodsSpecById(Long id);
/**
* 查询商品规格列表
*
* @param mallGoodsSpec 商品规格
* @return 商品规格集合
*/
public List<MallGoodsSpec> selectMallGoodsSpecList(MallGoodsSpec mallGoodsSpec);
/**
* 新增商品规格
*
* @param mallGoodsSpec 商品规格
* @return 结果
*/
public int insertMallGoodsSpec(MallGoodsSpec mallGoodsSpec);
/**
* 修改商品规格
*
* @param mallGoodsSpec 商品规格
* @return 结果
*/
public int updateMallGoodsSpec(MallGoodsSpec mallGoodsSpec);
/**
* 批量删除商品规格
*
* @param ids 需要删除的商品规格主键集合
* @return 结果
*/
public int deleteMallGoodsSpecByIds(Long[] ids);
/**
* 删除商品规格信息
*
* @param id 商品规格主键
* @return 结果
*/
public int deleteMallGoodsSpecById(Long id);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.service;
import cn.source.system.domain.MallNavigate;
import java.util.List;
/**
* 导航管理Service接口
*
* @author Mr Sir
* @date 2022-05-02
*/
public interface IMallNavigateService
{
/**
* 查询导航管理
*
* @param id 导航管理主键
* @return 导航管理
*/
public MallNavigate selectMallNavigateById(Long id);
/**
* 查询导航管理列表
*
* @param mallNavigate 导航管理
* @return 导航管理集合
*/
public List<MallNavigate> selectMallNavigateList(MallNavigate mallNavigate);
/**
* 新增导航管理
*
* @param mallNavigate 导航管理
* @return 结果
*/
public int insertMallNavigate(MallNavigate mallNavigate);
/**
* 修改导航管理
*
* @param mallNavigate 导航管理
* @return 结果
*/
public int updateMallNavigate(MallNavigate mallNavigate);
/**
* 批量删除导航管理
*
* @param ids 需要删除的导航管理主键集合
* @return 结果
*/
public int deleteMallNavigateByIds(Long[] ids);
/**
* 删除导航管理信息
*
* @param id 导航管理主键
* @return 结果
*/
public int deleteMallNavigateById(Long id);
}

View File

@ -0,0 +1,62 @@
package cn.source.system.service;
import cn.source.system.domain.MallOrder;
import java.util.List;
/**
* 订单信息Service接口
*
* @author 詹Sir
* @date 2022-06-19
*/
public interface IMallOrderService
{
/**
* 查询订单信息
*
* @param id 订单信息主键
* @return 订单信息
*/
public MallOrder selectMallOrderById(Long id);
/**
* 查询订单信息列表
*
* @param mallOrder 订单信息
* @return 订单信息集合
*/
public List<MallOrder> selectMallOrderList(MallOrder mallOrder);
/**
* 新增订单信息
*
* @param mallOrder 订单信息
* @return 结果
*/
public int insertMallOrder(MallOrder mallOrder);
/**
* 修改订单信息
*
* @param mallOrder 订单信息
* @return 结果
*/
public int updateMallOrder(MallOrder mallOrder);
/**
* 批量删除订单信息
*
* @param ids 需要删除的订单信息主键集合
* @return 结果
*/
public int deleteMallOrderByIds(Long[] ids);
/**
* 删除订单信息信息
*
* @param id 订单信息主键
* @return 结果
*/
public int deleteMallOrderById(Long id);
}

View File

@ -0,0 +1,131 @@
package cn.source.system.service.impl;
import cn.source.common.annotation.DataScope;
import cn.source.common.utils.DateUtils;
import cn.source.common.utils.SecurityUtils;
import cn.source.common.utils.StringUtils;
import cn.source.system.domain.MallAddress;
import cn.source.system.mapper.MallAddressMapper;
import cn.source.system.service.IMallAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 收货地址Service业务层处理
*
* @author 詹Sir
* @date 2022-06-19
*/
@Service
public class MallAddressServiceImpl implements IMallAddressService
{
@Autowired
private MallAddressMapper mallAddressMapper;
/**
* 查询收货地址
*
* @param id 收货地址主键
* @return 收货地址
*/
@Override
public MallAddress selectMallAddressById(Long id)
{
return mallAddressMapper.selectMallAddressById(id);
}
/**
* 查询收货地址列表
*
* @param mallAddress 收货地址
* @return 收货地址
*/
@Override
@DataScope(userAlias = "mall_address")
public List<MallAddress> selectMallAddressList(MallAddress mallAddress)
{
return mallAddressMapper.selectMallAddressList(mallAddress);
}
@Override
public List<MallAddress> selectApiMallAddressList(MallAddress mallAddress)
{
return mallAddressMapper.selectApiMallAddressList(mallAddress);
}
/**
* 新增收货地址
*
* @param mallAddress 收货地址
* @return 结果
*/
@Override
public int insertMallAddress(MallAddress mallAddress)
{
if(StringUtils.isNull(mallAddress.getUserId())){
mallAddress.setUserId(SecurityUtils.getUserId());
}
// true与1转换一下
if(mallAddress.getIsDefault().equals("true")){
mallAddress.setIsDefault("1");
}else{
mallAddress.setIsDefault("0");
}
mallAddress.setCreateTime(DateUtils.getNowDate());
int result = mallAddressMapper.insertMallAddress(mallAddress);
// 如果当前新增记录是默认地址将其他默认取消
if(mallAddress.getIsDefault().equals("1")){
result = mallAddressMapper.updateAddressDefault(mallAddress);
}
return result;
}
/**
* 修改收货地址
*
* @param mallAddress 收货地址
* @return 结果
*/
@Override
public int updateMallAddress(MallAddress mallAddress)
{
// true与1转换一下
if(mallAddress.getIsDefault().equals("true")){
mallAddress.setIsDefault("1");
}else{
mallAddress.setIsDefault("0");
}
mallAddress.setUpdateTime(DateUtils.getNowDate());
// 如果当前新增记录是默认地址将其他默认取消
if(mallAddress.getIsDefault().equals("1")){
mallAddressMapper.updateAddressDefault(mallAddress);
}
return mallAddressMapper.updateMallAddress(mallAddress);
}
/**
* 批量删除收货地址
*
* @param ids 需要删除的收货地址主键
* @return 结果
*/
@Override
public int deleteMallAddressByIds(Long[] ids)
{
return mallAddressMapper.deleteMallAddressByIds(ids);
}
/**
* 删除收货地址信息
*
* @param id 收货地址主键
* @return 结果
*/
@Override
public int deleteMallAddressById(Long id)
{
return mallAddressMapper.deleteMallAddressById(id);
}
}

View File

@ -0,0 +1,97 @@
package cn.source.system.service.impl;
import cn.source.common.utils.DateUtils;
import cn.source.system.domain.MallAdvert;
import cn.source.system.mapper.MallAdvertMapper;
import cn.source.system.service.IMallAdvertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 广告管理Service业务层处理
*
* @author Mr Sir
* @date 2022-05-02
*/
@Service
public class MallAdvertServiceImpl implements IMallAdvertService
{
@Autowired
private MallAdvertMapper mallAdvertMapper;
/**
* 查询广告管理
*
* @param id 广告管理主键
* @return 广告管理
*/
@Override
public MallAdvert selectMallAdvertById(Long id)
{
return mallAdvertMapper.selectMallAdvertById(id);
}
/**
* 查询广告管理列表
*
* @param mallAdvert 广告管理
* @return 广告管理
*/
@Override
public List<MallAdvert> selectMallAdvertList(MallAdvert mallAdvert)
{
return mallAdvertMapper.selectMallAdvertList(mallAdvert);
}
/**
* 新增广告管理
*
* @param mallAdvert 广告管理
* @return 结果
*/
@Override
public int insertMallAdvert(MallAdvert mallAdvert)
{
mallAdvert.setCreateTime(DateUtils.getNowDate());
return mallAdvertMapper.insertMallAdvert(mallAdvert);
}
/**
* 修改广告管理
*
* @param mallAdvert 广告管理
* @return 结果
*/
@Override
public int updateMallAdvert(MallAdvert mallAdvert)
{
mallAdvert.setUpdateTime(DateUtils.getNowDate());
return mallAdvertMapper.updateMallAdvert(mallAdvert);
}
/**
* 批量删除广告管理
*
* @param ids 需要删除的广告管理主键
* @return 结果
*/
@Override
public int deleteMallAdvertByIds(Long[] ids)
{
return mallAdvertMapper.deleteMallAdvertByIds(ids);
}
/**
* 删除广告管理信息
*
* @param id 广告管理主键
* @return 结果
*/
@Override
public int deleteMallAdvertById(Long id)
{
return mallAdvertMapper.deleteMallAdvertById(id);
}
}

View File

@ -0,0 +1,97 @@
package cn.source.system.service.impl;
import cn.source.common.utils.DateUtils;
import cn.source.system.domain.MallClassify;
import cn.source.system.mapper.MallClassifyMapper;
import cn.source.system.service.IMallClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 分类管理Service业务层处理
*
* @author Mr Sir
* @date 2022-05-02
*/
@Service
public class MallClassifyServiceImpl implements IMallClassifyService
{
@Autowired
private MallClassifyMapper mallClassifyMapper;
/**
* 查询分类管理
*
* @param id 分类管理主键
* @return 分类管理
*/
@Override
public MallClassify selectMallClassifyById(Long id)
{
return mallClassifyMapper.selectMallClassifyById(id);
}
/**
* 查询分类管理列表
*
* @param mallClassify 分类管理
* @return 分类管理
*/
@Override
public List<MallClassify> selectMallClassifyList(MallClassify mallClassify)
{
return mallClassifyMapper.selectMallClassifyList(mallClassify);
}
/**
* 新增分类管理
*
* @param mallClassify 分类管理
* @return 结果
*/
@Override
public int insertMallClassify(MallClassify mallClassify)
{
mallClassify.setCreateTime(DateUtils.getNowDate());
return mallClassifyMapper.insertMallClassify(mallClassify);
}
/**
* 修改分类管理
*
* @param mallClassify 分类管理
* @return 结果
*/
@Override
public int updateMallClassify(MallClassify mallClassify)
{
mallClassify.setUpdateTime(DateUtils.getNowDate());
return mallClassifyMapper.updateMallClassify(mallClassify);
}
/**
* 批量删除分类管理
*
* @param ids 需要删除的分类管理主键
* @return 结果
*/
@Override
public int deleteMallClassifyByIds(Long[] ids)
{
return mallClassifyMapper.deleteMallClassifyByIds(ids);
}
/**
* 删除分类管理信息
*
* @param id 分类管理主键
* @return 结果
*/
@Override
public int deleteMallClassifyById(Long id)
{
return mallClassifyMapper.deleteMallClassifyById(id);
}
}

View File

@ -0,0 +1,149 @@
package cn.source.system.service.impl;
import cn.source.common.utils.DateUtils;
import cn.source.common.utils.StringUtils;
import cn.source.system.domain.MallGoods;
import cn.source.system.domain.MallGoodsSpec;
import cn.source.system.mapper.MallGoodsMapper;
import cn.source.system.service.IMallGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* 商品管理Service业务层处理
*
* @author Mr Sir
* @date 2022-05-02
*/
@Service
public class MallGoodsServiceImpl implements IMallGoodsService
{
@Autowired
private MallGoodsMapper mallGoodsMapper;
/**
* 查询商品管理
*
* @param id 商品管理主键
* @return 商品管理
*/
@Override
public MallGoods selectMallGoodsById(Long id)
{
return mallGoodsMapper.selectMallGoodsById(id);
}
/**
* 查询商品管理列表
*
* @param mallGoods 商品管理
* @return 商品管理
*/
@Override
public List<MallGoods> selectMallGoodsList(MallGoods mallGoods)
{
return mallGoodsMapper.selectMallGoodsList(mallGoods);
}
/**
* 新增商品管理
*
* @param mallGoods 商品管理
* @return 结果
*/
@Transactional
@Override
public int insertMallGoods(MallGoods mallGoods)
{
mallGoods.setCreateTime(DateUtils.getNowDate());
int rows = mallGoodsMapper.insertMallGoods(mallGoods);
insertMallGoodsSpec(mallGoods);
return rows;
}
/**
* 修改商品管理
*
* @param mallGoods 商品管理
* @return 结果
*/
@Transactional
@Override
public int updateMallGoods(MallGoods mallGoods)
{
mallGoods.setUpdateTime(DateUtils.getNowDate());
mallGoodsMapper.deleteMallGoodsSpecByParentId(mallGoods.getId());
insertMallGoodsSpec(mallGoods);
return mallGoodsMapper.updateMallGoods(mallGoods);
}
/**
* 批量删除商品管理
*
* @param ids 需要删除的商品管理主键
* @return 结果
*/
@Transactional
@Override
public int deleteMallGoodsByIds(Long[] ids)
{
mallGoodsMapper.deleteMallGoodsSpecByParentIds(ids);
return mallGoodsMapper.deleteMallGoodsByIds(ids);
}
/**
* 删除商品管理信息
*
* @param id 商品管理主键
* @return 结果
*/
@Transactional
@Override
public int deleteMallGoodsById(Long id)
{
mallGoodsMapper.deleteMallGoodsSpecByParentId(id);
return mallGoodsMapper.deleteMallGoodsById(id);
}
/**
* 新增商品规格信息
*
* @param mallGoods 商品管理对象
*/
public void insertMallGoodsSpec(MallGoods mallGoods)
{
List<MallGoodsSpec> mallGoodsSpecList = mallGoods.getMallGoodsSpecList();
Long id = mallGoods.getId();
if (StringUtils.isNotNull(mallGoodsSpecList))
{
List<MallGoodsSpec> list = new ArrayList<MallGoodsSpec>();
for (MallGoodsSpec mallGoodsSpec : mallGoodsSpecList)
{
mallGoodsSpec.setParentId(id);
list.add(mallGoodsSpec);
}
if (list.size() > 0)
{
mallGoodsMapper.batchMallGoodsSpec(list);
}
}
}
/**
* 修改商品管理
*
* @param mallGoods 商品管理
* @return 结果
*/
@Transactional
@Override
public int changeStatus(MallGoods mallGoods)
{
mallGoods.setUpdateTime(DateUtils.getNowDate());
return mallGoodsMapper.changeStatus(mallGoods);
}
}

View File

@ -0,0 +1,97 @@
package cn.source.system.service.impl;
import cn.source.common.utils.DateUtils;
import cn.source.system.domain.MallGoodsSpec;
import cn.source.system.mapper.MallGoodsSpecMapper;
import cn.source.system.service.IMallGoodsSpecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 商品规格Service业务层处理
*
* @author Mr Sir
* @date 2022-05-02
*/
@Service
public class MallGoodsSpecServiceImpl implements IMallGoodsSpecService
{
@Autowired
private MallGoodsSpecMapper mallGoodsSpecMapper;
/**
* 查询商品规格
*
* @param id 商品规格主键
* @return 商品规格
*/
@Override
public MallGoodsSpec selectMallGoodsSpecById(Long id)
{
return mallGoodsSpecMapper.selectMallGoodsSpecById(id);
}
/**
* 查询商品规格列表
*
* @param mallGoodsSpec 商品规格
* @return 商品规格
*/
@Override
public List<MallGoodsSpec> selectMallGoodsSpecList(MallGoodsSpec mallGoodsSpec)
{
return mallGoodsSpecMapper.selectMallGoodsSpecList(mallGoodsSpec);
}
/**
* 新增商品规格
*
* @param mallGoodsSpec 商品规格
* @return 结果
*/
@Override
public int insertMallGoodsSpec(MallGoodsSpec mallGoodsSpec)
{
mallGoodsSpec.setCreateTime(DateUtils.getNowDate());
return mallGoodsSpecMapper.insertMallGoodsSpec(mallGoodsSpec);
}
/**
* 修改商品规格
*
* @param mallGoodsSpec 商品规格
* @return 结果
*/
@Override
public int updateMallGoodsSpec(MallGoodsSpec mallGoodsSpec)
{
mallGoodsSpec.setUpdateTime(DateUtils.getNowDate());
return mallGoodsSpecMapper.updateMallGoodsSpec(mallGoodsSpec);
}
/**
* 批量删除商品规格
*
* @param ids 需要删除的商品规格主键
* @return 结果
*/
@Override
public int deleteMallGoodsSpecByIds(Long[] ids)
{
return mallGoodsSpecMapper.deleteMallGoodsSpecByIds(ids);
}
/**
* 删除商品规格信息
*
* @param id 商品规格主键
* @return 结果
*/
@Override
public int deleteMallGoodsSpecById(Long id)
{
return mallGoodsSpecMapper.deleteMallGoodsSpecById(id);
}
}

View File

@ -0,0 +1,97 @@
package cn.source.system.service.impl;
import cn.source.common.utils.DateUtils;
import cn.source.system.domain.MallNavigate;
import cn.source.system.mapper.MallNavigateMapper;
import cn.source.system.service.IMallNavigateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 导航管理Service业务层处理
*
* @author Mr Sir
* @date 2022-05-02
*/
@Service
public class MallNavigateServiceImpl implements IMallNavigateService
{
@Autowired
private MallNavigateMapper mallNavigateMapper;
/**
* 查询导航管理
*
* @param id 导航管理主键
* @return 导航管理
*/
@Override
public MallNavigate selectMallNavigateById(Long id)
{
return mallNavigateMapper.selectMallNavigateById(id);
}
/**
* 查询导航管理列表
*
* @param mallNavigate 导航管理
* @return 导航管理
*/
@Override
public List<MallNavigate> selectMallNavigateList(MallNavigate mallNavigate)
{
return mallNavigateMapper.selectMallNavigateList(mallNavigate);
}
/**
* 新增导航管理
*
* @param mallNavigate 导航管理
* @return 结果
*/
@Override
public int insertMallNavigate(MallNavigate mallNavigate)
{
mallNavigate.setCreateTime(DateUtils.getNowDate());
return mallNavigateMapper.insertMallNavigate(mallNavigate);
}
/**
* 修改导航管理
*
* @param mallNavigate 导航管理
* @return 结果
*/
@Override
public int updateMallNavigate(MallNavigate mallNavigate)
{
mallNavigate.setUpdateTime(DateUtils.getNowDate());
return mallNavigateMapper.updateMallNavigate(mallNavigate);
}
/**
* 批量删除导航管理
*
* @param ids 需要删除的导航管理主键
* @return 结果
*/
@Override
public int deleteMallNavigateByIds(Long[] ids)
{
return mallNavigateMapper.deleteMallNavigateByIds(ids);
}
/**
* 删除导航管理信息
*
* @param id 导航管理主键
* @return 结果
*/
@Override
public int deleteMallNavigateById(Long id)
{
return mallNavigateMapper.deleteMallNavigateById(id);
}
}

View File

@ -0,0 +1,118 @@
package cn.source.system.service.impl;
import cn.source.common.annotation.DataScope;
import cn.source.common.utils.DateUtils;
import cn.source.common.utils.SecurityUtils;
import cn.source.common.utils.StringUtils;
import cn.source.common.utils.uuid.CodeUtil;
import cn.source.system.domain.MallOrder;
import cn.source.system.domain.MallOrderGoods;
import cn.source.system.mapper.MallOrderMapper;
import cn.source.system.service.IMallOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 订单信息Service业务层处理
*
* @author 詹Sir
* @date 2022-06-19
*/
@Service
public class MallOrderServiceImpl implements IMallOrderService
{
@Autowired
private MallOrderMapper mallOrderMapper;
/**
* 查询订单信息
*
* @param id 订单信息主键
* @return 订单信息
*/
@Override
public MallOrder selectMallOrderById(Long id)
{
return mallOrderMapper.selectMallOrderById(id);
}
/**
* 查询订单信息列表
*
* @param mallOrder 订单信息
* @return 订单信息
*/
@Override
@DataScope(userAlias = "mall_order")
public List<MallOrder> selectMallOrderList(MallOrder mallOrder)
{
return mallOrderMapper.selectMallOrderList(mallOrder);
}
/**
* 新增订单信息
*
* @param mallOrder 订单信息
* @return 结果
*/
@Override
public int insertMallOrder(MallOrder mallOrder)
{
if(StringUtils.isNull(mallOrder.getUserId())){
mallOrder.setUserId(SecurityUtils.getUserId());
}
mallOrder.setOrderCode(CodeUtil.getCode());
mallOrder.setOrderCreateTime(DateUtils.getNowDate());
mallOrder.setCreateTime(DateUtils.getNowDate());
mallOrder.setSortNo(0);
// 保存订单
mallOrderMapper.insertMallOrder(mallOrder);
List< MallOrderGoods > mallOrderGoodsList = mallOrder.getMallOrderGoodsList();
for (MallOrderGoods mallOrderGoods : mallOrderGoodsList)
{
// 设置订单id
mallOrderGoods.setOrderId(mallOrder.getId());
}
// 保存订单商品信息
return mallOrderMapper.insertMallOrderGoods(mallOrderGoodsList);
}
/**
* 修改订单信息
*
* @param mallOrder 订单信息
* @return 结果
*/
@Override
public int updateMallOrder(MallOrder mallOrder)
{
mallOrder.setUpdateTime(DateUtils.getNowDate());
return mallOrderMapper.updateMallOrder(mallOrder);
}
/**
* 批量删除订单信息
*
* @param ids 需要删除的订单信息主键
* @return 结果
*/
@Override
public int deleteMallOrderByIds(Long[] ids)
{
return mallOrderMapper.deleteMallOrderByIds(ids);
}
/**
* 删除订单信息信息
*
* @param id 订单信息主键
* @return 结果
*/
@Override
public int deleteMallOrderById(Long id)
{
return mallOrderMapper.deleteMallOrderById(id);
}
}

View File

@ -0,0 +1,117 @@
<?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="cn.source.system.mapper.MallAddressMapper">
<resultMap type="MallAddress" id="MallAddressResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="phone" column="phone" />
<result property="address" column="address" />
<result property="isDefault" column="is_default" />
<result property="normalDisable" column="normal_disable" />
<result property="sortNo" column="sort_no" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectMallAddressVo">
select id, user_id, user_name, phone, address, is_default, normal_disable, sort_no, create_by, create_time, update_by, update_time, remark from mall_address
</sql>
<select id="selectMallAddressList" parameterType="MallAddress" resultMap="MallAddressResult">
<include refid="selectMallAddressVo"/>
<where>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>
<select id="selectApiMallAddressList" parameterType="MallAddress" resultMap="MallAddressResult">
<include refid="selectMallAddressVo"/>
<where>
<if test="userId != null and userId != ''"> and user_Id = #{userId}</if>
<if test="isDefault != null and isDefault != ''"> and is_default = #{isDefault}</if>
</where>
</select>
<select id="selectMallAddressById" parameterType="Long" resultMap="MallAddressResult">
<include refid="selectMallAddressVo"/>
where id = #{id}
</select>
<insert id="insertMallAddress" parameterType="MallAddress" useGeneratedKeys="true" keyProperty="id">
insert into mall_address
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="address != null and address != ''">address,</if>
<if test="isDefault != null and isDefault != ''">is_default,</if>
<if test="normalDisable != null and normalDisable != ''">normal_disable,</if>
<if test="sortNo != null">sort_no,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
<if test="normalDisable != null and normalDisable != ''">#{normalDisable},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateMallAddress" parameterType="MallAddress">
update mall_address
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="address != null and address != ''">address = #{address},</if>
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
<if test="normalDisable != null and normalDisable != ''">normal_disable = #{normalDisable},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<update id="updateAddressDefault" parameterType="MallAddress">
update mall_address
set is_default = 0
where user_id = #{userId} and id != #{id}
</update>
<delete id="deleteMallAddressById" parameterType="Long">
delete from mall_address where id = #{id}
</delete>
<delete id="deleteMallAddressByIds" parameterType="String">
delete from mall_address where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,97 @@
<?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="cn.source.system.mapper.MallAdvertMapper">
<resultMap type="MallAdvert" id="MallAdvertResult">
<result property="id" column="id" />
<result property="advertType" column="advert_type" />
<result property="advertName" column="advert_name" />
<result property="advertAddress" column="advert_address" />
<result property="advertUrl" column="advert_url" />
<result property="sortNo" column="sort_no" />
<result property="normalDisable" column="normal_disable" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectMallAdvertVo">
select id, advert_type, advert_name, advert_address, advert_url, sort_no, normal_disable, create_by, create_time, update_by, update_time, remark from mall_advert
</sql>
<select id="selectMallAdvertList" parameterType="MallAdvert" resultMap="MallAdvertResult">
<include refid="selectMallAdvertVo"/>
<where>
<if test="advertType != null "> and advert_type = #{advertType}</if>
<if test="advertName != null and advertName != ''"> and advert_name like concat('%', #{advertName}, '%')</if>
</where>
</select>
<select id="selectMallAdvertById" parameterType="Long" resultMap="MallAdvertResult">
<include refid="selectMallAdvertVo"/>
where id = #{id}
</select>
<insert id="insertMallAdvert" parameterType="MallAdvert" useGeneratedKeys="true" keyProperty="id">
insert into mall_advert
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="advertType != null">advert_type,</if>
<if test="advertName != null and advertName != ''">advert_name,</if>
<if test="advertAddress != null and advertAddress != ''">advert_address,</if>
<if test="advertUrl != null and advertUrl != ''">advert_url,</if>
<if test="sortNo != null">sort_no,</if>
<if test="normalDisable != null">normal_disable,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="advertType != null">#{advertType},</if>
<if test="advertName != null and advertName != ''">#{advertName},</if>
<if test="advertAddress != null and advertAddress != ''">#{advertAddress},</if>
<if test="advertUrl != null and advertUrl != ''">#{advertUrl},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="normalDisable != null">#{normalDisable},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateMallAdvert" parameterType="MallAdvert">
update mall_advert
<trim prefix="SET" suffixOverrides=",">
<if test="advertType != null">advert_type = #{advertType},</if>
<if test="advertName != null and advertName != ''">advert_name = #{advertName},</if>
<if test="advertAddress != null and advertAddress != ''">advert_address = #{advertAddress},</if>
<if test="advertUrl != null and advertUrl != ''">advert_url = #{advertUrl},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="normalDisable != null">normal_disable = #{normalDisable},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMallAdvertById" parameterType="Long">
delete from mall_advert where id = #{id}
</delete>
<delete id="deleteMallAdvertByIds" parameterType="String">
delete from mall_advert where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,99 @@
<?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="cn.source.system.mapper.MallClassifyMapper">
<resultMap type="MallClassify" id="MallClassifyResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="classifyName" column="classify_name" />
<result property="classifyUrl" column="classify_url" />
<result property="sortNo" column="sort_no" />
<result property="normalDisable" column="normal_disable" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectMallClassifyVo">
select id, parent_id, ancestors, classify_name, classify_url, sort_no, normal_disable, create_by, create_time, update_by, update_time, remark from mall_classify
</sql>
<select id="selectMallClassifyList" parameterType="MallClassify" resultMap="MallClassifyResult">
<include refid="selectMallClassifyVo"/>
<where>
<if test="classifyName != null and classifyName != ''"> and classify_name like concat('%', #{classifyName}, '%')</if>
<if test="normalDisable != null and normalDisable != ''"> and normal_disable = #{normalDisable}</if>
<if test="parentId != null"> and parent_Id = #{parentId}</if>
</where>
order by sort_no
</select>
<select id="selectMallClassifyById" parameterType="Long" resultMap="MallClassifyResult">
<include refid="selectMallClassifyVo"/>
where id = #{id}
</select>
<insert id="insertMallClassify" parameterType="MallClassify" useGeneratedKeys="true" keyProperty="id">
insert into mall_classify
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="classifyName != null and classifyName != ''">classify_name,</if>
<if test="classifyUrl != null and classifyUrl != ''">classify_url,</if>
<if test="sortNo != null">sort_no,</if>
<if test="normalDisable != null">normal_disable,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="classifyName != null and classifyName != ''">#{classifyName},</if>
<if test="classifyUrl != null and classifyUrl != ''">#{classifyUrl},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="normalDisable != null">#{normalDisable},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateMallClassify" parameterType="MallClassify">
update mall_classify
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="classifyName != null and classifyName != ''">classify_name = #{classifyName},</if>
<if test="classifyUrl != null and classifyUrl != ''">classify_url = #{classifyUrl},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="normalDisable != null">normal_disable = #{normalDisable},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMallClassifyById" parameterType="Long">
delete from mall_classify where id = #{id}
</delete>
<delete id="deleteMallClassifyByIds" parameterType="String">
delete from mall_classify where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,176 @@
<?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="cn.source.system.mapper.MallGoodsMapper">
<resultMap type="MallGoods" id="MallGoodsResult">
<result property="id" column="id" />
<result property="goodsClassify" column="goods_classify" />
<result property="goodsName" column="goods_name" />
<result property="goodsFeature" column="goods_feature" />
<result property="newPrice" column="new_price" />
<result property="oldPrice" column="old_price" />
<result property="goodsStock" column="goods_stock" />
<result property="goodsFaceUrl" column="goods_face_url" />
<result property="goodsItemUrl" column="goods_item_url" />
<result property="articleContent" column="article_content" />
<result property="sortNo" column="sort_no" />
<result property="status" column="status" />
<result property="hotStatus" column="hot_Status" />
<result property="goodsView" column="goods_View" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<resultMap id="MallGoodsMallGoodsSpecResult" type="MallGoods" extends="MallGoodsResult">
<collection property="mallGoodsSpecList" notNullColumn="sub_id" javaType="java.util.List" resultMap="MallGoodsSpecResult" />
</resultMap>
<resultMap type="MallGoodsSpec" id="MallGoodsSpecResult">
<result property="id" column="sub_id" />
<result property="parentId" column="sub_parent_id" />
<result property="specName" column="sub_spec_name" />
<result property="specUrl" column="sub_spec_url" />
<result property="specPrice" column="sub_spec_price" />
<result property="specStock" column="sub_spec_stock" />
<result property="sortNo" column="sub_sort_no" />
<result property="normalDisable" column="sub_normal_disable" />
<result property="createBy" column="sub_create_by" />
<result property="createTime" column="sub_create_time" />
<result property="updateBy" column="sub_update_by" />
<result property="updateTime" column="sub_update_time" />
<result property="remark" column="sub_remark" />
</resultMap>
<sql id="selectMallGoodsVo">
select id, goods_classify, goods_name, goods_feature, new_price, old_price, goods_stock, goods_face_url, goods_item_url, article_content, sort_no, status,hot_status, goods_View,create_by, create_time, update_by, update_time, remark from mall_goods
</sql>
<select id="selectMallGoodsList" parameterType="MallGoods" resultMap="MallGoodsResult">
<include refid="selectMallGoodsVo"/>
<where>
<if test="goodsClassify != null and goodsClassify != ''"> and goods_classify = #{goodsClassify}</if>
<if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
</where>
</select>
<select id="selectMallGoodsById" parameterType="Long" resultMap="MallGoodsMallGoodsSpecResult">
select a.id, a.goods_classify, a.goods_name, a.goods_feature, a.new_price, a.old_price, a.goods_stock, a.goods_face_url, a.goods_item_url, a.article_content, a.sort_no, a.status,a.hot_status,a.goods_View, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
b.id as sub_id, b.parent_id as sub_parent_id, b.spec_name as sub_spec_name, b.spec_url as sub_spec_url, b.spec_price as sub_spec_price, b.spec_stock as sub_spec_stock, b.sort_no as sub_sort_no, b.normal_disable as sub_normal_disable, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark
from mall_goods a
left join mall_goods_spec b on b.parent_id = a.id
where a.id = #{id}
</select>
<insert id="insertMallGoods" parameterType="MallGoods" useGeneratedKeys="true" keyProperty="id">
insert into mall_goods
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="goodsClassify != null and goodsClassify != ''">goods_classify,</if>
<if test="goodsName != null and goodsName != ''">goods_name,</if>
<if test="goodsFeature != null">goods_feature,</if>
<if test="newPrice != null">new_price,</if>
<if test="oldPrice != null">old_price,</if>
<if test="goodsStock != null">goods_stock,</if>
<if test="goodsFaceUrl != null and goodsFaceUrl != ''">goods_face_url,</if>
<if test="goodsItemUrl != null and goodsItemUrl != ''">goods_item_url,</if>
<if test="articleContent != null and articleContent != ''">article_content,</if>
<if test="sortNo != null">sort_no,</if>
<if test="status != null">status,</if>
<if test="hotStatus != null">hot_status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="goodsClassify != null and goodsClassify != ''">#{goodsClassify},</if>
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
<if test="goodsFeature != null">#{goodsFeature},</if>
<if test="newPrice != null">#{newPrice},</if>
<if test="oldPrice != null">#{oldPrice},</if>
<if test="goodsStock != null">#{goodsStock},</if>
<if test="goodsFaceUrl != null and goodsFaceUrl != ''">#{goodsFaceUrl},</if>
<if test="goodsItemUrl != null and goodsItemUrl != ''">#{goodsItemUrl},</if>
<if test="articleContent != null and articleContent != ''">#{articleContent},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="status != null">#{status},</if>
<if test="hotStatus != null">#{hotStatus},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateMallGoods" parameterType="MallGoods">
update mall_goods
<trim prefix="SET" suffixOverrides=",">
<if test="goodsClassify != null and goodsClassify != ''">goods_classify = #{goodsClassify},</if>
<if test="goodsName != null and goodsName != ''">goods_name = #{goodsName},</if>
<if test="goodsFeature != null">goods_feature = #{goodsFeature},</if>
<if test="newPrice != null">new_price = #{newPrice},</if>
<if test="oldPrice != null">old_price = #{oldPrice},</if>
<if test="goodsStock != null">goods_stock = #{goodsStock},</if>
<if test="goodsFaceUrl != null and goodsFaceUrl != ''">goods_face_url = #{goodsFaceUrl},</if>
<if test="goodsItemUrl != null and goodsItemUrl != ''">goods_item_url = #{goodsItemUrl},</if>
<if test="articleContent != null and articleContent != ''">article_content = #{articleContent},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="status != null">status = #{status},</if>
<if test="hotStatus != null">hot_Status = #{hotStatus},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMallGoodsById" parameterType="Long">
delete from mall_goods where id = #{id}
</delete>
<delete id="deleteMallGoodsByIds" parameterType="String">
delete from mall_goods where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteMallGoodsSpecByParentIds" parameterType="String">
delete from mall_goods_spec where parent_id in
<foreach item="parentId" collection="array" open="(" separator="," close=")">
#{parentId}
</foreach>
</delete>
<delete id="deleteMallGoodsSpecByParentId" parameterType="Long">
delete from mall_goods_spec where parent_id = #{parentId}
</delete>
<insert id="batchMallGoodsSpec">
insert into mall_goods_spec( id, parent_id, spec_name, spec_url, spec_price, spec_stock, sort_no, normal_disable, create_by, create_time, update_by, update_time, remark) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.parentId}, #{item.specName}, #{item.specUrl}, #{item.specPrice}, #{item.specStock}, #{item.sortNo}, #{item.normalDisable}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark})
</foreach>
</insert>
<update id="changeStatus" parameterType="MallGoods">
update mall_goods
<trim prefix="SET" suffixOverrides=",">
<if test="status != null">status = #{status},</if>
<if test="hotStatus != null">hot_status = #{hotStatus},</if>
<if test="goodsView != null">goods_View = #{goodsView},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime}</if>
</trim>
where id = #{id}
</update>
</mapper>

View File

@ -0,0 +1,101 @@
<?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="cn.source.system.mapper.MallGoodsSpecMapper">
<resultMap type="MallGoodsSpec" id="MallGoodsSpecResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="specName" column="spec_name" />
<result property="specUrl" column="spec_url" />
<result property="specPrice" column="spec_price" />
<result property="specStock" column="spec_stock" />
<result property="sortNo" column="sort_no" />
<result property="normalDisable" column="normal_disable" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectMallGoodsSpecVo">
select id, parent_id, spec_name, spec_url, spec_price, spec_stock, sort_no, normal_disable, create_by, create_time, update_by, update_time, remark from mall_goods_spec
</sql>
<select id="selectMallGoodsSpecList" parameterType="MallGoodsSpec" resultMap="MallGoodsSpecResult">
<include refid="selectMallGoodsSpecVo"/>
<where>
<if test="specName != null and specName != ''"> and spec_name like concat('%', #{specName}, '%')</if>
<if test="normalDisable != null and normalDisable != ''"> and normal_disable = #{normalDisable}</if>
</where>
</select>
<select id="selectMallGoodsSpecById" parameterType="Long" resultMap="MallGoodsSpecResult">
<include refid="selectMallGoodsSpecVo"/>
where id = #{id}
</select>
<insert id="insertMallGoodsSpec" parameterType="MallGoodsSpec" useGeneratedKeys="true" keyProperty="id">
insert into mall_goods_spec
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="specName != null and specName != ''">spec_name,</if>
<if test="specUrl != null and specUrl != ''">spec_url,</if>
<if test="specPrice != null">spec_price,</if>
<if test="specStock != null">spec_stock,</if>
<if test="sortNo != null">sort_no,</if>
<if test="normalDisable != null and normalDisable != ''">normal_disable,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},</if>
<if test="specName != null and specName != ''">#{specName},</if>
<if test="specUrl != null and specUrl != ''">#{specUrl},</if>
<if test="specPrice != null">#{specPrice},</if>
<if test="specStock != null">#{specStock},</if>
<if test="sortNo != null">#{sortNo},</if>
<if test="normalDisable != null and normalDisable != ''">#{normalDisable},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateMallGoodsSpec" parameterType="MallGoodsSpec">
update mall_goods_spec
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="specName != null and specName != ''">spec_name = #{specName},</if>
<if test="specUrl != null and specUrl != ''">spec_url = #{specUrl},</if>
<if test="specPrice != null">spec_price = #{specPrice},</if>
<if test="specStock != null">spec_stock = #{specStock},</if>
<if test="sortNo != null">sort_no = #{sortNo},</if>
<if test="normalDisable != null and normalDisable != ''">normal_disable = #{normalDisable},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMallGoodsSpecById" parameterType="Long">
delete from mall_goods_spec where id = #{id}
</delete>
<delete id="deleteMallGoodsSpecByIds" parameterType="String">
delete from mall_goods_spec where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

Some files were not shown because too many files have changed in this diff Show More