master:档口、用户首页快捷功能绑定及查询功能;
parent
8ed8d0fc51
commit
6cdd1c1592
|
|
@ -0,0 +1,69 @@
|
|||
package com.ruoyi.web.controller.xkt;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.XktBaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.vo.menu.SysMenuDTO;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import com.ruoyi.web.controller.xkt.vo.quickFunction.QuickFuncVO;
|
||||
import com.ruoyi.xkt.dto.quickFunction.QuickFuncDTO;
|
||||
import com.ruoyi.xkt.service.IQuickFunctionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快捷功能Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Api(tags = "快捷功能")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/rest/v1/quick-functions")
|
||||
public class QuickFunctionController extends XktBaseController {
|
||||
|
||||
final IQuickFunctionService quickFuncService;
|
||||
final ISysMenuService menuService;
|
||||
|
||||
private static final String MENU_TYPE_C = "C";
|
||||
|
||||
/**
|
||||
* 查看已绑定的所有快捷菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:function:list')")
|
||||
@ApiOperation(value = "查看已绑定的所有快捷菜单", httpMethod = "GET", response = R.class)
|
||||
@GetMapping("/menus/{roleId}/{bizId}")
|
||||
public R<QuickFuncVO> getMenuList(@PathVariable("roleId") Long roleId, @PathVariable("bizId") Long bizId) {
|
||||
// 找到当前所有的快捷菜单
|
||||
List<QuickFuncDTO.DetailDTO> checkedList = quickFuncService.getCheckedMenuList(roleId, bizId);
|
||||
// 找到系统所有的二级菜单
|
||||
List<SysMenuDTO> sysMenuList = menuService.selectMenuListByRoleIdAndMenuType(roleId, MENU_TYPE_C);
|
||||
return R.ok(QuickFuncVO.builder().bizId(bizId).roleId(roleId)
|
||||
.checkedList(BeanUtil.copyToList(checkedList, QuickFuncVO.QuickFuncDetailVO.class))
|
||||
.menuList(BeanUtil.copyToList(sysMenuList, QuickFuncVO.QuickFuncDetailVO.class))
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改快捷功能
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:function:edit')")
|
||||
@ApiOperation(value = "修改快捷功能", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "修改快捷功能", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/checked")
|
||||
public R editCheckedList(@Validated @RequestBody QuickFuncVO quickFuncVO) {
|
||||
quickFuncService.updateCheckedList(BeanUtil.toBean(quickFuncVO, QuickFuncDTO.class));
|
||||
return success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
package com.ruoyi.web.controller.xkt;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.XktBaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.vo.menu.SysMenuDTO;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import com.ruoyi.web.controller.xkt.vo.storeQuickFunction.StoreQuickFuncVO;
|
||||
import com.ruoyi.xkt.dto.storeQuickFunction.StoreQuickFuncDTO;
|
||||
import com.ruoyi.xkt.service.IStoreQuickFunctionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档口快捷功能Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Api(tags = "档口快捷功能")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/rest/v1/quick-functions")
|
||||
public class StoreQuickFunctionController extends XktBaseController {
|
||||
|
||||
final IStoreQuickFunctionService storeQuickFuncService;
|
||||
final ISysMenuService menuService;
|
||||
|
||||
/**
|
||||
* 查看当前档口已绑定的所有快捷菜单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:function:list')")
|
||||
@ApiOperation(value = "查看当前档口已绑定的所有快捷菜单", httpMethod = "GET", response = R.class)
|
||||
@GetMapping("/menus/{storeId}")
|
||||
public R<StoreQuickFuncVO> getMenus(@PathVariable Long storeId) {
|
||||
// 找到当前档口所有的快捷菜单
|
||||
List<StoreQuickFuncDTO.DetailDTO> checkedList = storeQuickFuncService.getCheckedMenuList(storeId);
|
||||
// 找到系统所有的二级菜单
|
||||
List<SysMenuDTO> sysMenuList = menuService.selectMenuListByRoleIdAndMenuType(2L, "C");
|
||||
return R.ok(StoreQuickFuncVO.builder().storeId(storeId)
|
||||
.checkedList(CollectionUtils.isEmpty(checkedList) ? new ArrayList<>() : BeanUtil.copyToList(checkedList, StoreQuickFuncVO.QuickFuncDetailVO.class))
|
||||
.menuList(CollectionUtils.isEmpty(sysMenuList) ? new ArrayList<>() : BeanUtil.copyToList(sysMenuList, StoreQuickFuncVO.QuickFuncDetailVO.class))
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改档口快捷功能
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:function:edit')")
|
||||
@ApiOperation(value = "修改档口快捷功能", httpMethod = "PUT", response = R.class)
|
||||
@Log(title = "修改档口快捷功能", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/checked")
|
||||
public R editCheckedList(@Validated @RequestBody StoreQuickFuncVO quickFuncVO) {
|
||||
storeQuickFuncService.updateCheckedList(BeanUtil.toBean(quickFuncVO, StoreQuickFuncDTO.class));
|
||||
return success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.ruoyi.web.controller.xkt.vo.storeQuickFunction;
|
||||
package com.ruoyi.web.controller.xkt.vo.quickFunction;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
|
@ -19,11 +19,14 @@ import java.util.List;
|
|||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StoreQuickFuncVO {
|
||||
public class QuickFuncVO {
|
||||
|
||||
@ApiModelProperty(value = "档口ID", required = true)
|
||||
@NotNull(message = "档口ID不能为空!")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "业务ID 根据roleId确定,可能为store_id、user_id", required = true)
|
||||
@NotNull(message = "业务ID不能为空!")
|
||||
private Long bizId;
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
@NotNull(message = "角色ID不能为空!")
|
||||
private Long roleId;
|
||||
@ApiModelProperty(value = "档口勾选的快捷功能", required = true)
|
||||
@NotNull(message = "档口勾选的快捷功能不能为空!")
|
||||
private List<QuickFuncDetailVO> checkedList;
|
||||
|
|
@ -17,7 +17,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
|||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class StoreQuickFunction extends XktBaseEntity {
|
||||
@Accessors(chain = true)
|
||||
public class QuickFunction extends XktBaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
|
@ -27,10 +28,14 @@ public class StoreQuickFunction extends XktBaseEntity {
|
|||
private Long id;
|
||||
|
||||
/**
|
||||
* store.id
|
||||
* store.id or user.id
|
||||
*/
|
||||
@Excel(name = "store.id")
|
||||
private Long storeId;
|
||||
private Long bizId;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 快捷功能名称
|
||||
|
|
@ -61,7 +66,7 @@ public class StoreQuickFunction extends XktBaseEntity {
|
|||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("storeId", getStoreId())
|
||||
.append("bizId", getBizId())
|
||||
.append("menuName", getMenuName())
|
||||
.append("icon", getIcon())
|
||||
.append("path", getPath())
|
||||
|
|
@ -1,15 +1,11 @@
|
|||
package com.ruoyi.xkt.dto.storeQuickFunction;
|
||||
package com.ruoyi.xkt.dto.quickFunction;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -20,10 +16,12 @@ import java.util.List;
|
|||
@ApiModel("档口快捷功能")
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class StoreQuickFuncDTO {
|
||||
public class QuickFuncDTO {
|
||||
|
||||
@ApiModelProperty(value = "档口ID")
|
||||
private Long storeId;
|
||||
@ApiModelProperty(value = "bizId 根据roleId确定,为storeId或者userId")
|
||||
private Long bizId;
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
private Long roleId;
|
||||
@ApiModelProperty(value = "档口勾选的快捷功能")
|
||||
List<DetailDTO> checkedList;
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.xkt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.QuickFunction;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 档口快捷功能Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
public interface QuickFunctionMapper extends BaseMapper<QuickFunction> {
|
||||
|
||||
/**
|
||||
* 将指定角色指定bizId的快捷功能置为无效
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param bizId 业务ID
|
||||
*/
|
||||
void updateDelFlagByRoleIdAndBizId(@Param("roleId") Long roleId, @Param("bizId") Long bizId);
|
||||
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
package com.ruoyi.xkt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.xkt.domain.StoreQuickFunction;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档口快捷功能Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
public interface StoreQuickFunctionMapper extends BaseMapper<StoreQuickFunction> {
|
||||
/**
|
||||
* 查询档口快捷功能
|
||||
*
|
||||
* @param id 档口快捷功能主键
|
||||
* @return 档口快捷功能
|
||||
*/
|
||||
public StoreQuickFunction selectStoreQuickFunctionByStoreQuickFuncId(Long id);
|
||||
|
||||
/**
|
||||
* 查询档口快捷功能列表
|
||||
*
|
||||
* @param storeQuickFunction 档口快捷功能
|
||||
* @return 档口快捷功能集合
|
||||
*/
|
||||
public List<StoreQuickFunction> selectStoreQuickFunctionList(StoreQuickFunction storeQuickFunction);
|
||||
|
||||
/**
|
||||
* 新增档口快捷功能
|
||||
*
|
||||
* @param storeQuickFunction 档口快捷功能
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStoreQuickFunction(StoreQuickFunction storeQuickFunction);
|
||||
|
||||
/**
|
||||
* 修改档口快捷功能
|
||||
*
|
||||
* @param storeQuickFunction 档口快捷功能
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStoreQuickFunction(StoreQuickFunction storeQuickFunction);
|
||||
|
||||
/**
|
||||
* 删除档口快捷功能
|
||||
*
|
||||
* @param id 档口快捷功能主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreQuickFunctionByStoreQuickFuncId(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除档口快捷功能
|
||||
*
|
||||
* @param storeQuickFuncIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreQuickFunctionByStoreQuickFuncIds(Long[] storeQuickFuncIds);
|
||||
|
||||
void updateDelFlagByStoreId(Long storeId);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.xkt.dto.quickFunction.QuickFuncDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档口快捷功能Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
public interface IQuickFunctionService {
|
||||
/**
|
||||
* 获取当前绑定的快捷功能
|
||||
*
|
||||
* @param roleId 当前角色ID
|
||||
* @param bizId bizId
|
||||
* @return List<StoreQuickFuncDTO.DetailDTO>
|
||||
*/
|
||||
List<QuickFuncDTO.DetailDTO> getCheckedMenuList(Long roleId, Long bizId);
|
||||
|
||||
/**
|
||||
* 更新绑定的快捷功能
|
||||
*
|
||||
* @param storeQuickFuncDTO 绑定快捷功能的DTO
|
||||
* @return
|
||||
*/
|
||||
void updateCheckedList(QuickFuncDTO storeQuickFuncDTO);
|
||||
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.xkt.dto.storeQuickFunction.StoreQuickFuncDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档口快捷功能Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
public interface IStoreQuickFunctionService {
|
||||
/**
|
||||
* 获取当前档口绑定的快捷功能
|
||||
*
|
||||
* @param storeId 当前档口ID
|
||||
* @return List<StoreQuickFuncDTO.DetailDTO>
|
||||
*/
|
||||
List<StoreQuickFuncDTO.DetailDTO> getCheckedMenuList(Long storeId);
|
||||
|
||||
/**
|
||||
* 更新档口绑定的快捷功能
|
||||
*
|
||||
* @param storeQuickFuncDTO 绑定档口快捷功能的DTO
|
||||
* @return
|
||||
*/
|
||||
void updateCheckedList(StoreQuickFuncDTO storeQuickFuncDTO);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.xkt.domain.QuickFunction;
|
||||
import com.ruoyi.xkt.dto.quickFunction.QuickFuncDTO;
|
||||
import com.ruoyi.xkt.mapper.QuickFunctionMapper;
|
||||
import com.ruoyi.xkt.service.IQuickFunctionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快捷功能Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class QuickFunctionServiceImpl implements IQuickFunctionService {
|
||||
|
||||
final QuickFunctionMapper quickFuncMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<QuickFuncDTO.DetailDTO> getCheckedMenuList(Long roleId, Long bizId) {
|
||||
List<QuickFunction> storeQuickFuncList = quickFuncMapper.selectList(new LambdaQueryWrapper<QuickFunction>()
|
||||
.eq(QuickFunction::getBizId, bizId).eq(QuickFunction::getRoleId, roleId).eq(QuickFunction::getDelFlag, Constants.UNDELETED));
|
||||
return CollectionUtils.isEmpty(storeQuickFuncList) ? new ArrayList<>() : BeanUtil.copyToList(storeQuickFuncList, QuickFuncDTO.DetailDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新绑定的快捷功能
|
||||
*
|
||||
* @param storeQuickFuncDTO 绑定快捷功能的DTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateCheckedList(QuickFuncDTO storeQuickFuncDTO) {
|
||||
// 先将旧的绑定关系置为无效
|
||||
this.quickFuncMapper.updateDelFlagByRoleIdAndBizId(storeQuickFuncDTO.getRoleId(), storeQuickFuncDTO.getBizId());
|
||||
// 新增档口的快捷功能
|
||||
List<QuickFunction> checkedList = BeanUtil.copyToList(storeQuickFuncDTO.getCheckedList(), QuickFunction.class);
|
||||
checkedList.forEach(x -> x.setBizId(storeQuickFuncDTO.getBizId()).setRoleId(storeQuickFuncDTO.getRoleId()));
|
||||
this.quickFuncMapper.insert(checkedList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.xkt.domain.StoreQuickFunction;
|
||||
import com.ruoyi.xkt.dto.storeQuickFunction.StoreQuickFuncDTO;
|
||||
import com.ruoyi.xkt.mapper.StoreQuickFunctionMapper;
|
||||
import com.ruoyi.xkt.service.IStoreQuickFunctionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 档口快捷功能Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class StoreQuickFunctionServiceImpl implements IStoreQuickFunctionService {
|
||||
|
||||
final StoreQuickFunctionMapper storeQuickFuncMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<StoreQuickFuncDTO.DetailDTO> getCheckedMenuList(Long storeId) {
|
||||
List<StoreQuickFunction> storeQuickFuncList = storeQuickFuncMapper.selectList(new LambdaQueryWrapper<StoreQuickFunction>()
|
||||
.eq(StoreQuickFunction::getStoreId, storeId).eq(StoreQuickFunction::getDelFlag, Constants.UNDELETED));
|
||||
return CollectionUtils.isEmpty(storeQuickFuncList) ? new ArrayList<>() : BeanUtil.copyToList(storeQuickFuncList, StoreQuickFuncDTO.DetailDTO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新档口绑定的快捷功能
|
||||
*
|
||||
* @param storeQuickFuncDTO 绑定档口快捷功能的DTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateCheckedList(StoreQuickFuncDTO storeQuickFuncDTO) {
|
||||
// 先将旧的绑定关系置为无效
|
||||
this.storeQuickFuncMapper.updateDelFlagByStoreId(storeQuickFuncDTO.getStoreId());
|
||||
// 新增档口的快捷功能
|
||||
List<StoreQuickFunction> checkedList = BeanUtil.copyToList(storeQuickFuncDTO.getCheckedList(), StoreQuickFunction.class);
|
||||
checkedList.forEach(x -> x.setStoreId(storeQuickFuncDTO.getStoreId()));
|
||||
this.storeQuickFuncMapper.insert(checkedList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,106 +2,10 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.xkt.mapper.StoreQuickFunctionMapper">
|
||||
|
||||
<resultMap type="StoreQuickFunction" id="StoreQuickFunctionResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="storeId" column="store_id" />
|
||||
<result property="menuName" column="menu_name" />
|
||||
<result property="icon" column="icon" />
|
||||
<result property="path" column="path" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="version" column="version" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
<mapper namespace="com.ruoyi.xkt.mapper.QuickFunctionMapper">
|
||||
|
||||
<sql id="selectStoreQuickFunctionVo">
|
||||
select id, store_id, menu_name, icon, path, order_num, version, del_flag, create_by, create_time, update_by, update_time from store_quick_function
|
||||
</sql>
|
||||
|
||||
<select id="selectStoreQuickFunctionList" parameterType="StoreQuickFunction" resultMap="StoreQuickFunctionResult">
|
||||
<include refid="selectStoreQuickFunctionVo"/>
|
||||
<where>
|
||||
<if test="storeId != null "> and store_id = #{storeId}</if>
|
||||
<if test="menuName != null and menuName != ''"> and menu_name like concat('%', #{menuName}, '%')</if>
|
||||
<if test="icon != null and icon != ''"> and icon = #{icon}</if>
|
||||
<if test="path != null and path != ''"> and path = #{path}</if>
|
||||
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||
<if test="version != null "> and version = #{version}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectStoreQuickFunctionByStoreQuickFuncId" parameterType="Long" resultMap="StoreQuickFunctionResult">
|
||||
<include refid="selectStoreQuickFunctionVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertStoreQuickFunction" parameterType="StoreQuickFunction" useGeneratedKeys="true" keyProperty="storeQuickFuncId">
|
||||
insert into store_quick_function
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="menuName != null">menu_name,</if>
|
||||
<if test="icon != null">icon,</if>
|
||||
<if test="path != null">path,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="menuName != null">#{menuName},</if>
|
||||
<if test="icon != null">#{icon},</if>
|
||||
<if test="path != null">#{path},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStoreQuickFunction" parameterType="StoreQuickFunction">
|
||||
update store_quick_function
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="menuName != null">menu_name = #{menuName},</if>
|
||||
<if test="icon != null">icon = #{icon},</if>
|
||||
<if test="path != null">path = #{path},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
<update id="updateDelFlagByRoleIdAndBizId" parameterType="Long">
|
||||
UPDATE quick_function SET del_flag = 2 WHERE role_id = #{roleId} AND biz_id = #{bizId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteStoreQuickFunctionByStoreQuickFuncId" parameterType="Long">
|
||||
delete from store_quick_function where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStoreQuickFunctionByStoreQuickFuncIds" parameterType="String">
|
||||
delete from store_quick_function where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDelFlagByStoreId" parameterType="Long">
|
||||
UPDATE store_quick_function SET del_flag = 2 WHERE store_id = #{storeId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue