diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysUserEntity.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysUserEntity.java index 7ee7baf..1409997 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysUserEntity.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/model/SysUserEntity.java @@ -27,6 +27,7 @@ public class SysUserEntity extends SuperEntity implements Seriali private String password; private String roleIds; private String companyId; + private String companyIds; private Date createDate; private Date updateDate; @@ -165,5 +166,13 @@ public class SysUserEntity extends SuperEntity implements Seriali this.createDate = createDate; } + public String getCompanyIds() { + return companyIds; + } + + public void setCompanyIds(String companyIds) { + this.companyIds = companyIds; + } + } \ No newline at end of file diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysUserServiceImpl.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysUserServiceImpl.java index a41ba3a..11da7a7 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysUserServiceImpl.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/service/impl/SysUserServiceImpl.java @@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.alibaba.druid.util.StringUtils; import com.baomidou.mybatisplus.plugins.Page; import com.tamguo.modules.sys.dao.SysUserMapper; import com.tamguo.modules.sys.model.SysUserEntity; @@ -26,6 +27,15 @@ public class SysUserServiceImpl implements ISysUserService{ @Transactional(readOnly=false) @Override public Page listData(SysUserCondition condition) { + if(!StringUtils.isEmpty(condition.getCompanyCode())) { + condition.setCompanyCode("%" + condition.getCompanyCode() + "%"); + } + if(!StringUtils.isEmpty(condition.getName())) { + condition.setName("%" + condition.getName() + "%"); + } + if(!StringUtils.isEmpty(condition.getNickName())) { + condition.setNickName("%" + condition.getNickName() + "%"); + } Page page = new Page<>(condition.getPageNo() , condition.getPageSize()); return page.setRecords(sysUserMapper.listData(condition , page)); } diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/sys/utils/Result.java b/tamguo-oms/src/main/java/com/tamguo/modules/sys/utils/Result.java index af5a88e..5492e63 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/sys/utils/Result.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/sys/utils/Result.java @@ -68,10 +68,13 @@ public class Result implements Serializable { int totalPage) { Map result = new HashMap(); result.put("list", list); - result.put("totalCount", totalCount); + result.put("count", totalCount); + result.put("next", currPage == totalPage ? currPage : currPage + 1); + result.put("prev", currPage == 1 ? 1 : currPage - 1); + result.put("first", 1); + result.put("last", totalPage); result.put("pageSize", pageSize); - result.put("currPage", currPage); - result.put("totalPage", totalPage); + result.put("pageNo", currPage); return result; } diff --git a/tamguo-oms/src/main/resources/mappers/SysUserMapper.xml b/tamguo-oms/src/main/resources/mappers/SysUserMapper.xml index a3b0e15..a418bfd 100644 --- a/tamguo-oms/src/main/resources/mappers/SysUserMapper.xml +++ b/tamguo-oms/src/main/resources/mappers/SysUserMapper.xml @@ -39,7 +39,7 @@ 1 = 1 - and u.user_name like #{userName} + and u.user_name = #{userName} and u.nick_name like #{nickName} @@ -48,7 +48,7 @@ and u.nick_name like #{nickName} - and u.company_id = #{companyCode} + and u.company_ids like #{companyCode} and u.email = #{email}