feat(portal): 新增 HwWeb1 和 HwWebMenu1 域对象,专门负责产品中心的产品详情页面

master
zangch@mesnac.com 13 hours ago
parent 836394b110
commit 6fd14109f7

@ -0,0 +1,98 @@
package com.ruoyi.portal.controller;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.portal.domain.HwWeb1;
import com.ruoyi.portal.service.IHwWebService1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* haiweijsonController
*
* @author ruoyi
* @date 2025-08-18
*/
@RestController
@RequestMapping("/HwWeb1")
public class HwWebController1 extends BaseController
{
@Autowired
private IHwWebService1 hwWebService1;
/**
* haiweijson
*/
//@RequiresPermissions("portalhwWeb:list")
@GetMapping("/list")
public TableDataInfo list(HwWeb1 HwWeb1)
{
startPage();
List<HwWeb1> list = hwWebService1.selectHwWebList(HwWeb1);
return getDataTable(list);
}
/**
* haiweijson
*/
//@RequiresPermissions("portalhwWeb:export")
@Log(title = "haiwei官网json", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, HwWeb1 HwWeb1)
{
List<HwWeb1> list = hwWebService1.selectHwWebList(HwWeb1);
ExcelUtil<HwWeb1> util = new ExcelUtil<HwWeb1>(HwWeb1.class);
util.exportExcel(response, list, "haiwei官网json数据");
}
/**
* haiweijson
*/
//@RequiresPermissions("portalhwWeb:query")
@GetMapping(value = "/{webCode}")
public AjaxResult getInfo(@PathVariable("webCode") Long webCode)
{
return success(hwWebService1.selectHwWebByWebcode(webCode));
}
/**
* haiweijson
*/
//@RequiresPermissions("portalhwWeb:add")
@Log(title = "haiwei官网json", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody HwWeb1 HwWeb1)
{
return toAjax(hwWebService1.insertHwWeb(HwWeb1));
}
/**
* haiweijson
*/
//@RequiresPermissions("portalhwWeb:edit")
@Log(title = "haiwei官网json", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody HwWeb1 HwWeb1)
{
int i = hwWebService1.updateHwWeb(HwWeb1);
return toAjax(i);
}
/**
* haiweijson
*/
//@RequiresPermissions("portalhwWeb:remove")
@Log(title = "haiwei官网json", businessType = BusinessType.DELETE)
@DeleteMapping("/{webIds}")
public AjaxResult remove(@PathVariable Long[] webIds)
{
return toAjax(hwWebService1.deleteHwWebByWebIds(webIds));
}
}

@ -0,0 +1,103 @@
package com.ruoyi.portal.controller;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.portal.domain.HwWebMenu1;
import com.ruoyi.portal.service.IHwWebMenuService1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* haiweiController
*
* @author zch
* @date 2025-08-18
*/
@RestController
@RequestMapping("/hwWebMenu1")
public class HwWebMenuController1 extends BaseController
{
@Autowired
private IHwWebMenuService1 hwWebMenuService1;
/**
* haiwei
*/
//@RequiresPermissions("portalhwWebMenu:list")
@GetMapping("/list")
public AjaxResult list(HwWebMenu1 hwWebMenu1)
{
List<HwWebMenu1> list = hwWebMenuService1.selectHwWebMenuList(hwWebMenu1);
return success(list);
}
/**
* haiwei
*/
//@RequiresPermissions("portalhwWebMenu:export")
@Log(title = "haiwei官网菜单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, HwWebMenu1 hwWebMenu1)
{
List<HwWebMenu1> list = hwWebMenuService1.selectHwWebMenuList(hwWebMenu1);
ExcelUtil<HwWebMenu1> util = new ExcelUtil<HwWebMenu1>(HwWebMenu1.class);
util.exportExcel(response, list, "haiwei官网菜单数据");
}
/**
* haiwei
*/
//@RequiresPermissions("portalhwWebMenu:query")
@GetMapping(value = "/{webMenuId}")
public AjaxResult getInfo(@PathVariable("webMenuId") Long webMenuId)
{
return success(hwWebMenuService1.selectHwWebMenuByWebMenuId(webMenuId));
}
/**
* haiwei
*/
//@RequiresPermissions("portalhwWebMenu:add")
@Log(title = "haiwei官网菜单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody HwWebMenu1 hwWebMenu1)
{
return toAjax(hwWebMenuService1.insertHwWebMenu(hwWebMenu1));
}
/**
* haiwei
*/
//@RequiresPermissions("portalhwWebMenu:edit")
@Log(title = "haiwei官网菜单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody HwWebMenu1 hwWebMenu1)
{
return toAjax(hwWebMenuService1.updateHwWebMenu(hwWebMenu1));
}
/**
* haiwei
*/
//@RequiresPermissions("portalhwWebMenu:remove")
@Log(title = "haiwei官网菜单", businessType = BusinessType.DELETE)
@DeleteMapping("/{webMenuIds}")
public AjaxResult remove(@PathVariable Long[] webMenuIds)
{
return toAjax(hwWebMenuService1.deleteHwWebMenuByWebMenuIds(webMenuIds));
}
/**
*
*/
@GetMapping("/selectMenuTree")
public AjaxResult selectMenuTree(HwWebMenu1 hwWebMenu1){
return success(hwWebMenuService1.selectMenuTree(hwWebMenu1));
}
}

@ -0,0 +1,80 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* haiweijson hw_web
*
* @author ruoyi
* @date 2025-08-18
*/
public class HwWeb1 extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long webId;
/** json */
@Excel(name = "json")
private String webJson;
/** json字符串 */
@Excel(name = "json字符串")
private String webJsonString;
/** 页面 */
@Excel(name = "页面")
private Long webCode;
public void setWebId(Long webId)
{
this.webId = webId;
}
public Long getWebId()
{
return webId;
}
public void setWebJson(String webJson)
{
this.webJson = webJson;
}
public String getWebJson()
{
return webJson;
}
public void setWebJsonString(String webJsonString)
{
this.webJsonString = webJsonString;
}
public String getWebJsonString()
{
return webJsonString;
}
public void setWebCode(Long webCode)
{
this.webCode = webCode;
}
public Long getWebCode()
{
return webCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("webId", getWebId())
.append("webJson", getWebJson())
.append("webJsonString", getWebJsonString())
.append("webCode", getWebCode())
.toString();
}
}

@ -0,0 +1,134 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.TreeEntity;
import java.util.List;
/**
* haiwei hw_web_menu
*
* @author zch
* @date 2025-08-18
*/
public class HwWebMenu1 extends TreeEntity
{
private static final long serialVersionUID = 1L;
/** 菜单主键id */
private Long webMenuId;
/** 父节点 */
@Excel(name = "父节点")
private Long parent;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 菜单名称 */
@Excel(name = "菜单名称")
private String webMenuName;
/** 租户 */
@Excel(name = "租户")
private Long tenantId;
/** 图片地址 */
@Excel(name = "图片地址")
private String webMenuPic;
/** 官网菜单类型 */
@Excel(name = "官网菜单类型")
private Long webMenuType;
private String valuel;
public void setWebMenuId(Long webMenuId)
{
this.webMenuId = webMenuId;
}
public Long getWebMenuId()
{
return webMenuId;
}
public void setParent(Long parent)
{
this.parent = parent;
}
public Long getParent()
{
return parent;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setWebMenuName(String webMenuName)
{
this.webMenuName = webMenuName;
}
public String getWebMenuName()
{
return webMenuName;
}
public void setTenantId(Long tenantId)
{
this.tenantId = tenantId;
}
public Long getTenantId()
{
return tenantId;
}
public void setWebMenuPic(String webMenuPic)
{
this.webMenuPic = webMenuPic;
}
public String getWebMenuPic()
{
return webMenuPic;
}
public void setWebMenuType(Long webMenuType)
{
this.webMenuType = webMenuType;
}
public Long getWebMenuType()
{
return webMenuType;
}
public String getValuel() {
return valuel;
}
public void setValuel(String valuel) {
this.valuel = valuel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("webMenuId", getWebMenuId())
.append("parent", getParent())
.append("ancestors", getAncestors())
.append("status", getStatus())
.append("webMenuName", getWebMenuName())
.append("tenantId", getTenantId())
.append("webMenuPic", getWebMenuPic())
.append("webMenuType", getWebMenuType())
.append("valuel", getValuel())
.toString();
}
}

@ -0,0 +1,63 @@
package com.ruoyi.portal.mapper;
import com.ruoyi.portal.domain.HwWeb1;
import com.ruoyi.portal.domain.HwWeb1;
import java.util.List;
/**
* haiweijsonMapper
*
* @author ruoyi
* @date 2025-08-18
*/
public interface HwWebMapper1
{
/**
* haiweijson
*
* @param webId haiweijson
* @return haiweijson
*/
public HwWeb1 selectHwWebByWebcode(Long webCode);
/**
* haiweijson
*
* @param HwWeb1 haiweijson
* @return haiweijson
*/
public List<HwWeb1> selectHwWebList(HwWeb1 HwWeb1);
/**
* haiweijson
*
* @param HwWeb1 haiweijson
* @return
*/
public int insertHwWeb(HwWeb1 HwWeb1);
/**
* haiweijson
*
* @param HwWeb1 haiweijson
* @return
*/
public int updateHwWeb(HwWeb1 HwWeb1);
/**
* haiweijson
*
* @param webId haiweijson
* @return
*/
public int deleteHwWebByWebId(Long webId);
/**
* haiweijson
*
* @param webIds
* @return
*/
public int deleteHwWebByWebIds(Long[] webIds);
}

@ -0,0 +1,71 @@
package com.ruoyi.portal.mapper;
import com.ruoyi.portal.domain.HwWebMenu;
import com.ruoyi.portal.domain.HwWebMenu1;
import com.ruoyi.portal.domain.HwWebMenu1;
import java.util.List;
/**
* haiweiMapper
*
* @author zch
* @date 2025-08-18
*/
public interface HwWebMenuMapper1
{
/**
* haiwei
*
* @param webMenuId haiwei
* @return haiwei
*/
public HwWebMenu1 selectHwWebMenuByWebMenuId(Long webMenuId);
/**
* haiwei
*
* @param HwWebMenu1 haiwei
* @return haiwei
*/
public List<HwWebMenu1> selectHwWebMenuList(HwWebMenu1 HwWebMenu1);
/**
* haiwei
*
* @param HwWebMenu1 haiwei
* @return
*/
public int insertHwWebMenu(HwWebMenu1 HwWebMenu1);
/**
* haiwei
*
* @param HwWebMenu1 haiwei
* @return
*/
public int updateHwWebMenu(HwWebMenu1 HwWebMenu1);
/**
* haiwei
*
* @param webMenuId haiwei
* @return
*/
public int deleteHwWebMenuByWebMenuId(Long webMenuId);
/**
* haiwei
*
* @param webMenuIds
* @return
*/
public int deleteHwWebMenuByWebMenuIds(Long[] webMenuIds);
/**
*
*/
public List<HwWebMenu1> selectMenuTree(HwWebMenu1 hwWebMenu);
}

@ -0,0 +1,70 @@
package com.ruoyi.portal.service;
import com.ruoyi.portal.domain.HwWebMenu1;
import com.ruoyi.portal.domain.HwWebMenu1;
import java.util.List;
/**
* haiweiService
*
* @author zch
* @date 2025-08-18
*/
public interface IHwWebMenuService1
{
/**
* haiwei
*
* @param webMenuId haiwei
* @return haiwei
*/
public HwWebMenu1 selectHwWebMenuByWebMenuId(Long webMenuId);
/**
* haiwei
*
* @param HwWebMenu1 haiwei
* @return haiwei
*/
public List<HwWebMenu1> selectHwWebMenuList(HwWebMenu1 HwWebMenu1);
/**
* haiwei
*
* @param HwWebMenu1 haiwei
* @return
*/
public int insertHwWebMenu(HwWebMenu1 HwWebMenu1);
/**
* haiwei
*
* @param HwWebMenu1 haiwei
* @return
*/
public int updateHwWebMenu(HwWebMenu1 HwWebMenu1);
/**
* haiwei
*
* @param webMenuIds haiwei
* @return
*/
public int deleteHwWebMenuByWebMenuIds(Long[] webMenuIds);
/**
* haiwei
*
* @param webMenuId haiwei
* @return
*/
public int deleteHwWebMenuByWebMenuId(Long webMenuId);
/**
*
*/
public List<HwWebMenu1> selectMenuTree(HwWebMenu1 HwWebMenu1);
}

@ -0,0 +1,63 @@
package com.ruoyi.portal.service;
import com.ruoyi.portal.domain.HwWeb1;
import com.ruoyi.portal.domain.HwWeb1;
import java.util.List;
/**
* haiweijsonService
*
* @author ruoyi
* @date 2025-08-18
*/
public interface IHwWebService1
{
/**
* haiweijson
*
* @param webId haiweijson
* @return haiweijson
*/
public HwWeb1 selectHwWebByWebcode(Long webCode);
/**
* haiweijson
*
* @param HwWeb1 haiweijson
* @return haiweijson
*/
public List<HwWeb1> selectHwWebList(HwWeb1 HwWeb1);
/**
* haiweijson
*
* @param HwWeb1 haiweijson
* @return
*/
public int insertHwWeb(HwWeb1 HwWeb1);
/**
* haiweijson
*
* @param HwWeb1 haiweijson
* @return
*/
public int updateHwWeb(HwWeb1 HwWeb1);
/**
* haiweijson
*
* @param webIds haiweijson
* @return
*/
public int deleteHwWebByWebIds(Long[] webIds);
/**
* haiweijson
*
* @param webId haiweijson
* @return
*/
public int deleteHwWebByWebId(Long webId);
}

@ -0,0 +1,167 @@
package com.ruoyi.portal.service.impl;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.portal.domain.HwWebMenu1;
import com.ruoyi.portal.mapper.HwWebMenuMapper1;
import com.ruoyi.portal.service.IHwWebMenuService1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
/**
* haiweiService
*
* @author zch
* @date 2025-08-18
*/
@Service
public class HwWebMenuServiceImpl1 implements IHwWebMenuService1
{
@Autowired
private HwWebMenuMapper1 HwWebMenuMapper1;
/**
* haiwei
*
* @param webMenuId haiwei
* @return haiwei
*/
@Override
public HwWebMenu1 selectHwWebMenuByWebMenuId(Long webMenuId)
{
return HwWebMenuMapper1.selectHwWebMenuByWebMenuId(webMenuId);
}
/**
* haiwei
*
* @param HwWebMenu1 haiwei
* @return haiwei
*/
@Override
public List<HwWebMenu1> selectHwWebMenuList(HwWebMenu1 HwWebMenu1)
{
List<HwWebMenu1> hwWebMenus = HwWebMenuMapper1.selectHwWebMenuList(HwWebMenu1);
return hwWebMenus;
}
/**
*
*/
@Override
public List<HwWebMenu1> selectMenuTree(HwWebMenu1 HwWebMenu1)
{
List<HwWebMenu1> hwWebMenus = HwWebMenuMapper1.selectHwWebMenuList(HwWebMenu1);
return buildWebMenuTree(hwWebMenus);
}
/**
* haiwei
*
* @param HwWebMenu1 haiwei
* @return
*/
@Override
public int insertHwWebMenu(HwWebMenu1 HwWebMenu1)
{
return HwWebMenuMapper1.insertHwWebMenu(HwWebMenu1);
}
/**
* haiwei
*
* @param HwWebMenu1 haiwei
* @return
*/
@Override
public int updateHwWebMenu(HwWebMenu1 HwWebMenu1)
{
return HwWebMenuMapper1.updateHwWebMenu(HwWebMenu1);
}
/**
* haiwei
*
* @param webMenuIds haiwei
* @return
*/
@Override
public int deleteHwWebMenuByWebMenuIds(Long[] webMenuIds)
{
return HwWebMenuMapper1.deleteHwWebMenuByWebMenuIds(webMenuIds);
}
/**
* haiwei
*
* @param webMenuId haiwei
* @return
*/
@Override
public int deleteHwWebMenuByWebMenuId(Long webMenuId)
{
return HwWebMenuMapper1.deleteHwWebMenuByWebMenuId(webMenuId);
}
/**
*
*
* @param menus
* @return
*/
public List<HwWebMenu1> buildWebMenuTree(List<HwWebMenu1> menus) {
List<HwWebMenu1> returnList = new ArrayList<>();
List<Long> tempList = menus.stream().map(HwWebMenu1::getWebMenuId).collect(Collectors.toList());
for (HwWebMenu1 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;
}
/**
*
*/
private void recursionFn(List<HwWebMenu1> list, HwWebMenu1 t) {
// 得到子节点列表
List<HwWebMenu1> childList = getChildList(list, t);
t.setChildren(childList);
for (HwWebMenu1 tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
}
/**
*
*/
private List<HwWebMenu1> getChildList(List<HwWebMenu1> list, HwWebMenu1 t) {
List<HwWebMenu1> tlist = new ArrayList<HwWebMenu1>();
Iterator<HwWebMenu1> it = list.iterator();
while (it.hasNext()) {
HwWebMenu1 n = it.next();
if (StringUtils.isNotNull(n.getParent()) && n.getParent().longValue() == t.getWebMenuId().longValue()) {
tlist.add(n);
}
}
return tlist;
}
/**
*
*/
private boolean hasChild(List<HwWebMenu1> list, HwWebMenu1 t) {
return !getChildList(list, t).isEmpty();
}
}

@ -0,0 +1,104 @@
package com.ruoyi.portal.service.impl;
import com.ruoyi.portal.domain.HwWeb1;
import com.ruoyi.portal.mapper.HwWebMapper1;
import com.ruoyi.portal.service.IHwWebService1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* haiweijsonService
*
* @author ruoyi
* @date 2025-08-18
*/
@Service
public class HwWebServiceImpl1 implements IHwWebService1
{
@Autowired
private HwWebMapper1 hwWebMapper1;
/**
* haiweijson
*
* @param webId haiweijson
* @return haiweijson
*/
@Override
public HwWeb1 selectHwWebByWebcode(Long webCode)
{
return hwWebMapper1.selectHwWebByWebcode(webCode);
}
/**
* haiweijson
*
* @param HwWeb1 haiweijson
* @return haiweijson
*/
@Override
public List<HwWeb1> selectHwWebList(HwWeb1 HwWeb1)
{
return hwWebMapper1.selectHwWebList(HwWeb1);
}
/**
* haiweijson
*
* @param HwWeb1 haiweijson
* @return
*/
@Override
public int insertHwWeb(HwWeb1 HwWeb1)
{
return hwWebMapper1.insertHwWeb(HwWeb1);
}
/**
* haiweijson
*
* @param HwWeb1 haiweijson
* @return
*/
@Override
public int updateHwWeb(HwWeb1 HwWeb1)
{
HwWeb1 codeWeb = new HwWeb1();
//编号唯一
codeWeb.setWebCode(HwWeb1.getWebCode());
if(hwWebMapper1.selectHwWebList(codeWeb).isEmpty()){
return hwWebMapper1.insertHwWeb(HwWeb1);
}
return hwWebMapper1.updateHwWeb(HwWeb1);
}
/**
* haiweijson
*
* @param webIds haiweijson
* @return
*/
@Override
public int deleteHwWebByWebIds(Long[] webIds)
{
return hwWebMapper1.deleteHwWebByWebIds(webIds);
}
/**
* haiweijson
*
* @param webId haiweijson
* @return
*/
@Override
public int deleteHwWebByWebId(Long webId)
{
return hwWebMapper1.deleteHwWebByWebId(webId);
}
}

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.portal.mapper.HwWebMapper1">
<resultMap type="HwWeb1" id="HwWebResult1">
<result property="webId" column="web_id" />
<result property="webJson" column="web_json" />
<result property="webJsonString" column="web_json_string" />
<result property="webCode" column="web_code" />
</resultMap>
<sql id="selectHwWebVo">
select web_id, web_json, web_json_string, web_code from hw_web1
</sql>
<select id="selectHwWebList" parameterType="HwWeb1" resultMap="HwWebResult1">
<include refid="selectHwWebVo"/>
<where>
<if test="webId != null "> and web_id = #{webId}</if>
<if test="webJson != null and webJson != ''"> and web_json = #{webJson}</if>
<if test="webJsonString != null and webJsonString != ''"> and web_json_string = #{webJsonString}</if>
<if test="webCode != null "> and web_code = #{webCode}</if>
</where>
</select>
<select id="selectHwWebByWebcode" parameterType="Long" resultMap="HwWebResult1">
<include refid="selectHwWebVo"/>
where web_code = #{webCode}
</select>
<insert id="insertHwWeb" parameterType="HwWeb1" useGeneratedKeys="true" keyProperty="webId">
insert into hw_web1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="webJson != null">web_json,</if>
<if test="webJsonString != null">web_json_string,</if>
<if test="webCode != null">web_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="webJson != null">#{webJson},</if>
<if test="webJsonString != null">#{webJsonString},</if>
<if test="webCode != null">#{webCode},</if>
</trim>
</insert>
<update id="updateHwWeb" parameterType="HwWeb1">
update hw_web1
<trim prefix="SET" suffixOverrides=",">
<if test="webJson != null">web_json = #{webJson},</if>
<if test="webJsonString != null">web_json_string = #{webJsonString},</if>
<if test="webCode != null">web_code = #{webCode},</if>
</trim>
where web_code = #{webCode}
</update>
<delete id="deleteHwWebByWebId" parameterType="Long">
delete from hw_web1 where web_id = #{webId}
</delete>
<delete id="deleteHwWebByWebIds" parameterType="String">
delete from hw_web1 where web_id in
<foreach item="webId" collection="array" open="(" separator="," close=")">
#{webId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.portal.mapper.HwWebMenuMapper1">
<resultMap type="HwWebMenu1" id="HwWebMenuResult1">
<result property="webMenuId" column="web_menu_id" />
<result property="parent" column="parent" />
<result property="ancestors" column="ancestors" />
<result property="status" column="status" />
<result property="webMenuName" column="web_menu_name" />
<result property="tenantId" column="tenant_id" />
<result property="webMenuPic" column="web_menu__pic" />
<result property="webMenuType" column="web_menu_type" />
<result property="value" column="value" />
</resultMap>
<sql id="selectHwWebMenuVo">
select web_menu_id, parent, ancestors, status, web_menu_name, tenant_id, web_menu__pic,
value,
web_menu_type from hw_web_menu1
</sql>
<select id="selectHwWebMenuList" parameterType="HwWebMenu1" resultMap="HwWebMenuResult1">
<include refid="selectHwWebMenuVo"/>
<where>
<if test="parent != null "> and parent = #{parent}</if>
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="webMenuName != null and webMenuName != ''"> and web_menu_name like concat('%', #{webMenuName}, '%')</if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
<if test="webMenuPic != null and webMenuPic != ''"> and web_menu__pic = #{webMenuPic}</if>
<if test="webMenuType != null "> and web_menu_type = #{webMenuType}</if>
<if test="value != null and value != ''"> and value like concat('%', #{value}, '%')</if>
</where>
</select>
<select id="selectHwWebMenuByWebMenuId" parameterType="Long" resultMap="HwWebMenuResult1">
<include refid="selectHwWebMenuVo"/>
where web_menu_id = #{webMenuId}
</select>
<insert id="insertHwWebMenu" parameterType="HwWebMenu1">
insert into hw_web_menu1
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="webMenuId != null">web_menu_id,</if>
<if test="parent != null">parent,</if>
<if test="ancestors != null">ancestors,</if>
<if test="status != null">status,</if>
<if test="webMenuName != null">web_menu_name,</if>
<if test="tenantId != null">tenant_id,</if>
<if test="webMenuPic != null">web_menu__pic,</if>
<if test="webMenuType != null">web_menu_type,</if>
<if test="value != null">value,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="webMenuId != null">#{webMenuId},</if>
<if test="parent != null">#{parent},</if>
<if test="ancestors != null">#{ancestors},</if>
<if test="status != null">#{status},</if>
<if test="webMenuName != null">#{webMenuName},</if>
<if test="tenantId != null">#{tenantId},</if>
<if test="webMenuPic != null">#{webMenuPic},</if>
<if test="webMenuType != null">#{webMenuType},</if>
<if test="value != null">#{value},</if>
</trim>
</insert>
<update id="updateHwWebMenu" parameterType="HwWebMenu1">
update hw_web_menu1
<trim prefix="SET" suffixOverrides=",">
<if test="parent != null">parent = #{parent},</if>
<if test="ancestors != null">ancestors = #{ancestors},</if>
<if test="status != null">status = #{status},</if>
<if test="webMenuName != null">web_menu_name = #{webMenuName},</if>
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="webMenuPic != null">web_menu__pic = #{webMenuPic},</if>
<if test="webMenuType != null">web_menu_type = #{webMenuType},</if>
<if test="value != null">value = #{value},</if>
</trim>
where web_menu_id = #{webMenuId}
</update>
<delete id="deleteHwWebMenuByWebMenuId" parameterType="Long">
delete from hw_web_menu1 where web_menu_id = #{webMenuId}
</delete>
<delete id="deleteHwWebMenuByWebMenuIds" parameterType="String">
delete from hw_web_menu1 where web_menu_id in
<foreach item="webMenuId" collection="array" open="(" separator="," close=")">
#{webMenuId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save