#update
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package com.maibu.mapper;
|
||||
|
||||
import com.maibu.core.domain.entity.SysOrg;
|
||||
import com.maibu.mybatis.mapper.BaseMapperX;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 设备历史状态
|
||||
*/
|
||||
@Repository
|
||||
public interface SysOrgMapper extends BaseMapperX<SysOrg> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.maibu.mapper;
|
||||
|
||||
import com.maibu.core.domain.entity.SysSite;
|
||||
import com.maibu.mybatis.mapper.BaseMapperX;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 设备历史状态
|
||||
*/
|
||||
@Repository
|
||||
public interface SysSiteMapper extends BaseMapperX<SysSite> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.maibu.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.maibu.core.domain.entity.SysOrg;
|
||||
import com.maibu.mapper.SysOrgMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 登录校验方法
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class SysOrgService {
|
||||
|
||||
@Autowired
|
||||
private SysOrgMapper sysOrgMapper;
|
||||
|
||||
|
||||
public List<SysOrg> list(SysOrg org) {
|
||||
LambdaQueryWrapper<SysOrg> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (org != null && !StringUtils.isEmpty(org.getOrgCode())) {
|
||||
queryWrapper.eq(SysOrg::getOrgCode, org.getOrgCode());
|
||||
}
|
||||
if (org != null && !StringUtils.isEmpty(org.getOrgName())) {
|
||||
queryWrapper.like(SysOrg::getOrgName, org.getOrgName());
|
||||
}
|
||||
return sysOrgMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
public boolean save(SysOrg org) {
|
||||
return sysOrgMapper.saveOrUpdate(org);
|
||||
}
|
||||
|
||||
public int delete(Long id) {
|
||||
return sysOrgMapper.updateById(id);
|
||||
}
|
||||
|
||||
public SysOrg selectById(Long id) {
|
||||
return sysOrgMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.maibu.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.maibu.core.domain.entity.SysOrg;
|
||||
import com.maibu.core.domain.entity.SysSite;
|
||||
import com.maibu.core.redis.RedisCache;
|
||||
import com.maibu.mapper.SysOrgMapper;
|
||||
import com.maibu.mapper.SysSiteMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class SysSiteService {
|
||||
|
||||
@Autowired
|
||||
private SysSiteMapper sysSiteMapper;
|
||||
|
||||
|
||||
public List<SysSite> list(SysSite site) {
|
||||
LambdaQueryWrapper<SysSite> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (site != null && !StringUtils.isEmpty(site.getSiteName())) {
|
||||
queryWrapper.like(SysSite::getSiteName, site.getSiteName());
|
||||
}
|
||||
return sysSiteMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
public boolean save(SysSite org) {
|
||||
return sysSiteMapper.saveOrUpdate(org);
|
||||
}
|
||||
|
||||
public int delete(Long id) {
|
||||
return sysSiteMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public SysSite selectById(Long id) {
|
||||
return sysSiteMapper.selectById(id);
|
||||
}
|
||||
|
||||
public List<SysSite> selectByOrgId(Long id) {
|
||||
LambdaQueryWrapper<SysSite> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysSite::getOrgId, id);
|
||||
return sysSiteMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user