feat(hw-web): 新增haiwei官网json及文档模块

- 新增HwWeb和HwWeb1实体类,支持逻辑删除和时间字段自动填充
- 新增相应业务对象Bo和视图对象Vo,实现数据传输和映射
- 实现HwWeb1的业务逻辑,包括分页查询、版本化更新、逻辑删除等
- 添加HwWeb和HwWeb1的控制器,支持增删改查及导出Excel功能
- 新增HwWebDocument实体及Bo,实现文档信息管理
- 添加HwWebDocument控制器框架,准备后续完善API接口
- 编写HwWeb1Mapper及对应MyBatis XML,支持自定义SQL操作
- 建立完善的分页与查询条件构造,提高灵活性和性能
- 引入数据校验及重复提交防护机制保证接口安全与数据正确性
main
zangch@mesnac.com 2 months ago
parent 3f65fd0e7c
commit 9a817946fb

@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-modules</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hw-web</artifactId>
<description>
hw-web模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-core</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-doc</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-translation</artifactId>
</dependency>
<!-- OSS功能模块 -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-oss</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-log</artifactId>
</dependency>
<!-- excel-->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-excel</artifactId>
</dependency>
<!-- SMS功能模块 -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-sms</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-tenant</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-security</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-web</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-idempotent</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-sensitive</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-encrypt</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-sse</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,115 @@
package org.dromara.web.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.web.domain.vo.HwWeb1Vo;
import org.dromara.web.domain.bo.HwWeb1Bo;
import org.dromara.web.service.IHwWeb1Service;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
* haiweijson
*
* @author zch
* @date 2025-11-28
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/hwWeb1")
public class HwWeb1Controller extends BaseController {
private final IHwWeb1Service hwWeb1Service;
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb1:list")
@GetMapping("/list")
public TableDataInfo<HwWeb1Vo> list(HwWeb1Bo bo, PageQuery pageQuery) {
return hwWeb1Service.queryPageList(bo, pageQuery);
}
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb1:export")
@Log(title = "haiwei官网json", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HwWeb1Bo bo, HttpServletResponse response) {
List<HwWeb1Vo> list = hwWeb1Service.queryList(bo);
ExcelUtil.exportExcel(list, "haiwei官网json", HwWeb1Vo.class, response);
}
/**
* haiweijson
*
* @param webCode
*/
//@SaCheckPermission("web:hwWeb1:query")
@GetMapping("/{webCode}")
public R<HwWeb1Vo> getInfo(@NotNull(message = "页面编码不能为空")
@PathVariable Long webCode) {
return R.ok(hwWeb1Service.queryByWebCode(webCode));
}
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb1:add")
@Log(title = "haiwei官网json", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody HwWeb1Bo bo) {
return toAjax(hwWeb1Service.insertByBo(bo));
}
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb1:edit")
@Log(title = "haiwei官网json", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HwWeb1Bo bo) {
return toAjax(hwWeb1Service.updateByBo(bo));
}
/**
* haiweijson
*
* @param webIds
*/
//@SaCheckPermission("web:hwWeb1:remove")
@Log(title = "haiwei官网json", businessType = BusinessType.DELETE)
@DeleteMapping("/{webIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] webIds) {
return toAjax(hwWeb1Service.deleteWithValidByIds(List.of(webIds), true));
}
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb1:list")
@GetMapping("/getHwWeb1List")
public R<List<HwWeb1Vo>> getHwWeb1List(HwWeb1Bo bo) {
List<HwWeb1Vo> list = hwWeb1Service.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,116 @@
package org.dromara.web.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.web.domain.vo.HwWebVo;
import org.dromara.web.domain.bo.HwWebBo;
import org.dromara.web.service.IHwWebService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
* haiweijson
*
* @author zch
* @date 2025-11-28
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/hwWeb")
public class HwWebController extends BaseController {
private final IHwWebService hwWebService;
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb:list")
@GetMapping("/list")
public TableDataInfo<HwWebVo> list(HwWebBo bo, PageQuery pageQuery) {
return hwWebService.queryPageList(bo, pageQuery);
}
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb:export")
@Log(title = "haiwei官网json", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HwWebBo bo, HttpServletResponse response) {
List<HwWebVo> list = hwWebService.queryList(bo);
ExcelUtil.exportExcel(list, "haiwei官网json", HwWebVo.class, response);
}
/**
* haiweijson
*
* @param webCode
*/
//@SaCheckPermission("web:hwWeb:query")
@GetMapping("/{webCode}")
public R<HwWebVo> getInfo(@NotNull(message = "页面编码不能为空")
@PathVariable Long webCode) {
return R.ok(hwWebService.queryByWebCode(webCode));
}
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb:add")
@Log(title = "haiwei官网json", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody HwWebBo bo) {
return toAjax(hwWebService.insertByBo(bo));
}
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb:edit")
@Log(title = "haiwei官网json", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HwWebBo bo) {
return toAjax(hwWebService.updateByBo(bo));
}
/**
* haiweijson
*
* @param webIds
*/
//@SaCheckPermission("web:hwWeb:remove")
@Log(title = "haiwei官网json", businessType = BusinessType.DELETE)
@DeleteMapping("/{webIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] webIds) {
return toAjax(hwWebService.deleteWithValidByIds(List.of(webIds), true));
}
/**
* haiweijson
*/
//@SaCheckPermission("web:hwWeb:list")
@GetMapping("/getHwWebList")
public R<List<HwWebVo>> getHwWebList(HwWebBo bo) {
List<HwWebVo> list = hwWebService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,157 @@
package org.dromara.web.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.web.domain.vo.HwWebDocumentVo;
import org.dromara.web.domain.bo.HwWebDocumentBo;
import org.dromara.web.domain.bo.SecureDocumentRequest;
import org.dromara.web.service.IHwWebDocumentService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
* hwWebDocument
*
* @author zch
* @date 2025-11-28
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/hwWebDocument")
public class HwWebDocumentController extends BaseController {
private final IHwWebDocumentService hwWebDocumentService;
/**
* hwWebDocument
*
*/
//@SaCheckPermission("web:hwWebDocument:list")
@GetMapping("/list")
public TableDataInfo<HwWebDocumentVo> list(HwWebDocumentBo bo, PageQuery pageQuery) {
TableDataInfo<HwWebDocumentVo> result = hwWebDocumentService.queryPageList(bo, pageQuery);
// 遍历结果,隐藏密钥;若有密钥则隐藏文件地址
for (HwWebDocumentVo doc : result.getRows()) {
boolean hasSecret = doc.getHasSecret();
doc.setSecretKey(null); // 隐藏密钥
if (hasSecret) {
doc.setDocumentAddress(null); // 若有密钥保护则隐藏文件地址
}
}
return result;
}
/**
* hwWebDocument
*/
//@SaCheckPermission("web:hwWebDocument:export")
@Log(title = "hwWebDocument", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HwWebDocumentBo bo, HttpServletResponse response) {
List<HwWebDocumentVo> list = hwWebDocumentService.queryList(bo);
ExcelUtil.exportExcel(list, "hwWebDocument", HwWebDocumentVo.class, response);
}
/**
* hwWebDocument
*
*
* @param documentId
*/
//@SaCheckPermission("web:hwWebDocument:query")
@GetMapping("/{documentId}")
public R<HwWebDocumentVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable String documentId) {
HwWebDocumentVo doc = hwWebDocumentService.queryById(documentId);
if (doc != null) {
boolean hasSecret = doc.getHasSecret();
doc.setSecretKey(null); // 隐藏密钥
if (hasSecret) {
doc.setDocumentAddress(null); // 若有密钥保护则隐藏文件地址
}
}
return R.ok(doc);
}
/**
* hwWebDocument
*/
//@SaCheckPermission("web:hwWebDocument:add")
@Log(title = "hwWebDocument", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody HwWebDocumentBo bo) {
return toAjax(hwWebDocumentService.insertByBo(bo));
}
/**
* hwWebDocument
*/
//@SaCheckPermission("web:hwWebDocument:edit")
@Log(title = "hwWebDocument", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HwWebDocumentBo bo) {
return toAjax(hwWebDocumentService.updateByBo(bo));
}
/**
* hwWebDocument
*
* @param documentIds
*/
//@SaCheckPermission("web:hwWebDocument:remove")
@Log(title = "hwWebDocument", businessType = BusinessType.DELETE)
@DeleteMapping("/{documentIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable String[] documentIds) {
return toAjax(hwWebDocumentService.deleteWithValidByIds(List.of(documentIds), true));
}
/**
* hwWebDocument
*/
//@SaCheckPermission("web:hwWebDocument:list")
@GetMapping("/getHwWebDocumentList")
public R<List<HwWebDocumentVo>> getHwWebDocumentList(HwWebDocumentBo bo) {
List<HwWebDocumentVo> list = hwWebDocumentService.queryList(bo);
// 遍历结果,隐藏密钥;若有密钥则隐藏文件地址
for (HwWebDocumentVo doc : list) {
boolean hasSecret = doc.getHasSecret();
doc.setSecretKey(null);
if (hasSecret) {
doc.setDocumentAddress(null);
}
}
return R.ok(list);
}
/**
*
*
*/
//@SaCheckPermission("web:hwWebDocument:query")
@PostMapping("/getSecureDocumentAddress")
public R<String> getSecureDocumentAddress(@RequestBody SecureDocumentRequest request) {
String address = hwWebDocumentService.verifyAndGetDocumentAddress(
request.getDocumentId(),
request.getProvidedKey()
);
return R.ok(address);
}
}

@ -0,0 +1,125 @@
package org.dromara.web.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.web.domain.vo.HwWebMenu1Vo;
import org.dromara.web.domain.bo.HwWebMenu1Bo;
import org.dromara.web.service.IHwWebMenu1Service;
/**
* HwWebMenu1
*
* @author zch
* @date 2025-11-28
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/hwWebMenu1")
public class HwWebMenu1Controller extends BaseController {
private final IHwWebMenu1Service hwWebMenu1Service;
/**
* HwWebMenu1
* R<List> TableDataInfo
*/
//@SaCheckPermission("web:hwWebMenu1:list")
@GetMapping("/list")
public R<List<HwWebMenu1Vo>> list(HwWebMenu1Bo bo) {
// 与旧项目保持一致,直接返回列表而非分页数据
List<HwWebMenu1Vo> list = hwWebMenu1Service.queryList(bo);
return R.ok(list);
}
/**
* HwWebMenu1
*/
//@SaCheckPermission("web:hwWebMenu1:export")
@Log(title = "HwWebMenu1", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HwWebMenu1Bo bo, HttpServletResponse response) {
List<HwWebMenu1Vo> list = hwWebMenu1Service.queryList(bo);
ExcelUtil.exportExcel(list, "HwWebMenu1", HwWebMenu1Vo.class, response);
}
/**
* HwWebMenu1
*
* @param webMenuId
*/
//@SaCheckPermission("web:hwWebMenu1:query")
@GetMapping("/{webMenuId}")
public R<HwWebMenu1Vo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long webMenuId) {
return R.ok(hwWebMenu1Service.queryById(webMenuId));
}
/**
* HwWebMenu1
*/
//@SaCheckPermission("web:hwWebMenu1:add")
@Log(title = "HwWebMenu1", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody HwWebMenu1Bo bo) {
return toAjax(hwWebMenu1Service.insertByBo(bo));
}
/**
* HwWebMenu1
*/
//@SaCheckPermission("web:hwWebMenu1:edit")
@Log(title = "HwWebMenu1", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HwWebMenu1Bo bo) {
return toAjax(hwWebMenu1Service.updateByBo(bo));
}
/**
* HwWebMenu1
*
* @param webMenuIds
*/
//@SaCheckPermission("web:hwWebMenu1:remove")
@Log(title = "HwWebMenu1", businessType = BusinessType.DELETE)
@DeleteMapping("/{webMenuIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] webMenuIds) {
return toAjax(hwWebMenu1Service.deleteWithValidByIds(List.of(webMenuIds), true));
}
/**
* HwWebMenu1
*/
//@SaCheckPermission("web:hwWebMenu1:list")
@GetMapping("/getHwWebMenu1List")
public R<List<HwWebMenu1Vo>> getHwWebMenu1List(HwWebMenu1Bo bo) {
List<HwWebMenu1Vo> list = hwWebMenu1Service.queryList(bo);
return R.ok(list);
}
/**
*
*/
//@SaCheckPermission("web:hwWebMenu1:list")
@GetMapping("/selectMenuTree")
public R<List<HwWebMenu1Vo>> selectMenuTree(HwWebMenu1Bo bo) {
return R.ok(hwWebMenu1Service.selectMenuTree(bo));
}
}

@ -0,0 +1,125 @@
package org.dromara.web.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.web.domain.vo.HwWebMenuVo;
import org.dromara.web.domain.bo.HwWebMenuBo;
import org.dromara.web.service.IHwWebMenuService;
/**
* HwWebMenu
*
* @author zch
* @date 2025-11-28
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/hwWebMenu")
public class HwWebMenuController extends BaseController {
private final IHwWebMenuService hwWebMenuService;
/**
* HwWebMenu
* R<List> TableDataInfo
*/
//@SaCheckPermission("web:hwWebMenu:list")
@GetMapping("/list")
public R<List<HwWebMenuVo>> list(HwWebMenuBo bo) {
// 与旧项目保持一致,直接返回列表而非分页数据
List<HwWebMenuVo> list = hwWebMenuService.queryList(bo);
return R.ok(list);
}
/**
* HwWebMenu
*/
//@SaCheckPermission("web:hwWebMenu:export")
@Log(title = "HwWebMenu", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HwWebMenuBo bo, HttpServletResponse response) {
List<HwWebMenuVo> list = hwWebMenuService.queryList(bo);
ExcelUtil.exportExcel(list, "HwWebMenu", HwWebMenuVo.class, response);
}
/**
* HwWebMenu
*
* @param webMenuId
*/
//@SaCheckPermission("web:hwWebMenu:query")
@GetMapping("/{webMenuId}")
public R<HwWebMenuVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long webMenuId) {
return R.ok(hwWebMenuService.queryById(webMenuId));
}
/**
* HwWebMenu
*/
//@SaCheckPermission("web:hwWebMenu:add")
@Log(title = "HwWebMenu", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody HwWebMenuBo bo) {
return toAjax(hwWebMenuService.insertByBo(bo));
}
/**
* HwWebMenu
*/
//@SaCheckPermission("web:hwWebMenu:edit")
@Log(title = "HwWebMenu", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HwWebMenuBo bo) {
return toAjax(hwWebMenuService.updateByBo(bo));
}
/**
* HwWebMenu
*
* @param webMenuIds
*/
//@SaCheckPermission("web:hwWebMenu:remove")
@Log(title = "HwWebMenu", businessType = BusinessType.DELETE)
@DeleteMapping("/{webMenuIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] webMenuIds) {
return toAjax(hwWebMenuService.deleteWithValidByIds(List.of(webMenuIds), true));
}
/**
* HwWebMenu
*/
//@SaCheckPermission("web:hwWebMenu:list")
@GetMapping("/getHwWebMenuList")
public R<List<HwWebMenuVo>> getHwWebMenuList(HwWebMenuBo bo) {
List<HwWebMenuVo> list = hwWebMenuService.queryList(bo);
return R.ok(list);
}
/**
*
*/
//@SaCheckPermission("web:hwWebMenu:list")
@GetMapping("/selectMenuTree")
public R<List<HwWebMenuVo>> selectMenuTree(HwWebMenuBo bo) {
return R.ok(hwWebMenuService.selectMenuTree(bo));
}
}

@ -0,0 +1,67 @@
package org.dromara.web.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* haiweijson hw_web
*
* @author zch
* @date 2025-11-28
*/
@Data
@TableName("hw_web")
public class HwWeb implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "web_id")
private Long webId;
/**
* json
*/
private String webJson;
/**
* json
*/
private String webJsonString;
/**
*
*/
private Long webCode;
/**
* 0-1-
*/
@TableLogic(value = "0", delval = "1")
private String isDelete;
/**
*
*/
private String webJsonEnglish;
/**
*
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -0,0 +1,78 @@
package org.dromara.web.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* haiweijson hw_web1
*
* @author zch
* @date 2025-11-28
*/
@Data
@TableName("hw_web1")
public class HwWeb1 implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "web_id")
private Long webId;
/**
* json
*/
private String webJson;
/**
* json
*/
private String webJsonString;
/**
*
*/
private Long webCode;
/**
* id
*/
private Long deviceId;
/**
* idtypeId线
*/
@TableField("typeId")
private Long typeId;
/**
* 0-1-
*/
@TableLogic(value = "0", delval = "1")
private String isDelete;
/**
*
*/
private String webJsonEnglish;
/**
*
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -0,0 +1,73 @@
package org.dromara.web.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* hwWebDocument hw_web_document
*
* @author zch
* @date 2025-11-28
*/
@Data
@TableName("hw_web_document")
public class HwWebDocument implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(value = "document_id")
private String documentId;
/**
*
*/
private String documentAddress;
/**
*
*/
private String webCode;
/**
* secretKey线
*/
@TableField("secretKey")
private String secretKey;
/**
* json
*/
private String json;
/**
*
*/
private String type;
/**
* 0-1-
*/
@TableLogic(value = "0", delval = "1")
private String isDelete;
/**
*
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -0,0 +1,83 @@
package org.dromara.web.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* HwWebMenu hw_web_menu
*
* @author zch
* @date 2025-11-28
*/
@Data
@TableName("hw_web_menu")
public class HwWebMenu implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "web_menu_id")
private Long webMenuId;
/**
*
*/
private Long parent;
/**
*
*/
private String ancestors;
/**
*
*/
private String status;
/**
*
*/
private String webMenuName;
/**
* web_menu__pic线
*/
@TableField("web_menu__pic")
private String webMenuPic;
/**
*
*/
private Long webMenuType;
/**
* 0-1-
*/
@TableLogic(value = "0", delval = "1")
private String isDelete;
/**
*
*/
private String webMenuNameEnglish;
/**
*
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -0,0 +1,88 @@
package org.dromara.web.domain;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* HwWebMenu1 hw_web_menu1
*
* @author zch
* @date 2025-11-28
*/
@Data
@TableName("hw_web_menu1")
public class HwWebMenu1 implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* d
*/
@TableId(value = "web_menu_id")
private Long webMenuId;
/**
*
*/
private Long parent;
/**
*
*/
private String ancestors;
/**
*
*/
private String status;
/**
*
*/
private String webMenuName;
/**
* web_menu__pic线
*/
@TableField("web_menu__pic")
private String webMenuPic;
/**
*
*/
private Long webMenuType;
/**
*
*/
private String value;
/**
* 0-1-
*/
@TableLogic(value = "0", delval = "1")
private String isDelete;
/**
*
*/
private String webMenuNameEnglish;
/**
*
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
*
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -0,0 +1,81 @@
package org.dromara.web.domain.bo;
import org.dromara.web.domain.HwWeb1;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import jakarta.validation.constraints.*;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* haiweijson hw_web1
*
* @author zch
* @date 2025-11-28
*/
@Data
@AutoMapper(target = HwWeb1.class, reverseConvertGenerate = false)
public class HwWeb1Bo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Map<String, Object> params = new HashMap<>();
/**
*
*/
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
private Long webId;
/**
* json
*/
private String webJson;
/**
* json
*/
private String webJsonString;
/**
*
*/
private Long webCode;
/**
* id
*/
private Long deviceId;
/**
* id
*/
private Long typeId;
/**
* 0-1-
*/
private String isDelete;
/**
*
*/
private String webJsonEnglish;
public Map<String, Object> getParams() {
if (params == null) {
params = new HashMap<>();
}
return params;
}
}

@ -0,0 +1,74 @@
package org.dromara.web.domain.bo;
import org.dromara.web.domain.HwWeb;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import jakarta.validation.constraints.*;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* haiweijson hw_web
*
* @author zch
* @date 2025-11-28
*/
@Data
@AutoMapper(target = HwWeb.class, reverseConvertGenerate = false)
public class HwWebBo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Map<String, Object> params = new HashMap<>();
/**
*
*/
@NotNull(message = "主键不能为空", groups = { EditGroup.class })
private Long webId;
/**
* json
*/
private String webJson;
/**
* json
*/
private String webJsonString;
/**
*
*/
private Long webCode;
/**
* 0-1-
*/
private String isDelete;
/**
*
*/
private String webJsonEnglish;
/**
*
*/
public Map<String, Object> getParams() {
if (params == null) {
params = new HashMap<>();
}
return params;
}
}

@ -0,0 +1,76 @@
package org.dromara.web.domain.bo;
import org.dromara.web.domain.HwWebDocument;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import jakarta.validation.constraints.*;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* hwWebDocument hw_web_document
*
* @author zch
* @date 2025-11-28
*/
@Data
@AutoMapper(target = HwWebDocument.class, reverseConvertGenerate = false)
public class HwWebDocumentBo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Map<String, Object> params = new HashMap<>();
/**
*
*/
@NotBlank(message = "主键不能为空", groups = { EditGroup.class })
private String documentId;
/**
*
*/
private String documentAddress;
/**
*
*/
private String webCode;
/**
*
*/
private String secretKey;
/**
* json
*/
private String json;
/**
*
*/
private String type;
/**
* 0-1-
*/
private String isDelete;
public Map<String, Object> getParams() {
if (params == null) {
params = new HashMap<>();
}
return params;
}
}

@ -0,0 +1,91 @@
package org.dromara.web.domain.bo;
import org.dromara.web.domain.HwWebMenu1;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import jakarta.validation.constraints.*;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* HwWebMenu1 hw_web_menu1
*
* @author zch
* @date 2025-11-28
*/
@Data
@AutoMapper(target = HwWebMenu1.class, reverseConvertGenerate = false)
public class HwWebMenu1Bo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Map<String, Object> params = new HashMap<>();
/**
* d
*/
@NotNull(message = "设备d不能为空", groups = { EditGroup.class })
private Long webMenuId;
/**
*
*/
private Long parent;
/**
*
*/
private String ancestors;
/**
*
*/
private String status;
/**
*
*/
private String webMenuName;
/**
*
*/
private String webMenuPic;
/**
*
*/
private Long webMenuType;
/**
*
*/
private String value;
/**
* 0-1-
*/
private String isDelete;
/**
*
*/
private String webMenuNameEnglish;
public Map<String, Object> getParams() {
if (params == null) {
params = new HashMap<>();
}
return params;
}
}

@ -0,0 +1,86 @@
package org.dromara.web.domain.bo;
import org.dromara.web.domain.HwWebMenu;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import jakarta.validation.constraints.*;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* HwWebMenu hw_web_menu
*
* @author zch
* @date 2025-11-28
*/
@Data
@AutoMapper(target = HwWebMenu.class, reverseConvertGenerate = false)
public class HwWebMenuBo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Map<String, Object> params = new HashMap<>();
/**
* id
*/
@NotNull(message = "菜单主键id不能为空", groups = { EditGroup.class })
private Long webMenuId;
/**
*
*/
private Long parent;
/**
*
*/
private String ancestors;
/**
*
*/
private String status;
/**
*
*/
private String webMenuName;
/**
*
*/
private String webMenuPic;
/**
*
*/
private Long webMenuType;
/**
* 0-1-
*/
private String isDelete;
/**
*
*/
private String webMenuNameEnglish;
public Map<String, Object> getParams() {
if (params == null) {
params = new HashMap<>();
}
return params;
}
}

@ -0,0 +1,29 @@
package org.dromara.web.domain.bo;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
*
*
* @author zch
* @date 2025-11-28
*/
@Data
public class SecureDocumentRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String documentId;
/**
*
*/
private String providedKey;
}

@ -0,0 +1,80 @@
package org.dromara.web.domain.vo;
import org.dromara.web.domain.HwWeb1;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* haiweijson hw_web1
*
* @author zch
* @date 2025-11-28
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = HwWeb1.class)
public class HwWeb1Vo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "主键")
private Long webId;
/**
* json
*/
@ExcelProperty(value = "json")
private String webJson;
/**
* json
*/
@ExcelProperty(value = "json字符串")
private String webJsonString;
/**
*
*/
@ExcelProperty(value = "页面")
private Long webCode;
/**
* id
*/
@ExcelProperty(value = "设备id")
private Long deviceId;
/**
* id
*/
@ExcelProperty(value = "类型id")
private Long typeId;
/**
*
*/
@ExcelProperty(value = "")
private String isDelete;
/**
*
*/
@ExcelProperty(value = "")
private String webJsonEnglish;
}

@ -0,0 +1,86 @@
package org.dromara.web.domain.vo;
import org.dromara.web.domain.HwWebDocument;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* hwWebDocument hw_web_document
*
* @author zch
* @date 2025-11-28
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = HwWebDocument.class)
public class HwWebDocumentVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "主键")
private String documentId;
/**
*
*/
@ExcelProperty(value = "文件存储地址")
private String documentAddress;
/**
*
*/
@ExcelProperty(value = "页面编码,用来连表查询")
private String webCode;
/**
*
*/
@ExcelProperty(value = "密钥")
private String secretKey;
/**
* json
*/
@ExcelProperty(value = "json")
private String json;
/**
*
*/
@ExcelProperty(value = "类型")
private String type;
/**
*
*/
@ExcelProperty(value = "")
private String isDelete;
/**
*
*/
private Boolean hasSecret;
/**
*
*
* @return
*/
public Boolean getHasSecret() {
return secretKey != null && !secretKey.trim().isEmpty();
}
}

@ -0,0 +1,96 @@
package org.dromara.web.domain.vo;
import org.dromara.web.domain.HwWebMenu1;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* HwWebMenu1 hw_web_menu1
*
* @author zch
* @date 2025-11-28
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = HwWebMenu1.class)
public class HwWebMenu1Vo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* d
*/
@ExcelProperty(value = "设备d")
private Long webMenuId;
/**
*
*/
@ExcelProperty(value = "父节点")
private Long parent;
/**
*
*/
@ExcelProperty(value = "祖先")
private String ancestors;
/**
*
*/
@ExcelProperty(value = "状态")
private String status;
/**
*
*/
@ExcelProperty(value = "设备名称")
private String webMenuName;
/**
*
*/
@ExcelProperty(value = "图片地址")
private String webMenuPic;
/**
*
*/
@ExcelProperty(value = "官网菜单类型")
private Long webMenuType;
/**
*
*/
@ExcelProperty(value = "介绍")
private String value;
/**
*
*/
@ExcelProperty(value = "")
private String isDelete;
/**
*
*/
@ExcelProperty(value = "")
private String webMenuNameEnglish;
/**
* 使
*/
private List<HwWebMenu1Vo> children;
}

@ -0,0 +1,90 @@
package org.dromara.web.domain.vo;
import org.dromara.web.domain.HwWebMenu;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* HwWebMenu hw_web_menu
*
* @author zch
* @date 2025-11-28
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = HwWebMenu.class)
public class HwWebMenuVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* id
*/
@ExcelProperty(value = "菜单主键id")
private Long webMenuId;
/**
*
*/
@ExcelProperty(value = "父节点")
private Long parent;
/**
*
*/
@ExcelProperty(value = "祖先")
private String ancestors;
/**
*
*/
@ExcelProperty(value = "状态")
private String status;
/**
*
*/
@ExcelProperty(value = "菜单名称")
private String webMenuName;
/**
*
*/
@ExcelProperty(value = "图片地址")
private String webMenuPic;
/**
*
*/
@ExcelProperty(value = "官网菜单类型")
private Long webMenuType;
/**
*
*/
@ExcelProperty(value = "")
private String isDelete;
/**
*
*/
@ExcelProperty(value = "")
private String webMenuNameEnglish;
/**
* 使
*/
private List<HwWebMenuVo> children;
}

@ -0,0 +1,69 @@
package org.dromara.web.domain.vo;
import org.dromara.web.domain.HwWeb;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* haiweijson hw_web
*
* @author zch
* @date 2025-11-28
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = HwWeb.class)
public class HwWebVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "主键")
private Long webId;
/**
* json
*/
@ExcelProperty(value = "json")
private String webJson;
/**
* json
*/
@ExcelProperty(value = "json字符串")
private String webJsonString;
/**
*
*/
@ExcelProperty(value = "页面")
private Long webCode;
/**
*
*/
@ExcelProperty(value = "逻辑删除", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "逻辑删除()")
private String isDelete;
/**
*
*/
@ExcelProperty(value = "")
private String webJsonEnglish;
}

@ -0,0 +1,103 @@
package org.dromara.web.mapper;
import org.dromara.web.domain.HwWeb1;
import org.dromara.web.domain.vo.HwWeb1Vo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Collection;
/**
* haiweijsonMapper
*
* @author zch
* @date 2025-11-28
*/
public interface HwWeb1Mapper extends BaseMapperPlus<HwWeb1, HwWeb1Vo> {
/**
* haiweijson
*
* @param queryWrapper
* @return haiweijson
*/
List<HwWeb1Vo> selectCustomHwWeb1VoList(@Param(Constants.WRAPPER) Wrapper<HwWeb1> queryWrapper);
/**
* IDhaiweijson
*
* @param webId ID
* @return haiweijson
*/
HwWeb1Vo selectCustomHwWeb1VoById(@Param("webId") Long webId);
/**
* IDhaiweijson
*
* @param ids ID
* @return haiweijson
*/
List<HwWeb1Vo> selectCustomHwWeb1VoByIds(@Param("ids") Collection<Long> ids);
/**
* haiweijson
*
* @param queryWrapper
* @return
*/
Long countCustomHwWeb1(@Param(Constants.WRAPPER) Wrapper<HwWeb1> queryWrapper);
/**
* haiweijson
*
* @param page
* @param queryWrapper
* @return
*/
Page<HwWeb1Vo> selectCustomHwWeb1VoPage(@Param("page") Page<HwWeb1> page, @Param(Constants.WRAPPER) Wrapper<HwWeb1> queryWrapper);
/**
* haiweijson
*
* @param list haiweijson
* @return
*/
int batchInsertHwWeb1(@Param("list") List<HwWeb1> list);
/**
* haiweijson
*
* @param list haiweijson
* @return
*/
int batchUpdateHwWeb1(@Param("list") List<HwWeb1> list);
/**
* haiweijson
*
* @param queryWrapper
* @return
*/
int deleteCustomHwWeb1(@Param(Constants.WRAPPER) Wrapper<HwWeb1> queryWrapper);
/**
* IDhaiweijson
*
* @param ids ID
* @return
*/
int deleteCustomHwWeb1ByIds(@Param("ids") Collection<Long> ids);
/**
* haiweijson
*
* @param queryWrapper
* @return
*/
Boolean existsHwWeb1(@Param(Constants.WRAPPER) Wrapper<HwWeb1> queryWrapper);
}

@ -0,0 +1,103 @@
package org.dromara.web.mapper;
import org.dromara.web.domain.HwWebDocument;
import org.dromara.web.domain.vo.HwWebDocumentVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Collection;
/**
* hwWebDocumentMapper
*
* @author zch
* @date 2025-11-28
*/
public interface HwWebDocumentMapper extends BaseMapperPlus<HwWebDocument, HwWebDocumentVo> {
/**
* hwWebDocument
*
* @param queryWrapper
* @return hwWebDocument
*/
List<HwWebDocumentVo> selectCustomHwWebDocumentVoList(@Param(Constants.WRAPPER) Wrapper<HwWebDocument> queryWrapper);
/**
* IDhwWebDocument
*
* @param documentId ID
* @return hwWebDocument
*/
HwWebDocumentVo selectCustomHwWebDocumentVoById(@Param("documentId") String documentId);
/**
* IDhwWebDocument
*
* @param ids ID
* @return hwWebDocument
*/
List<HwWebDocumentVo> selectCustomHwWebDocumentVoByIds(@Param("ids") Collection<String> ids);
/**
* hwWebDocument
*
* @param queryWrapper
* @return
*/
Long countCustomHwWebDocument(@Param(Constants.WRAPPER) Wrapper<HwWebDocument> queryWrapper);
/**
* hwWebDocument
*
* @param page
* @param queryWrapper
* @return
*/
Page<HwWebDocumentVo> selectCustomHwWebDocumentVoPage(@Param("page") Page<HwWebDocument> page, @Param(Constants.WRAPPER) Wrapper<HwWebDocument> queryWrapper);
/**
* hwWebDocument
*
* @param list hwWebDocument
* @return
*/
int batchInsertHwWebDocument(@Param("list") List<HwWebDocument> list);
/**
* hwWebDocument
*
* @param list hwWebDocument
* @return
*/
int batchUpdateHwWebDocument(@Param("list") List<HwWebDocument> list);
/**
* hwWebDocument
*
* @param queryWrapper
* @return
*/
int deleteCustomHwWebDocument(@Param(Constants.WRAPPER) Wrapper<HwWebDocument> queryWrapper);
/**
* IDhwWebDocument
*
* @param ids ID
* @return
*/
int deleteCustomHwWebDocumentByIds(@Param("ids") Collection<String> ids);
/**
* hwWebDocument
*
* @param queryWrapper
* @return
*/
Boolean existsHwWebDocument(@Param(Constants.WRAPPER) Wrapper<HwWebDocument> queryWrapper);
}

@ -0,0 +1,103 @@
package org.dromara.web.mapper;
import org.dromara.web.domain.HwWeb;
import org.dromara.web.domain.vo.HwWebVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Collection;
/**
* haiweijsonMapper
*
* @author zch
* @date 2025-11-28
*/
public interface HwWebMapper extends BaseMapperPlus<HwWeb, HwWebVo> {
/**
* haiweijson
*
* @param queryWrapper
* @return haiweijson
*/
List<HwWebVo> selectCustomHwWebVoList(@Param(Constants.WRAPPER) Wrapper<HwWeb> queryWrapper);
/**
* IDhaiweijson
*
* @param webId ID
* @return haiweijson
*/
HwWebVo selectCustomHwWebVoById(@Param("webId") Long webId);
/**
* IDhaiweijson
*
* @param ids ID
* @return haiweijson
*/
List<HwWebVo> selectCustomHwWebVoByIds(@Param("ids") Collection<Long> ids);
/**
* haiweijson
*
* @param queryWrapper
* @return
*/
Long countCustomHwWeb(@Param(Constants.WRAPPER) Wrapper<HwWeb> queryWrapper);
/**
* haiweijson
*
* @param page
* @param queryWrapper
* @return
*/
Page<HwWebVo> selectCustomHwWebVoPage(@Param("page") Page<HwWeb> page, @Param(Constants.WRAPPER) Wrapper<HwWeb> queryWrapper);
/**
* haiweijson
*
* @param list haiweijson
* @return
*/
int batchInsertHwWeb(@Param("list") List<HwWeb> list);
/**
* haiweijson
*
* @param list haiweijson
* @return
*/
int batchUpdateHwWeb(@Param("list") List<HwWeb> list);
/**
* haiweijson
*
* @param queryWrapper
* @return
*/
int deleteCustomHwWeb(@Param(Constants.WRAPPER) Wrapper<HwWeb> queryWrapper);
/**
* IDhaiweijson
*
* @param ids ID
* @return
*/
int deleteCustomHwWebByIds(@Param("ids") Collection<Long> ids);
/**
* haiweijson
*
* @param queryWrapper
* @return
*/
Boolean existsHwWeb(@Param(Constants.WRAPPER) Wrapper<HwWeb> queryWrapper);
}

@ -0,0 +1,103 @@
package org.dromara.web.mapper;
import org.dromara.web.domain.HwWebMenu1;
import org.dromara.web.domain.vo.HwWebMenu1Vo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Collection;
/**
* HwWebMenu1Mapper
*
* @author zch
* @date 2025-11-28
*/
public interface HwWebMenu1Mapper extends BaseMapperPlus<HwWebMenu1, HwWebMenu1Vo> {
/**
* HwWebMenu1
*
* @param queryWrapper
* @return HwWebMenu1
*/
List<HwWebMenu1Vo> selectCustomHwWebMenu1VoList(@Param(Constants.WRAPPER) Wrapper<HwWebMenu1> queryWrapper);
/**
* IDHwWebMenu1
*
* @param webMenuId ID
* @return HwWebMenu1
*/
HwWebMenu1Vo selectCustomHwWebMenu1VoById(@Param("webMenuId") Long webMenuId);
/**
* IDHwWebMenu1
*
* @param ids ID
* @return HwWebMenu1
*/
List<HwWebMenu1Vo> selectCustomHwWebMenu1VoByIds(@Param("ids") Collection<Long> ids);
/**
* HwWebMenu1
*
* @param queryWrapper
* @return
*/
Long countCustomHwWebMenu1(@Param(Constants.WRAPPER) Wrapper<HwWebMenu1> queryWrapper);
/**
* HwWebMenu1
*
* @param page
* @param queryWrapper
* @return
*/
Page<HwWebMenu1Vo> selectCustomHwWebMenu1VoPage(@Param("page") Page<HwWebMenu1> page, @Param(Constants.WRAPPER) Wrapper<HwWebMenu1> queryWrapper);
/**
* HwWebMenu1
*
* @param list HwWebMenu1
* @return
*/
int batchInsertHwWebMenu1(@Param("list") List<HwWebMenu1> list);
/**
* HwWebMenu1
*
* @param list HwWebMenu1
* @return
*/
int batchUpdateHwWebMenu1(@Param("list") List<HwWebMenu1> list);
/**
* HwWebMenu1
*
* @param queryWrapper
* @return
*/
int deleteCustomHwWebMenu1(@Param(Constants.WRAPPER) Wrapper<HwWebMenu1> queryWrapper);
/**
* IDHwWebMenu1
*
* @param ids ID
* @return
*/
int deleteCustomHwWebMenu1ByIds(@Param("ids") Collection<Long> ids);
/**
* HwWebMenu1
*
* @param queryWrapper
* @return
*/
Boolean existsHwWebMenu1(@Param(Constants.WRAPPER) Wrapper<HwWebMenu1> queryWrapper);
}

@ -0,0 +1,103 @@
package org.dromara.web.mapper;
import org.dromara.web.domain.HwWebMenu;
import org.dromara.web.domain.vo.HwWebMenuVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Collection;
/**
* HwWebMenuMapper
*
* @author zch
* @date 2025-11-28
*/
public interface HwWebMenuMapper extends BaseMapperPlus<HwWebMenu, HwWebMenuVo> {
/**
* HwWebMenu
*
* @param queryWrapper
* @return HwWebMenu
*/
List<HwWebMenuVo> selectCustomHwWebMenuVoList(@Param(Constants.WRAPPER) Wrapper<HwWebMenu> queryWrapper);
/**
* IDHwWebMenu
*
* @param webMenuId ID
* @return HwWebMenu
*/
HwWebMenuVo selectCustomHwWebMenuVoById(@Param("webMenuId") Long webMenuId);
/**
* IDHwWebMenu
*
* @param ids ID
* @return HwWebMenu
*/
List<HwWebMenuVo> selectCustomHwWebMenuVoByIds(@Param("ids") Collection<Long> ids);
/**
* HwWebMenu
*
* @param queryWrapper
* @return
*/
Long countCustomHwWebMenu(@Param(Constants.WRAPPER) Wrapper<HwWebMenu> queryWrapper);
/**
* HwWebMenu
*
* @param page
* @param queryWrapper
* @return
*/
Page<HwWebMenuVo> selectCustomHwWebMenuVoPage(@Param("page") Page<HwWebMenu> page, @Param(Constants.WRAPPER) Wrapper<HwWebMenu> queryWrapper);
/**
* HwWebMenu
*
* @param list HwWebMenu
* @return
*/
int batchInsertHwWebMenu(@Param("list") List<HwWebMenu> list);
/**
* HwWebMenu
*
* @param list HwWebMenu
* @return
*/
int batchUpdateHwWebMenu(@Param("list") List<HwWebMenu> list);
/**
* HwWebMenu
*
* @param queryWrapper
* @return
*/
int deleteCustomHwWebMenu(@Param(Constants.WRAPPER) Wrapper<HwWebMenu> queryWrapper);
/**
* IDHwWebMenu
*
* @param ids ID
* @return
*/
int deleteCustomHwWebMenuByIds(@Param("ids") Collection<Long> ids);
/**
* HwWebMenu
*
* @param queryWrapper
* @return
*/
Boolean existsHwWebMenu(@Param(Constants.WRAPPER) Wrapper<HwWebMenu> queryWrapper);
}

@ -0,0 +1,84 @@
package org.dromara.web.service;
import org.dromara.web.domain.vo.HwWeb1Vo;
import org.dromara.web.domain.bo.HwWeb1Bo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* haiweijsonService
*
* @author zch
* @date 2025-11-28
*/
public interface IHwWeb1Service {
/**
* haiweijson
*
* @param webId
* @return haiweijson
*/
HwWeb1Vo queryById(Long webId);
/**
* haiweijson
*
* @param bo
* @param pageQuery
* @return haiweijson
*/
TableDataInfo<HwWeb1Vo> queryPageList(HwWeb1Bo bo, PageQuery pageQuery);
/**
* haiweijson
*
* @param bo
* @return haiweijson
*/
List<HwWeb1Vo> queryList(HwWeb1Bo bo);
/**
* haiweijson
*
* @param bo haiweijson
* @return
*/
Boolean insertByBo(HwWeb1Bo bo);
/**
* haiweijson
*
* @param bo haiweijson
* @return
*/
Boolean updateByBo(HwWeb1Bo bo);
/**
* haiweijson
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* haiweijson
*
* @param webCode
* @return haiweijson
*/
HwWeb1Vo queryByWebCode(Long webCode);
/**
* (webCode, deviceId, typeId)
*
* @param bo
* @return haiweijson
*/
HwWeb1Vo queryOne(HwWeb1Bo bo);
}

@ -0,0 +1,78 @@
package org.dromara.web.service;
import org.dromara.web.domain.vo.HwWebDocumentVo;
import org.dromara.web.domain.bo.HwWebDocumentBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* hwWebDocumentService
*
* @author zch
* @date 2025-11-28
*/
public interface IHwWebDocumentService {
/**
* hwWebDocument
*
* @param documentId
* @return hwWebDocument
*/
HwWebDocumentVo queryById(String documentId);
/**
* hwWebDocument
*
* @param bo
* @param pageQuery
* @return hwWebDocument
*/
TableDataInfo<HwWebDocumentVo> queryPageList(HwWebDocumentBo bo, PageQuery pageQuery);
/**
* hwWebDocument
*
* @param bo
* @return hwWebDocument
*/
List<HwWebDocumentVo> queryList(HwWebDocumentBo bo);
/**
* hwWebDocument
*
* @param bo hwWebDocument
* @return
*/
Boolean insertByBo(HwWebDocumentBo bo);
/**
* hwWebDocument
*
* @param bo hwWebDocument
* @return
*/
Boolean updateByBo(HwWebDocumentBo bo);
/**
* hwWebDocument
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
/**
*
*
*
* @param documentId ID
* @param providedKey
* @return
*/
String verifyAndGetDocumentAddress(String documentId, String providedKey);
}

@ -0,0 +1,76 @@
package org.dromara.web.service;
import org.dromara.web.domain.vo.HwWebMenu1Vo;
import org.dromara.web.domain.bo.HwWebMenu1Bo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* HwWebMenu1Service
*
* @author zch
* @date 2025-11-28
*/
public interface IHwWebMenu1Service {
/**
* HwWebMenu1
*
* @param webMenuId
* @return HwWebMenu1
*/
HwWebMenu1Vo queryById(Long webMenuId);
/**
* HwWebMenu1
*
* @param bo
* @param pageQuery
* @return HwWebMenu1
*/
TableDataInfo<HwWebMenu1Vo> queryPageList(HwWebMenu1Bo bo, PageQuery pageQuery);
/**
* HwWebMenu1
*
* @param bo
* @return HwWebMenu1
*/
List<HwWebMenu1Vo> queryList(HwWebMenu1Bo bo);
/**
* HwWebMenu1
*
* @param bo HwWebMenu1
* @return
*/
Boolean insertByBo(HwWebMenu1Bo bo);
/**
* HwWebMenu1
*
* @param bo HwWebMenu1
* @return
*/
Boolean updateByBo(HwWebMenu1Bo bo);
/**
* HwWebMenu1
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
*
*
* @param bo
* @return
*/
List<HwWebMenu1Vo> selectMenuTree(HwWebMenu1Bo bo);
}

@ -0,0 +1,76 @@
package org.dromara.web.service;
import org.dromara.web.domain.vo.HwWebMenuVo;
import org.dromara.web.domain.bo.HwWebMenuBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* HwWebMenuService
*
* @author zch
* @date 2025-11-28
*/
public interface IHwWebMenuService {
/**
* HwWebMenu
*
* @param webMenuId
* @return HwWebMenu
*/
HwWebMenuVo queryById(Long webMenuId);
/**
* HwWebMenu
*
* @param bo
* @param pageQuery
* @return HwWebMenu
*/
TableDataInfo<HwWebMenuVo> queryPageList(HwWebMenuBo bo, PageQuery pageQuery);
/**
* HwWebMenu
*
* @param bo
* @return HwWebMenu
*/
List<HwWebMenuVo> queryList(HwWebMenuBo bo);
/**
* HwWebMenu
*
* @param bo HwWebMenu
* @return
*/
Boolean insertByBo(HwWebMenuBo bo);
/**
* HwWebMenu
*
* @param bo HwWebMenu
* @return
*/
Boolean updateByBo(HwWebMenuBo bo);
/**
* HwWebMenu
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
*
*
* @param bo
* @return
*/
List<HwWebMenuVo> selectMenuTree(HwWebMenuBo bo);
}

@ -0,0 +1,76 @@
package org.dromara.web.service;
import org.dromara.web.domain.vo.HwWebVo;
import org.dromara.web.domain.bo.HwWebBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* haiweijsonService
*
* @author zch
* @date 2025-11-28
*/
public interface IHwWebService {
/**
* haiweijson
*
* @param webId
* @return haiweijson
*/
HwWebVo queryById(Long webId);
/**
* haiweijson
*
* @param bo
* @param pageQuery
* @return haiweijson
*/
TableDataInfo<HwWebVo> queryPageList(HwWebBo bo, PageQuery pageQuery);
/**
* haiweijson
*
* @param bo
* @return haiweijson
*/
List<HwWebVo> queryList(HwWebBo bo);
/**
* haiweijson
*
* @param bo haiweijson
* @return
*/
Boolean insertByBo(HwWebBo bo);
/**
* haiweijson
*
* @param bo haiweijson
* @return
*/
Boolean updateByBo(HwWebBo bo);
/**
* haiweijson
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* haiweijson
*
* @param webCode
* @return haiweijson
*/
HwWebVo queryByWebCode(Long webCode);
}

@ -0,0 +1,216 @@
package org.dromara.web.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.dromara.web.domain.bo.HwWeb1Bo;
import org.dromara.web.domain.vo.HwWeb1Vo;
import org.dromara.web.domain.HwWeb1;
import org.dromara.web.mapper.HwWeb1Mapper;
import org.dromara.web.service.IHwWeb1Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* haiweijsonService
*
* @author zch
* @date 2025-11-28
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class HwWeb1ServiceImpl implements IHwWeb1Service {
private final HwWeb1Mapper baseMapper;
/**
* haiweijson
*
* @param webId
* @return haiweijson
*/
@Override
public HwWeb1Vo queryById(Long webId){
return baseMapper.selectCustomHwWeb1VoById(webId);
}
/**
* haiweijson
*
* @param bo
* @param pageQuery
* @return haiweijson
*/
@Override
public TableDataInfo<HwWeb1Vo> queryPageList(HwWeb1Bo bo, PageQuery pageQuery) {
LambdaQueryWrapper<HwWeb1> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 进行分页查询
Page<HwWeb1Vo> result = baseMapper.selectCustomHwWeb1VoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* haiweijson
*
* @param bo
* @return haiweijson
*/
@Override
public List<HwWeb1Vo> queryList(HwWeb1Bo bo) {
LambdaQueryWrapper<HwWeb1> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 查询列表
return baseMapper.selectCustomHwWeb1VoList(lqw);
}
/**
*
* 使 @TableLogic MyBatis-Plus
*
* @param bo
* @return
*/
private LambdaQueryWrapper<HwWeb1> buildQueryWrapper(HwWeb1Bo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<HwWeb1> lqw = Wrappers.lambdaQuery();
lqw.orderByAsc(HwWeb1::getWebId);
lqw.eq(StringUtils.isNotBlank(bo.getWebJson()), HwWeb1::getWebJson, bo.getWebJson());
lqw.eq(StringUtils.isNotBlank(bo.getWebJsonString()), HwWeb1::getWebJsonString, bo.getWebJsonString());
lqw.eq(bo.getWebCode() != null, HwWeb1::getWebCode, bo.getWebCode());
lqw.eq(bo.getDeviceId() != null, HwWeb1::getDeviceId, bo.getDeviceId());
lqw.eq(bo.getTypeId() != null, HwWeb1::getTypeId, bo.getTypeId());
// @TableLogic 会自动过滤已删除记录,无需手动添加条件
lqw.eq(StringUtils.isNotBlank(bo.getWebJsonEnglish()), HwWeb1::getWebJsonEnglish, bo.getWebJsonEnglish());
return lqw;
}
/**
* haiweijson
*
* @param bo haiweijson
* @return
*/
@Override
public Boolean insertByBo(HwWeb1Bo bo) {
HwWeb1 add = MapstructUtils.convert(bo, HwWeb1.class);
// 设置逻辑删除默认值
if (add.getIsDelete() == null) {
add.setIsDelete("0");
}
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setWebId(add.getWebId());
}
return flag;
}
/**
* haiweijson
* <p>
*
* 1. (webCode, deviceId, typeId)
* 2. is_delete = '1'
* 3. is_delete = '0'
* <p>
*
* HwWeb HwWeb1
*
* @param bo haiweijson
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updateByBo(HwWeb1Bo bo) {
HwWeb1 update = MapstructUtils.convert(bo, HwWeb1.class);
validEntityBeforeSave(update);
// 第一步:按 (webCode, deviceId, typeId) 三元组查询所有未删除记录(@TableLogic 自动过滤)
LambdaQueryWrapper<HwWeb1> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(HwWeb1::getWebCode, bo.getWebCode())
.eq(bo.getDeviceId() != null, HwWeb1::getDeviceId, bo.getDeviceId())
.eq(bo.getTypeId() != null, HwWeb1::getTypeId, bo.getTypeId());
List<HwWeb1> existList = baseMapper.selectList(queryWrapper);
// 第二步:若存在旧记录,使用 MyBatis-Plus 逻辑删除
if (!existList.isEmpty()) {
List<Long> oldIds = existList.stream().map(HwWeb1::getWebId).toList();
// @TableLogic 会自动将 delete 转为 update is_delete = '1'
baseMapper.deleteByIds(oldIds);
}
// 第三步:插入新记录,设置为未删除状态
update.setWebId(null);
update.setIsDelete("0");
return baseMapper.insert(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(HwWeb1 entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* haiweijson
* 使 @TableLogic MyBatis-Plus delete update is_delete = '1'
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
// @TableLogic 自动处理逻辑删除
return baseMapper.deleteByIds(ids) > 0;
}
/**
* haiweijson
*
* @param webCode
* @return haiweijson
*/
@Override
public HwWeb1Vo queryByWebCode(Long webCode) {
// 查询指定 webCode 的记录(@TableLogic 自动过滤已删除记录)
LambdaQueryWrapper<HwWeb1> lqw = Wrappers.lambdaQuery();
lqw.eq(HwWeb1::getWebCode, webCode)
.last("LIMIT 1");
HwWeb1 entity = baseMapper.selectOne(lqw);
return MapstructUtils.convert(entity, HwWeb1Vo.class);
}
/**
* (webCode, deviceId, typeId)
*
* @param bo
* @return haiweijson
*/
@Override
public HwWeb1Vo queryOne(HwWeb1Bo bo) {
// 按 (webCode, deviceId, typeId) 三元组查询唯一记录(@TableLogic 自动过滤已删除记录)
LambdaQueryWrapper<HwWeb1> lqw = Wrappers.lambdaQuery();
lqw.eq(HwWeb1::getWebCode, bo.getWebCode())
.eq(bo.getDeviceId() != null, HwWeb1::getDeviceId, bo.getDeviceId())
.eq(bo.getTypeId() != null, HwWeb1::getTypeId, bo.getTypeId())
.last("LIMIT 1");
HwWeb1 entity = baseMapper.selectOne(lqw);
return MapstructUtils.convert(entity, HwWeb1Vo.class);
}
}

@ -0,0 +1,203 @@
package org.dromara.web.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.dromara.web.domain.bo.HwWebDocumentBo;
import org.dromara.web.domain.vo.HwWebDocumentVo;
import org.dromara.web.domain.HwWebDocument;
import org.dromara.web.mapper.HwWebDocumentMapper;
import org.dromara.web.service.IHwWebDocumentService;
import org.dromara.common.core.exception.ServiceException;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* hwWebDocumentService
*
* @author zch
* @date 2025-11-28
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class HwWebDocumentServiceImpl implements IHwWebDocumentService {
private final HwWebDocumentMapper baseMapper;
/**
* hwWebDocument
*
* @param documentId
* @return hwWebDocument
*/
@Override
public HwWebDocumentVo queryById(String documentId){
return baseMapper.selectCustomHwWebDocumentVoById(documentId);
}
/**
* hwWebDocument
*
* @param bo
* @param pageQuery
* @return hwWebDocument
*/
@Override
public TableDataInfo<HwWebDocumentVo> queryPageList(HwWebDocumentBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<HwWebDocument> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 进行分页查询
Page<HwWebDocumentVo> result = baseMapper.selectCustomHwWebDocumentVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* hwWebDocument
*
* @param bo
* @return hwWebDocument
*/
@Override
public List<HwWebDocumentVo> queryList(HwWebDocumentBo bo) {
LambdaQueryWrapper<HwWebDocument> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 查询列表
return baseMapper.selectCustomHwWebDocumentVoList(lqw);
}
private LambdaQueryWrapper<HwWebDocument> buildQueryWrapper(HwWebDocumentBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<HwWebDocument> lqw = Wrappers.lambdaQuery();
lqw.orderByAsc(HwWebDocument::getDocumentId);
lqw.eq(StringUtils.isNotBlank(bo.getDocumentAddress()), HwWebDocument::getDocumentAddress, bo.getDocumentAddress());
lqw.eq(StringUtils.isNotBlank(bo.getWebCode()), HwWebDocument::getWebCode, bo.getWebCode());
lqw.eq(StringUtils.isNotBlank(bo.getSecretKey()), HwWebDocument::getSecretKey, bo.getSecretKey());
lqw.eq(StringUtils.isNotBlank(bo.getJson()), HwWebDocument::getJson, bo.getJson());
lqw.eq(StringUtils.isNotBlank(bo.getType()), HwWebDocument::getType, bo.getType());
// @TableLogic 会自动过滤已删除记录,无需手动添加条件
return lqw;
}
/**
* hwWebDocument
*
* @param bo hwWebDocument
* @return
*/
@Override
public Boolean insertByBo(HwWebDocumentBo bo) {
HwWebDocument add = MapstructUtils.convert(bo, HwWebDocument.class);
// 设置逻辑删除默认值
if (add.getIsDelete() == null) {
add.setIsDelete("0");
}
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setDocumentId(add.getDocumentId());
}
return flag;
}
/**
* hwWebDocument
* <p>
*
* - null NULL
* -
* <p>
* null MyBatis-Plus
*
* @param bo hwWebDocument
* @return
*/
@Override
public Boolean updateByBo(HwWebDocumentBo bo) {
// 特殊处理 secretKey前端不传或传 null 时,设为空字符串以触发清空密钥操作
if (bo.getSecretKey() == null) {
bo.setSecretKey("");
}
HwWebDocument update = MapstructUtils.convert(bo, HwWebDocument.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(HwWebDocument entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* hwWebDocument
* 使 @TableLogic MyBatis-Plus delete update is_delete = '1'
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
// @TableLogic 自动处理逻辑删除
return baseMapper.deleteByIds(ids) > 0;
}
/**
*
* <p>
*
* 1. documentId
* 2. secretKey
* 3. secretKey
* -
* - "密钥不能为空"
* - "密钥错误"
*
* @param documentId ID
* @param providedKey
* @return
*/
@Override
public String verifyAndGetDocumentAddress(String documentId, String providedKey) {
// 第一步:查询文件记录
HwWebDocumentVo document = queryById(documentId);
if (document == null) {
throw new ServiceException("文件不存在");
}
String secretKey = document.getSecretKey();
String address = document.getDocumentAddress();
// 第二步:检查文件是否需要密钥保护
if (secretKey == null || secretKey.trim().isEmpty()) {
// 无密钥保护,直接返回文件地址
return address;
}
// 第三步:验证用户提供的密钥
String trimmedProvided = providedKey == null ? null : providedKey.trim();
if (trimmedProvided == null || trimmedProvided.isEmpty()) {
throw new ServiceException("密钥不能为空");
}
// 第四步:比对密钥
if (secretKey.trim().equals(trimmedProvided)) {
return address;
} else {
throw new ServiceException("密钥错误");
}
}
}

@ -0,0 +1,249 @@
package org.dromara.web.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.dromara.web.domain.bo.HwWebMenu1Bo;
import org.dromara.web.domain.vo.HwWebMenu1Vo;
import org.dromara.web.domain.HwWebMenu1;
import org.dromara.web.mapper.HwWebMenu1Mapper;
import org.dromara.web.service.IHwWebMenu1Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.stream.Collectors;
/**
* HwWebMenu1Service
*
* @author zch
* @date 2025-11-28
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class HwWebMenu1ServiceImpl implements IHwWebMenu1Service {
private final HwWebMenu1Mapper baseMapper;
/**
* HwWebMenu1
*
* @param webMenuId
* @return HwWebMenu1
*/
@Override
public HwWebMenu1Vo queryById(Long webMenuId){
return baseMapper.selectCustomHwWebMenu1VoById(webMenuId);
}
/**
* HwWebMenu1
*
* @param bo
* @param pageQuery
* @return HwWebMenu1
*/
@Override
public TableDataInfo<HwWebMenu1Vo> queryPageList(HwWebMenu1Bo bo, PageQuery pageQuery) {
LambdaQueryWrapper<HwWebMenu1> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 进行分页查询
Page<HwWebMenu1Vo> result = baseMapper.selectCustomHwWebMenu1VoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* HwWebMenu1
*
* @param bo
* @return HwWebMenu1
*/
@Override
public List<HwWebMenu1Vo> queryList(HwWebMenu1Bo bo) {
LambdaQueryWrapper<HwWebMenu1> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 查询列表
return baseMapper.selectCustomHwWebMenu1VoList(lqw);
}
private LambdaQueryWrapper<HwWebMenu1> buildQueryWrapper(HwWebMenu1Bo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<HwWebMenu1> lqw = Wrappers.lambdaQuery();
lqw.orderByAsc(HwWebMenu1::getWebMenuId);
lqw.eq(bo.getParent() != null, HwWebMenu1::getParent, bo.getParent());
lqw.eq(StringUtils.isNotBlank(bo.getAncestors()), HwWebMenu1::getAncestors, bo.getAncestors());
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), HwWebMenu1::getStatus, bo.getStatus());
lqw.like(StringUtils.isNotBlank(bo.getWebMenuName()), HwWebMenu1::getWebMenuName, bo.getWebMenuName());
lqw.eq(StringUtils.isNotBlank(bo.getWebMenuPic()), HwWebMenu1::getWebMenuPic, bo.getWebMenuPic());
lqw.eq(bo.getWebMenuType() != null, HwWebMenu1::getWebMenuType, bo.getWebMenuType());
lqw.eq(StringUtils.isNotBlank(bo.getValue()), HwWebMenu1::getValue, bo.getValue());
// @TableLogic 会自动过滤已删除记录,无需手动添加条件
lqw.eq(StringUtils.isNotBlank(bo.getWebMenuNameEnglish()), HwWebMenu1::getWebMenuNameEnglish, bo.getWebMenuNameEnglish());
return lqw;
}
/**
* HwWebMenu1
*
* @param bo HwWebMenu1
* @return
*/
@Override
public Boolean insertByBo(HwWebMenu1Bo bo) {
HwWebMenu1 add = MapstructUtils.convert(bo, HwWebMenu1.class);
// 设置逻辑删除默认值
if (add.getIsDelete() == null) {
add.setIsDelete("0");
}
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setWebMenuId(add.getWebMenuId());
}
return flag;
}
/**
* HwWebMenu1
*
* @param bo HwWebMenu1
* @return
*/
@Override
public Boolean updateByBo(HwWebMenu1Bo bo) {
HwWebMenu1 update = MapstructUtils.convert(bo, HwWebMenu1.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(HwWebMenu1 entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* HwWebMenu1
* 使 @TableLogic MyBatis-Plus delete update is_delete = '1'
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
// @TableLogic 自动处理逻辑删除
return baseMapper.deleteByIds(ids) > 0;
}
/**
*
* <p>
*
* 1.
* 2. parent
* 3. 使 children
*
* @param bo
* @return
*/
@Override
public List<HwWebMenu1Vo> selectMenuTree(HwWebMenu1Bo bo) {
// 第一步:查询平铺的菜单列表
List<HwWebMenu1Vo> menuList = queryList(bo);
// 第二步:构建树形结构
return buildWebMenuTree(menuList);
}
/**
*
* <p>
*
* 1. webMenuId tempList
* 2.
* - parent null 0
* - parent tempList
* 3.
*
* @param menus
* @return
*/
private List<HwWebMenu1Vo> buildWebMenuTree(List<HwWebMenu1Vo> menus) {
List<HwWebMenu1Vo> returnList = new ArrayList<>();
// 第一步收集所有菜单ID
List<Long> tempList = menus.stream()
.map(HwWebMenu1Vo::getWebMenuId)
.collect(Collectors.toList());
// 第二步:找出所有根节点并递归构建子树
for (HwWebMenu1Vo menu : menus) {
// 判断是否为顶级节点parent为null、0或不在当前列表中
if (menu.getParent() == null || menu.getParent() == 0L || !tempList.contains(menu.getParent())) {
recursionFn(menus, menu);
returnList.add(menu);
}
}
// 如果没有找到顶级节点,直接返回原列表
if (returnList.isEmpty()) {
returnList = menus;
}
return returnList;
}
/**
*
*
* @param list
* @param t
*/
private void recursionFn(List<HwWebMenu1Vo> list, HwWebMenu1Vo t) {
// 得到子节点列表
List<HwWebMenu1Vo> childList = getChildList(list, t);
t.setChildren(childList);
for (HwWebMenu1Vo tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
}
/**
*
*
* @param list
* @param t
* @return
*/
private List<HwWebMenu1Vo> getChildList(List<HwWebMenu1Vo> list, HwWebMenu1Vo t) {
List<HwWebMenu1Vo> tlist = new ArrayList<>();
for (HwWebMenu1Vo n : list) {
if (n.getParent() != null && n.getParent().longValue() == t.getWebMenuId().longValue()) {
tlist.add(n);
}
}
return tlist;
}
/**
*
*
* @param list
* @param t
* @return
*/
private boolean hasChild(List<HwWebMenu1Vo> list, HwWebMenu1Vo t) {
return !getChildList(list, t).isEmpty();
}
}

@ -0,0 +1,248 @@
package org.dromara.web.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.dromara.web.domain.bo.HwWebMenuBo;
import org.dromara.web.domain.vo.HwWebMenuVo;
import org.dromara.web.domain.HwWebMenu;
import org.dromara.web.mapper.HwWebMenuMapper;
import org.dromara.web.service.IHwWebMenuService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.stream.Collectors;
/**
* HwWebMenuService
*
* @author zch
* @date 2025-11-28
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class HwWebMenuServiceImpl implements IHwWebMenuService {
private final HwWebMenuMapper baseMapper;
/**
* HwWebMenu
*
* @param webMenuId
* @return HwWebMenu
*/
@Override
public HwWebMenuVo queryById(Long webMenuId){
return baseMapper.selectCustomHwWebMenuVoById(webMenuId);
}
/**
* HwWebMenu
*
* @param bo
* @param pageQuery
* @return HwWebMenu
*/
@Override
public TableDataInfo<HwWebMenuVo> queryPageList(HwWebMenuBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<HwWebMenu> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 进行分页查询
Page<HwWebMenuVo> result = baseMapper.selectCustomHwWebMenuVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* HwWebMenu
*
* @param bo
* @return HwWebMenu
*/
@Override
public List<HwWebMenuVo> queryList(HwWebMenuBo bo) {
LambdaQueryWrapper<HwWebMenu> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 查询列表
return baseMapper.selectCustomHwWebMenuVoList(lqw);
}
private LambdaQueryWrapper<HwWebMenu> buildQueryWrapper(HwWebMenuBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<HwWebMenu> lqw = Wrappers.lambdaQuery();
lqw.orderByAsc(HwWebMenu::getWebMenuId);
lqw.eq(bo.getParent() != null, HwWebMenu::getParent, bo.getParent());
lqw.eq(StringUtils.isNotBlank(bo.getAncestors()), HwWebMenu::getAncestors, bo.getAncestors());
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), HwWebMenu::getStatus, bo.getStatus());
lqw.like(StringUtils.isNotBlank(bo.getWebMenuName()), HwWebMenu::getWebMenuName, bo.getWebMenuName());
lqw.eq(StringUtils.isNotBlank(bo.getWebMenuPic()), HwWebMenu::getWebMenuPic, bo.getWebMenuPic());
lqw.eq(bo.getWebMenuType() != null, HwWebMenu::getWebMenuType, bo.getWebMenuType());
// @TableLogic 会自动过滤已删除记录,无需手动添加条件
lqw.eq(StringUtils.isNotBlank(bo.getWebMenuNameEnglish()), HwWebMenu::getWebMenuNameEnglish, bo.getWebMenuNameEnglish());
return lqw;
}
/**
* HwWebMenu
*
* @param bo HwWebMenu
* @return
*/
@Override
public Boolean insertByBo(HwWebMenuBo bo) {
HwWebMenu add = MapstructUtils.convert(bo, HwWebMenu.class);
// 设置逻辑删除默认值
if (add.getIsDelete() == null) {
add.setIsDelete("0");
}
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setWebMenuId(add.getWebMenuId());
}
return flag;
}
/**
* HwWebMenu
*
* @param bo HwWebMenu
* @return
*/
@Override
public Boolean updateByBo(HwWebMenuBo bo) {
HwWebMenu update = MapstructUtils.convert(bo, HwWebMenu.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(HwWebMenu entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* HwWebMenu
* 使 @TableLogic MyBatis-Plus delete update is_delete = '1'
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
// @TableLogic 自动处理逻辑删除
return baseMapper.deleteByIds(ids) > 0;
}
/**
*
* <p>
*
* 1.
* 2. parent
* 3. 使 children
*
* @param bo
* @return
*/
@Override
public List<HwWebMenuVo> selectMenuTree(HwWebMenuBo bo) {
// 第一步:查询平铺的菜单列表
List<HwWebMenuVo> menuList = queryList(bo);
// 第二步:构建树形结构
return buildWebMenuTree(menuList);
}
/**
*
* <p>
*
* 1. webMenuId tempList
* 2.
* - parent null 0
* - parent tempList
* 3.
*
* @param menus
* @return
*/
private List<HwWebMenuVo> buildWebMenuTree(List<HwWebMenuVo> menus) {
List<HwWebMenuVo> returnList = new ArrayList<>();
// 第一步收集所有菜单ID
List<Long> tempList = menus.stream()
.map(HwWebMenuVo::getWebMenuId)
.collect(Collectors.toList());
// 第二步:找出所有根节点并递归构建子树
for (HwWebMenuVo menu : menus) {
// 判断是否为顶级节点parent为null、0或不在当前列表中
if (menu.getParent() == null || menu.getParent() == 0L || !tempList.contains(menu.getParent())) {
recursionFn(menus, menu);
returnList.add(menu);
}
}
// 如果没有找到顶级节点,直接返回原列表
if (returnList.isEmpty()) {
returnList = menus;
}
return returnList;
}
/**
*
*
* @param list
* @param t
*/
private void recursionFn(List<HwWebMenuVo> list, HwWebMenuVo t) {
// 得到子节点列表
List<HwWebMenuVo> childList = getChildList(list, t);
t.setChildren(childList);
for (HwWebMenuVo tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
}
/**
*
*
* @param list
* @param t
* @return
*/
private List<HwWebMenuVo> getChildList(List<HwWebMenuVo> list, HwWebMenuVo t) {
List<HwWebMenuVo> tlist = new ArrayList<>();
for (HwWebMenuVo n : list) {
if (n.getParent() != null && n.getParent().longValue() == t.getWebMenuId().longValue()) {
tlist.add(n);
}
}
return tlist;
}
/**
*
*
* @param list
* @param t
* @return
*/
private boolean hasChild(List<HwWebMenuVo> list, HwWebMenuVo t) {
return !getChildList(list, t).isEmpty();
}
}

@ -0,0 +1,193 @@
package org.dromara.web.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.dromara.web.domain.bo.HwWebBo;
import org.dromara.web.domain.vo.HwWebVo;
import org.dromara.web.domain.HwWeb;
import org.dromara.web.mapper.HwWebMapper;
import org.dromara.web.service.IHwWebService;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* haiweijsonService
*
* @author zch
* @date 2025-11-28
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class HwWebServiceImpl implements IHwWebService {
private final HwWebMapper baseMapper;
/**
* haiweijson
*
* @param webId
* @return haiweijson
*/
@Override
public HwWebVo queryById(Long webId){
return baseMapper.selectCustomHwWebVoById(webId);
}
/**
* haiweijson
*
* @param bo
* @param pageQuery
* @return haiweijson
*/
@Override
public TableDataInfo<HwWebVo> queryPageList(HwWebBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<HwWeb> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 进行分页查询
Page<HwWebVo> result = baseMapper.selectCustomHwWebVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* haiweijson
*
* @param bo
* @return haiweijson
*/
@Override
public List<HwWebVo> queryList(HwWebBo bo) {
LambdaQueryWrapper<HwWeb> lqw = buildQueryWrapper(bo);
// 使用自定义 Mapper XML + MyBatis-Plus Wrapper 查询列表
return baseMapper.selectCustomHwWebVoList(lqw);
}
/**
*
* 使 @TableLogic MyBatis-Plus
*
* @param bo
* @return
*/
private LambdaQueryWrapper<HwWeb> buildQueryWrapper(HwWebBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<HwWeb> lqw = Wrappers.lambdaQuery();
lqw.orderByAsc(HwWeb::getWebId);
lqw.eq(StringUtils.isNotBlank(bo.getWebJson()), HwWeb::getWebJson, bo.getWebJson());
lqw.eq(StringUtils.isNotBlank(bo.getWebJsonString()), HwWeb::getWebJsonString, bo.getWebJsonString());
lqw.eq(bo.getWebCode() != null, HwWeb::getWebCode, bo.getWebCode());
// @TableLogic 会自动过滤已删除记录,无需手动添加条件
lqw.eq(StringUtils.isNotBlank(bo.getWebJsonEnglish()), HwWeb::getWebJsonEnglish, bo.getWebJsonEnglish());
return lqw;
}
/**
* haiweijson
*
* @param bo haiweijson
* @return
*/
@Override
public Boolean insertByBo(HwWebBo bo) {
HwWeb add = MapstructUtils.convert(bo, HwWeb.class);
// 设置逻辑删除默认值
if (add.getIsDelete() == null) {
add.setIsDelete("0");
}
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setWebId(add.getWebId());
}
return flag;
}
/**
* haiweijson
* <p>
*
* 1. webCode
* 2. is_delete = '1'
* 3. is_delete = '0'
* <p>
*
*
* @param bo haiweijson
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updateByBo(HwWebBo bo) {
HwWeb update = MapstructUtils.convert(bo, HwWeb.class);
validEntityBeforeSave(update);
// 第一步:查询同一 webCode 的所有未删除记录(@TableLogic 自动过滤)
LambdaQueryWrapper<HwWeb> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(HwWeb::getWebCode, bo.getWebCode());
List<HwWeb> existList = baseMapper.selectList(queryWrapper);
// 第二步:若存在旧记录,使用 MyBatis-Plus 逻辑删除
if (!existList.isEmpty()) {
List<Long> oldIds = existList.stream().map(HwWeb::getWebId).toList();
// @TableLogic 会自动将 delete 转为 update is_delete = '1'
baseMapper.deleteByIds(oldIds);
}
// 第三步:插入新记录,设置为未删除状态
update.setWebId(null);
update.setIsDelete("0");
return baseMapper.insert(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(HwWeb entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* haiweijson
* 使 @TableLogic MyBatis-Plus delete update is_delete = '1'
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
// @TableLogic 自动处理逻辑删除
return baseMapper.deleteByIds(ids) > 0;
}
/**
* haiweijson
*
* @param webCode
* @return haiweijson
*/
@Override
public HwWebVo queryByWebCode(Long webCode) {
// 查询指定 webCode 的记录(@TableLogic 自动过滤已删除记录)
LambdaQueryWrapper<HwWeb> lqw = Wrappers.lambdaQuery();
lqw.eq(HwWeb::getWebCode, webCode)
.last("LIMIT 1");
HwWeb entity = baseMapper.selectOne(lqw);
return MapstructUtils.convert(entity, HwWebVo.class);
}
}

@ -0,0 +1,176 @@
<?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="org.dromara.web.mapper.HwWeb1Mapper">
<resultMap type="org.dromara.web.domain.vo.HwWeb1Vo" id="HwWeb1Result">
</resultMap>
<select id="selectCustomHwWeb1VoList" resultMap="HwWeb1Result">
select t.web_id, t.web_json, t.web_json_string, t.web_code, t.device_id, t.file_address, t.secret_ket, t.typeId, t.is_delete, t.update_time, t.create_time, t.web_json_english
from hw_web1 t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 根据ID查询详情 -->
<select id="selectCustomHwWeb1VoById" resultMap="HwWeb1Result">
select t.web_id, t.web_json, t.web_json_string, t.web_code, t.device_id, t.file_address, t.secret_ket, t.typeId, t.is_delete, t.update_time, t.create_time, t.web_json_english
from hw_web1 t
where t.web_id = #{webId}
</select>
<!-- 批量查询 - 根据ID列表 -->
<select id="selectCustomHwWeb1VoByIds" resultMap="HwWeb1Result">
select t.web_id, t.web_json, t.web_json_string, t.web_code, t.device_id, t.file_address, t.secret_ket, t.typeId, t.is_delete, t.update_time, t.create_time, t.web_json_english
from hw_web1 t
where t.web_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 统计查询 -->
<select id="countCustomHwWeb1" resultType="java.lang.Long">
select count(1) from hw_web1 t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomHwWeb1VoPage" resultMap="HwWeb1Result">
select t.web_id, t.web_json, t.web_json_string, t.web_code, t.device_id, t.file_address, t.secret_ket, t.typeId, t.is_delete, t.update_time, t.create_time, t.web_json_english
from hw_web1 t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 批量插入 -->
<insert id="batchInsertHwWeb1">
insert into hw_web1(
web_json,
web_json_string,
web_code,
device_id,
file_address,
secret_ket,
typeId,
is_delete,
update_time,
create_time,
web_json_english
)
values
<foreach collection="list" item="item" separator=",">
(
#{item.webJson},
#{item.webJsonString},
#{item.webCode},
#{item.deviceId},
#{item.fileAddress},
#{item.secretKet},
#{item.typeid},
#{item.isDelete},
#{item.updateTime},
#{item.createTime},
#{item.webJsonEnglish}
)
</foreach>
</insert>
<!-- 批量更新 -->
<update id="batchUpdateHwWeb1">
<foreach collection="list" item="item" separator=";">
update hw_web1
<set>
<if test="item.webJson != null and item.webJson != ''">
web_json = #{item.webJson},
</if>
<if test="item.webJsonString != null and item.webJsonString != ''">
web_json_string = #{item.webJsonString},
</if>
<if test="item.webCode != null">
web_code = #{item.webCode},
</if>
<if test="item.deviceId != null">
device_id = #{item.deviceId},
</if>
<if test="item.fileAddress != null and item.fileAddress != ''">
file_address = #{item.fileAddress},
</if>
<if test="item.secretKet != null and item.secretKet != ''">
secret_ket = #{item.secretKet},
</if>
<if test="item.typeid != null">
typeId = #{item.typeid},
</if>
<if test="item.isDelete != null and item.isDelete != ''">
is_delete = #{item.isDelete},
</if>
<if test="item.updateTime != null">
update_time = #{item.updateTime},
</if>
<if test="item.createTime != null">
create_time = #{item.createTime},
</if>
<if test="item.webJsonEnglish != null and item.webJsonEnglish != ''">
web_json_english = #{item.webJsonEnglish}
</if>
</set>
where web_id = #{item.webId}
</foreach>
</update>
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomHwWeb1">
delete from hw_web1
<if test="ew != null">
${ew.customSqlSegment}
</if>
</delete>
<!-- 根据ID列表批量删除 -->
<delete id="deleteCustomHwWeb1ByIds">
delete from hw_web1
where web_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 检查是否存在 -->
<select id="existsHwWeb1" resultType="java.lang.Boolean">
select count(1) > 0 from hw_web1 t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
</mapper>

@ -0,0 +1,166 @@
<?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="org.dromara.web.mapper.HwWebDocumentMapper">
<resultMap type="org.dromara.web.domain.vo.HwWebDocumentVo" id="HwWebDocumentResult">
</resultMap>
<select id="selectCustomHwWebDocumentVoList" resultMap="HwWebDocumentResult">
select t.document_id, t.tenant_id, t.document_address, t.create_time, t.web_code, t.secretKey, t.json, t.type, t.is_delete, t.update_time
from hw_web_document t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 根据ID查询详情 -->
<select id="selectCustomHwWebDocumentVoById" resultMap="HwWebDocumentResult">
select t.document_id, t.tenant_id, t.document_address, t.create_time, t.web_code, t.secretKey, t.json, t.type, t.is_delete, t.update_time
from hw_web_document t
where t.document_id = #{documentId}
</select>
<!-- 批量查询 - 根据ID列表 -->
<select id="selectCustomHwWebDocumentVoByIds" resultMap="HwWebDocumentResult">
select t.document_id, t.tenant_id, t.document_address, t.create_time, t.web_code, t.secretKey, t.json, t.type, t.is_delete, t.update_time
from hw_web_document t
where t.document_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 统计查询 -->
<select id="countCustomHwWebDocument" resultType="java.lang.Long">
select count(1) from hw_web_document t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomHwWebDocumentVoPage" resultMap="HwWebDocumentResult">
select t.document_id, t.tenant_id, t.document_address, t.create_time, t.web_code, t.secretKey, t.json, t.type, t.is_delete, t.update_time
from hw_web_document t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 批量插入 -->
<insert id="batchInsertHwWebDocument">
insert into hw_web_document(
document_id,
tenant_id,
document_address,
create_time,
web_code,
secretKey,
json,
type,
is_delete,
update_time
)
values
<foreach collection="list" item="item" separator=",">
(
#{item.documentId},
#{item.tenantId},
#{item.documentAddress},
#{item.createTime},
#{item.webCode},
#{item.secretkey},
#{item.json},
#{item.type},
#{item.isDelete},
#{item.updateTime}
)
</foreach>
</insert>
<!-- 批量更新 -->
<update id="batchUpdateHwWebDocument">
<foreach collection="list" item="item" separator=";">
update hw_web_document
<set>
<if test="item.tenantId != null">
tenant_id = #{item.tenantId},
</if>
<if test="item.documentAddress != null and item.documentAddress != ''">
document_address = #{item.documentAddress},
</if>
<if test="item.createTime != null">
create_time = #{item.createTime},
</if>
<if test="item.webCode != null and item.webCode != ''">
web_code = #{item.webCode},
</if>
<if test="item.secretkey != null and item.secretkey != ''">
secretKey = #{item.secretkey},
</if>
<if test="item.json != null and item.json != ''">
json = #{item.json},
</if>
<if test="item.type != null and item.type != ''">
type = #{item.type},
</if>
<if test="item.isDelete != null and item.isDelete != ''">
is_delete = #{item.isDelete},
</if>
<if test="item.updateTime != null">
update_time = #{item.updateTime}
</if>
</set>
where document_id = #{item.documentId}
</foreach>
</update>
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomHwWebDocument">
delete from hw_web_document
<if test="ew != null">
${ew.customSqlSegment}
</if>
</delete>
<!-- 根据ID列表批量删除 -->
<delete id="deleteCustomHwWebDocumentByIds">
delete from hw_web_document
where document_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 检查是否存在 -->
<select id="existsHwWebDocument" resultType="java.lang.Boolean">
select count(1) > 0 from hw_web_document t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
</mapper>

@ -0,0 +1,148 @@
<?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="org.dromara.web.mapper.HwWebMapper">
<resultMap type="org.dromara.web.domain.vo.HwWebVo" id="HwWebResult">
</resultMap>
<select id="selectCustomHwWebVoList" resultMap="HwWebResult">
select t.web_id, t.web_json, t.web_json_string, t.web_code, t.is_delete, t.update_time, t.create_time, t.web_json_english
from hw_web t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 根据ID查询详情 -->
<select id="selectCustomHwWebVoById" resultMap="HwWebResult">
select t.web_id, t.web_json, t.web_json_string, t.web_code, t.is_delete, t.update_time, t.create_time, t.web_json_english
from hw_web t
where t.web_id = #{webId}
</select>
<!-- 批量查询 - 根据ID列表 -->
<select id="selectCustomHwWebVoByIds" resultMap="HwWebResult">
select t.web_id, t.web_json, t.web_json_string, t.web_code, t.is_delete, t.update_time, t.create_time, t.web_json_english
from hw_web t
where t.web_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 统计查询 -->
<select id="countCustomHwWeb" resultType="java.lang.Long">
select count(1) from hw_web t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomHwWebVoPage" resultMap="HwWebResult">
select t.web_id, t.web_json, t.web_json_string, t.web_code, t.is_delete, t.update_time, t.create_time, t.web_json_english
from hw_web t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 批量插入 -->
<insert id="batchInsertHwWeb">
insert into hw_web(
web_json,
web_json_string,
web_code,
is_delete,
update_time,
create_time,
web_json_english
)
values
<foreach collection="list" item="item" separator=",">
(
#{item.webJson},
#{item.webJsonString},
#{item.webCode},
#{item.isDelete},
#{item.updateTime},
#{item.createTime},
#{item.webJsonEnglish}
)
</foreach>
</insert>
<!-- 批量更新 -->
<update id="batchUpdateHwWeb">
<foreach collection="list" item="item" separator=";">
update hw_web
<set>
<if test="item.webJson != null and item.webJson != ''">
web_json = #{item.webJson},
</if>
<if test="item.webJsonString != null and item.webJsonString != ''">
web_json_string = #{item.webJsonString},
</if>
<if test="item.webCode != null">
web_code = #{item.webCode},
</if>
<if test="item.isDelete != null and item.isDelete != ''">
is_delete = #{item.isDelete},
</if>
<if test="item.updateTime != null">
update_time = #{item.updateTime},
</if>
<if test="item.createTime != null">
create_time = #{item.createTime},
</if>
<if test="item.webJsonEnglish != null and item.webJsonEnglish != ''">
web_json_english = #{item.webJsonEnglish}
</if>
</set>
where web_id = #{item.webId}
</foreach>
</update>
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomHwWeb">
delete from hw_web
<if test="ew != null">
${ew.customSqlSegment}
</if>
</delete>
<!-- 根据ID列表批量删除 -->
<delete id="deleteCustomHwWebByIds">
delete from hw_web
where web_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 检查是否存在 -->
<select id="existsHwWeb" resultType="java.lang.Boolean">
select count(1) > 0 from hw_web t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
</mapper>

@ -0,0 +1,183 @@
<?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="org.dromara.web.mapper.HwWebMenu1Mapper">
<resultMap type="org.dromara.web.domain.vo.HwWebMenu1Vo" id="HwWebMenu1Result">
</resultMap>
<select id="selectCustomHwWebMenu1VoList" resultMap="HwWebMenu1Result">
select t.web_menu_id, t.parent, t.ancestors, t.status, t.web_menu_name, t.tenant_id, t.web_menu__pic, t.web_menu_type, t.value, t.is_delete, t.update_time, t.create_time, t.web_menu_name_english
from hw_web_menu1 t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 根据ID查询详情 -->
<select id="selectCustomHwWebMenu1VoById" resultMap="HwWebMenu1Result">
select t.web_menu_id, t.parent, t.ancestors, t.status, t.web_menu_name, t.tenant_id, t.web_menu__pic, t.web_menu_type, t.value, t.is_delete, t.update_time, t.create_time, t.web_menu_name_english
from hw_web_menu1 t
where t.web_menu_id = #{webMenuId}
</select>
<!-- 批量查询 - 根据ID列表 -->
<select id="selectCustomHwWebMenu1VoByIds" resultMap="HwWebMenu1Result">
select t.web_menu_id, t.parent, t.ancestors, t.status, t.web_menu_name, t.tenant_id, t.web_menu__pic, t.web_menu_type, t.value, t.is_delete, t.update_time, t.create_time, t.web_menu_name_english
from hw_web_menu1 t
where t.web_menu_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 统计查询 -->
<select id="countCustomHwWebMenu1" resultType="java.lang.Long">
select count(1) from hw_web_menu1 t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomHwWebMenu1VoPage" resultMap="HwWebMenu1Result">
select t.web_menu_id, t.parent, t.ancestors, t.status, t.web_menu_name, t.tenant_id, t.web_menu__pic, t.web_menu_type, t.value, t.is_delete, t.update_time, t.create_time, t.web_menu_name_english
from hw_web_menu1 t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 批量插入 -->
<insert id="batchInsertHwWebMenu1">
insert into hw_web_menu1(
parent,
ancestors,
status,
web_menu_name,
tenant_id,
web_menu__pic,
web_menu_type,
value,
is_delete,
update_time,
create_time,
web_menu_name_english
)
values
<foreach collection="list" item="item" separator=",">
(
#{item.parent},
#{item.ancestors},
#{item.status},
#{item.webMenuName},
#{item.tenantId},
#{item.webMenuPic},
#{item.webMenuType},
#{item.value},
#{item.isDelete},
#{item.updateTime},
#{item.createTime},
#{item.webMenuNameEnglish}
)
</foreach>
</insert>
<!-- 批量更新 -->
<update id="batchUpdateHwWebMenu1">
<foreach collection="list" item="item" separator=";">
update hw_web_menu1
<set>
<if test="item.parent != null">
parent = #{item.parent},
</if>
<if test="item.ancestors != null and item.ancestors != ''">
ancestors = #{item.ancestors},
</if>
<if test="item.status != null and item.status != ''">
status = #{item.status},
</if>
<if test="item.webMenuName != null and item.webMenuName != ''">
web_menu_name = #{item.webMenuName},
</if>
<if test="item.tenantId != null">
tenant_id = #{item.tenantId},
</if>
<if test="item.webMenuPic != null and item.webMenuPic != ''">
web_menu__pic = #{item.webMenuPic},
</if>
<if test="item.webMenuType != null">
web_menu_type = #{item.webMenuType},
</if>
<if test="item.value != null and item.value != ''">
value = #{item.value},
</if>
<if test="item.isDelete != null and item.isDelete != ''">
is_delete = #{item.isDelete},
</if>
<if test="item.updateTime != null">
update_time = #{item.updateTime},
</if>
<if test="item.createTime != null">
create_time = #{item.createTime},
</if>
<if test="item.webMenuNameEnglish != null and item.webMenuNameEnglish != ''">
web_menu_name_english = #{item.webMenuNameEnglish}
</if>
</set>
where web_menu_id = #{item.webMenuId}
</foreach>
</update>
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomHwWebMenu1">
delete from hw_web_menu1
<if test="ew != null">
${ew.customSqlSegment}
</if>
</delete>
<!-- 根据ID列表批量删除 -->
<delete id="deleteCustomHwWebMenu1ByIds">
delete from hw_web_menu1
where web_menu_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 检查是否存在 -->
<select id="existsHwWebMenu1" resultType="java.lang.Boolean">
select count(1) > 0 from hw_web_menu1 t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
</mapper>

@ -0,0 +1,176 @@
<?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="org.dromara.web.mapper.HwWebMenuMapper">
<resultMap type="org.dromara.web.domain.vo.HwWebMenuVo" id="HwWebMenuResult">
</resultMap>
<select id="selectCustomHwWebMenuVoList" resultMap="HwWebMenuResult">
select t.web_menu_id, t.parent, t.ancestors, t.status, t.web_menu_name, t.tenant_id, t.web_menu__pic, t.web_menu_type, t.is_delete, t.update_time, t.create_time, t.web_menu_name_english
from hw_web_menu t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 根据ID查询详情 -->
<select id="selectCustomHwWebMenuVoById" resultMap="HwWebMenuResult">
select t.web_menu_id, t.parent, t.ancestors, t.status, t.web_menu_name, t.tenant_id, t.web_menu__pic, t.web_menu_type, t.is_delete, t.update_time, t.create_time, t.web_menu_name_english
from hw_web_menu t
where t.web_menu_id = #{webMenuId}
</select>
<!-- 批量查询 - 根据ID列表 -->
<select id="selectCustomHwWebMenuVoByIds" resultMap="HwWebMenuResult">
select t.web_menu_id, t.parent, t.ancestors, t.status, t.web_menu_name, t.tenant_id, t.web_menu__pic, t.web_menu_type, t.is_delete, t.update_time, t.create_time, t.web_menu_name_english
from hw_web_menu t
where t.web_menu_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 统计查询 -->
<select id="countCustomHwWebMenu" resultType="java.lang.Long">
select count(1) from hw_web_menu t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 分页查询(带自定义条件) -->
<select id="selectCustomHwWebMenuVoPage" resultMap="HwWebMenuResult">
select t.web_menu_id, t.parent, t.ancestors, t.status, t.web_menu_name, t.tenant_id, t.web_menu__pic, t.web_menu_type, t.is_delete, t.update_time, t.create_time, t.web_menu_name_english
from hw_web_menu t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
<!-- 批量插入 -->
<insert id="batchInsertHwWebMenu">
insert into hw_web_menu(
parent,
ancestors,
status,
web_menu_name,
tenant_id,
web_menu__pic,
web_menu_type,
is_delete,
update_time,
create_time,
web_menu_name_english
)
values
<foreach collection="list" item="item" separator=",">
(
#{item.parent},
#{item.ancestors},
#{item.status},
#{item.webMenuName},
#{item.tenantId},
#{item.webMenuPic},
#{item.webMenuType},
#{item.isDelete},
#{item.updateTime},
#{item.createTime},
#{item.webMenuNameEnglish}
)
</foreach>
</insert>
<!-- 批量更新 -->
<update id="batchUpdateHwWebMenu">
<foreach collection="list" item="item" separator=";">
update hw_web_menu
<set>
<if test="item.parent != null">
parent = #{item.parent},
</if>
<if test="item.ancestors != null and item.ancestors != ''">
ancestors = #{item.ancestors},
</if>
<if test="item.status != null and item.status != ''">
status = #{item.status},
</if>
<if test="item.webMenuName != null and item.webMenuName != ''">
web_menu_name = #{item.webMenuName},
</if>
<if test="item.tenantId != null">
tenant_id = #{item.tenantId},
</if>
<if test="item.webMenuPic != null and item.webMenuPic != ''">
web_menu__pic = #{item.webMenuPic},
</if>
<if test="item.webMenuType != null">
web_menu_type = #{item.webMenuType},
</if>
<if test="item.isDelete != null and item.isDelete != ''">
is_delete = #{item.isDelete},
</if>
<if test="item.updateTime != null">
update_time = #{item.updateTime},
</if>
<if test="item.createTime != null">
create_time = #{item.createTime},
</if>
<if test="item.webMenuNameEnglish != null and item.webMenuNameEnglish != ''">
web_menu_name_english = #{item.webMenuNameEnglish}
</if>
</set>
where web_menu_id = #{item.webMenuId}
</foreach>
</update>
<!-- 根据自定义条件删除 -->
<delete id="deleteCustomHwWebMenu">
delete from hw_web_menu
<if test="ew != null">
${ew.customSqlSegment}
</if>
</delete>
<!-- 根据ID列表批量删除 -->
<delete id="deleteCustomHwWebMenuByIds">
delete from hw_web_menu
where web_menu_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 检查是否存在 -->
<select id="existsHwWebMenu" resultType="java.lang.Boolean">
select count(1) > 0 from hw_web_menu t
<if test="ew != null">
${ew.customSqlSegment}
</if>
</select>
</mapper>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save