QueryWrapper全部升级LambdaQueryWrapper

This commit is contained in:
LIONCITYS\lioncity
2020-10-16 14:51:38 +08:00
parent 15b9680209
commit 4c89f55a05
44 changed files with 242 additions and 243 deletions

View File

@ -41,7 +41,7 @@ public class VisitsServiceImpl extends BaseServiceImpl<VisitsMapper, Visits> imp
@Override
public void save() {
LocalDate localDate = LocalDate.now();
Visits visits = this.getOne(new QueryWrapper<Visits>().lambda()
Visits visits = this.getOne(new LambdaQueryWrapper<Visits>()
.eq(Visits::getDate,localDate.toString()));
if(visits == null){
visits = new Visits();
@ -56,7 +56,7 @@ public class VisitsServiceImpl extends BaseServiceImpl<VisitsMapper, Visits> imp
@Override
public void count(HttpServletRequest request) {
LocalDate localDate = LocalDate.now();
Visits visits = this.getOne(new QueryWrapper<Visits>().lambda()
Visits visits = this.getOne(new LambdaQueryWrapper<Visits>()
.eq(Visits::getDate,localDate.toString()));
visits.setPvCounts(visits.getPvCounts()+1);
long ipCounts = logMapper.findIp(localDate.toString(), localDate.plusDays(1).toString());
@ -68,7 +68,7 @@ public class VisitsServiceImpl extends BaseServiceImpl<VisitsMapper, Visits> imp
public Object get() {
Map<String,Object> map = new HashMap<>(4);
LocalDate localDate = LocalDate.now();
Visits visits = this.getOne(new QueryWrapper<Visits>().lambda()
Visits visits = this.getOne(new LambdaQueryWrapper<Visits>()
.eq(Visits::getDate,localDate.toString()));
List<Visits> list = visitsMapper.findAllVisits(localDate.minusDays(6).toString(),localDate.plusDays(1).toString());

View File

@ -17,7 +17,7 @@ import co.yixiang.modules.quartz.service.dto.QuartzJobQueryCriteria;
import co.yixiang.modules.quartz.service.dto.QuartzLogDto;
import co.yixiang.modules.quartz.service.dto.QuartzLogQueryCriteria;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@ -134,7 +134,7 @@ public class QuartzJobController {
@PutMapping(value = "/exec/{id}")
@PreAuthorize("@el.check('admin','timing:edit')")
public ResponseEntity<Object> execution(@PathVariable Long id){
quartzJobService.execution(quartzJobService.getOne(new QueryWrapper<QuartzJob>().eq("id",id)));
quartzJobService.execution(quartzJobService.getOne(new LambdaQueryWrapper<QuartzJob>().eq(QuartzJob::getId,id)));
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}

View File

@ -16,7 +16,7 @@ import co.yixiang.modules.system.service.DeptService;
import co.yixiang.modules.system.service.dto.DeptDto;
import co.yixiang.modules.system.service.dto.DeptQueryCriteria;
import co.yixiang.utils.ValidationUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
@ -98,7 +98,7 @@ public class DeptController {
if(resources.getId().equals(resources.getPid())) {
throw new BadRequestException("上级不能为自己");
}
Dept dept = deptService.getOne(new QueryWrapper<Dept>().lambda()
Dept dept = deptService.getOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getId,resources.getId()));
ValidationUtil.isNull( dept.getId(),"Dept","id",resources.getId());
resources.setId(dept.getId());
@ -115,7 +115,7 @@ public class DeptController {
List<Long> deptIds = new ArrayList<>();
for (Long id : ids) {
List<Dept> deptList = deptService.findByPid(id);
Dept dept = deptService.getOne(new QueryWrapper<Dept>().eq("id",id));
Dept dept = deptService.getOne(new LambdaQueryWrapper<Dept>().eq(Dept::getId,id));
if(null!=dept){
deptIds.add(dept.getId());
}

View File

@ -17,7 +17,7 @@ import co.yixiang.modules.system.service.dto.MenuDto;
import co.yixiang.modules.system.service.dto.MenuQueryCriteria;
import co.yixiang.modules.system.service.dto.UserDto;
import co.yixiang.utils.SecurityUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
@ -131,7 +131,7 @@ public class MenuController {
Set<Menu> menuSet = new HashSet<>();
for (Long id : ids) {
List<Menu> menuList = menuService.findByPid(id);
menuSet.add(menuService.getOne(new QueryWrapper<Menu>().eq("id",id)));
menuSet.add(menuService.getOne(new LambdaQueryWrapper<Menu>().eq(Menu::getId,id)));
menuSet = menuService.getDeleteMenus(menuList, menuSet);
}
menuService.delete(menuSet);

View File

@ -190,7 +190,7 @@ public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, Dept> implement
for (Dept dept : deptList) {
deptDtos.add((DeptDto)generator.convert(deptList,DeptDto.class));
List<Dept> depts = Collections.singletonList(this.getOne(new QueryWrapper<Dept>().eq("id", dept.getId())));
List<Dept> depts = Collections.singletonList(this.getOne(new LambdaQueryWrapper<Dept>().eq("id", dept.getId())));
if(depts!=null && depts.size()!=0){
getDeleteDepts(depts, deptDtos);
}

View File

@ -28,7 +28,7 @@ import co.yixiang.modules.system.service.mapper.RoleMapper;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.StringUtils;
import co.yixiang.utils.ValidationUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.cache.annotation.CacheConfig;
@ -306,7 +306,7 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
isExitHttp(resources);
Menu menu1 = this.getOne(new QueryWrapper<Menu>().lambda()
Menu menu1 = this.getOne(new LambdaQueryWrapper<Menu>()
.eq(Menu::getName,resources.getName()));
if(menu1 != null && !menu1.getId().equals(menu.getId())){
@ -318,7 +318,7 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
if(menuCount > 1) {
throw new YshopException("请保持菜单组件名称唯一");
}
menu1 = this.getOne(new QueryWrapper<Menu>().lambda()
menu1 = this.getOne(new LambdaQueryWrapper<Menu>()
.eq(Menu::getComponentName,resources.getComponentName()));
if(menu1 != null && !menu1.getId().equals(menu.getId())){
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
@ -345,11 +345,11 @@ public class MenuServiceImpl extends BaseServiceImpl<MenuMapper, Menu> implement
@CacheEvict(allEntries = true)
public MenuDto create(Menu resources) {
isExitHttp(resources);
if(this.getOne(new QueryWrapper<Menu>().eq("name",resources.getName())) != null){
if(this.getOne(new LambdaQueryWrapper<Menu>().eq(Menu::getName,resources.getName())) != null){
throw new EntityExistException(Menu.class,"name",resources.getName());
}
if(StringUtils.isNotBlank(resources.getComponentName())){
if(this.getOne(new QueryWrapper<Menu>().eq("component_name",resources.getComponentName())) != null){
if(this.getOne(new LambdaQueryWrapper<Menu>().eq(Menu::getComponentName,resources.getComponentName())) != null){
throw new EntityExistException(Menu.class,"componentName",resources.getComponentName());
}
}

View File

@ -30,7 +30,6 @@ import co.yixiang.modules.system.service.mapper.RoleMapper;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
@ -190,11 +189,11 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
// @CacheEvict(allEntries = true)
@Transactional(rollbackFor = Exception.class)
public RoleDto create(Role resources) {
if (this.getOne(new QueryWrapper<Role>().lambda().eq(Role::getName, resources.getName())) != null) {
if (this.getOne(new LambdaQueryWrapper<Role>().eq(Role::getName, resources.getName())) != null) {
throw new EntityExistException(Role.class, "username", resources.getName());
}
if (this.getOne(new QueryWrapper<Role>().lambda().eq(Role::getName, resources.getName())) != null) {
if (this.getOne(new LambdaQueryWrapper<Role>().eq(Role::getName, resources.getName())) != null) {
throw new EntityExistException(Role.class, "username", resources.getName());
}
this.save(resources);
@ -216,12 +215,12 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleMapper, Role> implement
public void update(Role resources) {
Role role = this.getById(resources.getId());
Role role1 = this.getOne(new QueryWrapper<Role>().lambda().eq(Role::getName, resources.getName()));
Role role1 = this.getOne(new LambdaQueryWrapper<Role>().eq(Role::getName, resources.getName()));
if (role1 != null && !role1.getId().equals(role.getId())) {
throw new EntityExistException(Role.class, "username", resources.getName());
}
role1 = this.getOne(new QueryWrapper<Role>().lambda().eq(Role::getPermission, resources.getPermission()));
role1 = this.getOne(new LambdaQueryWrapper<Role>().eq(Role::getPermission, resources.getPermission()));
if (role1 != null && !role1.getId().equals(role.getId())) {
throw new EntityExistException(Role.class, "permission", resources.getPermission());
}

View File

@ -32,7 +32,7 @@ import co.yixiang.utils.RedisUtils;
import co.yixiang.utils.SecurityUtils;
import co.yixiang.utils.StringUtils;
import co.yixiang.utils.ValidationUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Pageable;
@ -172,9 +172,9 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, User> imp
*/
@Override
public void updateAvatar(MultipartFile multipartFile) {
User user = this.getOne(new QueryWrapper<User>().lambda()
User user = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getUsername,SecurityUtils.getUsername()));
UserAvatar userAvatar = userAvatarService.getOne(new QueryWrapper<UserAvatar>().lambda()
UserAvatar userAvatar = userAvatarService.getOne(new LambdaQueryWrapper<UserAvatar>()
.eq(UserAvatar::getId,user.getAvatarId()));
String oldPath = "";
if(userAvatar != null){
@ -217,12 +217,12 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, User> imp
//@CacheEvict(allEntries = true)
@Transactional(rollbackFor = Exception.class)
public boolean create(User resources) {
User userName = this.getOne(new QueryWrapper<User>().lambda()
User userName = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getUsername,resources.getUsername()));
if(userName != null){
throw new EntityExistException(User.class,"username",resources.getUsername());
}
User userEmail = this.getOne(new QueryWrapper<User>().lambda()
User userEmail = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getEmail,resources.getEmail()));
if(userEmail != null){
throw new EntityExistException(User.class,"email",resources.getEmail());
@ -251,12 +251,12 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserMapper, User> imp
//@CacheEvict(allEntries = true)
@Transactional(rollbackFor = Exception.class)
public void update(User resources) {
User user = this.getOne(new QueryWrapper<User>().lambda()
User user = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getId,resources.getId()));
ValidationUtil.isNull(user.getId(),"User","id",resources.getId());
User user1 = this.getOne(new QueryWrapper<User>().lambda()
User user1 = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getUsername,resources.getUsername()));
User user2 = this.getOne(new QueryWrapper<User>().lambda()
User user2 = this.getOne(new LambdaQueryWrapper<User>()
.eq(User::getEmail,resources.getEmail()));
if(user1 !=null&&!user.getId().equals(user1.getId())){

View File

@ -9,7 +9,6 @@ import co.yixiang.common.bean.LocalUser;
import co.yixiang.logging.domain.Log;
import co.yixiang.logging.service.LogService;
import co.yixiang.utils.RequestHolder;
import co.yixiang.utils.SecurityUtils;
import co.yixiang.utils.StringUtils;
import co.yixiang.utils.ThrowableUtil;
import lombok.extern.slf4j.Slf4j;

View File

@ -36,7 +36,7 @@ import co.yixiang.modules.services.CreatShareProductService;
import co.yixiang.modules.shop.service.YxSystemConfigService;
import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.service.YxUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@ -203,8 +203,8 @@ public class StoreBargainController {
return ApiResult.ok(map);
}
YxStoreBargainUserHelp storeBargainUserHelp = storeBargainUserHelpService
.getOne(new QueryWrapper<YxStoreBargainUserHelp>()
.lambda().eq(YxStoreBargainUserHelp::getBargainId,bargainId)
.getOne(new LambdaQueryWrapper<YxStoreBargainUserHelp>()
.eq(YxStoreBargainUserHelp::getBargainId,bargainId)
.eq(YxStoreBargainUserHelp::getBargainUserId,storeBargainUser.getId())
.eq(YxStoreBargainUserHelp::getUid,uid).last("limit 1"));
if(ObjectUtil.isNull(storeBargainUserHelp)){

View File

@ -34,5 +34,6 @@ public class BaseDomain implements Serializable {
@TableLogic
@JsonIgnore
@TableField(fill= FieldFill.INSERT)
private Integer isDel;
}

View File

@ -10,7 +10,7 @@ import co.yixiang.gen.domain.GenConfig;
import co.yixiang.gen.service.GenConfigService;
import co.yixiang.gen.service.mapper.GenConfigMapper;
import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import java.io.File;
@ -26,7 +26,7 @@ public class GenConfigServiceImpl extends BaseServiceImpl<GenConfigMapper, GenCo
@Override
// @Cacheable(key = "#p0")
public GenConfig find(String tableName) {
GenConfig genConfig = this.getOne(new QueryWrapper<GenConfig>().eq("table_name",tableName));
GenConfig genConfig = this.getOne(new LambdaQueryWrapper<GenConfig>().eq(GenConfig::getTableName,tableName));
if(genConfig == null){
return new GenConfig(tableName);
}

View File

@ -19,7 +19,7 @@ import co.yixiang.gen.utils.GenUtil;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.PageUtil;
import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.http.HttpStatus;
@ -61,8 +61,8 @@ public class GeneratorServiceImpl extends BaseServiceImpl<ColumnInfoMapper, Colu
@Override
public List<ColumnConfig> getColumns(String tableName) {
List<ColumnConfig> columnInfos = this.list(new QueryWrapper<ColumnConfig>()
.eq("table_name",tableName).orderByAsc("id"));
List<ColumnConfig> columnInfos = this.list(new LambdaQueryWrapper<ColumnConfig>()
.eq(ColumnConfig::getTableName,tableName).orderByAsc(ColumnConfig::getId));
if(CollectionUtil.isNotEmpty(columnInfos)){
return columnInfos;
} else {

View File

@ -34,7 +34,7 @@ import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.vo.YxUserQueryVo;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -304,9 +304,9 @@ public class YxStoreBargainServiceImpl extends BaseServiceImpl<YxStoreBargainMap
@Override
public List<YxStoreBargainQueryVo> getList(int page, int limit) {
Page<YxStoreBargain> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreBargain> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreBargain> wrapper = new LambdaQueryWrapper<>();
Date nowTime = new Date();
wrapper.lambda().eq(YxStoreBargain::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
wrapper.eq(YxStoreBargain::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.lt(YxStoreBargain::getStartTime,nowTime)
.gt(YxStoreBargain::getStopTime,nowTime);

View File

@ -19,7 +19,7 @@ import co.yixiang.modules.activity.service.mapper.YxStoreBargainUserHelpMapper;
import co.yixiang.modules.activity.vo.YxStoreBargainUserHelpQueryVo;
import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.service.YxUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -74,8 +74,8 @@ public class YxStoreBargainUserHelpServiceImpl extends BaseServiceImpl<YxStoreBa
return Collections.emptyList();
}
Page<YxStoreBargainUserHelp> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreBargainUserHelp> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreBargainUserHelp::getBargainUserId,storeBargainUser.getId())
LambdaQueryWrapper<YxStoreBargainUserHelp> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreBargainUserHelp::getBargainUserId,storeBargainUser.getId())
.orderByDesc(YxStoreBargainUserHelp::getId);
List<YxStoreBargainUserHelpQueryVo> storeBargainUserHelpQueryVos = generator
.convert(yxStoreBargainUserHelpMapper.selectPage(pageModel,wrapper).getRecords(),

View File

@ -22,7 +22,7 @@ import co.yixiang.modules.activity.service.YxStoreBargainUserHelpService;
import co.yixiang.modules.activity.service.YxStoreBargainUserService;
import co.yixiang.modules.activity.service.mapper.YxStoreBargainUserMapper;
import co.yixiang.modules.activity.vo.YxStoreBargainUserQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -188,8 +188,8 @@ public class YxStoreBargainUserServiceImpl extends BaseServiceImpl<YxStoreBargai
*/
@Override
public YxStoreBargainUser getBargainUserInfo(Long bargainId, Long uid) {
QueryWrapper<YxStoreBargainUser> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreBargainUser::getBargainId,bargainId)
LambdaQueryWrapper<YxStoreBargainUser> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreBargainUser::getBargainId,bargainId)
.eq(YxStoreBargainUser::getUid,uid)
.last("limit 1");
return yxStoreBargainUserMapper.selectOne(wrapper);
@ -217,7 +217,7 @@ public class YxStoreBargainUserServiceImpl extends BaseServiceImpl<YxStoreBargai
// */
// @Override
// public List<YxStoreBargainUserQueryVo> getBargainUserList(int bargainId, int status) {
// QueryWrapper<YxStoreBargainUser> wrapper = new QueryWrapper<>();
// LambdaQueryWrapper<YxStoreBargainUser> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq("bargain_id",bargainId).eq("status",status);
// return generator.convert(yxStoreBargainUserMapper.selectList(wrapper),
// YxStoreBargainUserQueryVo.class);

View File

@ -50,7 +50,7 @@ import co.yixiang.modules.template.domain.YxShippingTemplates;
import co.yixiang.modules.template.service.YxShippingTemplatesService;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.RedisUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
@ -178,8 +178,8 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
CombinationQueryVo combinationQueryVo = new CombinationQueryVo();
Date nowTime = new Date();
Page<YxStoreCombination> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreCombination> wrapper = new QueryWrapper<>();
wrapper.lambda()
LambdaQueryWrapper<YxStoreCombination> wrapper = new LambdaQueryWrapper<>();
wrapper
.eq(YxStoreCombination::getIsShow,1)
.le(YxStoreCombination::getStartTime,nowTime)
.ge(YxStoreCombination::getStopTime,nowTime)
@ -208,15 +208,15 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
List<YxStoreCombinationDto> combinationDTOS = generator.convert(page.getList(),YxStoreCombinationDto.class);
for (YxStoreCombinationDto combinationDTO : combinationDTOS) {
//参与人数
combinationDTO.setCountPeopleAll(yxStorePinkMapper.selectCount(new QueryWrapper<YxStorePink>().lambda()
combinationDTO.setCountPeopleAll(yxStorePinkMapper.selectCount(new LambdaQueryWrapper<YxStorePink>()
.eq(YxStorePink::getCid,combinationDTO.getId())));
//成团人数
combinationDTO.setCountPeoplePink(yxStorePinkMapper.selectCount(new QueryWrapper<YxStorePink>().lambda()
combinationDTO.setCountPeoplePink(yxStorePinkMapper.selectCount(new LambdaQueryWrapper<YxStorePink>()
.eq(YxStorePink::getCid,combinationDTO.getId())
.eq(YxStorePink::getKId,0)));//团长
//获取查看拼团产品人数
combinationDTO.setCountPeopleBrowse(yxStoreVisitMapper.selectCount(new QueryWrapper<YxStoreVisit>().lambda()
combinationDTO.setCountPeopleBrowse(yxStoreVisitMapper.selectCount(new LambdaQueryWrapper<YxStoreVisit>()
.eq(YxStoreVisit::getProductId,combinationDTO.getId())
.eq(YxStoreVisit::getProductType,"combination")));
}

View File

@ -31,7 +31,7 @@ import co.yixiang.modules.cart.vo.YxStoreCartQueryVo;
import co.yixiang.modules.user.domain.YxUser;
import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -264,8 +264,8 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
*/
private void checkInvalidCoupon() {
Date nowTime = new Date();
QueryWrapper<YxStoreCouponUser> wrapper= new QueryWrapper<>();
wrapper.lambda().lt(YxStoreCouponUser::getEndTime,nowTime)
LambdaQueryWrapper<YxStoreCouponUser> wrapper= new LambdaQueryWrapper<>();
wrapper.lt(YxStoreCouponUser::getEndTime,nowTime)
.eq(YxStoreCouponUser::getStatus,CouponEnum.STATUS_0.getValue());
YxStoreCouponUser couponUser = new YxStoreCouponUser();
couponUser.setStatus(CouponEnum.STATUS_2.getValue());
@ -284,7 +284,7 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
PageInfo<YxStoreCouponUser> page = new PageInfo<>(queryAll(criteria));
List<YxStoreCouponUserDto> storeOrderDTOS = generator.convert(page.getList(),YxStoreCouponUserDto.class);
for (YxStoreCouponUserDto couponUserDTO : storeOrderDTOS) {
couponUserDTO.setNickname(userService.getOne(new QueryWrapper<YxUser>().lambda()
couponUserDTO.setNickname(userService.getOne(new LambdaQueryWrapper<YxUser>()
.eq(YxUser::getUid,couponUserDTO.getUid())).getNickname());
}
Map<String,Object> map = new LinkedHashMap<>(2);

View File

@ -43,7 +43,6 @@ import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.modules.user.vo.YxUserQueryVo;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -135,7 +134,7 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
//把团长下个人设置为团长
if(ObjectUtil.isNotNull(nextPinkT)){
QueryWrapper<YxStorePink> wrapperO = new QueryWrapper<>();
LambdaQueryWrapper<YxStorePink> wrapperO = new LambdaQueryWrapper<>();
YxStorePink storePinkO = new YxStorePink();
storePinkO.setKId(0L); //设置团长
storePinkO.setStatus(OrderInfoEnum.PINK_STATUS_1.getValue());
@ -144,7 +143,7 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
yxStorePinkMapper.updateById(storePinkO);
//原有团长的数据变更成新团长下面
wrapperO.lambda().eq(YxStorePink::getKId,pinkT.getId());
wrapperO.eq(YxStorePink::getKId,pinkT.getId());
YxStorePink storePinkT = new YxStorePink();
storePinkT.setKId(nextPinkT.getId());
yxStorePinkMapper.update(storePinkT,wrapperO);
@ -519,8 +518,8 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
int pinkBool = PinkEnum.PINK_BOOL_0.getValue();
if(pinkStatus){
//更改状态
QueryWrapper<YxStorePink> wrapper = new QueryWrapper<>();
wrapper.lambda().in(YxStorePink::getId,idAll);
LambdaQueryWrapper<YxStorePink> wrapper = new LambdaQueryWrapper<>();
wrapper.in(YxStorePink::getId,idAll);
YxStorePink storePink = new YxStorePink();
storePink.setStopTime(new Date());
@ -546,14 +545,14 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
*/
private void orderPinkFailAfter(Long uid, Long pid) {
YxStorePink yxStorePink = new YxStorePink();
QueryWrapper<YxStorePink> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStorePink::getId,pid);
LambdaQueryWrapper<YxStorePink> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStorePink::getId,pid);
yxStorePink.setStatus(OrderInfoEnum.PINK_STATUS_3.getValue());
yxStorePink.setStopTime(new Date());
yxStorePinkMapper.update(yxStorePink,wrapper);
QueryWrapper<YxStorePink> wrapperT = new QueryWrapper<>();
wrapperT.lambda().eq(YxStorePink::getKId,pid);
LambdaQueryWrapper<YxStorePink> wrapperT = new LambdaQueryWrapper<>();
wrapperT.eq(YxStorePink::getKId,pid);
yxStorePinkMapper.update(yxStorePink,wrapperT);
//todo 模板消息
}
@ -625,8 +624,8 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
* @return int
*/
private int getPinkPeople(Long kid, int people) {
QueryWrapper<YxStorePink> wrapper= new QueryWrapper<>();
wrapper.lambda().eq(YxStorePink::getKId,kid)
LambdaQueryWrapper<YxStorePink> wrapper= new LambdaQueryWrapper<>();
wrapper.eq(YxStorePink::getKId,kid)
.eq(YxStorePink::getIsRefund, OrderInfoEnum.PINK_REFUND_STATUS_0.getValue());
//加上团长自己
int count = yxStorePinkMapper.selectCount(wrapper) + 1;

View File

@ -41,7 +41,7 @@ import co.yixiang.modules.template.service.YxShippingTemplatesService;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.RedisUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -82,7 +82,7 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
// @Override
// public YxStoreSeckill getSeckill(int id) {
// QueryWrapper<YxStoreSeckill> wrapper = new QueryWrapper<>();
// LambdaQueryWrapper<YxStoreSeckill> wrapper = new LambdaQueryWrapper<>();
// int nowTime = OrderUtil.getSecondTimestampTwo();
// wrapper.eq("id",id).eq("is_del",0).eq("status",1)
// .le("start_time",nowTime).ge("stop_time",nowTime);
@ -145,8 +145,8 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
public List<YxStoreSeckillQueryVo> getList(int page, int limit, int time) {
Date nowTime = new Date();
Page<YxStoreSeckill> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreSeckill> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
LambdaQueryWrapper<YxStoreSeckill> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxStoreSeckill::getTimeId,time)
.le(YxStoreSeckill::getStartTime,nowTime)
.ge(YxStoreSeckill::getStopTime,nowTime)
@ -171,8 +171,8 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
public List<YxStoreSeckillQueryVo> getList(int page, int limit) {
Date nowTime = new Date();
Page<YxStoreSeckill> pageModel = new Page<>(page, limit);
QueryWrapper<YxStoreSeckill> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
LambdaQueryWrapper<YxStoreSeckill> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreSeckill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxStoreSeckill::getIsHot,1)
.le(YxStoreSeckill::getStartTime,nowTime)
.ge(YxStoreSeckill::getStopTime,nowTime)

View File

@ -229,7 +229,7 @@ public class YxUserExtractServiceImpl extends BaseServiceImpl<YxUserExtractMappe
/**
boolean isTest = true;
if(!isTest){
YxWechatUserDto wechatUser = generator.convert(wechatUserService.getOne(new QueryWrapper<YxWechatUser>().eq("uid",resources.getUid())),YxWechatUserDto.class);
YxWechatUserDto wechatUser = generator.convert(wechatUserService.getOne(new LambdaQueryWrapper<YxWechatUser>().eq("uid",resources.getUid())),YxWechatUserDto.class);
if(ObjectUtil.isNotNull(wechatUser)){
try {
payService.entPay(wechatUser.getOpenid(),resources.getId().toString(),

View File

@ -42,7 +42,7 @@ import co.yixiang.modules.product.service.YxStoreProductService;
import co.yixiang.modules.product.vo.YxStoreProductQueryVo;
import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -163,15 +163,15 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
*/
@Override
public Map<String, Object> getUserProductCartList(Long uid, String cartIds, Integer status) {
QueryWrapper<YxStoreCart> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreCart::getUid, uid)
LambdaQueryWrapper<YxStoreCart> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreCart::getUid, uid)
.eq(YxStoreCart::getIsPay, OrderInfoEnum.PAY_STATUS_0.getValue())
.orderByDesc(YxStoreCart::getId);
if (status == null) {
wrapper.lambda().eq(YxStoreCart::getIsNew, CartTypeEnum.NEW_0.getValue());
wrapper.eq(YxStoreCart::getIsNew, CartTypeEnum.NEW_0.getValue());
}
if (StrUtil.isNotEmpty(cartIds)) {
wrapper.lambda().in(YxStoreCart::getId, Arrays.asList(cartIds.split(",")));
wrapper.in(YxStoreCart::getId, Arrays.asList(cartIds.split(",")));
}
List<YxStoreCart> carts = yxStoreCartMapper.selectList(wrapper);
@ -284,8 +284,8 @@ public class YxStoreCartServiceImpl extends BaseServiceImpl<StoreCartMapper, YxS
Integer isNew, Long combinationId, Long seckillId, Long bargainId) {
this.checkProductStock(uid, productId, cartNum, productAttrUnique, combinationId, seckillId, bargainId);
QueryWrapper<YxStoreCart> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreCart::getUid, uid)
LambdaQueryWrapper<YxStoreCart> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreCart::getUid, uid)
.eq(YxStoreCart::getIsPay, OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreCart::getProductId, productId)
.eq(YxStoreCart::getIsNew, isNew)

View File

@ -20,7 +20,7 @@ import co.yixiang.modules.category.service.mapper.StoreCategoryMapper;
import co.yixiang.utils.CateDTO;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.TreeUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Maps;
@ -59,8 +59,8 @@ public class YxStoreCategoryServiceImpl extends BaseServiceImpl<StoreCategoryMap
*/
@Override
public List<CateDTO> getList() {
QueryWrapper<YxStoreCategory> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreCategory::getIsShow, ShopCommonEnum.SHOW_1.getValue())
LambdaQueryWrapper<YxStoreCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreCategory::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByAsc(YxStoreCategory::getSort);
List<CateDTO> list = generator.convert(baseMapper.selectList(wrapper),CateDTO.class);
return TreeUtil.list2TreeConverter(list,0);

View File

@ -17,7 +17,7 @@ import co.yixiang.modules.order.service.dto.YxStoreOrderCartInfoQueryCriteria;
import co.yixiang.modules.order.service.mapper.StoreOrderCartInfoMapper;
import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
@ -47,8 +47,8 @@ public class YxStoreOrderCartInfoServiceImpl extends BaseServiceImpl<StoreOrderC
@Override
public YxStoreOrderCartInfo findByUni(String unique) {
QueryWrapper<YxStoreOrderCartInfo> wrapper= new QueryWrapper<>();
wrapper.eq("`unique`",unique);
LambdaQueryWrapper<YxStoreOrderCartInfo> wrapper= new LambdaQueryWrapper<>();
wrapper.eq(YxStoreOrderCartInfo::getUnique,unique);
return this.baseMapper.selectOne(wrapper);
}

View File

@ -97,7 +97,6 @@ import co.yixiang.utils.RedisUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -1035,49 +1034,49 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
*/
@Override
public List<YxStoreOrderQueryVo> orderList(Long uid, int type, int page, int limit) {
QueryWrapper<YxStoreOrder> wrapper= new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapper= new LambdaQueryWrapper<>();
if(uid != null) {
wrapper.lambda().eq(YxStoreOrder::getUid,uid);
wrapper.eq(YxStoreOrder::getUid,uid);
}
wrapper.lambda().orderByDesc(YxStoreOrder::getId);
wrapper.orderByDesc(YxStoreOrder::getId);
switch (OrderStatusEnum.toType(type)){
case STATUS_0://未支付
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
break;
case STATUS_1://待发货
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
break;
case STATUS_2://待收货
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue());
break;
case STATUS_3://待评价
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_2.getValue());
break;
case STATUS_4://已完成
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_3.getValue());
break;
case STATUS_MINUS_1://退款中
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_1.getValue());
break;
case STATUS_MINUS_2://已退款
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_2.getValue());
break;
case STATUS_MINUS_3://退款
String[] strs = {"1","2"};
wrapper.lambda().eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.in(YxStoreOrder::getRefundStatus, Arrays.asList(strs));
break;
}
@ -1110,7 +1109,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
.beginOfMonth(new Date()));
double price = 0d;
List<ChartDataDto> list = null;
QueryWrapper<YxStoreOrder> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq("paid",1).eq("refund_status",0).eq("is_del",0);
switch (OrderCountEnum.toType(cate)){
@ -1157,8 +1156,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
ShoperOrderTimeDataVo orderTimeDataVo = new ShoperOrderTimeDataVo();
//今日成交额
QueryWrapper<YxStoreOrder> wrapperOne = new QueryWrapper<>();
wrapperOne.lambda()
LambdaQueryWrapper<YxStoreOrder> wrapperOne = new LambdaQueryWrapper<>();
wrapperOne
.ge(YxStoreOrder::getPayTime,today)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
@ -1167,8 +1166,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
orderTimeDataVo.setTodayCount(yxStoreOrderMapper.selectCount(wrapperOne));
//昨日成交额
QueryWrapper<YxStoreOrder> wrapperTwo = new QueryWrapper<>();
wrapperTwo.lambda()
LambdaQueryWrapper<YxStoreOrder> wrapperTwo = new LambdaQueryWrapper<>();
wrapperTwo
.lt(YxStoreOrder::getPayTime,today)
.ge(YxStoreOrder::getPayTime,yesterday)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
@ -1178,8 +1177,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
orderTimeDataVo.setProCount(yxStoreOrderMapper.selectCount(wrapperTwo));
//本月成交额
QueryWrapper<YxStoreOrder> wrapperThree = new QueryWrapper<>();
wrapperThree.lambda()
LambdaQueryWrapper<YxStoreOrder> wrapperThree = new LambdaQueryWrapper<>();
wrapperThree
.ge(YxStoreOrder::getPayTime,nowMonth)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
@ -1188,8 +1187,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
orderTimeDataVo.setMonthCount(yxStoreOrderMapper.selectCount(wrapperThree));
//上周成交额
QueryWrapper<YxStoreOrder> wrapperLastWeek = new QueryWrapper<>();
wrapperLastWeek.lambda()
LambdaQueryWrapper<YxStoreOrder> wrapperLastWeek = new LambdaQueryWrapper<>();
wrapperLastWeek
.lt(YxStoreOrder::getPayTime,today)
.ge(YxStoreOrder::getPayTime,lastWeek)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
@ -1223,11 +1222,11 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
public UserOrderCountVo orderData(Long uid) {
//订单支付没有退款 数量
QueryWrapper<YxStoreOrder> wrapperOne = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperOne = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperOne.lambda().eq(YxStoreOrder::getUid,uid);
wrapperOne.eq(YxStoreOrder::getUid,uid);
}
wrapperOne.lambda().eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
wrapperOne.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue());
Integer orderCount = yxStoreOrderMapper.selectCount(wrapperOne);
@ -1235,62 +1234,62 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
double sumPrice = yxStoreOrderMapper.sumPrice(uid);
//订单待支付 数量
QueryWrapper<YxStoreOrder> wrapperTwo = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperTwo = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperTwo.lambda().eq(YxStoreOrder::getUid,uid);
wrapperTwo.eq(YxStoreOrder::getUid,uid);
}
wrapperTwo.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue())
wrapperTwo.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
Integer unpaidCount = yxStoreOrderMapper.selectCount(wrapperTwo);
//订单待发货 数量
QueryWrapper<YxStoreOrder> wrapperThree = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperThree = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperThree.lambda().eq(YxStoreOrder::getUid,uid);
wrapperThree.eq(YxStoreOrder::getUid,uid);
}
wrapperThree.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperThree.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue());
Integer unshippedCount = yxStoreOrderMapper.selectCount(wrapperThree);
//订单待收货 数量
QueryWrapper<YxStoreOrder> wrapperFour = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperFour = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperFour.lambda().eq(YxStoreOrder::getUid,uid);
wrapperFour.eq(YxStoreOrder::getUid,uid);
}
wrapperFour.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperFour.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue());
Integer receivedCount = yxStoreOrderMapper.selectCount(wrapperFour);
//订单待评价 数量
QueryWrapper<YxStoreOrder> wrapperFive = new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperFive = new LambdaQueryWrapper<>();
if(uid != null) {
wrapperFive.lambda().eq(YxStoreOrder::getUid,uid);
wrapperFive.eq(YxStoreOrder::getUid,uid);
}
wrapperFive.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperFive.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_2.getValue());
Integer evaluatedCount = yxStoreOrderMapper.selectCount(wrapperFive);
//订单已完成 数量
QueryWrapper<YxStoreOrder> wrapperSix= new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperSix= new LambdaQueryWrapper<>();
if(uid != null) {
wrapperSix.lambda().eq(YxStoreOrder::getUid,uid);
wrapperSix.eq(YxStoreOrder::getUid,uid);
}
wrapperSix.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperSix.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_3.getValue());
Integer completeCount = yxStoreOrderMapper.selectCount(wrapperSix);
//订单退款
QueryWrapper<YxStoreOrder> wrapperSeven= new QueryWrapper<>();
LambdaQueryWrapper<YxStoreOrder> wrapperSeven= new LambdaQueryWrapper<>();
if(uid != null) {
wrapperSeven.lambda().eq(YxStoreOrder::getUid,uid);
wrapperSeven.eq(YxStoreOrder::getUid,uid);
}
String[] strArr = {"1","2"};
wrapperSeven.lambda().eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
wrapperSeven.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_1.getValue())
.in(YxStoreOrder::getRefundStatus,Arrays.asList(strArr));
Integer refundCount = yxStoreOrderMapper.selectCount(wrapperSeven);
@ -1314,8 +1313,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
*/
@Override
public YxStoreOrderQueryVo handleOrder(YxStoreOrderQueryVo order) {
QueryWrapper<YxStoreOrderCartInfo> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreOrderCartInfo::getOid,order.getId());
LambdaQueryWrapper<YxStoreOrderCartInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreOrderCartInfo::getOid,order.getId());
List<YxStoreOrderCartInfo> cartInfos = orderCartInfoService.list(wrapper);
List<YxStoreCartQueryVo> cartInfo = cartInfos.stream()
@ -1414,8 +1413,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
YxStoreOrderQueryVo orderInfo = getOrderInfo(orderId,null);
//更新订单状态
QueryWrapper<YxStoreOrder> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreOrder::getOrderId,orderId);
LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreOrder::getOrderId,orderId);
YxStoreOrder storeOrder = new YxStoreOrder();
storeOrder.setPaid(OrderInfoEnum.PAY_STATUS_1.getValue());
storeOrder.setPayType(payType);
@ -1535,12 +1534,12 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
*/
@Override
public YxStoreOrderQueryVo getOrderInfo(String unique,Long uid) {
QueryWrapper<YxStoreOrder> wrapper = new QueryWrapper<>();
wrapper.lambda().and(
LambdaQueryWrapper<YxStoreOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.and(
i->i.eq(YxStoreOrder::getOrderId,unique).or().eq(YxStoreOrder::getUnique,unique).or()
.eq(YxStoreOrder::getExtendOrderId,unique));
if(uid != null) {
wrapper.lambda().eq(YxStoreOrder::getUid,uid);
wrapper.eq(YxStoreOrder::getUid,uid);
}
return generator.convert(yxStoreOrderMapper.selectOne(wrapper),YxStoreOrderQueryVo.class);
@ -1667,8 +1666,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|| OrderStatusEnum.STATUS_MINUS_2.getValue().equals(order.getStatus())){
return;
}
QueryWrapper<YxStoreOrderCartInfo> wrapper= new QueryWrapper<>();
wrapper.lambda().in(YxStoreOrderCartInfo::getCartId, Arrays.asList(order.getCartId().split(",")));
LambdaQueryWrapper<YxStoreOrderCartInfo> wrapper= new LambdaQueryWrapper<>();
wrapper.in(YxStoreOrderCartInfo::getCartId, Arrays.asList(order.getCartId().split(",")));
List<YxStoreOrderCartInfo> cartInfoList = orderCartInfoService.list(wrapper);
for (YxStoreOrderCartInfo cartInfo : cartInfoList) {
@ -2107,7 +2106,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
@Transactional(rollbackFor = Exception.class)
public void update(YxStoreOrder resources) {
YxStoreOrder yxStoreOrder = this.getById(resources.getId());
YxStoreOrder yxStoreOrder1 = this.getOne(new QueryWrapper<YxStoreOrder>().lambda()
YxStoreOrder yxStoreOrder1 = this.getOne(new LambdaQueryWrapper<YxStoreOrder>()
.eq(YxStoreOrder::getUnique,resources.getUnique()));
if(yxStoreOrder1 != null && !yxStoreOrder1.getId().equals(yxStoreOrder.getId())){
throw new EntityExistException(YxStoreOrder.class,"unique",resources.getUnique());
@ -2228,7 +2227,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
yxStoreOrderDto.setStoreOrderStatusList(orderStatusDtos);
//添加购物车详情
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(
new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId()));
new LambdaQueryWrapper<YxStoreOrderCartInfo>().eq(YxStoreOrderCartInfo::getOid,yxStoreOrder.getId()));
List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>();
for (YxStoreOrderCartInfo cartInfo : cartInfos) {
StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto();
@ -2247,7 +2246,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
@Override
public Map<String, Object> queryAll(List<String> ids) {
List<YxStoreOrder> yxStoreOrders = this.list(new QueryWrapper<YxStoreOrder>().in("order_id",ids));
List<YxStoreOrder> yxStoreOrders = this.list(new LambdaQueryWrapper<YxStoreOrder>().in(YxStoreOrder::getOrderId,ids));
List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
for (YxStoreOrder yxStoreOrder :yxStoreOrders) {
this.orderList(storeOrderDTOS, yxStoreOrder);
@ -2303,7 +2302,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
yxStoreOrder.getShippingType()));
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(
new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId()));
new LambdaQueryWrapper<YxStoreOrderCartInfo>().eq(YxStoreOrderCartInfo::getOid,yxStoreOrder.getId()));
List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>();
for (YxStoreOrderCartInfo cartInfo : cartInfos) {
StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto();
@ -2336,7 +2335,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
Long bargainId,Integer shippingType) {
String str = "[普通订单]";
if(pinkId > 0 || combinationId > 0){
YxStorePink storePink = storePinkService.getOne(new QueryWrapper<YxStorePink>().lambda()
YxStorePink storePink = storePinkService.getOne(new LambdaQueryWrapper<YxStorePink>()
.eq(YxStorePink::getOrderIdKey,id));
if(ObjectUtil.isNull(storePink)) {
str = "[拼团订单]";

View File

@ -27,7 +27,7 @@ import co.yixiang.modules.product.vo.YxStoreProductReplyQueryVo;
import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
@ -186,8 +186,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
@Override
public int getInfoCount(Integer oid, String unique) {
QueryWrapper<YxStoreProductReply> wrapper = new QueryWrapper<>();
wrapper.eq("`unique`",unique).eq("oid",oid);
LambdaQueryWrapper<YxStoreProductReply> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProductReply::getUnique,unique).eq(YxStoreProductReply::getOid,oid);
return this.baseMapper.selectCount(wrapper);
}
@ -201,8 +201,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
@Override
public int replyCount(String unique) {
QueryWrapper<YxStoreProductReply> wrapper = new QueryWrapper<>();
wrapper.eq("`unique`",unique);
LambdaQueryWrapper<YxStoreProductReply> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProductReply::getUnique,unique);
return this.baseMapper.selectCount(wrapper);
}
@ -213,8 +213,8 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
*/
@Override
public String replyPer(long productId) {
QueryWrapper<YxStoreProductReply> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreProductReply::getProductId,productId)
LambdaQueryWrapper<YxStoreProductReply> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProductReply::getProductId,productId)
.eq(YxStoreProductReply::getIsDel,ShopCommonEnum.DELETE_0.getValue())
.eq(YxStoreProductReply::getProductScore,5);
int productScoreCount = this.baseMapper.selectCount(wrapper);

View File

@ -171,8 +171,8 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override
public YxStoreProduct getProductInfo(int id) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
wrapper.eq("is_del", 0).eq("is_show", 1).eq("id", id);
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProduct::getIsShow, 1).eq(YxStoreProduct::getId, id);
YxStoreProduct storeProduct = this.baseMapper.selectOne(wrapper);
if (ObjectUtil.isNull(storeProduct)) {
throw new ErrorRequestException("商品不存在或已下架");
@ -230,7 +230,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override
public List<YxStoreProductQueryVo> getGoodsList(YxStoreProductQueryParam productQueryParam) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreProduct::getIsShow, CommonEnum.SHOW_STATUS_1.getValue());
//多字段模糊查询分类搜索
@ -296,8 +296,8 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
*/
@Override
public ProductVo goodsDetail(Long id, Long uid, String latitude, String longitude) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.eq(YxStoreProduct::getId, id);
YxStoreProduct storeProduct = storeProductMapper.selectOne(wrapper);
if (ObjectUtil.isNull(storeProduct)) {
@ -402,26 +402,26 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override
public List<YxStoreProductQueryVo> getList(int page, int limit, int order) {
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByDesc(YxStoreProduct::getSort);
// order
switch (ProductEnum.toType(order)) {
case TYPE_1:
wrapper.lambda().eq(YxStoreProduct::getIsBest,
wrapper.eq(YxStoreProduct::getIsBest,
ShopCommonEnum.IS_STATUS_1.getValue()); //精品推荐
break;
case TYPE_3:
wrapper.lambda().eq(YxStoreProduct::getIsNew,
wrapper.eq(YxStoreProduct::getIsNew,
ShopCommonEnum.IS_STATUS_1.getValue());//// 首发新品
break;
case TYPE_4:
wrapper.lambda().eq(YxStoreProduct::getIsBenefit,
wrapper.eq(YxStoreProduct::getIsBenefit,
ShopCommonEnum.IS_STATUS_1.getValue()); //// 猜你喜欢
break;
case TYPE_2:
wrapper.lambda().eq(YxStoreProduct::getIsHot,
wrapper.eq(YxStoreProduct::getIsHot,
ShopCommonEnum.IS_STATUS_1.getValue());//// 热门榜单
break;
}

View File

@ -13,7 +13,7 @@ import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.modules.shop.domain.YxSystemAttachment;
import co.yixiang.modules.shop.service.YxSystemAttachmentService;
import co.yixiang.modules.shop.service.mapper.YxSystemAttachmentMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -43,8 +43,8 @@ public class YxSystemAttachmentServiceImpl extends BaseServiceImpl<YxSystemAttac
*/
@Override
public YxSystemAttachment getInfo(String name) {
QueryWrapper<YxSystemAttachment> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxSystemAttachment::getName,name)
LambdaQueryWrapper<YxSystemAttachment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxSystemAttachment::getName,name)
.last("limit 1");
return yxSystemAttachmentMapper.selectOne(wrapper);
}
@ -56,8 +56,8 @@ public class YxSystemAttachmentServiceImpl extends BaseServiceImpl<YxSystemAttac
*/
@Override
public YxSystemAttachment getByCode(String code) {
QueryWrapper<YxSystemAttachment> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxSystemAttachment::getInviteCode,code)
LambdaQueryWrapper<YxSystemAttachment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxSystemAttachment::getInviteCode,code)
.last("limit 1");
return yxSystemAttachmentMapper.selectOne(wrapper);
}

View File

@ -19,7 +19,7 @@ import co.yixiang.modules.shop.service.dto.YxSystemConfigQueryCriteria;
import co.yixiang.modules.shop.service.mapper.SystemConfigMapper;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.RedisUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
@ -59,8 +59,8 @@ public class YxSystemConfigServiceImpl extends BaseServiceImpl<SystemConfigMappe
return result;
}
QueryWrapper<YxSystemConfig> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxSystemConfig::getMenuName,name);
LambdaQueryWrapper<YxSystemConfig> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxSystemConfig::getMenuName,name);
YxSystemConfig systemConfig = this.baseMapper.selectOne(wrapper);
if(systemConfig == null) {
return "";
@ -103,7 +103,7 @@ public class YxSystemConfigServiceImpl extends BaseServiceImpl<SystemConfigMappe
@Override
public YxSystemConfig findByKey(String key) {
return this.getOne(new QueryWrapper<YxSystemConfig>().lambda()
return this.getOne(new LambdaQueryWrapper<YxSystemConfig>()
.eq(YxSystemConfig::getMenuName,key));
}
}

View File

@ -29,7 +29,7 @@ import co.yixiang.modules.user.service.mapper.UserBillMapper;
import co.yixiang.modules.user.service.mapper.YxUserTaskFinishMapper;
import co.yixiang.modules.user.vo.YxSystemUserTaskQueryVo;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -112,8 +112,8 @@ public class YxSystemUserTaskServiceImpl extends BaseServiceImpl<SystemUserTaskM
*/
@Override
public TaskDto getTaskList(int levelId, Long uid) {
QueryWrapper<YxSystemUserTask> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxSystemUserTask::getLevelId,levelId)
LambdaQueryWrapper<YxSystemUserTask> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxSystemUserTask::getLevelId,levelId)
.eq(YxSystemUserTask::getIsShow, ShopCommonEnum.SHOW_1.getValue())
.orderByDesc(YxSystemUserTask::getSort);
List<YxSystemUserTaskQueryVo> list = generator.convert(yxSystemUserTaskMapper

View File

@ -20,7 +20,6 @@ import co.yixiang.modules.user.service.YxUserAddressService;
import co.yixiang.modules.user.service.mapper.YxUserAddressMapper;
import co.yixiang.modules.user.vo.YxUserAddressQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
@ -58,7 +57,7 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
YxUserAddress address = new YxUserAddress();
address.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue());
yxUserAddressMapper.update(address,
new QueryWrapper<YxUserAddress>().lambda().eq(YxUserAddress::getUid,uid));
new LambdaQueryWrapper<YxUserAddress>().eq(YxUserAddress::getUid,uid));
YxUserAddress userAddress = new YxUserAddress();
userAddress.setIsDefault(ShopCommonEnum.DEFAULT_1.getValue());
@ -90,7 +89,7 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
//新增地址如果是默认,把之前的状态改掉
YxUserAddress address = new YxUserAddress();
address.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue());
baseMapper.update(address,new QueryWrapper<YxUserAddress>().lambda().eq(YxUserAddress::getUid,uid));
baseMapper.update(address,new LambdaQueryWrapper<YxUserAddress>().eq(YxUserAddress::getUid,uid));
}else{
userAddress.setIsDefault(ShopCommonEnum.DEFAULT_0.getValue());
}
@ -136,8 +135,8 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
*/
@Override
public YxUserAddress getUserDefaultAddress(Long uid) {
QueryWrapper<YxUserAddress> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxUserAddress::getIsDefault,1).
LambdaQueryWrapper<YxUserAddress> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserAddress::getIsDefault,1).
eq(YxUserAddress::getUid,uid)
.last("limit 1");
return getOne(wrapper);

View File

@ -26,7 +26,7 @@ import co.yixiang.modules.user.vo.YxUserBillQueryVo;
import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -124,9 +124,9 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/
@Override
public int cumulativeAttendance(Long uid) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
wrapper.eq("uid",uid).eq("category","integral")
.eq("type","sign").eq("pm",1);
LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserBill::getUid,uid).eq(YxUserBill::getCategory,"integral")
.eq(YxUserBill::getType,"sign").eq(YxUserBill::getPm,1);
return yxUserBillMapper.selectCount(wrapper);
}
@ -139,11 +139,11 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/
@Override
public Map<String, Object> spreadOrder(Long uid, int page, int limit) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
wrapper.lambda().in(YxUserBill::getUid, uid)
LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.in(YxUserBill::getUid, uid)
.eq(YxUserBill::getType, BillDetailEnum.TYPE_2.getValue())
.eq(YxUserBill::getCategory, BillDetailEnum.CATEGORY_1.getValue());
wrapper.orderByDesc("time").groupBy("time");
wrapper.orderByDesc(YxUserBill::getCreateTime).groupBy(YxUserBill::getCreateTime);
Page<YxUserBill> pageModel = new Page<>(page, limit);
List<String> list = yxUserBillMapper.getBillOrderList(wrapper, pageModel);
@ -180,39 +180,39 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/
@Override
public List<BillVo> getUserBillList(int page, int limit, long uid, int type) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxUserBill::getUid,uid).orderByDesc(YxUserBill::getId);
wrapper.groupBy("time");
LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserBill::getUid,uid).orderByDesc(YxUserBill::getId);
wrapper.groupBy(YxUserBill::getCreateTime);
switch (BillInfoEnum.toType(type)){
case PAY_PRODUCT:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_3.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_3.getValue());
break;
case RECHAREGE:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_1.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_1.getValue());
break;
case BROKERAGE:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_2.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_2.getValue());
break;
case EXTRACT:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_4.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_4.getValue());
break;
case SIGN_INTEGRAL:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_2.getValue());
wrapper.lambda().eq(YxUserBill::getType,BillDetailEnum.TYPE_10.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_2.getValue());
wrapper.eq(YxUserBill::getType,BillDetailEnum.TYPE_10.getValue());
break;
default:
wrapper.lambda().eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
wrapper.eq(YxUserBill::getCategory,BillDetailEnum.CATEGORY_1.getValue());
}
Page<YxUserBill> pageModel = new Page<>(page, limit);
List<BillVo> billDTOList = yxUserBillMapper.getBillList(wrapper,pageModel);
for (BillVo billDTO : billDTOList) {
QueryWrapper<YxUserBill> wrapperT = new QueryWrapper<>();
wrapperT.lambda().in(YxUserBill::getId,Arrays.asList(billDTO.getIds().split(",")));
LambdaQueryWrapper<YxUserBill> wrapperT = new LambdaQueryWrapper<>();
wrapperT.in(YxUserBill::getId,Arrays.asList(billDTO.getIds().split(",")));
billDTO.setList(yxUserBillMapper.getUserBillList(wrapperT));
}
@ -245,8 +245,8 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
*/
@Override
public List<YxUserBillQueryVo> userBillList(Long uid,String category,int page,int limit) {
QueryWrapper<YxUserBill> wrapper = new QueryWrapper<>();
wrapper.lambda()
LambdaQueryWrapper<YxUserBill> wrapper = new LambdaQueryWrapper<>();
wrapper
.eq(YxUserBill::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserBill::getUid,uid)
.eq(YxUserBill::getCategory,category)

View File

@ -22,7 +22,7 @@ import co.yixiang.modules.user.service.YxUserService;
import co.yixiang.modules.user.service.mapper.SystemUserTaskMapper;
import co.yixiang.modules.user.service.mapper.YxUserLevelMapper;
import co.yixiang.utils.OrderUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -92,13 +92,13 @@ public class YxUserLevelServiceImpl extends BaseServiceImpl<YxUserLevelMapper, Y
*/
@Override
public YxUserLevel getUserLevel(Long uid, Integer grade) {
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>();
wrapper.lambda()
LambdaQueryWrapper<YxUserLevel> wrapper = new LambdaQueryWrapper<>();
wrapper
.eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserLevel::getUid,uid)
.orderByDesc(YxUserLevel::getGrade);
if(grade != null) {
wrapper.lambda().lt(YxUserLevel::getGrade,grade);
wrapper.lt(YxUserLevel::getGrade,grade);
}
YxUserLevel userLevel = this.getOne(wrapper,false);
if(ObjectUtil.isNull(userLevel)) {
@ -133,8 +133,8 @@ public class YxUserLevelServiceImpl extends BaseServiceImpl<YxUserLevelMapper, Y
int validTime = systemUserLevelQueryVo.getValidDate() * 86400;
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxUserLevel::getStatus,ShopCommonEnum.IS_STATUS_1.getValue())
LambdaQueryWrapper<YxUserLevel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserLevel::getStatus,ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserLevel::getUid,uid)
.eq(YxUserLevel::getLevelId,levelId)
.last("limit 1");

View File

@ -46,7 +46,7 @@ import co.yixiang.modules.user.service.mapper.UserMapper;
import co.yixiang.modules.user.vo.YxUserQueryVo;
import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
@ -356,8 +356,8 @@ public class YxUserServiceImpl extends BaseServiceImpl<UserMapper, YxUser> imple
*/
@Override
public double setLevelPrice(double price, long uid) {
QueryWrapper<YxUserLevel> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
LambdaQueryWrapper<YxUserLevel> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YxUserLevel::getStatus, ShopCommonEnum.IS_STATUS_1.getValue())
.eq(YxUserLevel::getUid,uid)
.orderByDesc(YxUserLevel::getGrade)
.last("limit 1");

View File

@ -17,7 +17,7 @@ import co.yixiang.modules.activity.domain.YxStorePink;
import co.yixiang.modules.activity.service.YxStorePinkService;
import co.yixiang.modules.order.domain.YxStoreOrder;
import co.yixiang.modules.order.service.YxStoreOrderService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.Message;
@ -61,7 +61,7 @@ public class RedisKeyExpirationListener implements MessageListener {
body = body.replace(ShopConstants.REDIS_ORDER_OUTTIME_UNPAY, "");
log.info("body:{}",body);
String orderId = body;
YxStoreOrder order = storeOrderService.getOne(new QueryWrapper<YxStoreOrder>().lambda()
YxStoreOrder order = storeOrderService.getOne(new LambdaQueryWrapper<YxStoreOrder>()
.eq(YxStoreOrder::getId, orderId)
.eq(YxStoreOrder::getPaid, OrderInfoEnum.PAY_STATUS_0.getValue()));
//只有待支付的订单能取消
@ -75,7 +75,7 @@ public class RedisKeyExpirationListener implements MessageListener {
body = body.replace(ShopConstants.REDIS_ORDER_OUTTIME_UNCONFIRM, "");
log.info("body:{}",body);
String orderId = body;
YxStoreOrder order = storeOrderService.getOne(new QueryWrapper<YxStoreOrder>().lambda()
YxStoreOrder order = storeOrderService.getOne(new LambdaQueryWrapper<YxStoreOrder>()
.eq(YxStoreOrder::getId, orderId)
.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue()));

View File

@ -58,8 +58,12 @@ public class MetaHandler implements MetaObjectHandler {
log.debug("自动插入 delFlag");
this.setFieldValByName("delFlag", false, metaObject);
}
if(metaObject.hasSetter("addTime")){
String timestamp = String.valueOf(System.currentTimeMillis()/1000);
if (metaObject.hasSetter("isDel")) {
log.debug("自动插入 isDel");
this.setFieldValByName("isDel", 0, metaObject);
}
if (metaObject.hasSetter("addTime")) {
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
this.setFieldValByName("addTime", Integer.valueOf(timestamp), metaObject);
}
} catch (Exception e) {

View File

@ -15,7 +15,7 @@ import co.yixiang.modules.mp.config.WxMpConfiguration;
import co.yixiang.utils.OrderUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.chanjar.weixin.common.bean.menu.WxMenu;
@ -50,7 +50,7 @@ public class WechatMenuController {
@GetMapping(value = "/YxWechatMenu")
@PreAuthorize("hasAnyRole('admin','YxWechatMenu_ALL','YxWechatMenu_SELECT')")
public ResponseEntity getYxWechatMenus(){
return new ResponseEntity(YxWechatMenuService.getOne(new QueryWrapper<YxWechatMenu>().lambda()
return new ResponseEntity(YxWechatMenuService.getOne(new LambdaQueryWrapper<YxWechatMenu>()
.eq(YxWechatMenu::getKey,ShopConstants.WECHAT_MENUS)),HttpStatus.OK);
}

View File

@ -23,7 +23,7 @@ import co.yixiang.utils.TranslatorUtil;
import co.yixiang.utils.ValidationUtil;
import co.yixiang.utils.YshopConstant;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Pageable;
@ -115,7 +115,7 @@ public class PictureServiceImpl extends BaseServiceImpl<PictureMapper, Picture>
public Picture upload(MultipartFile multipartFile, String username) {
File file = FileUtil.toFile(multipartFile);
// 验证是否重复上传
Picture picture = this.getOne(new QueryWrapper<Picture>().eq("md5code",FileUtil.getMd5(file)));
Picture picture = this.getOne(new LambdaQueryWrapper<Picture>().eq(Picture::getMd5code,FileUtil.getMd5(file)));
if(picture != null){
return picture;
}
@ -174,7 +174,7 @@ public class PictureServiceImpl extends BaseServiceImpl<PictureMapper, Picture>
JSONObject jsonObject = JSONUtil.parseObj(result);
List<Picture> pictures = JSON.parseArray(jsonObject.get("data").toString(), Picture.class);
for (Picture picture : pictures) {
if(this.getOne(new QueryWrapper<Picture>().eq("url",picture.getUrl()))==null){
if(this.getOne(new LambdaQueryWrapper<Picture>().eq(Picture::getUrl,picture.getUrl()))==null){
picture.setSize(FileUtil.getSize(Integer.parseInt(picture.getSize())));
picture.setUsername("System Sync");
picture.setMd5code(null);

View File

@ -16,7 +16,7 @@ import co.yixiang.tools.service.dto.QiniuQueryCriteria;
import co.yixiang.tools.utils.QiNiuUtil;
import co.yixiang.utils.FileUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qiniu.common.QiniuException;
import com.qiniu.http.Response;
import com.qiniu.storage.BucketManager;
@ -109,7 +109,7 @@ public class QiNiuServiceImpl implements QiNiuService {
String upToken = auth.uploadToken(qiniuConfig.getBucket());
try {
String key = file.getOriginalFilename();
if(qiniuContentService.getOne(new QueryWrapper<QiniuContent>().eq("name",key)) != null) {
if(qiniuContentService.getOne(new LambdaQueryWrapper<QiniuContent>().eq(QiniuContent::getName,key)) != null) {
key = QiNiuUtil.getKey(key);
}
Response response = uploadManager.put(file.getBytes(), key, upToken);
@ -117,7 +117,7 @@ public class QiNiuServiceImpl implements QiNiuService {
DefaultPutRet putRet = JSON.parseObject(response.bodyString(), DefaultPutRet.class);
QiniuContent content = qiniuContentService.getOne(new QueryWrapper<QiniuContent>().eq("name",FileUtil.getFileNameNoEx(putRet.key)));
QiniuContent content = qiniuContentService.getOne(new LambdaQueryWrapper<QiniuContent>().eq(QiniuContent::getName,FileUtil.getFileNameNoEx(putRet.key)));
if (content == null) {
//存入数据库
QiniuContent qiniuContent = new QiniuContent();
@ -199,7 +199,7 @@ public class QiNiuServiceImpl implements QiNiuService {
QiniuContent qiniuContent;
FileInfo[] items = fileListIterator.next();
for (FileInfo item : items) {
if(qiniuContentService.getOne(new QueryWrapper<QiniuContent>().eq("name",FileUtil.getFileNameNoEx(item.key)))
if(qiniuContentService.getOne(new LambdaQueryWrapper<QiniuContent>().eq(QiniuContent::getName,FileUtil.getFileNameNoEx(item.key)))
== null){
qiniuContent = new QiniuContent();
qiniuContent.setSize(FileUtil.getSize(Integer.parseInt(item.fsize+"")));

View File

@ -17,7 +17,7 @@ import co.yixiang.tools.domain.VerificationCode;
import co.yixiang.tools.domain.vo.EmailVo;
import co.yixiang.tools.service.VerificationCodeService;
import co.yixiang.tools.service.mapper.VerificationCodeMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -45,8 +45,8 @@ public class VerificationCodeServiceImpl extends BaseServiceImpl<VerificationCod
public EmailVo sendEmail(VerificationCode code) {
EmailVo emailVo;
String content;
VerificationCode verificationCode = this.getOne(new QueryWrapper<VerificationCode>()
.eq("scenes",code.getScenes()).eq("type",code.getType()).eq("value",code.getValue()));
VerificationCode verificationCode = this.getOne(new LambdaQueryWrapper<VerificationCode>()
.eq(VerificationCode::getScenes,code.getScenes()).eq(VerificationCode::getType,code.getType()).eq(VerificationCode::getValue,code.getValue()));
// 如果不存在有效的验证码,就创建一个新的
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH));
Template template = engine.getTemplate("email/email.ftl");
@ -66,9 +66,9 @@ public class VerificationCodeServiceImpl extends BaseServiceImpl<VerificationCod
@Override
public void validated(VerificationCode code) {
VerificationCode verificationCode = this.getOne(new QueryWrapper<VerificationCode>()
.eq("scenes",code.getScenes()).eq("type",code.getType()).eq("value",code.getValue())
.eq("status",true));
VerificationCode verificationCode = this.getOne(new LambdaQueryWrapper<VerificationCode>()
.eq(VerificationCode::getScenes,code.getScenes()).eq(VerificationCode::getType,code.getType()).eq(VerificationCode::getValue,code.getValue())
.eq(VerificationCode::getStatus,true));
if(verificationCode == null || !verificationCode.getCode().equals(code.getCode())){
throw new BadRequestException("无效验证码");
} else {

View File

@ -32,7 +32,6 @@ import co.yixiang.utils.FileUtil;
import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
@ -268,8 +267,8 @@ public class YxWechatLiveServiceImpl extends BaseServiceImpl<YxWechatLiveMapper,
@Override
public List<YxWechatLiveDto> getList(int page, int limit, int order) {
//todo 添加状态判断
QueryWrapper<YxWechatLive> wrapper = new QueryWrapper<>();
wrapper.lambda()
LambdaQueryWrapper<YxWechatLive> wrapper = new LambdaQueryWrapper<>();
wrapper
.orderByDesc(YxWechatLive::getStartTime);

View File

@ -14,7 +14,7 @@ import co.yixiang.modules.mp.service.YxWechatMenuService;
import co.yixiang.modules.mp.service.dto.YxWechatMenuDto;
import co.yixiang.modules.mp.service.dto.YxWechatMenuQueryCriteria;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
@ -79,7 +79,7 @@ public class YxWechatMenuServiceImpl extends BaseServiceImpl<WechatMenuMapper, Y
@Override
public Boolean isExist(String wechat_menus) {
YxWechatMenu yxWechatMenu = this.getOne(new QueryWrapper<YxWechatMenu>().lambda()
YxWechatMenu yxWechatMenu = this.getOne(new LambdaQueryWrapper<YxWechatMenu>()
.eq(YxWechatMenu::getKey,wechat_menus));
if(yxWechatMenu == null){
return false;

View File

@ -15,7 +15,7 @@ import co.yixiang.modules.mp.service.YxWechatReplyService;
import co.yixiang.modules.mp.service.dto.YxWechatReplyDto;
import co.yixiang.modules.mp.service.dto.YxWechatReplyQueryCriteria;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
@ -83,7 +83,7 @@ public class YxWechatReplyServiceImpl extends BaseServiceImpl<WechatReplyMapper,
@Override
public YxWechatReply isExist(String key) {
YxWechatReply yxWechatReply = this.getOne(new QueryWrapper<YxWechatReply>().lambda()
YxWechatReply yxWechatReply = this.getOne(new LambdaQueryWrapper<YxWechatReply>()
.eq(YxWechatReply::getKey,key));
return yxWechatReply;
}

View File

@ -14,7 +14,7 @@ import co.yixiang.modules.mp.service.dto.YxWechatTemplateQueryCriteria;
import co.yixiang.modules.mp.service.dto.YxWechatTemplateDto;
import co.yixiang.modules.mp.service.mapper.WechatTemplateMapper;
import co.yixiang.utils.FileUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Pageable;
@ -83,7 +83,7 @@ public class YxWechatTemplateServiceImpl extends BaseServiceImpl<WechatTemplateM
@Override
public YxWechatTemplate findByTempkey(String recharge_success_key) {
return this.getOne(new QueryWrapper<YxWechatTemplate>().lambda()
return this.getOne(new LambdaQueryWrapper<YxWechatTemplate>()
.eq(YxWechatTemplate::getTempkey,recharge_success_key));
}
}