Compare commits
No commits in common. "160033f107d45e21ab40b462aa6bdf00e17511a0" and "3ef4c7125821358196bbc95b9f2ee2f742900021" have entirely different histories.
160033f107
...
3ef4c71258
|
@ -65,11 +65,4 @@ public class Ab98UserTagController extends BaseController {
|
|||
ab98UserTagApplicationService.deleteAb98UserTag(new BulkOperationCommand<>(ids));
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
@Operation(summary = "获取所有标签名称")
|
||||
@GetMapping("/names")
|
||||
public ResponseDTO<List<String>> getDistinctTagNames() {
|
||||
List<String> tagNames = ab98UserTagApplicationService.selectDistinctTagNames();
|
||||
return ResponseDTO.ok(tagNames);
|
||||
}
|
||||
}
|
|
@ -10,7 +10,6 @@ import com.agileboot.domain.cabinet.cell.command.AddCabinetCellCommand;
|
|||
import com.agileboot.domain.cabinet.cell.command.UpdateCabinetCellCommand;
|
||||
import com.agileboot.domain.cabinet.cell.db.CabinetCellEntity;
|
||||
import com.agileboot.domain.cabinet.cell.dto.CabinetCellDTO;
|
||||
import com.agileboot.domain.cabinet.cell.dto.CabinetCellWithOrderCountDTO;
|
||||
import com.agileboot.domain.cabinet.cell.query.SearchCabinetCellQuery;
|
||||
import com.agileboot.domain.cabinet.cell.query.SearchCabinetCellWithOrdersQuery;
|
||||
import com.agileboot.domain.common.command.BulkOperationCommand;
|
||||
|
@ -40,8 +39,8 @@ public class CabinetCellController extends BaseController {
|
|||
|
||||
@Operation(summary = "格口列表")
|
||||
@GetMapping
|
||||
public ResponseDTO<PageDTO<CabinetCellWithOrderCountDTO>> list(SearchCabinetCellWithOrdersQuery<CabinetCellEntity> query) {
|
||||
PageDTO<CabinetCellWithOrderCountDTO> page = cabinetCellApplicationService.getCabinetCellList(query);
|
||||
public ResponseDTO<PageDTO<CabinetCellDTO>> list(SearchCabinetCellWithOrdersQuery<CabinetCellEntity> query) {
|
||||
PageDTO<CabinetCellDTO> page = cabinetCellApplicationService.getCabinetCellList(query);
|
||||
return ResponseDTO.ok(page);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,13 +20,18 @@ import com.agileboot.domain.qywx.user.db.QyUserEntity;
|
|||
import com.agileboot.domain.qywx.user.dto.QyUserDTO;
|
||||
import com.agileboot.domain.qywx.user.query.SearchQyUserQuery;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/qywx/users")
|
||||
|
@ -103,10 +108,4 @@ public class QyUserController extends BaseController {
|
|||
UserIdResponse response = QywxApiUtil.convertToUserid(accessToken.getAccessToken(), openid);
|
||||
return ResponseDTO.ok(JSONUtil.toJsonStr(response));
|
||||
}
|
||||
|
||||
@GetMapping("/getTotalBalance")
|
||||
public ResponseDTO<BigDecimal> getTotalBalance(@RequestParam(required = false) String corpid) {
|
||||
BigDecimal totalBalance = qyUserApplicationService.selectTotalBalance(corpid);
|
||||
return ResponseDTO.ok(totalBalance);
|
||||
}
|
||||
}
|
|
@ -58,8 +58,4 @@ public class Ab98UserTagApplicationService {
|
|||
public Ab98UserTagEntity getByTagId(Long tagId) {
|
||||
return ab98UserTagService.getByTagId(tagId);
|
||||
}
|
||||
|
||||
public List<String> selectDistinctTagNames() {
|
||||
return ab98UserTagService.selectDistinctTagNames();
|
||||
}
|
||||
}
|
|
@ -35,7 +35,4 @@ public interface Ab98UserTagMapper extends BaseMapper<Ab98UserTagEntity> {
|
|||
|
||||
@Select("SELECT * FROM ab98_user_tag WHERE tag_id = #{tagId} LIMIT 1")
|
||||
Ab98UserTagEntity selectByTagId(@Param("tagId") Long tagId);
|
||||
|
||||
@Select("SELECT DISTINCT tag_name FROM ab98_user_tag WHERE deleted = 0")
|
||||
List<String> selectDistinctTagNames();
|
||||
}
|
||||
|
|
|
@ -22,6 +22,4 @@ public interface Ab98UserTagService extends IService<Ab98UserTagEntity> {
|
|||
Ab98UserTagEntity getFirstEnabledTag();
|
||||
|
||||
Ab98UserTagEntity getByTagId(Long tagId);
|
||||
|
||||
List<String> selectDistinctTagNames();
|
||||
}
|
||||
|
|
|
@ -41,9 +41,4 @@ public class Ab98UserTagServiceImpl extends ServiceImpl<Ab98UserTagMapper, Ab98U
|
|||
public Ab98UserTagEntity getByTagId(Long tagId) {
|
||||
return baseMapper.selectByTagId(tagId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> selectDistinctTagNames() {
|
||||
return baseMapper.selectDistinctTagNames();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public class Ab98UserApplicationService {
|
|||
private final Ab98UserModelFactory userModelFactory;
|
||||
|
||||
public PageDTO<Ab98UserDTO> getUserList(SearchAb98UserQuery<Ab98UserEntity> query) {
|
||||
Page<Ab98UserEntity> page = userService.getUserListWithTagFilter(query);
|
||||
Page<Ab98UserEntity> page = userService.getUserList(query);
|
||||
List<Ab98UserDTO> dtoList = page.getRecords().stream()
|
||||
.map(Ab98UserDTO::new)
|
||||
.collect(Collectors.toList());
|
||||
|
|
|
@ -46,13 +46,4 @@ public interface Ab98UserMapper extends BaseMapper<Ab98UserEntity> {
|
|||
|
||||
@Select("SELECT * FROM ab98_user WHERE openid = #{openid} AND userid = #{userid} LIMIT 1")
|
||||
Ab98UserEntity selectByOpenidAndUserid(@Param("openid")String openid, @Param("userid")String userid);
|
||||
|
||||
@Select("SELECT DISTINCT u.* " +
|
||||
"FROM ab98_user u " +
|
||||
"LEFT JOIN ab98_user_tag t ON u.ab98_user_id = t.ab98_user_id " +
|
||||
"${ew.customSqlSegment}")
|
||||
Page<Ab98UserEntity> getUserListWithTagFilter(
|
||||
Page<Ab98UserEntity> page,
|
||||
@Param(Constants.WRAPPER) Wrapper<Ab98UserEntity> queryWrapper
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package com.agileboot.domain.ab98.user.db;
|
||||
|
||||
import com.agileboot.common.core.page.AbstractPageQuery;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
@ -18,7 +16,7 @@ import java.util.List;
|
|||
* @since 2025-05-10
|
||||
*/
|
||||
public interface Ab98UserService extends IService<Ab98UserEntity> {
|
||||
Page<Ab98UserEntity> getUserListWithTagFilter(AbstractPageQuery<Ab98UserEntity> query);
|
||||
Page<Ab98UserEntity> getUserList(AbstractPageQuery<Ab98UserEntity> query);
|
||||
|
||||
List<Ab98UserEntity> selectAll();
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ import java.util.List;
|
|||
public class Ab98UserServiceImpl extends ServiceImpl<Ab98UserMapper, Ab98UserEntity> implements Ab98UserService {
|
||||
|
||||
@Override
|
||||
public Page<Ab98UserEntity> getUserListWithTagFilter(AbstractPageQuery<Ab98UserEntity> query) {
|
||||
return baseMapper.getUserListWithTagFilter(query.toPage(), query.toQueryWrapper());
|
||||
public Page<Ab98UserEntity> getUserList(AbstractPageQuery<Ab98UserEntity> query) {
|
||||
return this.page(query.toPage(), query.toQueryWrapper());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,23 +21,21 @@ public class SearchAb98UserQuery<T> extends AbstractPageQuery<T> {
|
|||
private Boolean registered;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
private String tagName;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<T> addQueryCondition() {
|
||||
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper
|
||||
.eq(ab98UserId != null, "u.ab98_user_id", ab98UserId)
|
||||
.eq(StrUtil.isNotEmpty(openid), "u.openid", openid)
|
||||
.eq(StrUtil.isNotEmpty(userid), "u.userid", userid)
|
||||
.like(StrUtil.isNotEmpty(name), "u.name", name)
|
||||
.like(StrUtil.isNotEmpty(tel), "u.tel", tel)
|
||||
.like(StrUtil.isNotEmpty(idnum), "u.idnum", idnum)
|
||||
.eq(StrUtil.isNotEmpty(tagName), "t.tag_name", tagName)
|
||||
.eq(StrUtil.isNotEmpty(sex), "u.sex", sex)
|
||||
.eq(registered != null, "u.registered", registered)
|
||||
.between(startTime != null && endTime != null, "u.create_time", startTime, endTime);
|
||||
.eq(ab98UserId != null, "ab98_user_id", ab98UserId)
|
||||
.eq(StrUtil.isNotEmpty(openid), "openid", openid)
|
||||
.eq(StrUtil.isNotEmpty(userid), "userid", userid)
|
||||
.like(StrUtil.isNotEmpty(name), "name", name)
|
||||
.like(StrUtil.isNotEmpty(tel), "tel", tel)
|
||||
.like(StrUtil.isNotEmpty(idnum), "idnum", idnum)
|
||||
.eq(StrUtil.isNotEmpty(sex), "sex", sex)
|
||||
.eq(registered != null, "registered", registered)
|
||||
.between(startTime != null && endTime != null, "create_time", startTime, endTime);
|
||||
|
||||
this.timeRangeColumn = "create_time";
|
||||
|
||||
|
|
|
@ -30,9 +30,26 @@ public class CabinetCellApplicationService {
|
|||
private final CabinetCellModelFactory cabinetCellModelFactory;
|
||||
private final ShopGoodsService shopGoodsService;
|
||||
|
||||
public PageDTO<CabinetCellWithOrderCountDTO> getCabinetCellList(SearchCabinetCellWithOrdersQuery<CabinetCellEntity> query) {
|
||||
public PageDTO<CabinetCellDTO> getCabinetCellList(SearchCabinetCellWithOrdersQuery<CabinetCellEntity> query) {
|
||||
// Page<CabinetCellEntity> page = cabinetCellService.getCellList(query);
|
||||
Page<CabinetCellWithOrderCountDTO> page = cabinetCellService.getCellListWithOrders(query);
|
||||
return new PageDTO<>(page.getRecords(), page.getTotal());
|
||||
List<ShopGoodsEntity> goodsList = shopGoodsService.selectAll();
|
||||
List<CabinetCellDTO> dtoList = page.getRecords().stream()
|
||||
.map(cell -> {
|
||||
CabinetCellDTO dto = new CabinetCellDTO(cell);
|
||||
ShopGoodsEntity goods = goodsList.stream()
|
||||
.filter(g -> g.getGoodsId().equals(cell.getGoodsId()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (goods != null) {
|
||||
dto.setGoodsName(goods.getGoodsName());
|
||||
dto.setPrice(goods.getPrice());
|
||||
dto.setCoverImg(goods.getCoverImg());
|
||||
}
|
||||
return dto;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return new PageDTO<>(dtoList, page.getTotal());
|
||||
}
|
||||
|
||||
public void addCabinetCell(AddCabinetCellCommand command) {
|
||||
|
|
|
@ -52,10 +52,9 @@ public interface CabinetCellMapper extends BaseMapper<CabinetCellEntity> {
|
|||
"WHERE cell_id = #{cellId}")
|
||||
void clearGoodsIdAndFreeCell(@Param("cellId") Long cellId);
|
||||
|
||||
@Select("SELECT cc.*, COUNT(sog.order_goods_id) AS orderCount, sg.goods_name, sg.price, sg.cover_img " +
|
||||
@Select("SELECT cc.*, COUNT(sog.order_goods_id) AS orderCount " +
|
||||
"FROM cabinet_cell cc " +
|
||||
"LEFT JOIN shop_order_goods sog ON cc.cell_id = sog.cell_id AND sog.deleted = 0 " +
|
||||
"LEFT JOIN shop_goods sg ON cc.goods_id = sg.goods_id AND sg.deleted = 0 " +
|
||||
"${ew.customSqlSegment} ")
|
||||
Page<CabinetCellWithOrderCountDTO> getCellListWithOrders(
|
||||
Page<CabinetCellEntity> page,
|
||||
|
|
|
@ -1,28 +1,13 @@
|
|||
package com.agileboot.domain.cabinet.cell.dto;
|
||||
|
||||
import com.agileboot.domain.cabinet.cell.db.CabinetCellEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CabinetCellWithOrderCountDTO extends CabinetCellEntity {
|
||||
@ApiModelProperty("历史订单数量")
|
||||
private Integer orderCount;
|
||||
|
||||
@ApiModelProperty("关联商品名称")
|
||||
@TableField("goods_name")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty("关联商品价格")
|
||||
@TableField("price")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty("关联商品图片")
|
||||
@TableField("cover_img")
|
||||
private String coverImg;
|
||||
}
|
|
@ -4,7 +4,6 @@ import com.agileboot.common.core.page.AbstractPageQuery;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -19,7 +18,6 @@ public class SearchCabinetCellWithOrdersQuery<T> extends AbstractPageQuery<T> {
|
|||
private Integer availableStatus;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
private String goodsName;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<T> addQueryCondition() {
|
||||
|
@ -33,7 +31,6 @@ public class SearchCabinetCellWithOrdersQuery<T> extends AbstractPageQuery<T> {
|
|||
.eq(usageStatus != null, "cc.usage_status", usageStatus)
|
||||
.eq(availableStatus != null, "cc.available_status", availableStatus)
|
||||
.eq("cc.deleted", false)
|
||||
.like(StringUtils.isNotBlank(goodsName), "sg.goods_name", goodsName)
|
||||
.between(startTime != null && endTime != null, "cc.create_time", startTime, endTime)
|
||||
.groupBy("cc.cell_id");
|
||||
|
||||
|
|
|
@ -43,10 +43,6 @@ public class SmartCabinetEntity extends BaseEntity<SmartCabinetEntity> {
|
|||
@TableField("main_cabinet")
|
||||
private Long mainCabinet;
|
||||
|
||||
@ApiModelProperty("归属类型(0-借还柜 1-固资通)")
|
||||
@TableField("belong_type")
|
||||
private Integer belongType;
|
||||
|
||||
@ApiModelProperty("归属主柜名称")
|
||||
@TableField(exist = false)
|
||||
private String mainCabinetName;
|
||||
|
|
|
@ -37,9 +37,6 @@ public class SmartCabinetDTO {
|
|||
@ExcelColumn(name = "归属主柜ID")
|
||||
private Long mainCabinet;
|
||||
|
||||
@ExcelColumn(name = "归属类型(0-借还柜 1-固资通)")
|
||||
private Integer belongType;
|
||||
|
||||
@ExcelColumn(name = "归属主柜名称")
|
||||
private String mainCabinetName;
|
||||
|
||||
|
|
|
@ -18,8 +18,6 @@ public class SearchSmartCabinetQuery<T> extends AbstractPageQuery<T> {
|
|||
private Date endTime;
|
||||
private Long mqttServerId;
|
||||
private Long shopId;
|
||||
|
||||
private Integer belongType;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<T> addQueryCondition() {
|
||||
|
@ -30,7 +28,6 @@ public class SearchSmartCabinetQuery<T> extends AbstractPageQuery<T> {
|
|||
.eq(cabinetType != null, "sc.cabinet_type", cabinetType)
|
||||
.eq(mqttServerId!= null, "sc.mqtt_server_id", mqttServerId)
|
||||
.eq(shopId!= null, "sc.shop_id", shopId)
|
||||
.eq(belongType!= null, "sc.belong_type", belongType)
|
||||
.eq(StrUtil.isNotEmpty(templateNo), "sc.template_no", templateNo)
|
||||
.eq("sc.deleted", false)
|
||||
.between(startTime != null && endTime != null, "sc.create_time", startTime, endTime);
|
||||
|
|
|
@ -21,8 +21,6 @@ import com.agileboot.domain.system.user.db.SysUserEntity;
|
|||
import com.agileboot.domain.system.user.db.SysUserService;
|
||||
import com.agileboot.domain.system.user.dto.UserDTO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
@ -135,8 +133,4 @@ public class QyUserApplicationService {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BigDecimal selectTotalBalance(String corpid) {
|
||||
return userService.selectTotalBalance(corpid);
|
||||
}
|
||||
}
|
|
@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
@ -45,14 +43,4 @@ public interface QyUserMapper extends BaseMapper<QyUserEntity> {
|
|||
"AND sr.role_key = 'admin'")
|
||||
List<String> selectAdminUserIds();
|
||||
|
||||
@Select("SELECT SUM(balance) " +
|
||||
"FROM qy_user " +
|
||||
"WHERE deleted = 0")
|
||||
BigDecimal selectTotalBalance();
|
||||
|
||||
@Select("SELECT SUM(balance) " +
|
||||
"FROM qy_user " +
|
||||
"WHERE deleted = 0 AND corpid = #{corpid}")
|
||||
BigDecimal selectTotalBalanceByCorpid(@Param("corpid") String corpid);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@ package com.agileboot.domain.qywx.user.db;
|
|||
import com.agileboot.common.core.page.AbstractPageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -24,6 +22,4 @@ public interface QyUserService extends IService<QyUserEntity> {
|
|||
QyUserEntity getUserByUserId(String userid, String corpid);
|
||||
|
||||
List<String> selectAdminUserIds();
|
||||
|
||||
BigDecimal selectTotalBalance(String corpid);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.agileboot.domain.qywx.user.db;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
|
@ -15,8 +14,6 @@ import org.springframework.stereotype.Service;
|
|||
import com.agileboot.common.core.page.AbstractPageQuery;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
@ -46,13 +43,4 @@ public class QyUserServiceImpl extends ServiceImpl<QyUserMapper, QyUserEntity> i
|
|||
public List<String> selectAdminUserIds() {
|
||||
return baseMapper.selectAdminUserIds();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal selectTotalBalance(String corpid) {
|
||||
if (StringUtils.isBlank(corpid)) {
|
||||
return baseMapper.selectTotalBalance();
|
||||
} else {
|
||||
return baseMapper.selectTotalBalanceByCorpid(corpid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,6 @@ package com.agileboot.domain.qywx.user.query;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.agileboot.common.core.page.AbstractPageQuery;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -23,8 +21,6 @@ public class SearchQyUserQuery<T> extends AbstractPageQuery<T> {
|
|||
private Date startTime;
|
||||
private Date endTime;
|
||||
private Long sysRoleId;
|
||||
// 是否查询余额大于0的用户,1为是
|
||||
private Integer balancePage;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<T> addQueryCondition() {
|
||||
|
@ -39,7 +35,6 @@ public class SearchQyUserQuery<T> extends AbstractPageQuery<T> {
|
|||
.eq(StrUtil.isNotBlank(department), "department", department)
|
||||
.eq(StrUtil.isNotBlank(mainDepartment), "main_department", mainDepartment)
|
||||
.eq(StrUtil.isNotBlank(enable), "enable", enable)
|
||||
.gt(balancePage != null && balancePage.equals(1), "balance", BigDecimal.ZERO)
|
||||
.between(startTime != null && endTime != null, "create_time", startTime, endTime)
|
||||
.orderByDesc("id");
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public interface ShopOrderGoodsMapper extends BaseMapper<ShopOrderGoodsEntity> {
|
|||
"WHERE sog.deleted = 0 AND sg.deleted = 0 AND sog.goods_id != 6 " +
|
||||
"GROUP BY sog.goods_id, sg.goods_name, sg.cover_img " +
|
||||
"ORDER BY occurrence_count DESC " +
|
||||
"LIMIT 9")
|
||||
"LIMIT 10")
|
||||
List<TopGoodsDTO> selectTopGoodsByOccurrence();
|
||||
|
||||
@Select("SELECT sog.*, so.name AS buyer_name " +
|
||||
|
@ -39,7 +39,7 @@ public interface ShopOrderGoodsMapper extends BaseMapper<ShopOrderGoodsEntity> {
|
|||
"WHERE sog.deleted = 0 AND so.deleted = 0 " +
|
||||
"AND DATE(sog.create_time) = CURRENT_DATE " +
|
||||
"ORDER BY sog.create_time DESC " +
|
||||
"LIMIT 4")
|
||||
"LIMIT 10")
|
||||
List<TodayLatestOrderGoodsDTO> selectTodayLatestOrderGoods();
|
||||
|
||||
@Select("SELECT og.* " +
|
||||
|
|
|
@ -12,9 +12,4 @@ CREATE TABLE `ab98_user_tag` (
|
|||
PRIMARY KEY (`tag_id`),
|
||||
KEY `idx_user` (`ab98_user_id`),
|
||||
CONSTRAINT `fk_tag_user` FOREIGN KEY (`ab98_user_id`) REFERENCES `ab98_user` (`ab98_user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户标签表';
|
||||
|
||||
|
||||
ALTER TABLE `smart_cabinet`
|
||||
ADD COLUMN `belong_type` TINYINT NOT NULL DEFAULT 0 COMMENT '归属类型(0-借还柜 1-固资通)'
|
||||
AFTER `main_cabinet`;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户标签表';
|
|
@ -1,38 +0,0 @@
|
|||
DROP TABLE IF EXISTS `ab98_user_vip`;
|
||||
|
||||
CREATE TABLE `ab98_user_vip` (
|
||||
`vip_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`ab98_user_id` BIGINT NOT NULL COMMENT '关联用户ID',
|
||||
`vip_level` TINYINT NOT NULL DEFAULT 1 COMMENT 'VIP等级',
|
||||
`start_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '会员开始时间',
|
||||
`end_time` DATETIME NULL COMMENT '会员结束时间',
|
||||
`status` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '状态(1有效 0无效)',
|
||||
`creator_id` BIGINT DEFAULT 0 COMMENT '创建者ID',
|
||||
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater_id` BIGINT DEFAULT 0 COMMENT '更新者ID',
|
||||
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '删除标志(0存在 1删除)',
|
||||
PRIMARY KEY (`vip_id`),
|
||||
KEY `idx_user` (`ab98_user_id`),
|
||||
KEY `idx_level` (`vip_level`),
|
||||
CONSTRAINT `fk_vip_user` FOREIGN KEY (`ab98_user_id`) REFERENCES `ab98_user` (`ab98_user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户VIP信息表';
|
||||
|
||||
DROP TABLE IF EXISTS `ab98_vip_level`;
|
||||
|
||||
CREATE TABLE `ab98_vip_level` (
|
||||
`level_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`level_name` VARCHAR(50) NOT NULL COMMENT '等级名称',
|
||||
`level_value` TINYINT NOT NULL COMMENT '等级值',
|
||||
`discount_rate` DECIMAL(5,2) NOT NULL COMMENT '折扣率',
|
||||
`point_multiplier` DECIMAL(5,2) NOT NULL COMMENT '积分倍数',
|
||||
`free_shipping` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否免邮(0否 1是)',
|
||||
`birthday_benefit` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '生日特权(0无 1有)',
|
||||
`creator_id` BIGINT DEFAULT 0 COMMENT '创建者ID',
|
||||
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater_id` BIGINT DEFAULT 0 COMMENT '更新者ID',
|
||||
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '删除标志(0存在 1删除)',
|
||||
PRIMARY KEY (`level_id`),
|
||||
UNIQUE KEY `uk_level` (`level_value`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='VIP等级权限表';
|
Loading…
Reference in New Issue