| | |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_dept") |
| | | public class SysDept |
| | | public class SysDept implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_dict_data") |
| | | public class SysDictData |
| | | public class SysDictData implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 字典编码 */ |
| | | @Excel(name = "字典编码", cellType = ColumnType.NUMERIC) |
| | | @TableId(value = "dept_code",type = IdType.AUTO) |
| | | @TableId(value = "dict_code",type = IdType.AUTO) |
| | | private Long dictCode; |
| | | |
| | | /** 字典排序 */ |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_config") |
| | | public class SysDictType |
| | | @TableName("sys_dict_type") |
| | | public class SysDictType implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_menu") |
| | | public class SysMenu |
| | | public class SysMenu implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_role") |
| | | public class SysRole |
| | | public class SysRole implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | import javax.validation.constraints.Email; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_user") |
| | | public class SysUser |
| | | public class SysUser implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; |
| | | import com.baomidou.mybatisplus.core.incrementer.IKeyGenerator; |
| | | import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; |
| | | import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; |
| | | import com.baomidou.mybatisplus.core.injector.ISqlInjector; |
| | | import com.baomidou.mybatisplus.extension.incrementer.H2KeyGenerator; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.IllegalSQLInnerInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import com.ruoyi.framework.mybatisplus.CreateAndUpdateMetaObjectHandler; |
| | |
| | | // 乐观锁插件 |
| | | interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor()); |
| | | // 阻断插件 |
| | | interceptor.addInnerInterceptor(blockAttackInnerInterceptor()); |
| | | // interceptor.addInnerInterceptor(blockAttackInnerInterceptor()); |
| | | return interceptor; |
| | | } |
| | | |
| | |
| | | * 如果是对全表的删除或更新操作,就会终止该操作 |
| | | * https://baomidou.com/guide/interceptor-block-attack.html |
| | | */ |
| | | public BlockAttackInnerInterceptor blockAttackInnerInterceptor() { |
| | | return new BlockAttackInnerInterceptor(); |
| | | } |
| | | // public BlockAttackInnerInterceptor blockAttackInnerInterceptor() { |
| | | // return new BlockAttackInnerInterceptor(); |
| | | // } |
| | | |
| | | /** |
| | | * sql性能规范插件(垃圾SQL拦截) |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_config") |
| | | public class SysConfig { |
| | | public class SysConfig implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_logininfor") |
| | | public class SysLogininfor { |
| | | public class SysLogininfor implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_notice") |
| | | public class SysNotice { |
| | | public class SysNotice implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_oper_log") |
| | | public class SysOperLog { |
| | | public class SysOperLog implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 业务类型数组 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer[] businessTypes; |
| | | |
| | | /** |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Size; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | @NoArgsConstructor |
| | | @Accessors(chain = true) |
| | | @TableName("sys_post") |
| | | public class SysPost { |
| | | public class SysPost implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysLogininfor; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 系统访问日志情况信息 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysLogininforMapper extends BaseMapper<SysLogininfor> { |
| | | /** |
| | | * 新增系统登录日志 |
| | | * |
| | | * @param logininfor 访问日志对象 |
| | | */ |
| | | public void insertLogininfor(SysLogininfor logininfor); |
| | | |
| | | /** |
| | | * 查询系统登录日志集合 |
| | | * |
| | | * @param logininfor 访问日志对象 |
| | | * @return 登录记录集合 |
| | | */ |
| | | public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor); |
| | | |
| | | /** |
| | | * 批量删除系统登录日志 |
| | | * |
| | | * @param infoIds 需要删除的登录日志ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteLogininforByIds(Long[] infoIds); |
| | | |
| | | /** |
| | | * 清空系统登录日志 |
| | | * |
| | | * @return 结果 |
| | | */ |
| | | public int cleanLogininfor(); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 通知公告表 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysNoticeMapper extends BaseMapper<SysNotice> { |
| | | /** |
| | | * 查询公告信息 |
| | | * |
| | | * @param noticeId 公告ID |
| | | * @return 公告信息 |
| | | */ |
| | | public SysNotice selectNoticeById(Long noticeId); |
| | | |
| | | /** |
| | | * 查询公告列表 |
| | | * |
| | | * @param notice 公告信息 |
| | | * @return 公告集合 |
| | | */ |
| | | public List<SysNotice> selectNoticeList(SysNotice notice); |
| | | |
| | | /** |
| | | * 新增公告 |
| | | * |
| | | * @param notice 公告信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertNotice(SysNotice notice); |
| | | |
| | | /** |
| | | * 修改公告 |
| | | * |
| | | * @param notice 公告信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateNotice(SysNotice notice); |
| | | |
| | | /** |
| | | * 批量删除公告 |
| | | * |
| | | * @param noticeId 公告ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteNoticeById(Long noticeId); |
| | | |
| | | /** |
| | | * 批量删除公告信息 |
| | | * |
| | | * @param noticeIds 需要删除的公告ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteNoticeByIds(Long[] noticeIds); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 操作日志 数据层 |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysOperLogMapper extends BaseMapper<SysOperLog> { |
| | | /** |
| | | * 新增操作日志 |
| | | * |
| | | * @param operLog 操作日志对象 |
| | | */ |
| | | public void insertOperlog(SysOperLog operLog); |
| | | |
| | | /** |
| | | * 查询系统操作日志集合 |
| | | * |
| | | * @param operLog 操作日志对象 |
| | | * @return 操作日志集合 |
| | | */ |
| | | public List<SysOperLog> selectOperLogList(SysOperLog operLog); |
| | | |
| | | /** |
| | | * 批量删除系统操作日志 |
| | | * |
| | | * @param operIds 需要删除的操作日志ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteOperLogByIds(Long[] operIds); |
| | | |
| | | /** |
| | | * 查询操作日志详细 |
| | | * |
| | | * @param operId 操作ID |
| | | * @return 操作日志对象 |
| | | */ |
| | | public SysOperLog selectOperLogById(Long operId); |
| | | |
| | | /** |
| | | * 清空操作日志 |
| | | */ |
| | | public void cleanOperLog(); |
| | | } |
| | |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysPostMapper extends BaseMapper<SysPost> { |
| | | /** |
| | | * 查询岗位数据集合 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 岗位数据集合 |
| | | */ |
| | | public List<SysPost> selectPostList(SysPost post); |
| | | |
| | | /** |
| | | * 查询所有岗位 |
| | | * |
| | | * @return 岗位列表 |
| | | */ |
| | | public List<SysPost> selectPostAll(); |
| | | |
| | | /** |
| | | * 通过岗位ID查询岗位信息 |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 角色对象信息 |
| | | */ |
| | | public SysPost selectPostById(Long postId); |
| | | |
| | | /** |
| | | * 根据用户ID获取岗位选择框列表 |
| | |
| | | */ |
| | | public List<SysPost> selectPostsByUserName(String userName); |
| | | |
| | | /** |
| | | * 删除岗位信息 |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 结果 |
| | | */ |
| | | public int deletePostById(Long postId); |
| | | |
| | | /** |
| | | * 批量删除岗位信息 |
| | | * |
| | | * @param postIds 需要删除的岗位ID |
| | | * @return 结果 |
| | | */ |
| | | public int deletePostByIds(Long[] postIds); |
| | | |
| | | /** |
| | | * 修改岗位信息 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | | public int updatePost(SysPost post); |
| | | |
| | | /** |
| | | * 新增岗位信息 |
| | | * |
| | | * @param post 岗位信息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertPost(SysPost post); |
| | | |
| | | /** |
| | | * 校验岗位名称 |
| | | * |
| | | * @param postName 岗位名称 |
| | | * @return 结果 |
| | | */ |
| | | public SysPost checkPostNameUnique(String postName); |
| | | |
| | | /** |
| | | * 校验岗位编码 |
| | | * |
| | | * @param postCode 岗位编码 |
| | | * @return 结果 |
| | | */ |
| | | public SysPost checkPostCodeUnique(String postCode); |
| | | } |
| | |
| | | public int deleteUserPostByUserId(Long userId); |
| | | |
| | | /** |
| | | * 通过岗位ID查询岗位使用数量 |
| | | * |
| | | * @param postId 岗位ID |
| | | * @return 结果 |
| | | */ |
| | | public int countUserPostById(Long postId); |
| | | |
| | | /** |
| | | * 批量删除用户和岗位关联 |
| | | * |
| | | * @param ids 需要删除的数据ID |
| | |
| | | lqw.eq(StrUtil.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()); |
| | | lqw.like(StrUtil.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()); |
| | | Map<String, Object> params = config.getParams(); |
| | | lqw.apply(params.get("beginTime") != null, |
| | | lqw.apply(Validator.isNotEmpty(params.get("beginTime")), |
| | | "date_format(create_time,'%y%m%d') >= date_format(#{0},'%y%m%d')", |
| | | params.get("beginTime")); |
| | | lqw.apply(params.get("endTime") != null, |
| | | lqw.apply(Validator.isNotEmpty(params.get("endTime")), |
| | | "date_format(create_time,'%y%m%d') >= date_format(#{0},'%y%m%d')", |
| | | params.get("endTime")); |
| | | return baseMapper.selectList(lqw); |
| | |
| | | */ |
| | | @Service |
| | | public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService { |
| | | @Autowired |
| | | private SysDeptMapper deptMapper; |
| | | |
| | | @Autowired |
| | | private SysRoleMapper roleMapper; |
| | |
| | | @Override |
| | | public List<Integer> selectDeptListByRoleId(Long roleId) { |
| | | SysRole role = roleMapper.selectRoleById(roleId); |
| | | return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); |
| | | return baseMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | */ |
| | | @Service |
| | | public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService { |
| | | @Autowired |
| | | private SysDictTypeMapper dictTypeMapper; |
| | | |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | |
| | | List<SysDictData> dictDatas = dictDataMapper.selectList( |
| | | new LambdaQueryWrapper<SysDictData>() |
| | | .eq(SysDictData::getStatus, 0) |
| | | .eq(SysDictData::getDictType, dictType) |
| | | .eq(SysDictData::getDictType, dictType.getDictType()) |
| | | .orderByAsc(SysDictData::getDictSort)); |
| | | DictUtils.setDictCache(dictType.getDictType(), dictDatas); |
| | | } |
| | |
| | | public List<SysDictType> selectDictTypeList(SysDictType dictType) { |
| | | Map<String, Object> params = dictType.getParams(); |
| | | return list(new LambdaQueryWrapper<SysDictType>() |
| | | .like(SysDictType::getDictName, dictType.getDictName()) |
| | | .eq(SysDictType::getStatus, dictType.getStatus()) |
| | | .like(SysDictType::getDictType, dictType.getDictType()) |
| | | .apply(params.get("beginTime") != null, |
| | | .like(StrUtil.isNotBlank(dictType.getDictName()),SysDictType::getDictName, dictType.getDictName()) |
| | | .eq(StrUtil.isNotBlank(dictType.getStatus()),SysDictType::getStatus, dictType.getStatus()) |
| | | .like(StrUtil.isNotBlank(dictType.getDictType()),SysDictType::getDictType, dictType.getDictType()) |
| | | .apply(Validator.isNotEmpty(params.get("beginTime")), |
| | | "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(params.get("endTime") != null, |
| | | .apply(Validator.isNotEmpty(params.get("endTime")), |
| | | "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')", |
| | | params.get("endTime"))); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public int insertDictType(SysDictType dictType) { |
| | | int row = dictTypeMapper.insert(dictType); |
| | | int row = baseMapper.insert(dictType); |
| | | if (row > 0) { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | |
| | | dictDataMapper.update(null, new LambdaUpdateWrapper<SysDictData>() |
| | | .set(SysDictData::getDictType, dictType.getDictType()) |
| | | .eq(SysDictData::getDictType, oldDict.getDictType())); |
| | | int row = dictTypeMapper.updateById(dictType); |
| | | int row = baseMapper.updateById(dictType); |
| | | if (row > 0) { |
| | | DictUtils.clearDictCache(); |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.domain.SysLogininfor; |
| | | import com.ruoyi.system.mapper.SysLogininforMapper; |
| | | import com.ruoyi.system.service.ISysLogininforService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 系统访问日志情况信息 服务层处理 |
| | |
| | | @Service |
| | | public class SysLogininforServiceImpl extends ServiceImpl<SysLogininforMapper, SysLogininfor> implements ISysLogininforService { |
| | | |
| | | @Autowired |
| | | private SysLogininforMapper logininforMapper; |
| | | |
| | | /** |
| | | * 新增系统登录日志 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public void insertLogininfor(SysLogininfor logininfor) { |
| | | logininforMapper.insertLogininfor(logininfor); |
| | | save(logininfor); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) { |
| | | return logininforMapper.selectLogininforList(logininfor); |
| | | Map<String, Object> params = logininfor.getParams(); |
| | | return list(new LambdaQueryWrapper<SysLogininfor>() |
| | | .like(StrUtil.isNotBlank(logininfor.getIpaddr()),SysLogininfor::getIpaddr,logininfor.getIpaddr()) |
| | | .eq(StrUtil.isNotBlank(logininfor.getStatus()),SysLogininfor::getStatus,logininfor.getStatus()) |
| | | .like(StrUtil.isNotBlank(logininfor.getUserName()),SysLogininfor::getUserName,logininfor.getUserName()) |
| | | .apply(Validator.isNotEmpty(params.get("beginTime")), |
| | | "date_format(login_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(Validator.isNotEmpty(params.get("endTime")), |
| | | "date_format(login_time,'%y%m%d') <= date_format({0},'%y%m%d'", |
| | | params.get("endTime")) |
| | | .orderByDesc(SysLogininfor::getInfoId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int deleteLogininforByIds(Long[] infoIds) { |
| | | return logininforMapper.deleteLogininforByIds(infoIds); |
| | | return baseMapper.deleteBatchIds(Arrays.asList(infoIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void cleanLogininfor() { |
| | | logininforMapper.cleanLogininfor(); |
| | | remove(new LambdaQueryWrapper<>()); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.mapper.SysNoticeMapper; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 公告 服务层实现 |
| | |
| | | */ |
| | | @Service |
| | | public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService { |
| | | @Autowired |
| | | private SysNoticeMapper noticeMapper; |
| | | |
| | | /** |
| | | * 查询公告信息 |
| | |
| | | */ |
| | | @Override |
| | | public SysNotice selectNoticeById(Long noticeId) { |
| | | return noticeMapper.selectNoticeById(noticeId); |
| | | return getById(noticeId); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<SysNotice> selectNoticeList(SysNotice notice) { |
| | | return noticeMapper.selectNoticeList(notice); |
| | | return list(new LambdaQueryWrapper<SysNotice>() |
| | | .like(StrUtil.isNotBlank(notice.getNoticeTitle()),SysNotice::getNoticeTitle,notice.getNoticeTitle()) |
| | | .eq(StrUtil.isNotBlank(notice.getNoticeType()),SysNotice::getNoticeType,notice.getNoticeType()) |
| | | .like(StrUtil.isNotBlank(notice.getCreateBy()),SysNotice::getCreateBy,notice.getCreateBy())); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int insertNotice(SysNotice notice) { |
| | | return noticeMapper.insertNotice(notice); |
| | | return baseMapper.insert(notice); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int updateNotice(SysNotice notice) { |
| | | return noticeMapper.updateNotice(notice); |
| | | return baseMapper.updateById(notice); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int deleteNoticeById(Long noticeId) { |
| | | return noticeMapper.deleteNoticeById(noticeId); |
| | | return baseMapper.deleteById(noticeId); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int deleteNoticeByIds(Long[] noticeIds) { |
| | | return noticeMapper.deleteNoticeByIds(noticeIds); |
| | | return baseMapper.deleteBatchIds(Arrays.asList(noticeIds)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | | import com.ruoyi.system.mapper.SysOperLogMapper; |
| | | import com.ruoyi.system.service.ISysOperLogService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 操作日志 服务层处理 |
| | |
| | | */ |
| | | @Service |
| | | public class SysOperLogServiceImpl extends ServiceImpl<SysOperLogMapper, SysOperLog> implements ISysOperLogService { |
| | | @Autowired |
| | | private SysOperLogMapper operLogMapper; |
| | | |
| | | /** |
| | | * 新增操作日志 |
| | |
| | | */ |
| | | @Override |
| | | public void insertOperlog(SysOperLog operLog) { |
| | | operLogMapper.insertOperlog(operLog); |
| | | save(operLog); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<SysOperLog> selectOperLogList(SysOperLog operLog) { |
| | | return operLogMapper.selectOperLogList(operLog); |
| | | Map<String, Object> params = operLog.getParams(); |
| | | return list(new LambdaQueryWrapper<SysOperLog>() |
| | | .like(StrUtil.isNotBlank(operLog.getTitle()),SysOperLog::getTitle,operLog.getTitle()) |
| | | .eq(operLog.getBusinessType() != null && operLog.getBusinessType() > 0, |
| | | SysOperLog::getBusinessType,operLog.getBusinessType()) |
| | | .func(f -> { |
| | | if (ArrayUtil.isNotEmpty(operLog.getBusinessTypes())){ |
| | | f.in(SysOperLog::getBusinessType, Arrays.asList(operLog.getBusinessTypes())); |
| | | } |
| | | }) |
| | | .eq(operLog.getStatus() != null && operLog.getStatus() > 0, |
| | | SysOperLog::getStatus,operLog.getStatus()) |
| | | .like(StrUtil.isNotBlank(operLog.getOperName()),SysOperLog::getOperName,operLog.getOperName()) |
| | | .apply(Validator.isNotEmpty(params.get("beginTime")), |
| | | "date_format(login_time,'%y%m%d') >= date_format({0},'%y%m%d')", |
| | | params.get("beginTime")) |
| | | .apply(Validator.isNotEmpty(params.get("endTime")), |
| | | "date_format(login_time,'%y%m%d') <= date_format({0},'%y%m%d'", |
| | | params.get("endTime")) |
| | | .orderByDesc(SysOperLog::getOperId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int deleteOperLogByIds(Long[] operIds) { |
| | | return operLogMapper.deleteOperLogByIds(operIds); |
| | | return baseMapper.deleteBatchIds(Arrays.asList(operIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SysOperLog selectOperLogById(Long operId) { |
| | | return operLogMapper.selectOperLogById(operId); |
| | | return getById(operId); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public void cleanOperLog() { |
| | | operLogMapper.cleanOperLog(); |
| | | remove(new LambdaQueryWrapper<>()); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | | import com.ruoyi.system.mapper.SysPostMapper; |
| | | import com.ruoyi.system.mapper.SysUserPostMapper; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | public class SysPostServiceImpl extends ServiceImpl<SysPostMapper, SysPost> implements ISysPostService { |
| | | @Autowired |
| | | private SysPostMapper postMapper; |
| | | |
| | | @Autowired |
| | | private SysUserPostMapper userPostMapper; |
| | |
| | | */ |
| | | @Override |
| | | public List<SysPost> selectPostList(SysPost post) { |
| | | return postMapper.selectPostList(post); |
| | | return list(new LambdaQueryWrapper<SysPost>() |
| | | .like(StrUtil.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode()) |
| | | .eq(StrUtil.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus()) |
| | | .like(StrUtil.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName())); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<SysPost> selectPostAll() { |
| | | return postMapper.selectPostAll(); |
| | | return list(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SysPost selectPostById(Long postId) { |
| | | return postMapper.selectPostById(postId); |
| | | return getById(postId); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<Integer> selectPostListByUserId(Long userId) { |
| | | return postMapper.selectPostListByUserId(userId); |
| | | return baseMapper.selectPostListByUserId(userId); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public String checkPostNameUnique(SysPost post) { |
| | | Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | SysPost info = postMapper.checkPostNameUnique(post.getPostName()); |
| | | SysPost info = getOne(new LambdaQueryWrapper<SysPost>() |
| | | .eq(SysPost::getPostName, post.getPostName()).last("limit 1")); |
| | | if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | |
| | | @Override |
| | | public String checkPostCodeUnique(SysPost post) { |
| | | Long postId = Validator.isNull(post.getPostId()) ? -1L : post.getPostId(); |
| | | SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); |
| | | SysPost info = getOne(new LambdaQueryWrapper<SysPost>() |
| | | .eq(SysPost::getPostCode, post.getPostCode()).last("limit 1")); |
| | | if (Validator.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public int countUserPostById(Long postId) { |
| | | return userPostMapper.countUserPostById(postId); |
| | | return userPostMapper.selectCount(new LambdaQueryWrapper<SysUserPost>().eq(SysUserPost::getPostId,postId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int deletePostById(Long postId) { |
| | | return postMapper.deletePostById(postId); |
| | | return baseMapper.deleteById(postId); |
| | | } |
| | | |
| | | /** |
| | |
| | | throw new CustomException(String.format("%1$s已分配,不能删除", post.getPostName())); |
| | | } |
| | | } |
| | | return postMapper.deletePostByIds(postIds); |
| | | return baseMapper.deleteBatchIds(Arrays.asList(postIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int insertPost(SysPost post) { |
| | | return postMapper.insertPost(post); |
| | | return baseMapper.insert(post); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int updatePost(SysPost post) { |
| | | return postMapper.updatePost(post); |
| | | return baseMapper.updateById(post); |
| | | } |
| | | } |
| | |
| | | <result property="loginTime" column="login_time"/> |
| | | </resultMap> |
| | | |
| | | <insert id="insertLogininfor" parameterType="SysLogininfor"> |
| | | insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) |
| | | values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) |
| | | </insert> |
| | | |
| | | <select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult"> |
| | | select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor |
| | | <where> |
| | | <if test="ipaddr != null and ipaddr != ''"> |
| | | AND ipaddr like concat('%', #{ipaddr}, '%') |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | AND user_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | and date_format(login_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |
| | | </if> |
| | | <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
| | | and date_format(login_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | </where> |
| | | order by info_id desc |
| | | </select> |
| | | |
| | | <delete id="deleteLogininforByIds" parameterType="Long"> |
| | | delete from sys_logininfor where info_id in |
| | | <foreach collection="array" item="infoId" open="(" separator="," close=")"> |
| | | #{infoId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="cleanLogininfor"> |
| | | truncate table sys_logininfor |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | <result property="remark" column="remark"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectNoticeVo"> |
| | | select notice_id, |
| | | notice_title, |
| | | notice_type, |
| | | cast(notice_content as char) as notice_content, |
| | | status, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | remark |
| | | from sys_notice |
| | | </sql> |
| | | |
| | | <select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult"> |
| | | <include refid="selectNoticeVo"/> |
| | | where notice_id = #{noticeId} |
| | | </select> |
| | | |
| | | <select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult"> |
| | | <include refid="selectNoticeVo"/> |
| | | <where> |
| | | <if test="noticeTitle != null and noticeTitle != ''"> |
| | | AND notice_title like concat('%', #{noticeTitle}, '%') |
| | | </if> |
| | | <if test="noticeType != null and noticeType != ''"> |
| | | AND notice_type = #{noticeType} |
| | | </if> |
| | | <if test="createBy != null and createBy != ''"> |
| | | AND create_by like concat('%', #{createBy}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <insert id="insertNotice" parameterType="SysNotice"> |
| | | insert into sys_notice ( |
| | | <if test="noticeTitle != null and noticeTitle != '' ">notice_title,</if> |
| | | <if test="noticeType != null and noticeType != '' ">notice_type,</if> |
| | | <if test="noticeContent != null and noticeContent != '' ">notice_content,</if> |
| | | <if test="status != null and status != '' ">status,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | create_time |
| | | )values( |
| | | <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if> |
| | | <if test="noticeType != null and noticeType != ''">#{noticeType},</if> |
| | | <if test="noticeContent != null and noticeContent != ''">#{noticeContent},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateNotice" parameterType="SysNotice"> |
| | | update sys_notice |
| | | <set> |
| | | <if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if> |
| | | <if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if> |
| | | <if test="noticeContent != null">notice_content = #{noticeContent},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where notice_id = #{noticeId} |
| | | </update> |
| | | |
| | | <delete id="deleteNoticeById" parameterType="Long"> |
| | | delete |
| | | from sys_notice |
| | | where notice_id = #{noticeId} |
| | | </delete> |
| | | |
| | | <delete id="deleteNoticeByIds" parameterType="Long"> |
| | | delete from sys_notice where notice_id in |
| | | <foreach item="noticeId" collection="array" open="(" separator="," close=")"> |
| | | #{noticeId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | <result property="operTime" column="oper_time"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectOperLogVo"> |
| | | select oper_id, |
| | | title, |
| | | business_type, |
| | | method, |
| | | request_method, |
| | | operator_type, |
| | | oper_name, |
| | | dept_name, |
| | | oper_url, |
| | | oper_ip, |
| | | oper_location, |
| | | oper_param, |
| | | json_result, |
| | | status, |
| | | error_msg, |
| | | oper_time |
| | | from sys_oper_log |
| | | </sql> |
| | | |
| | | <insert id="insertOperlog" parameterType="SysOperLog"> |
| | | insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, |
| | | oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, |
| | | oper_time) |
| | | values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, |
| | | #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate()) |
| | | </insert> |
| | | |
| | | <select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult"> |
| | | <include refid="selectOperLogVo"/> |
| | | <where> |
| | | <if test="title != null and title != ''"> |
| | | AND title like concat('%', #{title}, '%') |
| | | </if> |
| | | <if test="businessType != null and businessType != ''"> |
| | | AND business_type = #{businessType} |
| | | </if> |
| | | <if test="businessTypes != null and businessTypes.length > 0"> |
| | | AND business_type in |
| | | <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")"> |
| | | #{businessType} |
| | | </foreach> |
| | | </if> |
| | | <if test="status != null"> |
| | | AND status = #{status} |
| | | </if> |
| | | <if test="operName != null and operName != ''"> |
| | | AND oper_name like concat('%', #{operName}, '%') |
| | | </if> |
| | | <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |
| | | and date_format(oper_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |
| | | </if> |
| | | <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
| | | and date_format(oper_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |
| | | </if> |
| | | </where> |
| | | order by oper_id desc |
| | | </select> |
| | | |
| | | <delete id="deleteOperLogByIds" parameterType="Long"> |
| | | delete from sys_oper_log where oper_id in |
| | | <foreach collection="array" item="operId" open="(" separator="," close=")"> |
| | | #{operId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult"> |
| | | <include refid="selectOperLogVo"/> |
| | | where oper_id = #{operId} |
| | | </select> |
| | | |
| | | <update id="cleanOperLog"> |
| | | truncate table sys_oper_log |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | from sys_post |
| | | </sql> |
| | | |
| | | <select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | <where> |
| | | <if test="postCode != null and postCode != ''"> |
| | | AND post_code like concat('%', #{postCode}, '%') |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | | </if> |
| | | <if test="postName != null and postName != ''"> |
| | | AND post_name like concat('%', #{postName}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectPostAll" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | </select> |
| | | |
| | | <select id="selectPostById" parameterType="Long" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | where post_id = #{postId} |
| | | </select> |
| | | |
| | | <select id="selectPostListByUserId" parameterType="Long" resultType="Integer"> |
| | | select p.post_id |
| | | from sys_post p |
| | |
| | | left join sys_user u on u.user_id = up.user_id |
| | | where u.user_name = #{userName} |
| | | </select> |
| | | |
| | | <select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | where post_name=#{postName} limit 1 |
| | | </select> |
| | | |
| | | <select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | where post_code=#{postCode} limit 1 |
| | | </select> |
| | | |
| | | <update id="updatePost" parameterType="SysPost"> |
| | | update sys_post |
| | | <set> |
| | | <if test="postCode != null and postCode != ''">post_code = #{postCode},</if> |
| | | <if test="postName != null and postName != ''">post_name = #{postName},</if> |
| | | <if test="postSort != null and postSort != ''">post_sort = #{postSort},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where post_id = #{postId} |
| | | </update> |
| | | |
| | | <insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId"> |
| | | insert into sys_post( |
| | | <if test="postId != null and postId != 0">post_id,</if> |
| | | <if test="postCode != null and postCode != ''">post_code,</if> |
| | | <if test="postName != null and postName != ''">post_name,</if> |
| | | <if test="postSort != null and postSort != ''">post_sort,</if> |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | create_time |
| | | )values( |
| | | <if test="postId != null and postId != 0">#{postId},</if> |
| | | <if test="postCode != null and postCode != ''">#{postCode},</if> |
| | | <if test="postName != null and postName != ''">#{postName},</if> |
| | | <if test="postSort != null and postSort != ''">#{postSort},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | <delete id="deletePostById" parameterType="Long"> |
| | | delete |
| | | from sys_post |
| | | where post_id = #{postId} |
| | | </delete> |
| | | |
| | | <delete id="deletePostByIds" parameterType="Long"> |
| | | delete from sys_post where post_id in |
| | | <foreach collection="array" item="postId" open="(" separator="," close=")"> |
| | | #{postId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | where user_id = #{userId} |
| | | </delete> |
| | | |
| | | <select id="countUserPostById" resultType="Integer"> |
| | | select count(1) |
| | | from sys_user_post |
| | | where post_id = #{postId} |
| | | </select> |
| | | |
| | | <delete id="deleteUserPost" parameterType="Long"> |
| | | delete from sys_user_post where user_id in |
| | | <foreach collection="array" item="userId" open="(" separator="," close=")"> |