新增球杆类型,品牌,系列,商品等功能CRUD
This commit is contained in:
parent
3b85b8bd40
commit
d32dbefd58
@ -0,0 +1,10 @@
|
||||
package com.tmerclub.cloud.common.validate;
|
||||
|
||||
/**
|
||||
* 校验分组 添加
|
||||
*
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
public interface AddGroup {
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.tmerclub.cloud.common.validate;
|
||||
|
||||
/**
|
||||
* 校验分组 修改
|
||||
*
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
public interface EditGroup {
|
||||
}
|
@ -1,17 +1,97 @@
|
||||
package com.tmerclub.cloud.cuerecycle.controller.admin;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.common.validate.AddGroup;
|
||||
import com.tmerclub.cloud.common.validate.EditGroup;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueBrandDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueBrandVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueBrandService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 球杆品牌
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
@Tag(name = "后管-球杆品牌")
|
||||
@RestController("adminCueBrandController")
|
||||
@RequestMapping("/admin/cueBrand")
|
||||
public class CueBrandController {
|
||||
@Resource
|
||||
CueBrandService cueBrandService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueBrandDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "查询球杆品牌分页列表", description = "查询球杆品牌分页列表")
|
||||
public ServerResponseEntity<PageVO<CueBrandVO>> page(@Valid PageDTO pageDTO, CueBrandDTO cueBrandDTO) {
|
||||
PageVO<CueBrandVO> cueBrandPage = cueBrandService.page(pageDTO, cueBrandDTO);
|
||||
return ServerResponseEntity.success(cueBrandPage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键id获取球杆品牌
|
||||
*
|
||||
* @param brandId 主键id
|
||||
* @return CueBrandVO
|
||||
*/
|
||||
@GetMapping
|
||||
@Operation(summary = "根据id获取球杆品牌", description = "根据id获取球杆品牌")
|
||||
public ServerResponseEntity<CueBrandVO> getById(@RequestParam Long brandId) {
|
||||
CueBrandVO cueBrand = cueBrandService.getById(brandId);
|
||||
return ServerResponseEntity.success(cueBrand);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增球杆品牌
|
||||
*
|
||||
* @param cueBrandDTO CueBrandDTO
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "新增球杆品牌", description = "新增球杆品牌")
|
||||
public ServerResponseEntity<Void> save(@Validated(AddGroup.class) @RequestBody CueBrandDTO cueBrandDTO) {
|
||||
int insert = cueBrandService.save(cueBrandDTO);
|
||||
return insert > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("保存失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改球杆品牌
|
||||
*
|
||||
* @param cueBrandDTO CueBrandDTO
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@PutMapping
|
||||
@Operation(summary = "修改球杆品牌", description = "修改球杆品牌")
|
||||
public ServerResponseEntity<Void> update(@Validated(EditGroup.class) @RequestBody CueBrandDTO cueBrandDTO) {
|
||||
int update = cueBrandService.update(cueBrandDTO);
|
||||
return update > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除球杆品牌
|
||||
*
|
||||
* @param brandId 主键id
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除球杆品牌", description = "删除球杆品牌")
|
||||
public ServerResponseEntity<Void> delete(@RequestParam Long brandId) {
|
||||
int delete = cueBrandService.delete(brandId);
|
||||
return delete > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("删除失败");
|
||||
}
|
||||
}
|
@ -1,17 +1,97 @@
|
||||
package com.tmerclub.cloud.cuerecycle.controller.admin;
|
||||
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.common.validate.AddGroup;
|
||||
import com.tmerclub.cloud.common.validate.EditGroup;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueProductDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueProductVO;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueProductService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 球杆商品
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
@Tag(name = "后管-球杆商品")
|
||||
@RestController("adminCueProductController")
|
||||
@RequestMapping("/admin/cueProduct")
|
||||
public class CueProductController {
|
||||
@Resource
|
||||
CueProductService cueProductService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueProductDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "查询球杆商品分页列表", description = "查询球杆商品分页列表")
|
||||
public ServerResponseEntity<PageVO<CueProductVO>> page(@Valid PageDTO pageDTO, CueProductDTO cueProductDTO) {
|
||||
PageVO<CueProductVO> cueProductPage = cueProductService.page(pageDTO, cueProductDTO);
|
||||
return ServerResponseEntity.success(cueProductPage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键id获取球杆商品
|
||||
*
|
||||
* @param productId 主键id
|
||||
* @return CueProductVO
|
||||
*/
|
||||
@GetMapping
|
||||
@Operation(summary = "根据id获取球杆商品", description = "根据id获取球杆商品")
|
||||
public ServerResponseEntity<CueProductVO> getById(@RequestParam Long productId) {
|
||||
CueProductVO cueProduct = cueProductService.getById(productId);
|
||||
return ServerResponseEntity.success(cueProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增球杆商品
|
||||
*
|
||||
* @param cueProductDTO CueProductDTO
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "新增球杆商品", description = "新增球杆商品")
|
||||
public ServerResponseEntity<Void> save(@Validated(AddGroup.class) @RequestBody CueProductDTO cueProductDTO) {
|
||||
int insert = cueProductService.save(cueProductDTO);
|
||||
return insert > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("保存失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改球杆商品
|
||||
*
|
||||
* @param cueProductDTO CueProductDTO
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@PutMapping
|
||||
@Operation(summary = "修改球杆商品", description = "修改球杆商品")
|
||||
public ServerResponseEntity<Void> update(@Validated(EditGroup.class) @RequestBody CueProductDTO cueProductDTO) {
|
||||
int update = cueProductService.update(cueProductDTO);
|
||||
return update > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除球杆商品
|
||||
*
|
||||
* @param productId 主键id
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除球杆商品", description = "删除球杆商品")
|
||||
public ServerResponseEntity<Void> delete(@RequestParam Long productId) {
|
||||
int delete = cueProductService.delete(productId);
|
||||
return delete > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("删除失败");
|
||||
}
|
||||
}
|
@ -1,17 +1,97 @@
|
||||
package com.tmerclub.cloud.cuerecycle.controller.admin;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.common.validate.AddGroup;
|
||||
import com.tmerclub.cloud.common.validate.EditGroup;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueSeriesDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueSeriesVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueSeriesService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 球杆系列
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
@Tag(name = "后管-球杆系列")
|
||||
@RestController("adminCueSeriesController")
|
||||
@RequestMapping("/admin/cueSeries")
|
||||
public class CueSeriesController {
|
||||
@Resource
|
||||
CueSeriesService cueSeriesService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueSeriesDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "查询球杆系列分页列表", description = "查询球杆系列分页列表")
|
||||
public ServerResponseEntity<PageVO<CueSeriesVO>> page(@Valid PageDTO pageDTO, CueSeriesDTO cueSeriesDTO) {
|
||||
PageVO<CueSeriesVO> cueSeriesPage = cueSeriesService.page(pageDTO, cueSeriesDTO);
|
||||
return ServerResponseEntity.success(cueSeriesPage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键id获取球杆系列
|
||||
*
|
||||
* @param seriesId 主键id
|
||||
* @return CueSeriesVO
|
||||
*/
|
||||
@GetMapping
|
||||
@Operation(summary = "根据id获取球杆系列", description = "根据id获取球杆系列")
|
||||
public ServerResponseEntity<CueSeriesVO> getById(@RequestParam Long seriesId) {
|
||||
CueSeriesVO cueSeries = cueSeriesService.getById(seriesId);
|
||||
return ServerResponseEntity.success(cueSeries);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增球杆系列
|
||||
*
|
||||
* @param cueSeriesDTO CueSeriesDTO
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "新增球杆系列", description = "新增球杆系列")
|
||||
public ServerResponseEntity<Void> save(@Validated(AddGroup.class) @RequestBody CueSeriesDTO cueSeriesDTO) {
|
||||
int insert = cueSeriesService.save(cueSeriesDTO);
|
||||
return insert > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("保存失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改球杆系列
|
||||
*
|
||||
* @param cueSeriesDTO CueSeriesDTO
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@PutMapping
|
||||
@Operation(summary = "修改球杆系列", description = "修改球杆系列")
|
||||
public ServerResponseEntity<Void> update(@Validated(EditGroup.class) @RequestBody CueSeriesDTO cueSeriesDTO) {
|
||||
int update = cueSeriesService.update(cueSeriesDTO);
|
||||
return update > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除球杆系列
|
||||
*
|
||||
* @param seriesId 主键id
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除球杆系列", description = "删除球杆系列")
|
||||
public ServerResponseEntity<Void> delete(@RequestParam Long seriesId) {
|
||||
int delete = cueSeriesService.delete(seriesId);
|
||||
return delete > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("删除失败");
|
||||
}
|
||||
}
|
@ -1,23 +1,26 @@
|
||||
package com.tmerclub.cloud.cuerecycle.controller.admin;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.common.validate.AddGroup;
|
||||
import com.tmerclub.cloud.common.validate.EditGroup;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueTypeDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueTypeVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueTypeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 球杆类型
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11 21:22:35
|
||||
*/
|
||||
@Tag(name = "后管-球杆类型")
|
||||
@RestController("adminCueTypeController")
|
||||
@RequestMapping("/admin/cueType")
|
||||
@ -25,13 +28,70 @@ public class CueTypeController {
|
||||
@Resource
|
||||
CueTypeService cueTypeService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueTypeDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "查询球杆类型分页列表", description = "查询球杆类型分页列表")
|
||||
public ServerResponseEntity<PageVO<CueTypeVO>> page(@Valid PageDTO pageDTO, CueTypeDTO cueTypeDTO) {
|
||||
PageVO<CueTypeVO> cueTypePage = cueTypeService.page(pageDTO, cueTypeDTO);
|
||||
return ServerResponseEntity.success(cueTypePage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键id获取球杆类型
|
||||
*
|
||||
* @param typeId 主键id
|
||||
* @return CueTypeVO
|
||||
*/
|
||||
@GetMapping
|
||||
@Operation(summary = "根据id获取球杆类型", description = "根据id获取球杆类型")
|
||||
public ServerResponseEntity<CueTypeVO> getById(@RequestParam Long typeId) {
|
||||
CueTypeVO cueType = cueTypeService.getById(typeId);
|
||||
return ServerResponseEntity.success(cueType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增球杆类型
|
||||
*
|
||||
* @param cueTypeDTO CueTypeDTO
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "保存球杆类型", description = "保存球杆类型")
|
||||
public ServerResponseEntity<Void> save(@Valid @RequestBody CueTypeDTO couponDTO) {
|
||||
int insert = cueTypeService.insert(couponDTO);
|
||||
if (insert <= 0) {
|
||||
return ServerResponseEntity.showFailMsg("保存球杆类型失败");
|
||||
}
|
||||
return ServerResponseEntity.success();
|
||||
@Operation(summary = "新增球杆类型", description = "新增球杆类型")
|
||||
public ServerResponseEntity<Void> save(@Validated(AddGroup.class) @RequestBody CueTypeDTO cueTypeDTO) {
|
||||
int insert = cueTypeService.save(cueTypeDTO);
|
||||
return insert > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("保存失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改球杆类型
|
||||
*
|
||||
* @param cueTypeDTO CueTypeDTO
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@PutMapping
|
||||
@Operation(summary = "修改球杆类型", description = "修改球杆类型")
|
||||
public ServerResponseEntity<Void> update(@Validated(EditGroup.class) @RequestBody CueTypeDTO cueTypeDTO) {
|
||||
int update = cueTypeService.update(cueTypeDTO);
|
||||
return update > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除球杆类型
|
||||
*
|
||||
* @param typeId 主键id
|
||||
* @return ServerResponseEntity
|
||||
*/
|
||||
@DeleteMapping
|
||||
@Operation(summary = "删除球杆类型", description = "删除球杆类型")
|
||||
public ServerResponseEntity<Void> delete(@RequestParam Long typeId) {
|
||||
int delete = cueTypeService.delete(typeId);
|
||||
return delete > 0 ? ServerResponseEntity.success() : ServerResponseEntity.showFailMsg("删除失败");
|
||||
}
|
||||
}
|
@ -1,6 +1,15 @@
|
||||
package com.tmerclub.cloud.cuerecycle.controller.app;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueBrandVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueBrandService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -14,4 +23,20 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController("appCueBrandController")
|
||||
@RequestMapping("/app/cueBrand")
|
||||
public class CueBrandController {
|
||||
|
||||
@Resource
|
||||
CueBrandService cueBrandService;
|
||||
|
||||
/**
|
||||
* 分页查询启用球杆品牌列表
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @return 球杆品牌分页列表
|
||||
*/
|
||||
@GetMapping("/listEnabled")
|
||||
@Operation(summary = "分页查询启用球杆品牌列表", description = "分页查询启用球杆品牌列表")
|
||||
public ServerResponseEntity<PageVO<CueBrandVO>> listEnabled(@Valid PageDTO pageDTO) {
|
||||
PageVO<CueBrandVO> cueBrandPage = cueBrandService.listEnabled(pageDTO);
|
||||
return ServerResponseEntity.success(cueBrandPage);
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.tmerclub.cloud.cuerecycle.controller.app;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 球杆商品
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
@Tag(name = "App-球杆商品")
|
||||
@RestController("appCueProductController")
|
||||
@RequestMapping("/app/cueProduct")
|
||||
public class CueProductController {
|
||||
}
|
@ -1,6 +1,16 @@
|
||||
package com.tmerclub.cloud.cuerecycle.controller.app;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueSeriesDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueSeriesVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueSeriesService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -14,4 +24,21 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController("appCueSeriesController")
|
||||
@RequestMapping("/app/cueSeries")
|
||||
public class CueSeriesController {
|
||||
|
||||
@Resource
|
||||
CueSeriesService cueSeriesService;
|
||||
|
||||
/**
|
||||
* 分页查询启用球杆系列列表
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueSeriesDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/listByBrand")
|
||||
@Operation(summary = "分页查询启用球杆系列列表", description = "分页查询启用球杆系列列表")
|
||||
public ServerResponseEntity<PageVO<CueSeriesVO>> listByBrand(@Valid PageDTO pageDTO, CueSeriesDTO cueSeriesDTO) {
|
||||
PageVO<CueSeriesVO> cueSeriesPage = cueSeriesService.listByBrand(pageDTO, cueSeriesDTO);
|
||||
return ServerResponseEntity.success(cueSeriesPage);
|
||||
}
|
||||
}
|
@ -1,6 +1,15 @@
|
||||
package com.tmerclub.cloud.cuerecycle.controller.app;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.common.response.ServerResponseEntity;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueTypeVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueTypeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -14,4 +23,21 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController("appCueTypeController")
|
||||
@RequestMapping("/app/cueType")
|
||||
public class CueTypeController {
|
||||
|
||||
@Resource
|
||||
CueTypeService cueTypeService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询启用球杆类型列表
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/listEnabled")
|
||||
@Operation(summary = "分页查询启用球杆类型列表", description = "分页查询启用球杆类型列表")
|
||||
public ServerResponseEntity<PageVO<CueTypeVO>> listEnabled(@Valid PageDTO pageDTO) {
|
||||
PageVO<CueTypeVO> cueTypePage = cueTypeService.listEnabled(pageDTO);
|
||||
return ServerResponseEntity.success(cueTypePage);
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.tmerclub.cloud.cuerecycle.mapper;
|
||||
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueBrand;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueBrandDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueBrandVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -9,57 +10,40 @@ import java.util.List;
|
||||
/**
|
||||
* 球杆品牌Mapper接口
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
public interface CueBrandMapper {
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
* 查询球杆品牌列表
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 球杆品牌
|
||||
* @param cueBrandDTO 查询参数
|
||||
* @return 球杆品牌列表数据
|
||||
*/
|
||||
CueBrand selectById(Long id);
|
||||
List<CueBrandVO> list(@Param("dto") CueBrandDTO cueBrandDTO);
|
||||
|
||||
/**
|
||||
* 根据类型查询
|
||||
* 获取球杆品牌详情
|
||||
*
|
||||
* @param typeId 类型
|
||||
* @return 球杆品牌
|
||||
* @param brandId 主键
|
||||
* @return 球杆品牌详情
|
||||
*/
|
||||
List<CueBrand> listByType(Long typeId);
|
||||
CueBrandVO getById(Long brandId);
|
||||
|
||||
/**
|
||||
* 根据条件查询
|
||||
* 新增球杆品牌
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 球杆品牌
|
||||
* @param cueBrand 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
List<CueBrand> list(CueBrandDTO query);
|
||||
int save(CueBrand cueBrand);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* 修改球杆品牌
|
||||
*
|
||||
* @param brand 球杆品牌
|
||||
* @return 影响行数
|
||||
* @param cueBrand 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int insert(CueBrand brand);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param brand 球杆品牌
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(CueBrand brand);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*
|
||||
* @param id 主键
|
||||
* @param status 状态
|
||||
* @return 影响行数
|
||||
*/
|
||||
int updateStatus(@Param("id") Long id, @Param("status") Integer status);
|
||||
}
|
||||
int update(CueBrand cueBrand);
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
package com.tmerclub.cloud.cuerecycle.mapper;
|
||||
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueProduct;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueProductDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueProductVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueProduct;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -9,56 +10,40 @@ import java.util.List;
|
||||
/**
|
||||
* 球杆商品Mapper接口
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
public interface CueProductMapper {
|
||||
/**
|
||||
* 根据主键id查询
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return 球杆商品
|
||||
*/
|
||||
CueProduct selectById(Long id);
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
public interface CueProductMapper{
|
||||
|
||||
/**
|
||||
* 根据系列id查询列表
|
||||
* 查询球杆商品列表
|
||||
*
|
||||
* @param seriesId 系列id
|
||||
* @return 球杆商品列表
|
||||
* @param cueProductDTO 查询参数
|
||||
* @return 球杆商品列表数据
|
||||
*/
|
||||
List<CueProduct> listBySeries(Long seriesId);
|
||||
List<CueProductVO> list(@Param("dto") CueProductDTO cueProductDTO);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* 获取球杆商品详情
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 球杆商品列表
|
||||
* @param id 主键
|
||||
* @return 球杆商品详情
|
||||
*/
|
||||
List<CueProduct> list(CueProductDTO query);
|
||||
CueProductVO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* 新增球杆商品
|
||||
*
|
||||
* @param product 球杆商品
|
||||
* @return 影响行数
|
||||
* @param cueProduct 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
int insert(CueProduct product);
|
||||
int save(CueProduct cueProduct);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* 修改球杆商品
|
||||
*
|
||||
* @param product 球杆商品
|
||||
* @return 影响行数
|
||||
* @param cueProduct 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int update(CueProduct product);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param status 状态
|
||||
* @return 影响行数
|
||||
*/
|
||||
int updateStatus(@Param("id") Long id, @Param("status") Integer status);
|
||||
}
|
||||
int update(CueProduct cueProduct);
|
||||
}
|
@ -2,6 +2,7 @@ package com.tmerclub.cloud.cuerecycle.mapper;
|
||||
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueSeries;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueSeriesDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueSeriesVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -9,56 +10,40 @@ import java.util.List;
|
||||
/**
|
||||
* 球杆系列Mapper接口
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
public interface CueSeriesMapper {
|
||||
/**
|
||||
* 根据id查询球杆系列
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return 对象
|
||||
*/
|
||||
CueSeries selectById(Long id);
|
||||
|
||||
/**
|
||||
* 根据品牌id查询球杆系列
|
||||
* 查询球杆系列列表
|
||||
*
|
||||
* @param brandId 品牌id
|
||||
* @return 对象集合
|
||||
* @param cueSeriesDTO 查询参数
|
||||
* @return 球杆系列列表数据
|
||||
*/
|
||||
List<CueSeries> listByBrand(Long brandId);
|
||||
List<CueSeriesVO> list(@Param("dto") CueSeriesDTO cueSeriesDTO);
|
||||
|
||||
/**
|
||||
* 根据条件查询球杆系列
|
||||
* 获取球杆系列详情
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 对象集合
|
||||
* @param seriesId 主键
|
||||
* @return 球杆系列详情
|
||||
*/
|
||||
List<CueSeries> list(CueSeriesDTO query);
|
||||
CueSeriesVO getById(Long seriesId);
|
||||
|
||||
/**
|
||||
* 新增球杆系列
|
||||
*
|
||||
* @param series 球杆系列
|
||||
* @return 影响行数
|
||||
* @param cueSeries 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
int insert(CueSeries series);
|
||||
int save(CueSeries cueSeries);
|
||||
|
||||
/**
|
||||
* 更新球杆系列
|
||||
* 修改球杆系列
|
||||
*
|
||||
* @param series 球杆系列
|
||||
* @return 影响行数
|
||||
* @param cueSeries 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int update(CueSeries series);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param status 状态
|
||||
* @return 影响行数
|
||||
*/
|
||||
int updateStatus(@Param("id") Long id, @Param("status") Integer status);
|
||||
int update(CueSeries cueSeries);
|
||||
}
|
@ -2,62 +2,48 @@ package com.tmerclub.cloud.cuerecycle.mapper;
|
||||
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueType;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueTypeDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueTypeVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 球杆类型Mapper接口
|
||||
* 球杆类型表Mapper接口
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11 21:22:35
|
||||
*/
|
||||
public interface CueTypeMapper {
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id 主键id
|
||||
* @return 对象
|
||||
*/
|
||||
CueType selectById(Long id);
|
||||
|
||||
/**
|
||||
* 查询所有启用状态的数据
|
||||
* 查询球杆类型表列表
|
||||
*
|
||||
* @return 对象集合
|
||||
* @param cueTypeDTO 查询参数
|
||||
* @return 球杆类型表列表数据
|
||||
*/
|
||||
List<CueType> listEnabled();
|
||||
List<CueTypeVO> list(@Param("dto") CueTypeDTO cueTypeDTO);
|
||||
|
||||
/**
|
||||
* 根据条件查询
|
||||
* 获取球杆类型表详情
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 对象集合
|
||||
* @param typeId 主键
|
||||
* @return 球杆类型表详情
|
||||
*/
|
||||
List<CueType> list(CueTypeDTO query);
|
||||
CueTypeVO getById(Long typeId);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* 新增球杆类型表
|
||||
*
|
||||
* @param cueType 对象
|
||||
* @return 影响行数
|
||||
* @param cueType 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
int insert(CueType cueType);
|
||||
int save(CueType cueType);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* 修改球杆类型表
|
||||
*
|
||||
* @param cueType 对象
|
||||
* @return 影响行数
|
||||
* @param cueType 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int update(CueType cueType);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param status 状态
|
||||
* @return 影响行数
|
||||
*/
|
||||
int updateStatus(@Param("id") Long id, @Param("status") Integer status);
|
||||
}
|
||||
}
|
@ -10,9 +10,9 @@ import java.io.Serializable;
|
||||
/**
|
||||
* 球杆品牌对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CueBrand extends BaseModel implements Serializable {
|
||||
@ -20,27 +20,27 @@ public class CueBrand extends BaseModel implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* 品牌ID
|
||||
*/
|
||||
private Long id;
|
||||
private Long brandId;
|
||||
/**
|
||||
* 球杆类型id
|
||||
* 品牌名称
|
||||
*/
|
||||
private Long typeId;
|
||||
private String brandName;
|
||||
/**
|
||||
* 球杆品牌名称
|
||||
* 品牌logo
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 球杆品牌logo
|
||||
*/
|
||||
private String logo;
|
||||
private String brandLogo;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Integer brandSeq;
|
||||
/**
|
||||
* 状态
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
private Integer brandStatus;
|
||||
/**
|
||||
* 删除状态 0-未删除 1-已删除
|
||||
*/
|
||||
private Integer deleted;
|
||||
}
|
@ -6,14 +6,13 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 球杆商品对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CueProduct extends BaseModel implements Serializable {
|
||||
@ -21,35 +20,47 @@ public class CueProduct extends BaseModel implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* 商品ID
|
||||
*/
|
||||
private Long id;
|
||||
private Long productId;
|
||||
/**
|
||||
* 系列id
|
||||
* 关联的品牌ID
|
||||
*/
|
||||
private Long brandId;
|
||||
/**
|
||||
* 关联的系列ID
|
||||
*/
|
||||
private Long seriesId;
|
||||
/**
|
||||
* 关联的球杆类型ID
|
||||
*/
|
||||
private Long typeId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String name;
|
||||
private String productName;
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
private String description;
|
||||
private String productDescription;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String images;
|
||||
private String productImages;
|
||||
/**
|
||||
* 商品价格
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
private Long productPrice;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Integer productSeq;
|
||||
/**
|
||||
* 状态
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
private Integer productStatus;
|
||||
/**
|
||||
* 删除状态 0-未删除 1-已删除
|
||||
*/
|
||||
private Integer deleted;
|
||||
}
|
@ -10,9 +10,9 @@ import java.io.Serializable;
|
||||
/**
|
||||
* 球杆系列对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CueSeries extends BaseModel implements Serializable {
|
||||
@ -20,23 +20,27 @@ public class CueSeries extends BaseModel implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* 系列ID
|
||||
*/
|
||||
private Long id;
|
||||
private Long seriesId;
|
||||
/**
|
||||
* 品牌id
|
||||
* 关联的品牌ID
|
||||
*/
|
||||
private Long brandId;
|
||||
/**
|
||||
* 系列名称
|
||||
*/
|
||||
private String name;
|
||||
private String seriesName;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Integer seriesSeq;
|
||||
/**
|
||||
* 状态
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
private Integer seriesStatus;
|
||||
/**
|
||||
* 删除状态 0-未删除 1-已删除
|
||||
*/
|
||||
private Integer deleted;
|
||||
}
|
@ -10,9 +10,9 @@ import java.io.Serializable;
|
||||
/**
|
||||
* 球杆类型对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CueType extends BaseModel implements Serializable {
|
||||
@ -20,23 +20,27 @@ public class CueType extends BaseModel implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 球杆类型id
|
||||
* 类型ID
|
||||
*/
|
||||
private Long id;
|
||||
private Long typeId;
|
||||
/**
|
||||
* 球杆类型名称
|
||||
* 类型名称
|
||||
*/
|
||||
private String name;
|
||||
private String typeName;
|
||||
/**
|
||||
* 球杆类型图片
|
||||
* 类型图片
|
||||
*/
|
||||
private String image;
|
||||
private String typeImage;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Integer typeSeq;
|
||||
/**
|
||||
* 状态
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
private Integer typeStatus;
|
||||
/**
|
||||
* 删除状态 0-未删除 1-已删除
|
||||
*/
|
||||
private Integer deleted;
|
||||
}
|
@ -1,43 +1,50 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import com.tmerclub.cloud.common.validate.AddGroup;
|
||||
import com.tmerclub.cloud.common.validate.EditGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 球杆品牌业务对象
|
||||
* 球杆品牌对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
public class CueBrandDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* 品牌ID
|
||||
*/
|
||||
private Long id;
|
||||
@NotNull(message = "品牌ID不能为空", groups = {EditGroup.class})
|
||||
private Long brandId;
|
||||
/**
|
||||
* 球杆类型id
|
||||
* 品牌名称
|
||||
*/
|
||||
private Long typeId;
|
||||
@NotBlank(message = "品牌名称不能为空", groups = {AddGroup.class})
|
||||
private String brandName;
|
||||
/**
|
||||
* 球杆品牌名称
|
||||
* 品牌logo
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 球杆品牌logo
|
||||
*/
|
||||
private String logo;
|
||||
@NotBlank(message = "品牌Logo不能为空", groups = {AddGroup.class})
|
||||
private String brandLogo;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Integer brandSeq;
|
||||
/**
|
||||
* 状态
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
private Integer brandStatus;
|
||||
/**
|
||||
* 删除状态 0-未删除 1-已删除
|
||||
*/
|
||||
private Integer deleted;
|
||||
}
|
@ -1,52 +1,70 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import com.tmerclub.cloud.common.validate.AddGroup;
|
||||
import com.tmerclub.cloud.common.validate.EditGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 球杆商品业务对象
|
||||
* 球杆商品对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
public class CueProductDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* 商品ID
|
||||
*/
|
||||
private Long id;
|
||||
@NotNull(message = "商品ID不能为空", groups = {EditGroup.class})
|
||||
private Long productId;
|
||||
/**
|
||||
* 系列id
|
||||
* 关联的品牌ID
|
||||
*/
|
||||
@NotNull(message = "未关联球杆品牌", groups = {AddGroup.class})
|
||||
private Long brandId;
|
||||
/**
|
||||
* 关联的系列ID
|
||||
*/
|
||||
@NotNull(message = "未关联球杆系列", groups = {AddGroup.class})
|
||||
private Long seriesId;
|
||||
/**
|
||||
* 关联的球杆类型ID
|
||||
*/
|
||||
@NotNull(message = "未关联球杆类型", groups = {AddGroup.class})
|
||||
private Long typeId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String name;
|
||||
@NotBlank(message = "商品名称不能为空", groups = {AddGroup.class})
|
||||
private String productName;
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
private String description;
|
||||
private String productDescription;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String images;
|
||||
@NotBlank(message = "商品图片不能为空", groups = {AddGroup.class})
|
||||
private String productImages;
|
||||
/**
|
||||
* 商品价格
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
@NotNull(message = "商品价格不能为空", groups = {AddGroup.class})
|
||||
private Long productPrice;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Integer productSeq;
|
||||
/**
|
||||
* 状态
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
private Integer productStatus;
|
||||
}
|
@ -1,39 +1,50 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import com.tmerclub.cloud.common.validate.AddGroup;
|
||||
import com.tmerclub.cloud.common.validate.EditGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 球杆系列业务对象
|
||||
* 球杆系列对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
public class CueSeriesDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* 系列ID
|
||||
*/
|
||||
private Long id;
|
||||
@NotNull(message = "系列ID不能为空", groups = {EditGroup.class})
|
||||
private Long seriesId;
|
||||
/**
|
||||
* 品牌id
|
||||
* 关联的品牌ID
|
||||
*/
|
||||
@NotNull(message = "未关联球杆品牌", groups = {AddGroup.class})
|
||||
private Long brandId;
|
||||
/**
|
||||
* 系列名称
|
||||
*/
|
||||
private String name;
|
||||
@NotBlank(message = "系列名称不能为空", groups = {AddGroup.class})
|
||||
private String seriesName;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Integer seriesSeq;
|
||||
/**
|
||||
* 状态
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
private Integer seriesStatus;
|
||||
/**
|
||||
* 删除状态 0-未删除 1-已删除
|
||||
*/
|
||||
private Integer deleted;
|
||||
}
|
@ -1,38 +1,45 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.dto;
|
||||
|
||||
import com.tmerclub.cloud.common.validate.AddGroup;
|
||||
import com.tmerclub.cloud.common.validate.EditGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 球杆类型业务对象
|
||||
* 球杆类型对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
public class CueTypeDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 球杆类型id
|
||||
* 类型ID
|
||||
*/
|
||||
private Long id;
|
||||
@NotNull(message = "类型ID不能为空", groups = {EditGroup.class})
|
||||
private Long typeId;
|
||||
/**
|
||||
* 球杆类型名称
|
||||
* 类型名称
|
||||
*/
|
||||
private String name;
|
||||
@NotBlank(message = "类型名称不能为空", groups = {AddGroup.class})
|
||||
private String typeName;
|
||||
/**
|
||||
* 球杆类型图片
|
||||
* 类型图片
|
||||
*/
|
||||
private String image;
|
||||
private String typeImage;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Integer typeSeq;
|
||||
/**
|
||||
* 状态
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
private Integer typeStatus;
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.tmerclub.cloud.cuerecycle.model.vo;
|
||||
|
||||
import com.tmerclub.cloud.common.model.BaseModel;
|
||||
import com.tmerclub.cloud.common.vo.BaseVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@ -12,9 +11,9 @@ import java.io.Serializable;
|
||||
/**
|
||||
* 球杆品牌视图对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CueBrandVO extends BaseVO implements Serializable {
|
||||
@ -22,18 +21,28 @@ public class CueBrandVO extends BaseVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* 品牌ID
|
||||
*/
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
@Schema(description = "品牌ID")
|
||||
private Long brandId;
|
||||
/**
|
||||
* 球杆品牌名称
|
||||
* 品牌名称
|
||||
*/
|
||||
@Schema(description = "球杆品牌名称")
|
||||
private String name;
|
||||
@Schema(description = "品牌名称")
|
||||
private String brandName;
|
||||
/**
|
||||
* 球杆品牌logo
|
||||
* 品牌logo
|
||||
*/
|
||||
@Schema(description = "球杆品牌logo")
|
||||
private String logo;
|
||||
@Schema(description = "品牌logo")
|
||||
private String brandLogo;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer brandSeq;
|
||||
/**
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
@Schema(description = "状态:0-禁用,1-启用")
|
||||
private Integer brandStatus;
|
||||
}
|
@ -7,14 +7,13 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 球杆商品视图对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CueProductVO extends BaseVO implements Serializable {
|
||||
@ -22,38 +21,53 @@ public class CueProductVO extends BaseVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* 商品ID
|
||||
*/
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
@Schema(description = "商品ID")
|
||||
private Long productId;
|
||||
/**
|
||||
* 关联的品牌ID
|
||||
*/
|
||||
@Schema(description = "关联的品牌ID")
|
||||
private Long brandId;
|
||||
/**
|
||||
* 关联的系列ID
|
||||
*/
|
||||
@Schema(description = "关联的系列ID")
|
||||
private Long seriesId;
|
||||
/**
|
||||
* 关联的球杆类型ID
|
||||
*/
|
||||
@Schema(description = "关联的球杆类型ID")
|
||||
private Long typeId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description = "商品名称")
|
||||
private String name;
|
||||
private String productName;
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
@Schema(description = "商品描述")
|
||||
private String description;
|
||||
private String productDescription;
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
@Schema(description = "商品图片")
|
||||
private String images;
|
||||
private String productImages;
|
||||
/**
|
||||
* 商品价格
|
||||
* 价格
|
||||
*/
|
||||
@Schema(description = "商品价格")
|
||||
private BigDecimal price;
|
||||
@Schema(description = "价格")
|
||||
private Long productPrice;
|
||||
/**
|
||||
* 品牌名称
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "品牌名称")
|
||||
private String brandName;
|
||||
@Schema(description = "排序")
|
||||
private Integer productSeq;
|
||||
/**
|
||||
* 品牌logo
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
@Schema(description = "品牌logo")
|
||||
private String brandLogo;
|
||||
}
|
||||
@Schema(description = "状态:0-禁用,1-启用")
|
||||
private Integer productStatus;
|
||||
}
|
@ -11,9 +11,9 @@ import java.io.Serializable;
|
||||
/**
|
||||
* 球杆系列视图对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CueSeriesVO extends BaseVO implements Serializable {
|
||||
@ -21,13 +21,28 @@ public class CueSeriesVO extends BaseVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* 系列ID
|
||||
*/
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
@Schema(description = "系列ID")
|
||||
private Long seriesId;
|
||||
/**
|
||||
* 关联的品牌ID
|
||||
*/
|
||||
@Schema(description = "关联的品牌ID")
|
||||
private Long brandId;
|
||||
/**
|
||||
* 系列名称
|
||||
*/
|
||||
@Schema(description = "系列名称")
|
||||
private String name;
|
||||
}
|
||||
private String seriesName;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer seriesSeq;
|
||||
/**
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
@Schema(description = "状态:0-禁用,1-启用")
|
||||
private Integer seriesStatus;
|
||||
}
|
@ -11,9 +11,9 @@ import java.io.Serializable;
|
||||
/**
|
||||
* 球杆类型视图对象
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-10
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CueTypeVO extends BaseVO implements Serializable {
|
||||
@ -21,18 +21,28 @@ public class CueTypeVO extends BaseVO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 球杆类型id
|
||||
* 类型ID
|
||||
*/
|
||||
@Schema(description = "球杆类型id")
|
||||
private Long id;
|
||||
@Schema(description = "类型ID")
|
||||
private Long typeId;
|
||||
/**
|
||||
* 球杆类型名称
|
||||
* 类型名称
|
||||
*/
|
||||
@Schema(description = "球杆类型名称")
|
||||
private String name;
|
||||
@Schema(description = "类型名称")
|
||||
private String typeName;
|
||||
/**
|
||||
* 球杆类型图片
|
||||
* 类型图片
|
||||
*/
|
||||
@Schema(description = "球杆类型图片")
|
||||
private String image;
|
||||
}
|
||||
@Schema(description = "类型图片")
|
||||
private String typeImage;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer typeSeq;
|
||||
/**
|
||||
* 状态:0-禁用,1-启用
|
||||
*/
|
||||
@Schema(description = "状态:0-禁用,1-启用")
|
||||
private Integer typeStatus;
|
||||
}
|
@ -1,10 +1,63 @@
|
||||
package com.tmerclub.cloud.cuerecycle.service;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueBrandDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueBrandVO;
|
||||
|
||||
/**
|
||||
* 球杆品牌Service接口
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-11
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
public interface CueBrandService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取球杆品牌分页列表
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueBrandDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
PageVO<CueBrandVO> page(PageDTO pageDTO, CueBrandDTO cueBrandDTO);
|
||||
|
||||
/**
|
||||
* 根据类型查询
|
||||
*
|
||||
* @return 球杆品牌
|
||||
*/
|
||||
PageVO<CueBrandVO> listEnabled(PageDTO pageDTO);
|
||||
|
||||
/**
|
||||
* 获取球杆品牌详情
|
||||
*
|
||||
* @param brandId 主键
|
||||
* @return 球杆品牌详情
|
||||
*/
|
||||
CueBrandVO getById(Long brandId);
|
||||
|
||||
/**
|
||||
* 新增球杆品牌
|
||||
*
|
||||
* @param cueBrandDTO 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
int save(CueBrandDTO cueBrandDTO);
|
||||
|
||||
/**
|
||||
* 修改球杆品牌
|
||||
*
|
||||
* @param cueBrandDTO 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int update(CueBrandDTO cueBrandDTO);
|
||||
|
||||
/**
|
||||
* 删除球杆品牌
|
||||
*
|
||||
* @param brandId 主键
|
||||
* @return 删除结果
|
||||
*/
|
||||
int delete(Long brandId);
|
||||
}
|
@ -1,10 +1,56 @@
|
||||
package com.tmerclub.cloud.cuerecycle.service;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueProductDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueProductVO;
|
||||
|
||||
/**
|
||||
* 球杆商品Service接口
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-11
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
public interface CueProductService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取球杆商品分页列表
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueProductDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
PageVO<CueProductVO> page(PageDTO pageDTO,CueProductDTO cueProductDTO);
|
||||
|
||||
/**
|
||||
* 获取球杆商品详情
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 球杆商品详情
|
||||
*/
|
||||
CueProductVO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增球杆商品
|
||||
*
|
||||
* @param cueProductDTO 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
int save(CueProductDTO cueProductDTO);
|
||||
|
||||
/**
|
||||
* 修改球杆商品
|
||||
*
|
||||
* @param cueProductDTO 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int update(CueProductDTO cueProductDTO);
|
||||
|
||||
/**
|
||||
* 删除球杆商品
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 删除结果
|
||||
*/
|
||||
int delete(Long id);
|
||||
}
|
@ -1,10 +1,64 @@
|
||||
package com.tmerclub.cloud.cuerecycle.service;
|
||||
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueSeriesDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueSeriesVO;
|
||||
|
||||
/**
|
||||
* 球杆系列Service接口
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-11
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
public interface CueSeriesService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取球杆系列分页列表
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueSeriesDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
PageVO<CueSeriesVO> page(PageDTO pageDTO, CueSeriesDTO cueSeriesDTO);
|
||||
|
||||
/**
|
||||
* 根据品牌id查询球杆系列
|
||||
*
|
||||
* @param cueSeriesDTO 搜索参数
|
||||
* @return 对象集合
|
||||
*/
|
||||
PageVO<CueSeriesVO> listByBrand(PageDTO pageDTO, CueSeriesDTO cueSeriesDTO);
|
||||
|
||||
/**
|
||||
* 获取球杆系列详情
|
||||
*
|
||||
* @param seriesId 主键
|
||||
* @return 球杆系列详情
|
||||
*/
|
||||
CueSeriesVO getById(Long seriesId);
|
||||
|
||||
/**
|
||||
* 新增球杆系列
|
||||
*
|
||||
* @param cueSeriesDTO 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
int save(CueSeriesDTO cueSeriesDTO);
|
||||
|
||||
/**
|
||||
* 修改球杆系列
|
||||
*
|
||||
* @param cueSeriesDTO 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int update(CueSeriesDTO cueSeriesDTO);
|
||||
|
||||
/**
|
||||
* 删除球杆系列
|
||||
*
|
||||
* @param seriesId 主键
|
||||
* @return 删除结果
|
||||
*/
|
||||
int delete(Long seriesId);
|
||||
}
|
@ -1,39 +1,64 @@
|
||||
package com.tmerclub.cloud.cuerecycle.service;
|
||||
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueType;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueTypeDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueTypeVO;
|
||||
|
||||
/**
|
||||
* 球杆类型Service接口
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-11
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11 21:22:35
|
||||
*/
|
||||
public interface CueTypeService {
|
||||
|
||||
/**
|
||||
* 获取球杆类型分页列表
|
||||
*
|
||||
* @param pageDTO 分页参数
|
||||
* @param cueTypeDTO 查询参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
PageVO<CueTypeVO> page(PageDTO pageDTO, CueTypeDTO cueTypeDTO);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* 查询已启动球杆类型列表
|
||||
*
|
||||
* @param couponDTO 对象
|
||||
* @return 影响行数
|
||||
* @param pageDTO 分页参数
|
||||
* @return 分页数据
|
||||
*/
|
||||
int insert(CueTypeDTO couponDTO);
|
||||
PageVO<CueTypeVO> listEnabled(PageDTO pageDTO);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* 获取球杆类型详情
|
||||
*
|
||||
* @param cueType 对象
|
||||
* @return 影响行数
|
||||
* @param typeId 主键
|
||||
* @return 球杆类型详情
|
||||
*/
|
||||
int update(CueType cueType);
|
||||
CueTypeVO getById(Long typeId);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* 新增球杆类型
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param status 状态
|
||||
* @return 影响行数
|
||||
* @param cueTypeDTO 新增参数
|
||||
* @return 新增结果
|
||||
*/
|
||||
int updateStatus(Long id, Integer status);
|
||||
}
|
||||
int save(CueTypeDTO cueTypeDTO);
|
||||
|
||||
/**
|
||||
* 修改球杆类型
|
||||
*
|
||||
* @param cueTypeDTO 修改参数
|
||||
* @return 修改结果
|
||||
*/
|
||||
int update(CueTypeDTO cueTypeDTO);
|
||||
|
||||
/**
|
||||
* 删除球杆类型
|
||||
*
|
||||
* @param typeId 主键
|
||||
* @return 删除结果
|
||||
*/
|
||||
int delete(Long typeId);
|
||||
}
|
@ -1,18 +1,67 @@
|
||||
package com.tmerclub.cloud.cuerecycle.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.tmerclub.cloud.common.database.util.PageUtil;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueBrandDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueBrandVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueBrand;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueBrandMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueBrandService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 球杆品牌Service接口
|
||||
* 球杆品牌Service实现类
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-11
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
@Service
|
||||
public class CueBrandServiceImpl implements CueBrandService {
|
||||
|
||||
@Resource
|
||||
CueBrandMapper cueBrandMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageVO<CueBrandVO> page(PageDTO pageDTO, CueBrandDTO cueBrandDTO) {
|
||||
return PageUtil.doPage(pageDTO, () -> cueBrandMapper.list(cueBrandDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageVO<CueBrandVO> listEnabled(PageDTO pageDTO) {
|
||||
CueBrandDTO cueBrandDTO = new CueBrandDTO();
|
||||
cueBrandDTO.setBrandStatus(1);
|
||||
return PageUtil.doPage(pageDTO, () -> cueBrandMapper.list(cueBrandDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CueBrandVO getById(Long brandId) {
|
||||
return cueBrandMapper.getById(brandId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(CueBrandDTO cueBrandDTO) {
|
||||
CueBrand cueBrand = BeanUtil.toBean(cueBrandDTO, CueBrand.class);
|
||||
cueBrand.setCreateTime(DateUtil.date());
|
||||
return cueBrandMapper.save(cueBrand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(CueBrandDTO cueBrandDTO) {
|
||||
CueBrand cueBrand = BeanUtil.toBean(cueBrandDTO, CueBrand.class);
|
||||
cueBrand.setUpdateTime(DateUtil.date());
|
||||
return cueBrandMapper.update(cueBrand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Long brandId) {
|
||||
CueBrandVO cueBrandVO = cueBrandMapper.getById(brandId);
|
||||
CueBrand cueBrand = BeanUtil.toBean(cueBrandVO, CueBrand.class);
|
||||
cueBrand.setUpdateTime(DateUtil.date());
|
||||
cueBrand.setDeleted(1);
|
||||
return cueBrandMapper.update(cueBrand);
|
||||
}
|
||||
}
|
@ -1,14 +1,60 @@
|
||||
package com.tmerclub.cloud.cuerecycle.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.tmerclub.cloud.common.database.util.PageUtil;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueProductDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueProductVO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueProduct;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueProductMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueProductService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 球杆商品Service接口
|
||||
* 球杆商品Service实现类
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-11
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
@Service
|
||||
public class CueProductServiceImpl implements CueProductService {
|
||||
}
|
||||
|
||||
@Resource
|
||||
CueProductMapper cueProductMapper;
|
||||
|
||||
@Override
|
||||
public PageVO<CueProductVO> page(PageDTO pageDTO, CueProductDTO cueProductDTO) {
|
||||
return PageUtil.doPage(pageDTO, () -> cueProductMapper.list(cueProductDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CueProductVO getById(Long id) {
|
||||
return cueProductMapper.getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(CueProductDTO cueProductDTO) {
|
||||
CueProduct cueProduct = BeanUtil.toBean(cueProductDTO, CueProduct.class);
|
||||
cueProduct.setCreateTime(DateUtil.date());
|
||||
return cueProductMapper.save(cueProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(CueProductDTO cueProductDTO) {
|
||||
CueProduct cueProduct = BeanUtil.toBean(cueProductDTO, CueProduct.class);
|
||||
cueProduct.setUpdateTime(DateUtil.date());
|
||||
return cueProductMapper.update(cueProduct);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Long id) {
|
||||
CueProductVO cueProductVO = cueProductMapper.getById(id);
|
||||
CueProduct cueProduct = BeanUtil.toBean(cueProductVO, CueProduct.class);
|
||||
cueProduct.setUpdateTime(DateUtil.date());
|
||||
cueProduct.setDeleted(1);
|
||||
return cueProductMapper.update(cueProduct);
|
||||
}
|
||||
}
|
@ -1,14 +1,66 @@
|
||||
package com.tmerclub.cloud.cuerecycle.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.util.PageUtil;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueSeriesMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueSeries;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueSeriesDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueSeriesVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueSeriesService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 球杆系列Service接口
|
||||
* 球杆系列Service实现类
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-11
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11
|
||||
*/
|
||||
@Service
|
||||
public class CueSeriesServiceImpl implements CueSeriesService {
|
||||
}
|
||||
|
||||
@Resource
|
||||
CueSeriesMapper cueSeriesMapper;
|
||||
|
||||
@Override
|
||||
public PageVO<CueSeriesVO> page(PageDTO pageDTO, CueSeriesDTO cueSeriesDTO) {
|
||||
return PageUtil.doPage(pageDTO, () -> cueSeriesMapper.list(cueSeriesDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageVO<CueSeriesVO> listByBrand(PageDTO pageDTO, CueSeriesDTO cueSeriesDTO) {
|
||||
cueSeriesDTO.setSeriesStatus(1);
|
||||
return PageUtil.doPage(pageDTO, () -> cueSeriesMapper.list(cueSeriesDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CueSeriesVO getById(Long seriesId) {
|
||||
return cueSeriesMapper.getById(seriesId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(CueSeriesDTO cueSeriesDTO) {
|
||||
CueSeries cueSeries = BeanUtil.toBean(cueSeriesDTO, CueSeries.class);
|
||||
cueSeries.setCreateTime(DateUtil.date());
|
||||
return cueSeriesMapper.save(cueSeries);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(CueSeriesDTO cueSeriesDTO) {
|
||||
CueSeries cueSeries = BeanUtil.toBean(cueSeriesDTO, CueSeries.class);
|
||||
cueSeries.setUpdateTime(DateUtil.date());
|
||||
return cueSeriesMapper.update(cueSeries);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Long seriesId) {
|
||||
CueSeriesVO cueSeriesVO = cueSeriesMapper.getById(seriesId);
|
||||
CueSeries cueSeries = BeanUtil.toBean(cueSeriesVO, CueSeries.class);
|
||||
cueSeries.setUpdateTime(DateUtil.date());
|
||||
cueSeries.setDeleted(1);
|
||||
return cueSeriesMapper.update(cueSeries);
|
||||
}
|
||||
}
|
@ -2,40 +2,66 @@ package com.tmerclub.cloud.cuerecycle.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.tmerclub.cloud.common.database.dto.PageDTO;
|
||||
import com.tmerclub.cloud.common.database.util.PageUtil;
|
||||
import com.tmerclub.cloud.common.database.vo.PageVO;
|
||||
import com.tmerclub.cloud.cuerecycle.mapper.CueTypeMapper;
|
||||
import com.tmerclub.cloud.cuerecycle.model.CueType;
|
||||
import com.tmerclub.cloud.cuerecycle.model.dto.CueTypeDTO;
|
||||
import com.tmerclub.cloud.cuerecycle.model.vo.CueTypeVO;
|
||||
import com.tmerclub.cloud.cuerecycle.service.CueTypeService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 球杆类型Service接口
|
||||
* 球杆类型表Service实现类
|
||||
*
|
||||
* @author: frank
|
||||
* @create: 2025-04-11
|
||||
**/
|
||||
* @author : frank
|
||||
* @create : 2025-04-11 21:22:35
|
||||
*/
|
||||
@Service
|
||||
public class CueTypeServiceImpl implements CueTypeService {
|
||||
|
||||
@Resource
|
||||
CueTypeMapper cueTypeMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public int insert(CueTypeDTO couponDTO) {
|
||||
CueType cueType = BeanUtil.toBean(couponDTO, CueType.class);
|
||||
cueType.setCreateTime(DateUtil.date());
|
||||
return cueTypeMapper.insert(cueType);
|
||||
public PageVO<CueTypeVO> page(PageDTO pageDTO, CueTypeDTO cueTypeDTO) {
|
||||
return PageUtil.doPage(pageDTO, () -> cueTypeMapper.list(cueTypeDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(CueType cueType) {
|
||||
public PageVO<CueTypeVO> listEnabled(PageDTO pageDTO) {
|
||||
CueTypeDTO cueTypeDTO = new CueTypeDTO();
|
||||
cueTypeDTO.setTypeStatus(1);
|
||||
return PageUtil.doPage(pageDTO, () -> cueTypeMapper.list(cueTypeDTO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CueTypeVO getById(Long typeId) {
|
||||
return cueTypeMapper.getById(typeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(CueTypeDTO cueTypeDTO) {
|
||||
CueType cueType = BeanUtil.toBean(cueTypeDTO, CueType.class);
|
||||
cueType.setCreateTime(DateUtil.date());
|
||||
return cueTypeMapper.save(cueType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(CueTypeDTO cueTypeDTO) {
|
||||
CueType cueType = BeanUtil.toBean(cueTypeDTO, CueType.class);
|
||||
cueType.setUpdateTime(DateUtil.date());
|
||||
return cueTypeMapper.update(cueType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateStatus(Long id, Integer status) {
|
||||
return cueTypeMapper.updateStatus(id, status);
|
||||
public int delete(Long typeId) {
|
||||
CueTypeVO cueTypeVO = cueTypeMapper.getById(typeId);
|
||||
CueType cueType = BeanUtil.toBean(cueTypeVO, CueType.class);
|
||||
cueType.setUpdateTime(DateUtil.date());
|
||||
cueType.setDeleted(1);
|
||||
return cueTypeMapper.update(cueType);
|
||||
}
|
||||
}
|
@ -1,80 +1,62 @@
|
||||
<?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.tmerclub.cloud.cuerecycle.mapper.CueBrandMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.tmerclub.cloud.cuerecycle.model.CueBrand">
|
||||
<id column="id" property="id"/>
|
||||
<result column="type_id" property="typeId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="logo" property="logo"/>
|
||||
<result column="sort" property="sort"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap id="cueBrandVOMap" type="com.tmerclub.cloud.cuerecycle.model.vo.CueBrandVO">
|
||||
<result property="brandId" column="brand_id"/>
|
||||
<result property="brandName" column="brand_name"/>
|
||||
<result property="brandLogo" column="brand_logo"/>
|
||||
<result property="brandSeq" column="brand_seq"/>
|
||||
<result property="brandStatus" column="brand_status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, type_id, name, logo, image, sort, status, create_time, update_time
|
||||
<sql id="Vo_Column_List">
|
||||
brand_id,brand_name,brand_logo,brand_seq,brand_status,deleted,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
<select id="list" resultMap="cueBrandVOMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
cue_brand
|
||||
WHERE
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="listByType" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
cue_brand
|
||||
WHERE
|
||||
type_id = #{typeId}
|
||||
AND status = 1
|
||||
ORDER BY
|
||||
sort ASC,
|
||||
id DESC
|
||||
</select>
|
||||
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
cue_brand
|
||||
<include refid="Vo_Column_List" />
|
||||
FROM cue_brand
|
||||
<where>
|
||||
<if test="typeId != null">
|
||||
AND type_id = #{typeId}
|
||||
deleted = 0
|
||||
<if test="dto.brandName != null and dto.brandName != ''">
|
||||
AND brand_name LIKE CONCAT('%', #{dto.brandName}, '%')
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
<if test="dto.brandStatus != null">
|
||||
AND brand_status = #{dto.brandStatus}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sort ASC, id DESC
|
||||
ORDER BY
|
||||
brand_seq ASC,
|
||||
brand_id DESC
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO cue_brand
|
||||
<select id="getById" resultMap="cueBrandVOMap">
|
||||
SELECT
|
||||
<include refid="Vo_Column_List" />
|
||||
FROM cue_brand
|
||||
WHERE brand_id = #{brandId}
|
||||
</select>
|
||||
|
||||
<insert id="save" useGeneratedKeys="true" keyProperty="brandId">
|
||||
INSERT INTO cue_brand
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null">type_id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="logo != null">logo,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="brandName != null and brandName != ''">brand_name,</if>
|
||||
<if test="brandLogo != null and brandLogo != ''">brand_logo,</if>
|
||||
<if test="brandSeq != null">brand_seq,</if>
|
||||
<if test="brandStatus != null">brand_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="logo != null">#{logo},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="brandName != null and brandName != ''">#{brandName},</if>
|
||||
<if test="brandLogo != null and brandLogo != ''">#{brandLogo},</if>
|
||||
<if test="brandSeq != null">#{brandSeq},</if>
|
||||
<if test="brandStatus != null">#{brandStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@ -82,20 +64,25 @@
|
||||
<update id="update">
|
||||
UPDATE cue_brand
|
||||
<set>
|
||||
<if test="typeId != null">type_id = #{typeId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="logo != null">logo = #{logo},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="brandName != null and brandName != ''">
|
||||
brand_name = #{brandName},
|
||||
</if>
|
||||
<if test="brandLogo != null and brandLogo != ''">
|
||||
brand_logo = #{brandLogo},
|
||||
</if>
|
||||
<if test="brandSeq != null">
|
||||
brand_seq = #{brandSeq},
|
||||
</if>
|
||||
<if test="brandStatus != null">
|
||||
brand_status = #{brandStatus},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateStatus">
|
||||
UPDATE
|
||||
cue_brand
|
||||
SET
|
||||
status = #{status}
|
||||
WHERE
|
||||
id = #{id}
|
||||
where brand_id = #{brandId}
|
||||
</update>
|
||||
</mapper>
|
@ -1,80 +1,130 @@
|
||||
<?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.tmerclub.cloud.cuerecycle.mapper.CueProductMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.tmerclub.cloud.cuerecycle.model.CueProduct">
|
||||
<id column="id" property="id"/>
|
||||
<result column="series_id" property="seriesId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="images" property="images"/>
|
||||
<result column="price" property="price"/>
|
||||
<result column="sort" property="sort"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap id="cueProductVOMap" type="com.tmerclub.cloud.cuerecycle.model.vo.CueProductVO">
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="brandId" column="brand_id"/>
|
||||
<result property="seriesId" column="series_id"/>
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="productDescription" column="product_description"/>
|
||||
<result property="productImages" column="product_images"/>
|
||||
<result property="productPrice" column="product_price"/>
|
||||
<result property="productSeq" column="product_seq"/>
|
||||
<result property="productStatus" column="product_status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, series_id, name, description, images, price, sort, status, create_time, update_time
|
||||
<sql id="Vo_Column_List">
|
||||
product_id,brand_id,series_id,type_id,product_name,product_description,product_images,product_price,product_seq,product_status,deleted,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM cue_product
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="listBySeries" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM cue_product
|
||||
WHERE series_id = #{seriesId}
|
||||
AND status = 1
|
||||
ORDER BY sort ASC, id DESC
|
||||
</select>
|
||||
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM cue_product
|
||||
<select id="list" resultMap="cueProductVOMap">
|
||||
SELECT
|
||||
<include refid="Vo_Column_List" />
|
||||
FROM
|
||||
cue_product
|
||||
<where>
|
||||
<if test="seriesId != null">
|
||||
AND series_id = #{seriesId}
|
||||
deleted = 0
|
||||
<if test="dto.productName != null and dto.productName != ''">
|
||||
AND product_name LIKE CONCAT('%', #{dto.productName}, '%')
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name LIKE CONCAT('%', #{name}, '%')
|
||||
<if test="dto.productStatus != null">
|
||||
AND product_status = #{dto.productStatus}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
<if test="dto.brandId != null">
|
||||
AND brand_id = #{dto.brandId}
|
||||
</if>
|
||||
<if test="dto.typeId != null">
|
||||
AND type_id = #{dto.typeId}
|
||||
</if>
|
||||
<if test="dto.seriesId != null">
|
||||
AND series_id = #{dto.seriesId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sort ASC, id DESC
|
||||
ORDER BY
|
||||
product_seq ASC,
|
||||
product_id DESC
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO cue_product (series_id, name, description, images, price, sort, status)
|
||||
VALUES (#{seriesId}, #{name}, #{description}, #{images}, #{price}, #{sort}, #{status})
|
||||
<select id="getById" resultMap="cueProductVOMap">
|
||||
SELECT
|
||||
<include refid="Vo_Column_List" />
|
||||
FROM
|
||||
cue_product
|
||||
WHERE
|
||||
product_id = #{productId}
|
||||
</select>
|
||||
|
||||
<insert id="save" useGeneratedKeys="true" keyProperty="productId">
|
||||
INSERT INTO cue_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="brandId != null">brand_id,</if>
|
||||
<if test="seriesId != null">series_id,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
<if test="productName != null and productName != ''">product_name,</if>
|
||||
<if test="productDescription != null and productDescription != ''">product_description,</if>
|
||||
<if test="productImages != null and productImages != ''">product_images,</if>
|
||||
<if test="productPrice != null">product_price,</if>
|
||||
<if test="productSeq != null">product_seq,</if>
|
||||
<if test="productStatus != null">product_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="brandId != null">#{brandId},</if>
|
||||
<if test="seriesId != null">#{seriesId},</if>
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
<if test="productName != null and productName != ''">#{productName},</if>
|
||||
<if test="productDescription != null and productDescription != ''">#{productDescription},</if>
|
||||
<if test="productImages != null and productImages != ''">#{productImages},</if>
|
||||
<if test="productPrice != null">#{productPrice},</if>
|
||||
<if test="productSeq != null">#{productSeq},</if>
|
||||
<if test="productStatus != null">#{productStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE cue_product
|
||||
<set>
|
||||
<if test="seriesId != null">series_id = #{seriesId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="images != null">images = #{images},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="brandId != null">
|
||||
brand_id = #{brandId},
|
||||
</if>
|
||||
<if test="seriesId != null">
|
||||
series_id = #{seriesId},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id = #{typeId},
|
||||
</if>
|
||||
<if test="productName != null and productName != ''">
|
||||
product_name = #{productName},
|
||||
</if>
|
||||
<if test="productDescription != null and productDescription != ''">
|
||||
product_description = #{productDescription},
|
||||
</if>
|
||||
<if test="productImages != null and productImages != ''">
|
||||
product_images = #{productImages},
|
||||
</if>
|
||||
<if test="productPrice != null">
|
||||
product_price = #{productPrice},
|
||||
</if>
|
||||
<if test="productSeq != null">
|
||||
product_seq = #{productSeq},
|
||||
</if>
|
||||
<if test="productStatus != null">
|
||||
product_status = #{productStatus},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateStatus">
|
||||
UPDATE
|
||||
cue_product
|
||||
SET
|
||||
status = #{status}
|
||||
WHERE
|
||||
id = #{id}
|
||||
where product_id = #{productId}
|
||||
</update>
|
||||
</mapper>
|
@ -1,79 +1,67 @@
|
||||
<?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.tmerclub.cloud.cuerecycle.mapper.CueSeriesMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.tmerclub.cloud.cuerecycle.model.CueSeries">
|
||||
<id column="id" property="id"/>
|
||||
<result column="brand_id" property="brandId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="sort" property="sort"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap id="cueSeriesVOMap" type="com.tmerclub.cloud.cuerecycle.model.vo.CueSeriesVO">
|
||||
<result property="seriesId" column="series_id"/>
|
||||
<result property="brandId" column="brand_id"/>
|
||||
<result property="seriesName" column="series_name"/>
|
||||
<result property="seriesSeq" column="series_seq"/>
|
||||
<result property="seriesStatus" column="series_status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, brand_id, name, sort, status, create_time, update_time
|
||||
<sql id="Vo_Column_List">
|
||||
series_id,brand_id,series_name,series_seq,series_status,deleted,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
<select id="list" resultMap="cueSeriesVOMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
cue_series
|
||||
WHERE
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="listByBrand" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
cue_series
|
||||
WHERE
|
||||
brand_id = #{brandId}
|
||||
AND status = 1
|
||||
ORDER BY
|
||||
sort ASC,
|
||||
id DESC
|
||||
</select>
|
||||
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
cue_series
|
||||
<include refid="Vo_Column_List" />
|
||||
FROM cue_series
|
||||
<where>
|
||||
<if test="brandId != null">
|
||||
AND brand_id =
|
||||
#{brandId}
|
||||
deleted = 0
|
||||
<if test="dto.seriesName != null and dto.seriesName != ''">
|
||||
AND series_name LIKE CONCAT('%', #{dto.seriesName}, '%')
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name LIKE CONCAT('%',#{name},'%')
|
||||
<if test="dto.seriesStatus != null">
|
||||
AND series_status = #{dto.seriesStatus}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
<if test="dto.brandId != null">
|
||||
AND brand_id = #{dto.brandId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
sort ASC,
|
||||
id DESC
|
||||
series_seq ASC,
|
||||
series_id DESC
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
<select id="getById" resultMap="cueSeriesVOMap">
|
||||
SELECT
|
||||
<include refid="Vo_Column_List" />
|
||||
FROM
|
||||
cue_series
|
||||
WHERE
|
||||
series_id = #{seriesId}
|
||||
</select>
|
||||
|
||||
<insert id="save" useGeneratedKeys="true" keyProperty="seriesId">
|
||||
INSERT INTO cue_series
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="brandId != null">brand_id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="seriesName != null and seriesName != ''">series_name,</if>
|
||||
<if test="seriesSeq != null">series_seq,</if>
|
||||
<if test="seriesStatus != null">series_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="brandId != null">#{brandId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="seriesName != null and seriesName != ''">#{seriesName},</if>
|
||||
<if test="seriesSeq != null">#{seriesSeq},</if>
|
||||
<if test="seriesStatus != null">#{seriesStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@ -81,21 +69,25 @@
|
||||
<update id="update">
|
||||
UPDATE cue_series
|
||||
<set>
|
||||
<if test="brandId != null">brand_id = #{brandId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="brandId != null">
|
||||
brand_id = #{brandId},
|
||||
</if>
|
||||
<if test="seriesName != null and seriesName != ''">
|
||||
series_name = #{seriesName},
|
||||
</if>
|
||||
<if test="seriesSeq != null">
|
||||
series_seq = #{seriesSeq},
|
||||
</if>
|
||||
<if test="seriesStatus != null">
|
||||
series_status = #{seriesStatus},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateStatus">
|
||||
UPDATE
|
||||
cue_series
|
||||
SET
|
||||
status = #{status}
|
||||
WHERE
|
||||
id = #{id}
|
||||
where series_id = #{seriesId}
|
||||
</update>
|
||||
</mapper>
|
@ -1,74 +1,64 @@
|
||||
<?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.tmerclub.cloud.cuerecycle.mapper.CueTypeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.tmerclub.cloud.cuerecycle.model.CueType">
|
||||
<id column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="image" property="image"/>
|
||||
<result column="sort" property="sort"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap id="cueTypeVOMap" type="com.tmerclub.cloud.cuerecycle.model.vo.CueTypeVO">
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="typeName" column="type_name"/>
|
||||
<result property="typeImage" column="type_image"/>
|
||||
<result property="typeSeq" column="type_seq"/>
|
||||
<result property="typeStatus" column="type_status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, name, image, sort, status, create_time, update_time
|
||||
<sql id="Vo_Column_List">
|
||||
type_id,type_name,type_image,type_seq,type_status,deleted,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
<select id="list" resultMap="cueTypeVOMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
cue_type
|
||||
WHERE
|
||||
id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="listEnabled" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
cue_type
|
||||
WHERE
|
||||
status = 1
|
||||
ORDER BY
|
||||
sort ASC,
|
||||
id DESC
|
||||
</select>
|
||||
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
cue_type
|
||||
<include refid="Vo_Column_List" />
|
||||
FROM cue_type
|
||||
<where>
|
||||
<if test="name != null and name != ''">
|
||||
AND name LIKE CONCAT('%', #{name}, '%')
|
||||
deleted = 0
|
||||
<if test="dto.typeStatus != null">
|
||||
AND type_status = #{dto.typeStatus}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
<if test="dto.typeName != null and dto.typeName != ''">
|
||||
AND type_name like CONCAT('%', #{dto.typeName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
sort ASC,
|
||||
id DESC
|
||||
type_seq asc,
|
||||
type_id desc
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
<select id="getById" resultMap="cueTypeVOMap">
|
||||
SELECT
|
||||
<include refid="Vo_Column_List" />
|
||||
FROM
|
||||
cue_type
|
||||
WHERE
|
||||
type_id = #{typeId}
|
||||
</select>
|
||||
|
||||
<insert id="save" useGeneratedKeys="true" keyProperty="typeId">
|
||||
INSERT INTO cue_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="image != null">image,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="typeName != null and typeName != ''">type_name,</if>
|
||||
<if test="typeImage != null and typeImage != ''">type_image,</if>
|
||||
<if test="typeSeq != null">type_seq,</if>
|
||||
<if test="typeStatus != null">type_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="image != null">#{image},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="typeName != null and typeName != ''">#{typeName},</if>
|
||||
<if test="typeImage != null and typeImage != ''">#{typeImage},</if>
|
||||
<if test="typeSeq != null">#{typeSeq},</if>
|
||||
<if test="typeStatus != null">#{typeStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@ -76,22 +66,25 @@
|
||||
<update id="update">
|
||||
UPDATE cue_type
|
||||
<set>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="image != null">image = #{image},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
type_name = #{typeName},
|
||||
</if>
|
||||
<if test="typeImage != null and typeImage != ''">
|
||||
type_image = #{typeImage},
|
||||
</if>
|
||||
<if test="typeSeq != null">
|
||||
type_seq = #{typeSeq},
|
||||
</if>
|
||||
<if test="typeStatus != null">
|
||||
type_status = #{typeStatus},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
where type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<update id="updateStatus">
|
||||
UPDATE
|
||||
cue_type
|
||||
SET
|
||||
status = #{status}
|
||||
WHERE
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user