提交 0401e840 作者: 张小凤

user(add)

上级 bab66b72
...@@ -49,9 +49,9 @@ public class AuthHandler { ...@@ -49,9 +49,9 @@ public class AuthHandler {
BaseAccountDTO account = JsonUtil.parseJsonToObj(json, BaseAccountDTO.class); BaseAccountDTO account = JsonUtil.parseJsonToObj(json, BaseAccountDTO.class);
// 如果是PC管理端-获取部门缓存信息 // 如果是PC管理端-获取部门缓存信息
if (JwtConstant.SXTB_ACCOUNT_TOKEN.equals(account.getTokenPort())) { /* if (JwtConstant.SXTB_ACCOUNT_TOKEN.equals(account.getTokenPort())) {
account.getCompanyInfo().setCompanys(this.getCompanys(account.getCompanyInfo().getId())); account.getCompanyInfo().setCompanys(this.getCompanys(account.getCompanyInfo().getId()));
} }*/
return account; return account;
} }
...@@ -61,7 +61,7 @@ public class AuthHandler { ...@@ -61,7 +61,7 @@ public class AuthHandler {
map.put(JwtConstant.ROLEIDKEY, roleId); map.put(JwtConstant.ROLEIDKEY, roleId);
map.put(JwtConstant.TOKEN_TYPE, tokenType); map.put(JwtConstant.TOKEN_TYPE, tokenType);
String token = JwtUtil.createJwt(map); String token = JwtUtil.createJwt(map);
loginInfo.setTokenPort(tokenType); // loginInfo.setTokenPort(tokenType);
// 缓存登录token-jwt // 缓存登录token-jwt
stringRedisTemplate.opsForValue().set( stringRedisTemplate.opsForValue().set(
...@@ -70,12 +70,12 @@ public class AuthHandler { ...@@ -70,12 +70,12 @@ public class AuthHandler {
// 平台PC管理端登录保存-单位的id及无限下级id集合 // 平台PC管理端登录保存-单位的id及无限下级id集合
if (JwtConstant.SXTB_ACCOUNT_TOKEN.equals(tokenType)) { if (JwtConstant.SXTB_ACCOUNT_TOKEN.equals(tokenType)) {
if (loginInfo.getCompanyInfo() != null && !CollectionUtils.isEmpty(loginInfo.getCompanyInfo().getCompanys())) { /*if (loginInfo.getCompanyInfo() != null && !CollectionUtils.isEmpty(loginInfo.getCompanyInfo().getCompanys())) {
List<Integer> companys = loginInfo.getCompanyInfo().getCompanys(); List<Integer> companys = loginInfo.getCompanyInfo().getCompanys();
this.refreshCompanys(companys, loginInfo.getCompanyInfo().getId()); this.refreshCompanys(companys, loginInfo.getCompanyInfo().getId());
// 置为null--省内存 // 置为null--省内存
loginInfo.getCompanyInfo().setCompanys(null); loginInfo.getCompanyInfo().setCompanys(null);
} }*/
} }
// 缓存登录对象 // 缓存登录对象
stringRedisTemplate.opsForValue().set(token, JsonUtil.parseObjToJson(loginInfo), JwtConstant.EXPIRATION, stringRedisTemplate.opsForValue().set(token, JsonUtil.parseObjToJson(loginInfo), JwtConstant.EXPIRATION,
......
package com.mmc.oms.controller; package com.mmc.oms.controller;
import com.alibaba.fastjson.JSONObject;
import com.mmc.oms.common.AuthHandler; import com.mmc.oms.common.AuthHandler;
import com.mmc.oms.common.BizException;
import com.mmc.oms.common.ResultEnum;
import com.mmc.oms.jwt.JwtConstant; import com.mmc.oms.jwt.JwtConstant;
import com.mmc.oms.model.dto.BaseAccountDTO; import com.mmc.oms.model.dto.BaseAccountDTO;
import com.mmc.oms.model.dto.CurrentUserDTO; import com.mmc.oms.model.dto.CurrentUserDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -18,6 +23,8 @@ public abstract class BaseController { ...@@ -18,6 +23,8 @@ public abstract class BaseController {
@Autowired @Autowired
private AuthHandler authHandler; private AuthHandler authHandler;
@Autowired
private StringRedisTemplate stringRedisTemplate;
/** /**
* 获取当前用户 * 获取当前用户
* *
...@@ -35,7 +42,14 @@ public abstract class BaseController { ...@@ -35,7 +42,14 @@ public abstract class BaseController {
* 获取当前登录账号信息 * 获取当前登录账号信息
*/ */
public BaseAccountDTO getCurrentAccount(HttpServletRequest request) { public BaseAccountDTO getCurrentAccount(HttpServletRequest request) {
String token = request.getHeader(JwtConstant.TOKENKEY); String token = request.getHeader("token");
return authHandler.getCurrentAccount(token); String json = stringRedisTemplate.opsForValue().get(token);
if (StringUtils.isBlank(json)){
throw new BizException(ResultEnum.LOGIN_ACCOUNT_STATUS_ERROR);
}
BaseAccountDTO baseAccountDTO= JSONObject.parseObject(json, BaseAccountDTO.class);
return baseAccountDTO;
} }
} }
...@@ -122,9 +122,9 @@ public class CouponUserController extends BaseController { ...@@ -122,9 +122,9 @@ public class CouponUserController extends BaseController {
@RequestParam String uuid, @RequestParam String uuid,
@RequestParam String phone) { @RequestParam String phone) {
BaseAccountDTO countDTO = new BaseAccountDTO(); BaseAccountDTO countDTO = new BaseAccountDTO();
countDTO.setId(uid); countDTO.setUserAccountId(uid);
countDTO.setUid(uuid); countDTO.setUid(uuid);
countDTO.setAccountPhone(phone); countDTO.setPhoneNum(phone);
return couponUserService.receiveCoupon(id, countDTO); return couponUserService.receiveCoupon(id, countDTO);
} }
...@@ -167,9 +167,9 @@ public class CouponUserController extends BaseController { ...@@ -167,9 +167,9 @@ public class CouponUserController extends BaseController {
@RequestParam String uuid, @RequestParam String uuid,
@RequestParam String phone) { @RequestParam String phone) {
BaseAccountDTO countDTO = new BaseAccountDTO(); BaseAccountDTO countDTO = new BaseAccountDTO();
countDTO.setId(uid); countDTO.setUserAccountId(uid);
countDTO.setUid(uuid); countDTO.setUid(uuid);
countDTO.setAccountPhone(phone); countDTO.setPhoneNum(phone);
return couponUserService.receiveCouponList(id, countDTO); return couponUserService.receiveCouponList(id, countDTO);
} }
......
...@@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -17,7 +17,7 @@ import javax.servlet.http.HttpServletRequest;
@RestController @RestController
@RequestMapping("/RentalOrders") @RequestMapping("/RentalOrders")
@Api(tags = {"web租赁订单"}) @Api(tags = {"web租赁订单"})
public class RentalOrdersController { public class RentalOrdersController extends BaseController{
@Autowired private RentalOrdersService rentalOrdersService; @Autowired private RentalOrdersService rentalOrdersService;
...@@ -41,8 +41,7 @@ public class RentalOrdersController { ...@@ -41,8 +41,7 @@ public class RentalOrdersController {
@PostMapping("listPcWechatOrder") @PostMapping("listPcWechatOrder")
public ResultBody listPcWechatOrder(HttpServletRequest request, @RequestBody OrderInfoQO param) { public ResultBody listPcWechatOrder(HttpServletRequest request, @RequestBody OrderInfoQO param) {
return ResultBody.success( return ResultBody.success(
// this.getCurrentAccount(request) rentalOrdersService.listPcOrderInfo(param, this.getCurrentAccount(request)));
rentalOrdersService.listPcOrderInfo(param, null));
} }
@ApiOperation(value = "小程序-云仓-订单-分页-列表") @ApiOperation(value = "小程序-云仓-订单-分页-列表")
...@@ -50,6 +49,6 @@ public class RentalOrdersController { ...@@ -50,6 +49,6 @@ public class RentalOrdersController {
@PostMapping("listPageWechatOrder") @PostMapping("listPageWechatOrder")
public ResultBody listPageWechatOrder( public ResultBody listPageWechatOrder(
HttpServletRequest request, @RequestBody OrderInfoQO param) { HttpServletRequest request, @RequestBody OrderInfoQO param) {
return ResultBody.success(rentalOrdersService.listPageWechatOrder(null, param)); return ResultBody.success(rentalOrdersService.listPageWechatOrder(this.getCurrentAccount(request), param));
} }
} }
...@@ -21,77 +21,27 @@ import java.io.Serializable; ...@@ -21,77 +21,27 @@ import java.io.Serializable;
//@ApiModel(value = "com.mmc.csf.model.dto.BaseAccountDTO", description = "登录信息DTO") //@ApiModel(value = "com.mmc.csf.model.dto.BaseAccountDTO", description = "登录信息DTO")
public class BaseAccountDTO implements Serializable { public class BaseAccountDTO implements Serializable {
private static final long serialVersionUID = -2979712090903806216L; private static final long serialVersionUID = -2979712090903806216L;
private Integer id;
private String uid; @ApiModelProperty(value = "token")
private String accountPhone; private String token;
@ApiModelProperty(value = "账号id")
private Integer userAccountId;
@ApiModelProperty(value = "账号")
private String accountNo; private String accountNo;
private String accountName; @ApiModelProperty(value = "账号uid")
private String tokenPort; private String uid;
@ApiModelProperty(value = "角色ID") @ApiModelProperty(value = "手机号")
private Integer roleId; private String phoneNum;
@ApiModelProperty(value = "是否为管理角色:0否 1是") @ApiModelProperty(value = "用户名称")
private Integer admin;// 是否为管理角色 private String userName;
@ApiModelProperty(value = "是否为运营角色:0否 1是") @ApiModelProperty(value = "用户昵称")
private Integer operate; private String nickName;
@ApiModelProperty(value = "是否PMC发货专员:0否 1是")
private Integer pmc;
@ApiModelProperty(value = "单位信息")
private CompanyCacheDTO companyInfo;// 单位信息
public BaseAccountDTO(UserAccountDTO user) {
this.id = user.getId();
this.accountNo = user.getAccountNo();
this.accountName = user.getUserName();
this.roleId = user.getRoleInfo() == null ? null : user.getRoleInfo().getId();
this.admin = user.getRoleInfo() == null ? null : user.getRoleInfo().getAdmin();
this.operate = user.getRoleInfo() == null ? null : user.getRoleInfo().getOperate();
this.pmc = user.getRoleInfo() == null ? null : user.getRoleInfo().getPmc();
}
public BaseAccountDTO(RepoAccountDTO account) {
this.id = account.getId();
this.accountName = account.getAccountName();
this.uid = account.getUid();
this.accountPhone = account.getPhoneNum();
}
public BaseAccountDTO(MallUserDTO account) {
this.id = account.getId();
this.accountName = account.getNickName();
this.uid = account.getUid();
this.accountPhone = account.getPhoneNum();
}
public BaseAccountDTO(FlyerAccountDTO account) {
this.id = account.getId();
this.accountName = account.getAccountName();
this.uid = account.getUid();
this.accountPhone = account.getPhoneNum();
}
/**
* 是否为科比特超级管理员单位(是:无单位资源限制 否:只能看当前和下级单位的资源)
* @return
*/
public boolean isManage() {
if(this.getCompanyInfo()==null){
return false;
}
if(this.getCompanyInfo().getManage()==null){
return false;
}
return this.getCompanyInfo().getManage() == 1;
}
/**
* 判断是否已授权
*
* @return
*/
// public boolean authorized() {
// if (StringUtils.isBlank(this.accountName) || StringUtils.isBlank(this.accountPhone)) {
// return false;
// }
// return true;
// }
} }
...@@ -29,14 +29,14 @@ public class OrderInfoQO implements Serializable { ...@@ -29,14 +29,14 @@ public class OrderInfoQO implements Serializable {
@ApiModelProperty(value = "关键字") @ApiModelProperty(value = "关键字")
private String keyword; private String keyword;
@ApiModelProperty(value = "买家账号") @ApiModelProperty(value = "买家名称")
private String buyerAccount; private String buyerName;
@ApiModelProperty(value = "订单编号") @ApiModelProperty(value = "订单编号")
private String orderNo; private String orderNo;
@ApiModelProperty(value = "商品id") @ApiModelProperty(value = "商品编号")
private String wareInfoId; private String wareNo;
@ApiModelProperty(value = "商品名称") @ApiModelProperty(value = "商品名称")
private String wareTitle; private String wareTitle;
......
...@@ -72,7 +72,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser ...@@ -72,7 +72,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
@Override @Override
public ResultBody getMyList(Integer status,Integer pageNo,Integer pageSize, BaseAccountDTO currentAccount) { public ResultBody getMyList(Integer status,Integer pageNo,Integer pageSize, BaseAccountDTO currentAccount) {
Integer uid = currentAccount.getId(); Integer uid = currentAccount.getUserAccountId();
LambdaQueryWrapper<CouponUserDO> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CouponUserDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CouponUserDO::getUid, uid); queryWrapper.eq(CouponUserDO::getUid, uid);
if (status == null) { if (status == null) {
...@@ -127,7 +127,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser ...@@ -127,7 +127,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
if (!couponDO.getGetType().equals(CouponConstants.COUPON_USR_TYPE_ACTIVITY)){ if (!couponDO.getGetType().equals(CouponConstants.COUPON_USR_TYPE_ACTIVITY)){
//查看当前优惠券是否限制每人领取 //查看当前优惠券是否限制每人领取
LambdaQueryWrapper<CouponUserDO> queryWrap = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CouponUserDO> queryWrap = new LambdaQueryWrapper<>();
queryWrap.eq(CouponUserDO::getUid, currentAccount.getId()).eq(CouponUserDO::getCouponId, id); queryWrap.eq(CouponUserDO::getUid, currentAccount.getUserAccountId()).eq(CouponUserDO::getCouponId, id);
long count = this.count(queryWrap); long count = this.count(queryWrap);
if (count >= couponDO.getRestrictedAccess()) { if (count >= couponDO.getRestrictedAccess()) {
return ResultBody.error("已领取,不可重复领取"); return ResultBody.error("已领取,不可重复领取");
...@@ -149,9 +149,9 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser ...@@ -149,9 +149,9 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
} }
CouponUserDO couponUser = new CouponUserDO(couponDO); CouponUserDO couponUser = new CouponUserDO(couponDO);
couponUser.setUid(currentAccount.getId()); couponUser.setUid(currentAccount.getUserAccountId());
couponUser.setUuid(currentAccount.getUid()); couponUser.setUuid(currentAccount.getUid());
couponUser.setUserPhone(currentAccount.getAccountPhone()); couponUser.setUserPhone(currentAccount.getPhoneNum());
//如果优惠券是活动券 则为活动领取 //如果优惠券是活动券 则为活动领取
if (CouponConstants.COUPON_USR_TYPE_ACTIVITY.equals(couponDO.getGetType())){ if (CouponConstants.COUPON_USR_TYPE_ACTIVITY.equals(couponDO.getGetType())){
couponUser.setGainType(CouponConstants.STORE_COUPON_USER_TYPE_ACTIVITY); couponUser.setGainType(CouponConstants.STORE_COUPON_USER_TYPE_ACTIVITY);
...@@ -185,7 +185,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser ...@@ -185,7 +185,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
}); });
if (execute) { if (execute) {
asynSendUserAppletMsg(currentAccount.getId(),couponDO) ; asynSendUserAppletMsg(currentAccount.getUserAccountId(),couponDO) ;
return ResultBody.success(); return ResultBody.success();
} else { } else {
return ResultBody.error("领取失败,请稍后再试"); return ResultBody.error("领取失败,请稍后再试");
...@@ -270,7 +270,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser ...@@ -270,7 +270,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
//查看当前优惠券是否限制每人领取 //查看当前优惠券是否限制每人领取
if (couponDO.getIsLimited()){ if (couponDO.getIsLimited()){
LambdaQueryWrapper<CouponUserDO> queryWrap = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CouponUserDO> queryWrap = new LambdaQueryWrapper<>();
queryWrap.eq(CouponUserDO::getUid, currentAccount.getId()).eq(CouponUserDO::getCouponId, couponDO.getId()); queryWrap.eq(CouponUserDO::getUid, currentAccount.getUserAccountId()).eq(CouponUserDO::getCouponId, couponDO.getId());
long count = this.count(queryWrap); long count = this.count(queryWrap);
if (count >= couponDO.getRestrictedAccess()) { if (count >= couponDO.getRestrictedAccess()) {
sb.append("优惠券名称:" + couponDO.getCouponName() + "-该优惠券已领取,不可重复领取;"); sb.append("优惠券名称:" + couponDO.getCouponName() + "-该优惠券已领取,不可重复领取;");
...@@ -293,9 +293,9 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser ...@@ -293,9 +293,9 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
couponDO.setUseEndTime(DateUtil.offsetDay(dateTime, couponDay)); couponDO.setUseEndTime(DateUtil.offsetDay(dateTime, couponDay));
} }
CouponUserDO couponUser = new CouponUserDO(couponDO); CouponUserDO couponUser = new CouponUserDO(couponDO);
couponUser.setUid(currentAccount.getId()); couponUser.setUid(currentAccount.getUserAccountId());
couponUser.setUuid(currentAccount.getUid()); couponUser.setUuid(currentAccount.getUid());
couponUser.setUserPhone(currentAccount.getAccountPhone()); couponUser.setUserPhone(currentAccount.getPhoneNum());
//如果优惠券是活动券 则为活动领取 //如果优惠券是活动券 则为活动领取
if (CouponConstants.COUPON_USR_TYPE_ACTIVITY.equals(couponDO.getGetType())){ if (CouponConstants.COUPON_USR_TYPE_ACTIVITY.equals(couponDO.getGetType())){
couponUser.setGainType(CouponConstants.STORE_COUPON_USER_TYPE_ACTIVITY); couponUser.setGainType(CouponConstants.STORE_COUPON_USER_TYPE_ACTIVITY);
...@@ -337,7 +337,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser ...@@ -337,7 +337,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
System.out.println(collect); System.out.println(collect);
log.info("消息发送成功"+collect); log.info("消息发送成功"+collect);
collect.stream().forEach(t->{ collect.stream().forEach(t->{
asynSendUserAppletMsgList(currentAccount.getId(),t); asynSendUserAppletMsgList(currentAccount.getUserAccountId(),t);
}); });
return ResultBody.success(sb); return ResultBody.success(sb);
} else { } else {
...@@ -512,7 +512,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser ...@@ -512,7 +512,7 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
//获取用户当前已领取未使用的优惠券 //获取用户当前已领取未使用的优惠券
HashMap<Integer, CouponUserDO> couponUserMap = new HashMap<>(); HashMap<Integer, CouponUserDO> couponUserMap = new HashMap<>();
Integer userId = currentAccount.getId(); Integer userId = currentAccount.getUserAccountId();
LambdaQueryWrapper<CouponUserDO> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CouponUserDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(CouponUserDO::getUid, userId); lambdaQueryWrapper.eq(CouponUserDO::getUid, userId);
List<CouponUserDO> list = this.list(lambdaQueryWrapper); List<CouponUserDO> list = this.list(lambdaQueryWrapper);
......
...@@ -66,7 +66,7 @@ public class RentalOrdersServiceImpl implements RentalOrdersService { ...@@ -66,7 +66,7 @@ public class RentalOrdersServiceImpl implements RentalOrdersService {
public ResultBody addLease(BaseAccountDTO account, RentalOrderVO param) { public ResultBody addLease(BaseAccountDTO account, RentalOrderVO param) {
// 通过用户获取渠道等级id 未完善 // 通过用户获取渠道等级id 未完善
Integer channelLevelId = getChannelLevel(account.getId()); Integer channelLevelId = getChannelLevel(account.getUserAccountId());
// 通过渠道等级获取每一天的单价 未完善 // 通过渠道等级获取每一天的单价 未完善
Double unitPrice = getUnitPrice(param, channelLevelId); Double unitPrice = getUnitPrice(param, channelLevelId);
...@@ -249,9 +249,8 @@ public class RentalOrdersServiceImpl implements RentalOrdersService { ...@@ -249,9 +249,8 @@ public class RentalOrdersServiceImpl implements RentalOrdersService {
@Override @Override
public PageResult listPcOrderInfo(OrderInfoQO param, BaseAccountDTO cuser) { public PageResult listPcOrderInfo(OrderInfoQO param, BaseAccountDTO cuser) {
if (!cuser.isManage()) {
param.setCompanys(cuser.getCompanyInfo().getCompanys());
}
Integer count = rentalOrdersDao.countPcOrderInfo(param); Integer count = rentalOrdersDao.countPcOrderInfo(param);
if (count == 0) { if (count == 0) {
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count); return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count);
...@@ -270,7 +269,7 @@ public class RentalOrdersServiceImpl implements RentalOrdersService { ...@@ -270,7 +269,7 @@ public class RentalOrdersServiceImpl implements RentalOrdersService {
@Override @Override
public PageResult listPageWechatOrder(BaseAccountDTO account, OrderInfoQO param) { public PageResult listPageWechatOrder(BaseAccountDTO account, OrderInfoQO param) {
param.setRepoAccountId(account.getId()); param.setRepoAccountId(account.getUserAccountId());
int count = rentalOrdersDao.countPageOrderInfo(param); int count = rentalOrdersDao.countPageOrderInfo(param);
if (count == 0) { if (count == 0) {
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count); return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count);
......
...@@ -203,27 +203,27 @@ ...@@ -203,27 +203,27 @@
select count(*) select count(*)
from order_info o from order_info o
<where>1=1 <where>1=1
<if test=" keyword1 != null and keyword1 != '' "> <if test=" buyerName != null and buyerName != '' ">
and ( and (
o.uid like CONCAT('%',#{keyword1},'%') o.uid like CONCAT('%',#{buyerName},'%')
or o.buyer_name like CONCAT('%',#{keyword1},'%') or o.buyer_name like CONCAT('%',#{buyerName},'%')
) )
</if> </if>
<if test=" keyword2 != null and keyword2 != '' "> <if test=" orderNo != null and orderNo != '' ">
and ( and (
o.order_no like CONCAT('%',#{keyword2},'%') o.order_no like CONCAT('%',#{orderNo},'%')
) )
</if> </if>
<if test=" keyword3 != null and keyword3 != '' "> <if test=" wareNo != null and wareNo != '' ">
and ( and (
o.ware_no like CONCAT('%',#{keyword3},'%') o.ware_no like CONCAT('%',#{wareNo},'%')
) )
</if> </if>
<if test=" keyword4 != null and keyword4 != '' "> <if test=" wareTitle != null and wareTitle != '' ">
and ( and (
o.ware_title like CONCAT('%',#{keyword4},'%') o.ware_title like CONCAT('%',#{wareTitle},'%')
) )
</if> </if>
<if test=" startTime != null and startTime != '' "> <if test=" startTime != null and startTime != '' ">
...@@ -261,27 +261,27 @@ ...@@ -261,27 +261,27 @@
from order_info o from order_info o
inner join order_receipt rp on rp.order_info_id=o.id inner join order_receipt rp on rp.order_info_id=o.id
<where>1=1 <where>1=1
<if test=" keyword1 != null and keyword1 != '' "> <if test=" buyerName != null and buyerName != '' ">
and ( and (
o.uid like CONCAT('%',#{keyword1},'%') o.uid like CONCAT('%',#{buyerName},'%')
or o.buyer_name like CONCAT('%',#{keyword1},'%') or o.buyer_name like CONCAT('%',#{buyerName},'%')
) )
</if> </if>
<if test=" keyword2 != null and keyword2 != '' "> <if test=" orderNo != null and orderNo != '' ">
and ( and (
o.order_no like CONCAT('%',#{keyword2},'%') o.order_no like CONCAT('%',#{orderNo},'%')
) )
</if> </if>
<if test=" keyword3 != null and keyword3 != '' "> <if test=" wareNo != null and wareNo != '' ">
and ( and (
o.ware_no like CONCAT('%',#{keyword3},'%') o.ware_no like CONCAT('%',#{wareNo},'%')
) )
</if> </if>
<if test=" keyword4 != null and keyword4 != '' "> <if test=" wareTitle != null and wareTitle != '' ">
and ( and (
o.ware_title like CONCAT('%',#{keyword4},'%') o.ware_title like CONCAT('%',#{wareTitle},'%')
) )
</if> </if>
<if test=" startTime != null and startTime != '' "> <if test=" startTime != null and startTime != '' ">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论