From 74d7aed668f67adea64ba507373b58b86fffd100 Mon Sep 17 00:00:00 2001
From: zhangzeli <123456>
Date: 星期一, 08 十一月 2021 08:41:05 +0800
Subject: [PATCH] 用户表,片区表
---
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java | 4 +++-
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/AreaMapper.java | 4 ++--
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/AreaController.java | 6 +++---
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Area.java | 2 +-
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/AreaController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/AreaController.java
index 3e27411..c8c02d9 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/AreaController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/AreaController.java
@@ -49,10 +49,10 @@
@RequestMapping(value = "/getByPage", method = RequestMethod.GET)
@ApiOperation(value = "鍒嗛〉鑾峰彇")
- public Result<IPage<Area>> getByPage(String areaId,PageVo page) {
+ public Result<IPage<Area>> getByPage(String name,PageVo page) {
QueryWrapper<Area> wrapper = new QueryWrapper<>();
- if (!StrUtil.isEmpty(areaId))
- wrapper.eq("area_id",areaId);
+ if (!StrUtil.isEmpty(name))
+ wrapper.like("a.name",name);
IPage<Area> data = iAreaService.page2(PageUtil.initMpPage(page),wrapper);
return new ResultUtil<IPage<Area>>().setData(data);
}
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java
index df25787..bd68872 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java
@@ -50,10 +50,12 @@
@RequestMapping(value = "/getByPage", method = RequestMethod.GET)
@ApiOperation(value = "" +
"")
- public Result<IPage<Customer>> getByPage(String areaSectionId,PageVo page) {
+ public Result<IPage<Customer>> getByPage(String areaSectionId,String name,PageVo page) {
QueryWrapper<Customer> wrapper = new QueryWrapper<>();
if (!StrUtil.isEmpty(areaSectionId))
wrapper.eq("area_section_id",areaSectionId);
+ if (!StrUtil.isEmpty(name))
+ wrapper.like("name","%"+name+"%");
IPage<Customer> data = iCustomerService.page(PageUtil.initMpPage(page),wrapper);
return new ResultUtil<IPage<Customer>>().setData(data);
}
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Area.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Area.java
index 6eb5a5a..3fe41c5 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Area.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Area.java
@@ -41,5 +41,5 @@
@Transient
@TableField(exist = false)
- private String userName;
+ private String nickName;
}
\ No newline at end of file
diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/AreaMapper.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/AreaMapper.java
index b7824a9..d641dd8 100644
--- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/AreaMapper.java
+++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/mapper/AreaMapper.java
@@ -21,7 +21,7 @@
*/
public interface AreaMapper extends BaseMapper<Area> {
- @Select("SELECT a.*,b.username as temp FROM t_area a LEFT JOIN t_user b ON a.user_id=b.id ${ew.customSqlSegment} ")
- @Results({@Result(column="temp", property="userName", jdbcType = JdbcType.VARCHAR)})
+ @Select("SELECT a.*,b.nickname as temp FROM t_area a LEFT JOIN t_user b ON a.user_id=b.id ${ew.customSqlSegment} ")
+ @Results({@Result(column="temp", property="nickName", jdbcType = JdbcType.VARCHAR)})
IPage<Area> page2(Page initMpPage, @Param(Constants.WRAPPER) QueryWrapper<Area> wrapper);
}
\ No newline at end of file
--
Gitblit v1.9.1