diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AjaxMemberController.java b/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AjaxMemberController.java new file mode 100644 index 000000000..cb36d062f --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AjaxMemberController.java @@ -0,0 +1,91 @@ +package com.ruoyi.business.ajax; + +import com.ruoyi.business.domain.BizMember; +import com.ruoyi.business.domain.BizMemberAddress; +import com.ruoyi.business.domain.BizProduct; +import com.ruoyi.business.service.IBizMemberAddressService; +import com.ruoyi.business.service.IBizMemberService; +import com.ruoyi.business.service.IBizProductService; +import com.ruoyi.business.service.IBizProductTypeService; +import com.ruoyi.common.core.domain.AjaxResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/ajax/member") +public class AjaxMemberController extends AuthController { + + @Autowired + private IBizMemberService bizMemberService; + + @Autowired + private IBizMemberAddressService bizMemberAddressService; + + //个人中心 + @PostMapping("/center") + public AjaxResult center() + { + Long userID = getUserID(); + Map resultMap = new HashMap(); + BizMember member = bizMemberService.selectBizMemberById(userID); + resultMap.put("name", member.getMemberName()); + resultMap.put("mobile", member.getMobile()); + resultMap.put("douBalance", member.getDouBalance()); + resultMap.put("douPerson", member.getDouPerson()); + resultMap.put("douTeam", member.getDouTeam()); + resultMap.put("douField", member.getDouField()); + return AjaxResult.success(resultMap); + } + + //读取我的地址列表 + @PostMapping("/addressList") + public AjaxResult addressList() + { + Long userID = getUserID(); + return AjaxResult.success(bizMemberAddressService.selectBizMemberAddressList(userID)); + } + + //我的地址详细 + @PostMapping("/addressDetail") + public AjaxResult addressDetail(Long addressID) + { + Long userID = getUserID(); + BizMemberAddress address = bizMemberAddressService.selectBizMemberAddressById(addressID); + if (address == null || address.getMemberID() != userID) { + return AjaxResult.error("操作有误请重试"); + } + return AjaxResult.success(address); + } + + //编辑我的地址 + @PostMapping("/addressEdit") + public AjaxResult addressDetail(BizMemberAddress bizMemberAddress) + { + Long userID = getUserID(); + BizMemberAddress address = bizMemberAddressService.selectBizMemberAddressById(bizMemberAddress.getId()); + if (address == null || address.getMemberID() != userID) { + return AjaxResult.error("操作有误请重试"); + } + return AjaxResult.success(bizMemberAddressService.updateBizMemberAddress(bizMemberAddress)); + } + + //删除我的地址 + @PostMapping("/addressDelete") + public AjaxResult addressDelete(Long addressID) + { + Long userID = getUserID(); + BizMemberAddress address = bizMemberAddressService.selectBizMemberAddressById(addressID); + if (address == null || address.getMemberID() != userID) { + return AjaxResult.error("操作有误请重试"); + } + if (bizMemberAddressService.selectBizMemberAddressList(userID).size() <= 1) { + return AjaxResult.error("不能删除默认收货地址"); + } + return AjaxResult.success(bizMemberAddressService.deleteBizMemberAddressById(addressID)); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AjaxOrderController.java b/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AjaxOrderController.java new file mode 100644 index 000000000..559928f64 --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AjaxOrderController.java @@ -0,0 +1,90 @@ +package com.ruoyi.business.ajax; + +import com.ruoyi.business.domain.BizMember; +import com.ruoyi.business.domain.BizMemberAddress; +import com.ruoyi.business.domain.BizOrder; +import com.ruoyi.business.domain.BizProduct; +import com.ruoyi.business.service.*; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/ajax/order") +public class AjaxOrderController extends AuthController { + + @Autowired + private IBizOrderService bizOrderService; + + @Autowired + private IBizProductService bizProductService; + + @Autowired + private IBizMemberService bizMemberService; + + @Autowired + private IBizMemberAddressService bizMemberAddressService; + + + //我的订单(status-1取全部订单) + @PostMapping("/orderList") + public AjaxResult orderList(Integer status) + { + Long userID = getUserID(); + BizOrder order = new BizOrder(); + order.setMemberId(userID); + order.setOrderStatus(status); + return AjaxResult.success(bizOrderService.selectBizOrderList(order)); + } + + //我的订单详情 + @PostMapping("/orderDetail") + public AjaxResult orderDetail(Long orderID) + { + Long userID = getUserID(); + BizOrder order = bizOrderService.selectBizOrderById(orderID); + if (order == null || userID != order.getMemberId()) { + return AjaxResult.error(); + } + return AjaxResult.success(order); + } + + //订单结账 + @PostMapping("/orderConclude") + public AjaxResult orderConclude(Long productID, Integer productNum) + { + Long userID = getUserID(); + Map resultMap = new HashMap(); + //取出福豆余额 + resultMap.put("douBalance", bizMemberService.selectBizMemberDou(userID, BizMember.DOU_BALANCE)); + //取出默认地址 + BizMemberAddress defaultAddress = bizMemberAddressService.selectDefaultAddressByMemberId(userID); + resultMap.put("defaultAddress", defaultAddress); + //取出商品 + BizProduct product = bizProductService.selectBizProductById(productID); + if (product == null || product.getOnlineStatus() == 0) { //检测上架 + return AjaxResult.error("该商品不存在"); + } + resultMap.put("productName", product.getProductName()); + resultMap.put("productNum", productNum); + resultMap.put("productPrice", product.getAmount()); + resultMap.put("orderPrice", product.getAmount() * productNum); + return AjaxResult.success(resultMap); + } + + //下订单 + @PostMapping("/orderAdd") + public AjaxResult orderAdd(Long productID, Integer productNum, Long addressID, String remark) + { + Long userID = getUserID(); + + + return AjaxResult.success(); + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AjaxProductController.java b/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AjaxProductController.java new file mode 100644 index 000000000..b2376ca1d --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AjaxProductController.java @@ -0,0 +1,93 @@ +package com.ruoyi.business.ajax; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.github.pagehelper.PageHelper; +import com.ruoyi.business.domain.BizProduct; +import com.ruoyi.business.domain.BizProductType; +import com.ruoyi.business.mapper.BizAccountMapper; +import com.ruoyi.business.mapper.BizMemberMapper; +import com.ruoyi.business.service.IBizProductService; +import com.ruoyi.business.service.IBizProductTypeService; +import com.ruoyi.business.sync.UserData; +import com.ruoyi.business.sync.UserDataListener; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.*; + +@RestController +@RequestMapping("/ajax/product") +public class AjaxProductController extends AuthController { + + @Autowired + private IBizProductService bizProductService; + + @Autowired + private IBizProductTypeService bizProductTypeService; + + //分类和推荐商品 + @PostMapping("/center") + public AjaxResult center() + { + PageHelper.startPage(1, 10); + //首页分类 + Map resultMap = new HashMap(); + BizProductType productType = new BizProductType(); + productType.setIsEnable(1); + resultMap.put("typeList", bizProductTypeService.selectBizProductTypeList(productType)); + + //首页商品 + BizProduct product = new BizProduct(); + product.setOnlineStatus(1); + resultMap.put("productList", getSimpleProductList(bizProductService.selectBizProductList(product))); + return AjaxResult.success(resultMap); + } + + //产品列表 + @PostMapping("/list") + public AjaxResult list(Long typeID) + { + PageHelper.startPage(1, 20); + + Map resultMap = new HashMap(); + BizProductType productType = new BizProductType(); + productType.setIsEnable(1); + resultMap.put("typeList", bizProductTypeService.selectBizProductTypeList(productType)); + + BizProduct product = new BizProduct(); + product.setOnlineStatus(1); + product.setProductTypeId(typeID); + resultMap.put("productList", getSimpleProductList(bizProductService.selectBizProductList(product))); + resultMap.put("typeID", typeID); + return AjaxResult.success(resultMap); + } + + //读取产品 + @PostMapping("/load") + public AjaxResult load(Long productId) + { + BizProduct bizProduct = bizProductService.selectBizProductById(productId); + return AjaxResult.success(bizProduct); + } + + //简易商品列表 + private List getSimpleProductList(List productList) + { + List resultList = new ArrayList(); + for (BizProduct bizProduct : productList) { + Map map = new HashMap(); + map.put("name", bizProduct.getProductName()); + map.put("mainImage", bizProduct.getMainImage()); + map.put("price", bizProduct.getAmount()); + resultList.add(map); + } + return resultList; + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AuthController.java b/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AuthController.java new file mode 100644 index 000000000..4296b2dcc --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/ajax/AuthController.java @@ -0,0 +1,13 @@ +package com.ruoyi.business.ajax; + +import com.ruoyi.common.core.controller.BaseController; + +public class AuthController extends BaseController { + + + //获取前端登录用户ID + public Long getUserID() + { + return 1L; + } +} diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizMember.java b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizMember.java index 1fb8360eb..e8c4036ca 100644 --- a/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizMember.java +++ b/ruoyi-business/src/main/java/com/ruoyi/business/domain/BizMember.java @@ -15,6 +15,12 @@ public class BizMember extends BaseEntity { private static final long serialVersionUID = 1L; + //用户豆账户(0-福豆余额,1-个人福豆,2-团队福豆, 3-福豆田) + public static final int DOU_BALANCE = 0; + public static final int DOU_PERSON = 1; + public static final int DOU_TEAM = 2; + public static final int DOU_FIELD = 3; + /** 会员ID */ private Long id; diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberAddressMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberAddressMapper.java new file mode 100644 index 000000000..b639cb11e --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberAddressMapper.java @@ -0,0 +1,79 @@ +package com.ruoyi.business.mapper; + + +import com.ruoyi.business.domain.BizMemberAddress; + +import java.util.List; + +/** + * 会员收货地址Mapper接口 + * + * @author ruoyi + * @date 2020-09-17 + */ +public interface BizMemberAddressMapper +{ + /** + * 查询会员收货地址 + * + * @param id 会员收货地址ID + * @return 会员收货地址 + */ + public BizMemberAddress selectBizMemberAddressById(Long id); + + /** + * 查询会员默认收货地址 + * + * @param memberID 会员ID + * @return 会员收货地址 + */ + public BizMemberAddress selectDefaultAddressByMemberId(Long memberID); + + /** + * 取消默认收货地址 + * + * @param memberID 会员ID + * @return int + */ + public int cancelDefaultAddress(Long memberID); + + /** + * 查询会员收货地址列表 + * + * @param memberID 会员ID + * @return 会员收货地址集合 + */ + public List selectBizMemberAddressList(Long memberID); + + /** + * 新增会员收货地址 + * + * @param bizMemberAddress 会员收货地址 + * @return 结果 + */ + public int insertBizMemberAddress(BizMemberAddress bizMemberAddress); + + /** + * 修改会员收货地址 + * + * @param bizMemberAddress 会员收货地址 + * @return 结果 + */ + public int updateBizMemberAddress(BizMemberAddress bizMemberAddress); + + /** + * 删除会员收货地址 + * + * @param id 会员收货地址ID + * @return 结果 + */ + public int deleteBizMemberAddressById(Long id); + + /** + * 批量删除会员收货地址 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteBizMemberAddressByIds(String[] ids); +} \ No newline at end of file diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberMapper.java b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberMapper.java index c90ca289e..75661d595 100644 --- a/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberMapper.java +++ b/ruoyi-business/src/main/java/com/ruoyi/business/mapper/BizMemberMapper.java @@ -1,6 +1,8 @@ package com.ruoyi.business.mapper; import java.util.List; +import java.util.Map; + import com.ruoyi.business.domain.BizMember; /** @@ -35,6 +37,14 @@ public interface BizMemberMapper */ public List selectBizMemberList(BizMember bizMember); + /** + * 会员福豆余额 + * + * @param map + * @return 结果 + */ + public Long selectBizMemberDou(Map map); + /** * 新增会员 * diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberAddressService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberAddressService.java new file mode 100644 index 000000000..6e3523faf --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberAddressService.java @@ -0,0 +1,71 @@ +package com.ruoyi.business.service; + +import com.ruoyi.business.domain.BizMemberAddress; + +import java.util.List; + +/** + * 会员收货地址Service接口 + * + * @author ruoyi + * @date 2020-09-17 + */ +public interface IBizMemberAddressService +{ + /** + * 查询会员收货地址 + * + * @param id 会员收货地址ID + * @return 会员收货地址 + */ + public BizMemberAddress selectBizMemberAddressById(Long id); + + /** + * 查询会员默认收货地址 + * + * @param memberID 会员ID + * @return 会员收货地址 + */ + public BizMemberAddress selectDefaultAddressByMemberId(Long memberID); + + /** + * 取消默认收货地址 + * + * @param memberID 会员ID + * @return int + */ + public int cancelDefaultAddress(Long memberID); + + /** + * 查询会员收货地址列表 + * + * @param memberID 会员ID + * @return 会员收货地址集合 + */ + public List selectBizMemberAddressList(Long memberID); + + /** + * 新增会员收货地址 + * + * @param bizMemberAddress 会员收货地址 + * @return 结果 + */ + public int insertBizMemberAddress(BizMemberAddress bizMemberAddress); + + /** + * 修改会员收货地址 + * + * @param bizMemberAddress 会员收货地址 + * @return 结果 + */ + public int updateBizMemberAddress(BizMemberAddress bizMemberAddress); + + /** + * 删除会员收货地址 + * + * @param id 会员收货地址ID + * @return 结果 + */ + public int deleteBizMemberAddressById(Long id); + +} \ No newline at end of file diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberService.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberService.java index 6eb52008e..98e1527c3 100644 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberService.java +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/IBizMemberService.java @@ -1,6 +1,8 @@ package com.ruoyi.business.service; import java.util.List; +import java.util.Map; + import com.ruoyi.business.domain.BizMember; /** @@ -35,6 +37,14 @@ public interface IBizMemberService */ public List selectBizMemberList(BizMember bizMember); + /** + * 会员福豆余额 + * + * @param memberID type + * @return 结果 + */ + public Long selectBizMemberDou(Long memberID, int type); + /** * 新增会员 * diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberAddressServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberAddressServiceImpl.java new file mode 100644 index 000000000..ef6e2db5f --- /dev/null +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberAddressServiceImpl.java @@ -0,0 +1,113 @@ +package com.ruoyi.business.service.impl; + +import com.ruoyi.business.domain.BizMemberAddress; +import com.ruoyi.business.mapper.BizMemberAddressMapper; +import com.ruoyi.business.service.IBizMemberAddressService; +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +/** + * 会员收货地址Service业务层处理 + * + * @author ruoyi + * @date 2020-09-17 + */ +@Service +public class BizMemberAddressServiceImpl implements IBizMemberAddressService +{ + @Autowired + private BizMemberAddressMapper bizMemberAddressMapper; + + /** + * 查询会员收货地址 + * + * @param id 会员收货地址ID + * @return 会员收货地址 + */ + @Override + public BizMemberAddress selectBizMemberAddressById(Long id) + { + return bizMemberAddressMapper.selectBizMemberAddressById(id); + } + + /** + * 查询会员默认收货地址 + * + * @param memberID 会员ID + * @return 会员收货地址 + */ + public BizMemberAddress selectDefaultAddressByMemberId(Long memberID) + { + return bizMemberAddressMapper.selectDefaultAddressByMemberId(memberID); + } + + /** + * 取消默认收货地址 + * + * @param memberID 会员ID + * @return int + */ + public int cancelDefaultAddress(Long memberID) + { + return bizMemberAddressMapper.cancelDefaultAddress(memberID); + } + + /** + * 查询会员收货地址列表 + * + * @param memberID 会员ID + * @return 会员收货地址 + */ + @Override + public List selectBizMemberAddressList(Long memberID) + { + return bizMemberAddressMapper.selectBizMemberAddressList(memberID); + } + + /** + * 新增会员收货地址 + * + * @param bizMemberAddress 会员收货地址 + * @return 结果 + */ + @Override + public int insertBizMemberAddress(BizMemberAddress bizMemberAddress) + { + bizMemberAddress.setCreateTime(DateUtils.getNowDate()); + if (bizMemberAddress.getIsDelete() == 1) { //默认收货地址 + bizMemberAddressMapper.cancelDefaultAddress(bizMemberAddress.getMemberID()); + } + return bizMemberAddressMapper.insertBizMemberAddress(bizMemberAddress); + } + + /** + * 修改会员收货地址 + * + * @param bizMemberAddress 会员收货地址 + * @return 结果 + */ + @Override + public int updateBizMemberAddress(BizMemberAddress bizMemberAddress) + { + bizMemberAddress.setUpdateTime(DateUtils.getNowDate()); + if (bizMemberAddress.getIsDelete() == 1) { //默认收货地址 + bizMemberAddressMapper.cancelDefaultAddress(bizMemberAddress.getMemberID()); + } + return bizMemberAddressMapper.updateBizMemberAddress(bizMemberAddress); + } + + /** + * 删除会员收货地址信息 + * + * @param id 会员收货地址ID + * @return 结果 + */ + @Override + public int deleteBizMemberAddressById(Long id) + { + return bizMemberAddressMapper.deleteBizMemberAddressById(id); + } +} \ No newline at end of file diff --git a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberServiceImpl.java b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberServiceImpl.java index 43398830a..25161a9bb 100644 --- a/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberServiceImpl.java +++ b/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizMemberServiceImpl.java @@ -1,6 +1,9 @@ package com.ruoyi.business.service.impl; +import java.util.HashMap; import java.util.List; +import java.util.Map; + import com.ruoyi.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -57,6 +60,20 @@ public class BizMemberServiceImpl implements IBizMemberService return bizMemberMapper.selectBizMemberList(bizMember); } + /** + * 会员福豆余额 + * + * @param memberID type + * @return 结果 + */ + public Long selectBizMemberDou(Long memberID, int type) + { + Map map = new HashMap<>(); + map.put("memberID", memberID); + map.put("type", type); + return bizMemberMapper.selectBizMemberDou(map); + } + /** * 新增会员 * diff --git a/ruoyi-business/src/main/resources/mapper/business/BizMemberAddressMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BizMemberAddressMapper.xml new file mode 100644 index 000000000..4728ebcea --- /dev/null +++ b/ruoyi-business/src/main/resources/mapper/business/BizMemberAddressMapper.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + select id, mobile, member_id, member_name, address, province_code, province_name, city_code, city_name, area_code, area_name, is_delete, create_by, create_time, update_by, update_time from biz_member_address + + + + + + + + + + update biz_member_address + set is_delete = 0 where member_id = #{memberID} + + + + insert into biz_member_address + + mobile, + member_id, + member_name, + address, + province_code, + province_name, + city_code, + city_name, + area_code, + area_name, + is_delete, + create_by, + create_time, + update_by, + update_time, + + + #{mobile}, + #{memberID}, + #{memberName}, + #{address}, + #{provinceCode}, + #{provinceName}, + #{cityCode}, + #{cityName}, + #{areaCode}, + #{areaName}, + #{isDelete}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update biz_member_address + + mobile = #{mobile}, + member_name = #{memberName}, + address = #{address}, + province_code = #{provinceCode}, + province_name = #{provinceName}, + city_code = #{cityCode}, + city_name = #{cityName}, + area_code = #{areaCode}, + area_name = #{areaName}, + is_delete = #{isDelete}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from biz_member_address where id = #{id} + + + + delete from biz_member_address where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-business/src/main/resources/mapper/business/BizMemberMapper.xml b/ruoyi-business/src/main/resources/mapper/business/BizMemberMapper.xml index 71c8d6531..a2b043c21 100644 --- a/ruoyi-business/src/main/resources/mapper/business/BizMemberMapper.xml +++ b/ruoyi-business/src/main/resources/mapper/business/BizMemberMapper.xml @@ -44,6 +44,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where a.id = #{id} + + - and (a.member_name like concat('%', #{memberName}, '%') or a.mobile like concat('%', #{memberName}, '%')) + and (a.member_name like concat('%', #{memberName}, '%') or a.mobile like concat('%', #{memberName}, '%')) + and a.member_id = #{memberId} + and a.order_status = #{orderStatus} order by a.id desc