2 Commits

  1. 2
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/buyer/CereBuyerUserDAO.java
  2. 9
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/buyer/impl/CereBuyerUserServiceImpl.java
  3. 4
      cereshop-admin/src/main/resources/mybatis/mapper/buyer/CereBuyerUserDAO.xml
  4. 6
      cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java
  5. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java
  6. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java
  7. 8
      cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java
  8. 4
      cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml

2
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/buyer/CereBuyerUserDAO.java

@ -65,4 +65,6 @@ public interface CereBuyerUserDAO extends BaseMapper<CereBuyerUser> {
List<CerePlatformLabel> getUserLabels(BuyerGetLabelsParam param);
int increaseCredit(@Param("buyerUserId") long buyerUserId, @Param("credit") Integer credit);
List<CereBuyerUser> getBuyerUserBySearch(String searchContent);
}

9
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/buyer/impl/CereBuyerUserServiceImpl.java

@ -240,15 +240,16 @@ public class CereBuyerUserServiceImpl implements CereBuyerUserService {
@Override
public Page<CereBuyerUser> searchUser(UserSearchParam param) {
PageHelper.startPage(param.getPage(),param.getPageSize());
LambdaQueryWrapper<CereBuyerUser> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CereBuyerUser::getBuyerUserId, param.getSearchKey())
/* LambdaQueryWrapper<CereBuyerUser> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CereBuyerUser::getProject, "0")
.eq(CereBuyerUser::getBuyerUserId, param.getSearchKey())
.or()
.eq(CereBuyerUser::getWechatOpenId, param.getSearchKey())
.or()
.like(CereBuyerUser::getName, param.getSearchKey())
.or()
.eq(CereBuyerUser::getPhone, param.getSearchKey());
List<CereBuyerUser> userList = cereBuyerUserDAO.selectList(wrapper);
.eq(CereBuyerUser::getPhone, param.getSearchKey());*/
List<CereBuyerUser> userList = cereBuyerUserDAO.getBuyerUserBySearch(param.getSearchKey());
PageInfo<CereBuyerUser> pageInfo=new PageInfo<>(userList);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;

4
cereshop-admin/src/main/resources/mybatis/mapper/buyer/CereBuyerUserDAO.xml

@ -341,4 +341,8 @@
LEFT JOIN cere_platform_label b ON a.buyer_label_id=b.buyer_label_id
where a.buyer_user_id=#{buyerUserId}
</select>
<select id="getBuyerUserBySearch" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.buyer.CereBuyerUser">
SELECT * FROM cere_buyer_user where project=0 and concat(buyer_user_id,ifnull(wechat_open_id, ''),ifnull(name, ''),ifnull(phone, '')) like concat('%',#{searchContent},'%')
</select>
</mapper>

6
cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java

@ -176,8 +176,10 @@ public class BusinessBuyerUserController {
@NoRepeatSubmit
@ApiOperation(value = "搜索用户信息")
@NoRepeatWebLog
public Result<Page<CereBuyerUser>> searchUser(@RequestBody BusinessUserSearchParam param) {
Page<CereBuyerUser> page = cereBuyerUserService.searchUser(param);
public Result<Page<CereBuyerUser>> searchUser(@RequestBody BusinessUserSearchParam param, HttpServletRequest request) {
//获取当前登录账户
CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user");
Page<CereBuyerUser> page = cereBuyerUserService.searchUser(String.valueOf(user.getBusinessId()), param);
return new Result(page);
}

2
cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java

@ -63,4 +63,6 @@ public interface BusinessBuyerUserDAO extends BaseMapper<CereBuyerUser> {
List<CerePlatformLabel> getUserLabels(BusinessBuyerGetLabelsParam param);
int increaseCredit(@Param("buyerUserId") long buyerUserId, @Param("credit") Integer credit);
List<CereBuyerUser> getBuyerUserBySearch(String project, String searchContent);
}

2
cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java

@ -79,5 +79,5 @@ public interface CereBusinessBuyerUserService {
* @param param
* @return
*/
Page<CereBuyerUser> searchUser(BusinessUserSearchParam param);
Page<CereBuyerUser> searchUser(String project, BusinessUserSearchParam param);
}

8
cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java

@ -237,17 +237,17 @@ public class CereBusinessBuyerUserServiceImpl implements CereBusinessBuyerUserSe
}
@Override
public Page<CereBuyerUser> searchUser(BusinessUserSearchParam param) {
public Page<CereBuyerUser> searchUser(String project, BusinessUserSearchParam param) {
PageHelper.startPage(param.getPage(),param.getPageSize());
LambdaQueryWrapper<CereBuyerUser> wrapper = new LambdaQueryWrapper<>();
/* LambdaQueryWrapper<CereBuyerUser> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CereBuyerUser::getBuyerUserId, param.getSearchKey())
.or()
.eq(CereBuyerUser::getWechatOpenId, param.getSearchKey())
.or()
.like(CereBuyerUser::getName, param.getSearchKey())
.or()
.eq(CereBuyerUser::getPhone, param.getSearchKey());
List<CereBuyerUser> userList = businessBuyerUserDAO.selectList(wrapper);
.eq(CereBuyerUser::getPhone, param.getSearchKey());*/
List<CereBuyerUser> userList = businessBuyerUserDAO.getBuyerUserBySearch(project, param.getSearchKey());
PageInfo<CereBuyerUser> pageInfo=new PageInfo<>(userList);
Page page=new Page(pageInfo.getList(),pageInfo.getTotal());
return page;

4
cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml

@ -344,4 +344,8 @@
LEFT JOIN cere_platform_label b ON a.buyer_label_id=b.buyer_label_id
where a.buyer_user_id=#{buyerUserId}
</select>
<select id="getBuyerUserBySearch" parameterType="java.lang.Object" resultType="com.shop.cereshop.commons.domain.buyer.CereBuyerUser">
SELECT * FROM cere_buyer_user where project=#{project} and concat(buyer_user_id,ifnull(wechat_open_id, ''),ifnull(name, ''),ifnull(phone, '')) like concat('%',#{searchContent},'%')
</select>
</mapper>
Loading…
Cancel
Save