feat(shop): 新增电子围栏功能并重构仓库模块
- 添加 ShopStoreFence 实体类及相关数据库表映射 - 实现 ShopStoreFenceController 提供完整的 CRUD 操作接口 - 创建 ShopStoreFenceService 和 ShopStoreFenceServiceImpl 业务逻辑层 - 设计 ShopStoreFenceParam 查询参数类支持条件筛选 - 新建 ShopStoreFenceMapper 及其 XML 映射文件 - 将原有的 ShopWarehouse 重命名为 ShopStoreWarehouse 并更新相关引用 - 修改 GltTicketOrderMapper 和 ShopOrderMapper 中的仓库表关联关系 - 更新 ShopWarehouse 相关的所有控制器、服务、参数和映射文件命名 - 在订单相关查询中将 shop_warehouse 表替换为 shop_store_warehouse 表 - 为仓库控制器添加用户登录信息自动填充功能
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
d.address as receiverAddress, d.full_address as receiverFullAddress, d.lat as receiverLat, d.lng as receiverLng
|
||||
FROM glt_ticket_order a
|
||||
LEFT JOIN shop_store b ON a.store_id = b.id
|
||||
LEFT JOIN shop_warehouse w ON a.warehouse_id = w.id
|
||||
LEFT JOIN shop_store_warehouse w ON a.warehouse_id = w.id
|
||||
LEFT JOIN shop_store_rider c ON a.rider_id = c.user_id
|
||||
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
||||
LEFT JOIN shop_user_address d ON a.address_id = d.id
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.ShopStoreFenceService;
|
||||
import com.gxwebsoft.shop.entity.ShopStoreFence;
|
||||
import com.gxwebsoft.shop.param.ShopStoreFenceParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 黄家明_电子围栏控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
@Tag(name = "黄家明_电子围栏管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/shop-store-fence")
|
||||
public class ShopStoreFenceController extends BaseController {
|
||||
@Resource
|
||||
private ShopStoreFenceService shopStoreFenceService;
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreFence:list')")
|
||||
@Operation(summary = "分页查询黄家明_电子围栏")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ShopStoreFence>> page(ShopStoreFenceParam param) {
|
||||
// 使用关联查询
|
||||
return success(shopStoreFenceService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreFence:list')")
|
||||
@Operation(summary = "查询全部黄家明_电子围栏")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ShopStoreFence>> list(ShopStoreFenceParam param) {
|
||||
// 使用关联查询
|
||||
return success(shopStoreFenceService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreFence:list')")
|
||||
@Operation(summary = "根据id查询黄家明_电子围栏")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ShopStoreFence> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(shopStoreFenceService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreFence:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加黄家明_电子围栏")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ShopStoreFence shopStoreFence) {
|
||||
if (shopStoreFenceService.save(shopStoreFence)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreFence:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改黄家明_电子围栏")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ShopStoreFence shopStoreFence) {
|
||||
if (shopStoreFenceService.updateById(shopStoreFence)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreFence:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除黄家明_电子围栏")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (shopStoreFenceService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreFence:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加黄家明_电子围栏")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ShopStoreFence> list) {
|
||||
if (shopStoreFenceService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreFence:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改黄家明_电子围栏")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopStoreFence> batchParam) {
|
||||
if (batchParam.update(shopStoreFenceService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreFence:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除黄家明_电子围栏")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (shopStoreFenceService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.ShopWarehouseService;
|
||||
import com.gxwebsoft.shop.entity.ShopWarehouse;
|
||||
import com.gxwebsoft.shop.param.ShopWarehouseParam;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.service.ShopStoreWarehouseService;
|
||||
import com.gxwebsoft.shop.entity.ShopStoreWarehouse;
|
||||
import com.gxwebsoft.shop.param.ShopStoreWarehouseParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
@@ -21,102 +22,102 @@ import java.util.List;
|
||||
* 仓库控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-30 17:46:48
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
@Tag(name = "仓库管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/shop-warehouse")
|
||||
public class ShopWarehouseController extends BaseController {
|
||||
@RequestMapping("/api/shop/shop-store-warehouse")
|
||||
public class ShopStoreWarehouseController extends BaseController {
|
||||
@Resource
|
||||
private ShopWarehouseService shopWarehouseService;
|
||||
private ShopStoreWarehouseService shopStoreWarehouseService;
|
||||
|
||||
@Operation(summary = "分页查询仓库")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ShopWarehouse>> page(ShopWarehouseParam param) {
|
||||
public ApiResult<PageResult<ShopStoreWarehouse>> page(ShopStoreWarehouseParam param) {
|
||||
// 使用关联查询
|
||||
return success(shopWarehouseService.pageRel(param));
|
||||
return success(shopStoreWarehouseService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部仓库")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ShopWarehouse>> list(ShopWarehouseParam param) {
|
||||
public ApiResult<List<ShopStoreWarehouse>> list(ShopStoreWarehouseParam param) {
|
||||
// 使用关联查询
|
||||
return success(shopWarehouseService.listRel(param));
|
||||
return success(shopStoreWarehouseService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询仓库")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<ShopWarehouse> get(@PathVariable("id") Integer id) {
|
||||
public ApiResult<ShopStoreWarehouse> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(shopWarehouseService.getByIdRel(id));
|
||||
return success(shopStoreWarehouseService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopWarehouse:save')")
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreWarehouse:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加仓库")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ShopWarehouse shopWarehouse) {
|
||||
public ApiResult<?> save(@RequestBody ShopStoreWarehouse shopStoreWarehouse) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// shopWarehouse.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (shopWarehouseService.save(shopWarehouse)) {
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
shopStoreWarehouse.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (shopStoreWarehouseService.save(shopStoreWarehouse)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopWarehouse:update')")
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreWarehouse:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改仓库")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ShopWarehouse shopWarehouse) {
|
||||
if (shopWarehouseService.updateById(shopWarehouse)) {
|
||||
public ApiResult<?> update(@RequestBody ShopStoreWarehouse shopStoreWarehouse) {
|
||||
if (shopStoreWarehouseService.updateById(shopStoreWarehouse)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopWarehouse:remove')")
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreWarehouse:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除仓库")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (shopWarehouseService.removeById(id)) {
|
||||
if (shopStoreWarehouseService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopWarehouse:save')")
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreWarehouse:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加仓库")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ShopWarehouse> list) {
|
||||
if (shopWarehouseService.saveBatch(list)) {
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ShopStoreWarehouse> list) {
|
||||
if (shopStoreWarehouseService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopWarehouse:update')")
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreWarehouse:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改仓库")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopWarehouse> batchParam) {
|
||||
if (batchParam.update(shopWarehouseService, "id")) {
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopStoreWarehouse> batchParam) {
|
||||
if (batchParam.update(shopStoreWarehouseService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopWarehouse:remove')")
|
||||
@PreAuthorize("hasAuthority('shop:shopStoreWarehouse:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除仓库")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (shopWarehouseService.removeByIds(ids)) {
|
||||
if (shopStoreWarehouseService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
69
src/main/java/com/gxwebsoft/shop/entity/ShopStoreFence.java
Normal file
69
src/main/java/com/gxwebsoft/shop/entity/ShopStoreFence.java
Normal file
@@ -0,0 +1,69 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 黄家明_电子围栏
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ShopStoreFence对象", description = "黄家明_电子围栏")
|
||||
public class ShopStoreFence implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "围栏名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型 0圆形 1方形")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "定位")
|
||||
private String location;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private String longitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private String latitude;
|
||||
|
||||
@Schema(description = "区域")
|
||||
private String district;
|
||||
|
||||
@Schema(description = "电子围栏轮廓")
|
||||
private String points;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -13,12 +13,12 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
* 仓库
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-30 17:46:47
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "ShopWarehouse对象", description = "仓库")
|
||||
public class ShopWarehouse implements Serializable {
|
||||
@Schema(name = "ShopStoreWarehouse对象", description = "仓库")
|
||||
public class ShopStoreWarehouse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.ShopStoreFence;
|
||||
import com.gxwebsoft.shop.param.ShopStoreFenceParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 黄家明_电子围栏Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
public interface ShopStoreFenceMapper extends BaseMapper<ShopStoreFence> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ShopStoreFence>
|
||||
*/
|
||||
List<ShopStoreFence> selectPageRel(@Param("page") IPage<ShopStoreFence> page,
|
||||
@Param("param") ShopStoreFenceParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ShopStoreFence> selectListRel(@Param("param") ShopStoreFenceParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.ShopStoreWarehouse;
|
||||
import com.gxwebsoft.shop.param.ShopStoreWarehouseParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
public interface ShopStoreWarehouseMapper extends BaseMapper<ShopStoreWarehouse> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ShopStoreWarehouse>
|
||||
*/
|
||||
List<ShopStoreWarehouse> selectPageRel(@Param("page") IPage<ShopStoreWarehouse> page,
|
||||
@Param("param") ShopStoreWarehouseParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ShopStoreWarehouse> selectListRel(@Param("param") ShopStoreWarehouseParam param);
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.ShopWarehouse;
|
||||
import com.gxwebsoft.shop.param.ShopWarehouseParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-30 17:46:47
|
||||
*/
|
||||
public interface ShopWarehouseMapper extends BaseMapper<ShopWarehouse> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<ShopWarehouse>
|
||||
*/
|
||||
List<ShopWarehouse> selectPageRel(@Param("page") IPage<ShopWarehouse> page,
|
||||
@Param("param") ShopWarehouseParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<ShopWarehouse> selectListRel(@Param("param") ShopWarehouseParam param);
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
||||
LEFT JOIN shop_store c ON a.store_id = c.id
|
||||
LEFT JOIN shop_store_rider d ON a.rider_id = d.id
|
||||
LEFT JOIN shop_warehouse e ON a.warehouse_id = e.id
|
||||
LEFT JOIN shop_store_warehouse e ON a.warehouse_id = e.id
|
||||
<where>
|
||||
<if test="param.orderId != null">
|
||||
AND a.order_id = #{param.orderId}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.ShopStoreFenceMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_store_fence a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.location != null">
|
||||
AND a.location LIKE CONCAT('%', #{param.location}, '%')
|
||||
</if>
|
||||
<if test="param.longitude != null">
|
||||
AND a.longitude LIKE CONCAT('%', #{param.longitude}, '%')
|
||||
</if>
|
||||
<if test="param.latitude != null">
|
||||
AND a.latitude LIKE CONCAT('%', #{param.latitude}, '%')
|
||||
</if>
|
||||
<if test="param.district != null">
|
||||
AND a.district LIKE CONCAT('%', #{param.district}, '%')
|
||||
</if>
|
||||
<if test="param.points != null">
|
||||
AND a.points LIKE CONCAT('%', #{param.points}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.ShopStoreFence">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.ShopStoreFence">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.ShopWarehouseMapper">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.ShopStoreWarehouseMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_warehouse a
|
||||
FROM shop_store_warehouse a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
@@ -29,13 +29,13 @@
|
||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||
</if>
|
||||
<if test="param.province != null">
|
||||
AND a.province LIKE CONCAT('%', #{param.province}, '%')
|
||||
AND a.province LIKE CONCAT('%', #{param.province}, '%')
|
||||
</if>
|
||||
<if test="param.city != null">
|
||||
AND a.city LIKE CONCAT('%', #{param.city}, '%')
|
||||
AND a.city LIKE CONCAT('%', #{param.city}, '%')
|
||||
</if>
|
||||
<if test="param.region != null">
|
||||
AND a.region LIKE CONCAT('%', #{param.region}, '%')
|
||||
AND a.region LIKE CONCAT('%', #{param.region}, '%')
|
||||
</if>
|
||||
<if test="param.lngAndLat != null">
|
||||
AND a.lng_and_lat LIKE CONCAT('%', #{param.lngAndLat}, '%')
|
||||
@@ -66,12 +66,12 @@
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.ShopWarehouse">
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.ShopStoreWarehouse">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.ShopWarehouse">
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.ShopStoreWarehouse">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 黄家明_电子围栏查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-02-07 18:10:24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "ShopStoreFenceParam对象", description = "黄家明_电子围栏查询参数")
|
||||
public class ShopStoreFenceParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "围栏名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型 0圆形 1方形")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "定位")
|
||||
private String location;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private String longitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private String latitude;
|
||||
|
||||
@Schema(description = "区域")
|
||||
private String district;
|
||||
|
||||
@Schema(description = "电子围栏轮廓")
|
||||
private String points;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -13,13 +13,13 @@ import lombok.EqualsAndHashCode;
|
||||
* 仓库查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-30 17:46:47
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "ShopWarehouseParam对象", description = "仓库查询参数")
|
||||
public class ShopWarehouseParam extends BaseParam {
|
||||
@Schema(name = "ShopStoreWarehouseParam对象", description = "仓库查询参数")
|
||||
public class ShopStoreWarehouseParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@@ -45,15 +45,12 @@ public class ShopWarehouseParam extends BaseParam {
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "所在省份")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String province;
|
||||
|
||||
@Schema(description = "所在城市")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String city;
|
||||
|
||||
@Schema(description = "所在辖区")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String region;
|
||||
|
||||
@Schema(description = "经纬度")
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.ShopStoreFence;
|
||||
import com.gxwebsoft.shop.param.ShopStoreFenceParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 黄家明_电子围栏Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
public interface ShopStoreFenceService extends IService<ShopStoreFence> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<ShopStoreFence>
|
||||
*/
|
||||
PageResult<ShopStoreFence> pageRel(ShopStoreFenceParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<ShopStoreFence>
|
||||
*/
|
||||
List<ShopStoreFence> listRel(ShopStoreFenceParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 自增ID
|
||||
* @return ShopStoreFence
|
||||
*/
|
||||
ShopStoreFence getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.ShopStoreWarehouse;
|
||||
import com.gxwebsoft.shop.param.ShopStoreWarehouseParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
public interface ShopStoreWarehouseService extends IService<ShopStoreWarehouse> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<ShopStoreWarehouse>
|
||||
*/
|
||||
PageResult<ShopStoreWarehouse> pageRel(ShopStoreWarehouseParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<ShopStoreWarehouse>
|
||||
*/
|
||||
List<ShopStoreWarehouse> listRel(ShopStoreWarehouseParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 自增ID
|
||||
* @return ShopStoreWarehouse
|
||||
*/
|
||||
ShopStoreWarehouse getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.ShopWarehouse;
|
||||
import com.gxwebsoft.shop.param.ShopWarehouseParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-30 17:46:48
|
||||
*/
|
||||
public interface ShopWarehouseService extends IService<ShopWarehouse> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<ShopWarehouse>
|
||||
*/
|
||||
PageResult<ShopWarehouse> pageRel(ShopWarehouseParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<ShopWarehouse>
|
||||
*/
|
||||
List<ShopWarehouse> listRel(ShopWarehouseParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 自增ID
|
||||
* @return ShopWarehouse
|
||||
*/
|
||||
ShopWarehouse getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.ShopStoreFenceMapper;
|
||||
import com.gxwebsoft.shop.service.ShopStoreFenceService;
|
||||
import com.gxwebsoft.shop.entity.ShopStoreFence;
|
||||
import com.gxwebsoft.shop.param.ShopStoreFenceParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 黄家明_电子围栏Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
@Service
|
||||
public class ShopStoreFenceServiceImpl extends ServiceImpl<ShopStoreFenceMapper, ShopStoreFence> implements ShopStoreFenceService {
|
||||
|
||||
@Override
|
||||
public PageResult<ShopStoreFence> pageRel(ShopStoreFenceParam param) {
|
||||
PageParam<ShopStoreFence, ShopStoreFenceParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<ShopStoreFence> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopStoreFence> listRel(ShopStoreFenceParam param) {
|
||||
List<ShopStoreFence> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<ShopStoreFence, ShopStoreFenceParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopStoreFence getByIdRel(Integer id) {
|
||||
ShopStoreFenceParam param = new ShopStoreFenceParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.ShopStoreWarehouseMapper;
|
||||
import com.gxwebsoft.shop.service.ShopStoreWarehouseService;
|
||||
import com.gxwebsoft.shop.entity.ShopStoreWarehouse;
|
||||
import com.gxwebsoft.shop.param.ShopStoreWarehouseParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-02-07 18:10:25
|
||||
*/
|
||||
@Service
|
||||
public class ShopStoreWarehouseServiceImpl extends ServiceImpl<ShopStoreWarehouseMapper, ShopStoreWarehouse> implements ShopStoreWarehouseService {
|
||||
|
||||
@Override
|
||||
public PageResult<ShopStoreWarehouse> pageRel(ShopStoreWarehouseParam param) {
|
||||
PageParam<ShopStoreWarehouse, ShopStoreWarehouseParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<ShopStoreWarehouse> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopStoreWarehouse> listRel(ShopStoreWarehouseParam param) {
|
||||
List<ShopStoreWarehouse> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<ShopStoreWarehouse, ShopStoreWarehouseParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopStoreWarehouse getByIdRel(Integer id) {
|
||||
ShopStoreWarehouseParam param = new ShopStoreWarehouseParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.ShopWarehouseMapper;
|
||||
import com.gxwebsoft.shop.service.ShopWarehouseService;
|
||||
import com.gxwebsoft.shop.entity.ShopWarehouse;
|
||||
import com.gxwebsoft.shop.param.ShopWarehouseParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2026-01-30 17:46:48
|
||||
*/
|
||||
@Service
|
||||
public class ShopWarehouseServiceImpl extends ServiceImpl<ShopWarehouseMapper, ShopWarehouse> implements ShopWarehouseService {
|
||||
|
||||
@Override
|
||||
public PageResult<ShopWarehouse> pageRel(ShopWarehouseParam param) {
|
||||
PageParam<ShopWarehouse, ShopWarehouseParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<ShopWarehouse> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopWarehouse> listRel(ShopWarehouseParam param) {
|
||||
List<ShopWarehouse> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<ShopWarehouse, ShopWarehouseParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopWarehouse getByIdRel(Integer id) {
|
||||
ShopWarehouseParam param = new ShopWarehouseParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user