feat(customer): 添加客户银行代码字段并实现批量删除功能
- 在Customer实体中添加bank_code字段映射
- 实现批量删除客户时同步清理关联的客户联系人关系
- 添加removeCustomerContactsByCustomerIds方法处理联系人关联删除逻辑
- 添加parseCustomerId辅助方法进行安全的ID解析
- 优化客户批量删除流程确保数据一致性
| | |
| | | IPage<ProductModelVo> pageModelAndQua(Page<ProductModelVo> page, @Param("c") ProductModel productModel); |
| | | |
| | | List<Map<String, Object>> selectBatchNoQtyByProductModelIds(@Param("list") List<Long> productModelIds); |
| | | |
| | | List<Map<String, Object>> selectUnqualifiedBatchNoQtyByProductModelIds(@Param("list") List<Long> productModelIds); |
| | | } |
| | |
| | | .eq(CustomerUser::getCustomerId, id) |
| | | ); |
| | | } |
| | | // 删除客户对应的联系人关联 |
| | | removeCustomerContactsByCustomerIds(idList); |
| | | |
| | | // 删除客户主表数据 |
| | | return customerMapper.deleteBatchIds(idList); |
| | | } |
| | | |
| | | private void removeCustomerContactsByCustomerIds(List<Long> customerIds) { |
| | | if (CollectionUtils.isEmpty(customerIds)) { |
| | | return; |
| | | } |
| | | List<CustomerContact> customerContacts = customerContactMapper.selectList(new QueryWrapper<>()); |
| | | if (CollectionUtils.isEmpty(customerContacts)) { |
| | | return; |
| | | } |
| | | Set<Long> customerIdSet = customerIds.stream() |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toSet()); |
| | | for (CustomerContact customerContact : customerContacts) { |
| | | String contactCustomerIds = customerContact.getCustomerId(); |
| | | if (StringUtils.isEmpty(contactCustomerIds)) { |
| | | continue; |
| | | } |
| | | String updatedCustomerIds = Arrays.stream(contactCustomerIds.split(",")) |
| | | .map(String::trim) |
| | | .filter(StringUtils::isNotEmpty) |
| | | .filter(id -> { |
| | | Long parsedId = parseCustomerId(id); |
| | | return parsedId == null || !customerIdSet.contains(parsedId); |
| | | }) |
| | | .distinct() |
| | | .collect(Collectors.joining(",")); |
| | | if (StringUtils.isEmpty(updatedCustomerIds)) { |
| | | customerContactMapper.deleteById(customerContact.getId()); |
| | | } else if (!updatedCustomerIds.equals(contactCustomerIds)) { |
| | | customerContact.setCustomerId(updatedCustomerIds); |
| | | customerContactMapper.updateById(customerContact); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private Long parseCustomerId(String customerId) { |
| | | try { |
| | | return Long.valueOf(customerId); |
| | | } catch (NumberFormatException e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<Customer> selectCustomerListByIds(Long[] ids) { |
| | | LambdaQueryWrapper<Customer> queryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | // 浪潮用于区分成品和物料 |
| | | if (productDto.getProductType() != null && !productDto.getProductType().isEmpty()) { |
| | | if (productDto.getProductType().equals("成品")){ |
| | | if (productDto.getProductType().equals("成品")) { |
| | | queryWrapper.eq(Product::getProductName, productDto.getProductType()); |
| | | }else queryWrapper.ne(Product::getProductName, "成品"); |
| | | } else queryWrapper.ne(Product::getProductName, "成品"); |
| | | } |
| | | |
| | | // 查询根节点列表 |
| | |
| | | } |
| | | |
| | | List<Map<String, Object>> batchRows = productModelMapper.selectBatchNoQtyByProductModelIds(productModelIds); |
| | | List<Map<String, Object>> unqualifiedBatchRows = |
| | | productModelMapper.selectUnqualifiedBatchNoQtyByProductModelIds(productModelIds); |
| | | batchRows.addAll(unqualifiedBatchRows); |
| | | Map<Long, HashMap<String, HashMap<String, BigDecimal>>> batchNoQtyMapsByProductModelId = |
| | | buildBatchNoQtyMaps(batchRows); |
| | | for (ProductModelVo record : records) { |
| | | record.setBatchNoMaps(toBatchNoMaps( |
| | | batchNoQtyMapsByProductModelId.getOrDefault(record.getId(), new HashMap<>()))); |
| | | } |
| | | } |
| | | |
| | | private Map<Long, HashMap<String, HashMap<String, BigDecimal>>> buildBatchNoQtyMaps( |
| | | List<Map<String, Object>> batchRows) { |
| | | Map<Long, HashMap<String, HashMap<String, BigDecimal>>> batchNoQtyMapsByProductModelId = new HashMap<>(); |
| | | for (Map<String, Object> batchRow : batchRows) { |
| | | Long productModelId = toLong(batchRow.get("productModelId")); |
| | |
| | | .computeIfAbsent(String.valueOf(warehouseId), key -> new HashMap<>()) |
| | | .merge(batchNo, toBigDecimal(batchRow.get("qty")), BigDecimal::add); |
| | | } |
| | | return batchNoQtyMapsByProductModelId; |
| | | } |
| | | |
| | | for (ProductModelVo record : records) { |
| | | HashMap<String, List<Map<String, BigDecimal>>> batchNoMaps = new HashMap<>(); |
| | | HashMap<String, HashMap<String, BigDecimal>> stockBatchNoQtyMaps = |
| | | batchNoQtyMapsByProductModelId.getOrDefault(record.getId(), new HashMap<>()); |
| | | |
| | | for (Map.Entry<String, HashMap<String, BigDecimal>> entry : stockBatchNoQtyMaps.entrySet()) { |
| | | List<Map<String, BigDecimal>> batchList = new ArrayList<>(); |
| | | for (Map.Entry<String, BigDecimal> batchEntry : entry.getValue().entrySet()) { |
| | | Map<String, BigDecimal> batchItem = new HashMap<>(); |
| | | batchItem.put(batchEntry.getKey(), batchEntry.getValue()); |
| | | batchList.add(batchItem); |
| | | } |
| | | batchNoMaps.put(entry.getKey(), batchList); |
| | | private HashMap<String, List<Map<String, BigDecimal>>> toBatchNoMaps( |
| | | HashMap<String, HashMap<String, BigDecimal>> stockBatchNoQtyMaps) { |
| | | HashMap<String, List<Map<String, BigDecimal>>> batchNoMaps = new HashMap<>(); |
| | | for (Map.Entry<String, HashMap<String, BigDecimal>> entry : stockBatchNoQtyMaps.entrySet()) { |
| | | List<Map<String, BigDecimal>> batchList = new ArrayList<>(); |
| | | for (Map.Entry<String, BigDecimal> batchEntry : entry.getValue().entrySet()) { |
| | | Map<String, BigDecimal> batchItem = new HashMap<>(); |
| | | batchItem.put(batchEntry.getKey(), batchEntry.getValue()); |
| | | batchList.add(batchItem); |
| | | } |
| | | |
| | | record.setBatchNoMaps(batchNoMaps); |
| | | batchNoMaps.put(entry.getKey(), batchList); |
| | | } |
| | | return batchNoMaps; |
| | | } |
| | | |
| | | private Long toLong(Object value) { |
| | |
| | | |
| | | long nextSeq = 1; |
| | | List<Map<String, Object>> records = mapper.selectMaps(wrapper); |
| | | |
| | | if (!records.isEmpty()) { |
| | | Object lastCode = records.get(0).get(code); |
| | | if (lastCode != null) { |
| | |
| | | package com.ruoyi.production.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 车间表 |
| | |
| | | @TableField(value = "update_user_name",fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUserName; |
| | | |
| | | @TableField(value = "dept_id",fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | |
| | | package com.ruoyi.project.system.domain;
|
| | |
|
| | | import java.util.Set;
|
| | | import com.baomidou.mybatisplus.annotation.FieldFill;
|
| | | import com.baomidou.mybatisplus.annotation.TableField;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | | import jakarta.validation.constraints.NotBlank;
|
| | | import jakarta.validation.constraints.NotNull;
|
| | | import jakarta.validation.constraints.Size;
|
| | | import org.apache.commons.lang3.builder.ToStringBuilder;
|
| | | import org.apache.commons.lang3.builder.ToStringStyle;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
|
| | | import com.ruoyi.framework.web.domain.BaseEntity;
|
| | |
|
| | | import java.util.Set;
|
| | |
|
| | | /**
|
| | | * 角色表 sys_role
|
| | | * |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | public class SysRole extends BaseEntity
|
| | |
| | | /** 角色菜单权限 */
|
| | | private Set<String> permissions;
|
| | |
|
| | | @TableField(fill = FieldFill.INSERT)
|
| | | private Long deptId;
|
| | | public SysRole()
|
| | | {
|
| | |
|
| | |
| | | this.status = status;
|
| | | }
|
| | |
|
| | | public Long getDeptId()
|
| | | {
|
| | | return deptId;
|
| | | }
|
| | |
|
| | | public void setDeptId(Long deptId)
|
| | | {
|
| | | this.deptId = deptId;
|
| | | }
|
| | |
|
| | | public String getDelFlag()
|
| | | {
|
| | | return delFlag;
|
| | |
| | | package com.ruoyi.project.system.mapper;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
|
| | | import com.ruoyi.project.system.domain.SysRole;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * 角色表 数据层
|
| | | * |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | public interface SysRoleMapper
|
| | | {
|
| | | /**
|
| | | * 根据条件分页查询角色数据
|
| | | * |
| | | *
|
| | | * @param role 角色信息
|
| | | * @return 角色数据集合信息
|
| | | */
|
| | | @DataScope(deptAlias = "r")
|
| | | public List<SysRole> selectRoleList(SysRole role);
|
| | |
|
| | | /**
|
| | | * 根据用户ID查询角色
|
| | | * |
| | | *
|
| | | * @param userId 用户ID
|
| | | * @return 角色列表
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 查询所有角色
|
| | | * |
| | | *
|
| | | * @return 角色列表
|
| | | */
|
| | | public List<SysRole> selectRoleAll();
|
| | |
|
| | | /**
|
| | | * 根据用户ID获取角色选择框列表
|
| | | * |
| | | *
|
| | | * @param userId 用户ID
|
| | | * @return 选中角色ID列表
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 通过角色ID查询角色
|
| | | * |
| | | *
|
| | | * @param roleId 角色ID
|
| | | * @return 角色对象信息
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 根据用户ID查询角色
|
| | | * |
| | | *
|
| | | * @param userName 用户名
|
| | | * @return 角色列表
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 校验角色名称是否唯一
|
| | | * |
| | | *
|
| | | * @param roleName 角色名称
|
| | | * @return 角色信息
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 校验角色权限是否唯一
|
| | | * |
| | | *
|
| | | * @param roleKey 角色权限
|
| | | * @return 角色信息
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 修改角色信息
|
| | | * |
| | | *
|
| | | * @param role 角色信息
|
| | | * @return 结果
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 新增角色信息
|
| | | * |
| | | *
|
| | | * @param role 角色信息
|
| | | * @return 结果
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 通过角色ID删除角色
|
| | | * |
| | | *
|
| | | * @param roleId 角色ID
|
| | | * @return 结果
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 批量删除角色信息
|
| | | * |
| | | *
|
| | | * @param roleIds 需要删除的角色ID
|
| | | * @return 结果
|
| | | */
|
| | |
| | | package com.ruoyi.project.system.mapper;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
|
| | | import com.ruoyi.project.system.domain.SysUser;
|
| | | import org.apache.ibatis.annotations.Mapper;
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
| | | * @param sysUser 用户信息
|
| | | * @return 用户信息集合信息
|
| | | */
|
| | | @DataScope(deptAlias = "u", userAlias = "u")
|
| | | public List<SysUser> selectUserList(SysUser sysUser);
|
| | |
|
| | | /**
|
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private String warehouseName; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | } |
| | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private int createUser; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private int deptId; |
| | | private Long deptId; |
| | | } |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.concurrent.ThreadLocalRandom; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } else { |
| | | wrapper.eq(StockUninventory::getBatchNo, stockUninventoryDto.getBatchNo()); |
| | | } |
| | | if (ObjectUtils.isEmpty(stockUninventoryDto.getBatchNo())) { |
| | | String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyMMddHHmm")); |
| | | int suffix = ThreadLocalRandom.current().nextInt(100, 1000); |
| | | stockUninventoryDto.setBatchNo("PY" + time + suffix); |
| | | } |
| | | //新增入库记录再添加库存 |
| | | StockInRecordDto stockInRecordDto = new StockInRecordDto(); |
| | | stockInRecordDto.setRecordId(stockUninventoryDto.getRecordId()); |
| | |
| | | c.maintenance_time, |
| | | c.tenant_id, |
| | | c.type, |
| | | c.bank_code, |
| | | c.is_assigned, |
| | | c.usage_user, |
| | | c.basic_bank_account, |
| | |
| | | order by si.product_model_id, si.warehouse_info_id, si.batch_no, si.id |
| | | </select> |
| | | |
| | | <select id="selectUnqualifiedBatchNoQtyByProductModelIds" resultType="java.util.Map"> |
| | | select su.product_model_id as productModelId, |
| | | su.warehouse_info_id as warehouseId, |
| | | su.batch_no as batchNo, |
| | | su.qualitity as qty |
| | | from stock_uninventory su |
| | | where su.product_model_id in |
| | | <foreach collection="list" item="productModelId" separator="," open="(" close=")"> |
| | | #{productModelId} |
| | | </foreach> |
| | | and su.warehouse_info_id is not null |
| | | and su.batch_no is not null |
| | | and su.batch_no != '' |
| | | order by su.product_model_id, su.warehouse_info_id, su.batch_no, su.id |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | 0 as qualifiedLockedQuantity, |
| | | COALESCE(su.locked_quantity, 0) as unQualifiedLockedQuantity, |
| | | su.product_model_id, |
| | | null as warehouse_info_id, |
| | | null as warehouse_name, |
| | | su.warehouse_info_id, |
| | | siw.warehouse_name, |
| | | su.create_time, |
| | | su.update_time, |
| | | 0 as warn_num, |
| | |
| | | from stock_uninventory su |
| | | left join product_model pm on su.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join stock_warehouse_info siw on su.warehouse_info_id = siw.id |
| | | ) as combined |
| | | <where> |
| | | <if test="ew.productName != null and ew.productName !=''"> |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="staffCount" column="staff_count" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="selectDeptVo"> |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time |
| | | from sys_dept d |
| | | </sql> |
| | | |
| | |
| | | AND d.status = #{status} |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | | -- ${params.dataScope} |
| | | group by d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | | |
| | | |
| | | <select id="selectDeptListByRoleId" resultType="java.lang.Long"> |
| | | select d.dept_id |
| | | from sys_dept d |
| | |
| | | </if> |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | | |
| | | |
| | | <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult"> |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, |
| | | (select dept_name from sys_dept where dept_id = d.parent_id) parent_name, |
| | |
| | | from sys_dept d |
| | | where d.dept_id = #{deptId} |
| | | </select> |
| | | |
| | | |
| | | <select id="checkDeptExistUser" parameterType="Long" resultType="int"> |
| | | select count(1) from sys_user_dept where dept_id = #{deptId} |
| | | </select> |
| | | |
| | | |
| | | <select id="hasChildByDeptId" parameterType="Long" resultType="int"> |
| | | select count(1) from sys_dept |
| | | where del_flag = '0' and parent_id = #{deptId} limit 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult"> |
| | | select * from sys_dept where find_in_set(#{deptId}, ancestors) |
| | | </select> |
| | | |
| | | |
| | | <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int"> |
| | | select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors) |
| | | </select> |
| | | |
| | | |
| | | <select id="checkDeptNameUnique" resultMap="SysDeptResult"> |
| | | <include refid="selectDeptVo"/> |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertDept" parameterType="com.ruoyi.project.system.domain.SysDept"> |
| | | insert into sys_dept( |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <update id="updateDept" parameterType="com.ruoyi.project.system.domain.SysDept"> |
| | | update sys_dept |
| | | <set> |
| | |
| | | </set> |
| | | where dept_id = #{deptId} |
| | | </update> |
| | | |
| | | |
| | | <update id="updateDeptChildren" parameterType="java.util.List"> |
| | | update sys_dept set ancestors = |
| | | <foreach collection="depts" item="item" index="index" |
| | |
| | | #{item.deptId} |
| | | </foreach> |
| | | </update> |
| | | |
| | | |
| | | <update id="updateDeptStatusNormal" parameterType="Long"> |
| | | update sys_dept set status = '0' where dept_id in |
| | | update sys_dept set status = '0' where dept_id in |
| | | <foreach collection="array" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | </foreach> |
| | | </update> |
| | | |
| | | |
| | | <delete id="deleteDeptById" parameterType="Long"> |
| | | update sys_dept set del_flag = '2' where dept_id = #{deptId} |
| | | </delete> |
| | |
| | | WHERE parent_id = 100; |
| | | </select> |
| | | |
| | | </mapper> |
| | | </mapper> |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="selectRoleVo"> |
| | | select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, |
| | | r.status, r.del_flag, r.create_time, r.remark |
| | | r.status, r.del_flag, r.create_time, r.remark |
| | | from sys_role r |
| | | left join sys_user_role ur on ur.role_id = r.role_id |
| | | left join sys_user u on u.user_id = ur.user_id |
| | | </sql> |
| | | |
| | | |
| | | <select id="selectRoleList" parameterType="com.ruoyi.project.system.domain.SysRole" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where r.del_flag = '0' |
| | |
| | | and date_format(r.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | | -- ${params.dataScope} |
| | | order by r.role_sort |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | WHERE r.del_flag = '0' and ur.user_id = #{userId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRoleAll" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | WHERE r.del_flag = '0' |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRoleListByUserId" parameterType="Long" resultType="Long"> |
| | | select r.role_id |
| | | from sys_role r |
| | |
| | | left join sys_user u on u.user_id = ur.user_id |
| | | where u.user_id = #{userId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where r.role_id = #{roleId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | WHERE r.del_flag = '0' and u.user_name = #{userName} |
| | | </select> |
| | | |
| | | |
| | | <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where r.role_name=#{roleName} and r.del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertRole" parameterType="com.ruoyi.project.system.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId"> |
| | | insert into sys_role( |
| | | <if test="roleId != null and roleId != 0">role_id,</if> |
| | |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <update id="updateRole" parameterType="com.ruoyi.project.system.domain.SysRole"> |
| | | update sys_role |
| | | <set> |
| | |
| | | </set> |
| | | where role_id = #{roleId} |
| | | </update> |
| | | |
| | | |
| | | <delete id="deleteRoleById" parameterType="Long"> |
| | | update sys_role set del_flag = '2' where role_id = #{roleId} |
| | | </delete> |
| | | |
| | | |
| | | <delete id="deleteRoleByIds" parameterType="Long"> |
| | | update sys_role set del_flag = '2' where role_id in |
| | | <foreach collection="array" item="roleId" open="(" separator="," close=")"> |
| | | #{roleId} |
| | | </foreach> |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |
| | | |
| | | </mapper> |
| | |
| | | ) |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | | -- ${params.dataScope} |
| | | </select> |
| | | |
| | | <select id="selectAllocatedList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult"> |
| | |
| | | AND u.phonenumber like concat('%', #{phonenumber}, '%') |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | | -- ${params.dataScope} |
| | | </select> |
| | | |
| | | <select id="selectUnallocatedList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult"> |
| | |
| | | AND u.phonenumber like concat('%', #{phonenumber}, '%') |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | | -- ${params.dataScope} |
| | | </select> |
| | | |
| | | <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |