main
parent
3ee7f2748f
commit
de20d2b661
@ -1,8 +1,13 @@
|
|||||||
package com.tamguo.modules.sys.dao;
|
package com.tamguo.modules.sys.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.plugins.Page;
|
||||||
import com.tamguo.config.dao.SuperMapper;
|
import com.tamguo.config.dao.SuperMapper;
|
||||||
import com.tamguo.modules.sys.model.SysRoleEntity;
|
import com.tamguo.modules.sys.model.SysRoleEntity;
|
||||||
|
import com.tamguo.modules.sys.model.condition.SysRoleCondition;
|
||||||
|
|
||||||
public interface SysRoleMapper extends SuperMapper<SysRoleEntity>{
|
public interface SysRoleMapper extends SuperMapper<SysRoleEntity>{
|
||||||
|
|
||||||
|
List<SysRoleEntity> listData(SysRoleCondition condition, Page<SysRoleEntity> page);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.tamguo.modules.sys.model.condition;
|
||||||
|
|
||||||
|
public class SysRoleCondition {
|
||||||
|
|
||||||
|
private Integer pageNo;
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
public Integer getPageNo() {
|
||||||
|
return pageNo;
|
||||||
|
}
|
||||||
|
public void setPageNo(Integer pageNo) {
|
||||||
|
this.pageNo = pageNo;
|
||||||
|
}
|
||||||
|
public Integer getPageSize() {
|
||||||
|
return pageSize;
|
||||||
|
}
|
||||||
|
public void setPageSize(Integer pageSize) {
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,11 @@
|
|||||||
package com.tamguo.modules.sys.service;
|
package com.tamguo.modules.sys.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.plugins.Page;
|
||||||
|
import com.tamguo.modules.sys.model.SysRoleEntity;
|
||||||
|
import com.tamguo.modules.sys.model.condition.SysRoleCondition;
|
||||||
|
|
||||||
public interface ISysRoleService {
|
public interface ISysRoleService {
|
||||||
|
|
||||||
|
Page<SysRoleEntity> listData(SysRoleCondition condition);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,26 @@
|
|||||||
package com.tamguo.modules.sys.service.impl;
|
package com.tamguo.modules.sys.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.plugins.Page;
|
||||||
|
import com.tamguo.modules.sys.dao.SysRoleMapper;
|
||||||
|
import com.tamguo.modules.sys.model.SysRoleEntity;
|
||||||
|
import com.tamguo.modules.sys.model.condition.SysRoleCondition;
|
||||||
import com.tamguo.modules.sys.service.ISysRoleService;
|
import com.tamguo.modules.sys.service.ISysRoleService;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class SysRoleServiceImpl implements ISysRoleService{
|
public class SysRoleServiceImpl implements ISysRoleService{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysRoleMapper sysRoleMapper;
|
||||||
|
|
||||||
|
@Transactional(readOnly=true)
|
||||||
|
@Override
|
||||||
|
public Page<SysRoleEntity> listData(SysRoleCondition condition) {
|
||||||
|
Page<SysRoleEntity> page = new Page<>(condition.getPageNo(), condition.getPageSize());
|
||||||
|
return page.setRecords(sysRoleMapper.listData(condition , page));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.tamguo.modules.sys.dao.SysRoleMapper">
|
||||||
|
|
||||||
|
<select id="listData" resultType="SysRoleEntity">
|
||||||
|
SELECT
|
||||||
|
r.role_code,
|
||||||
|
r.role_name,
|
||||||
|
r.role_type,
|
||||||
|
r.role_sort,
|
||||||
|
r.is_sys,
|
||||||
|
r.user_type,
|
||||||
|
r.data_scope,
|
||||||
|
r.`status`,
|
||||||
|
r.create_by,
|
||||||
|
r.create_date,
|
||||||
|
r.update_by,
|
||||||
|
r.update_date,
|
||||||
|
r.remarks,
|
||||||
|
r.corp_code,
|
||||||
|
r.corp_name
|
||||||
|
FROM
|
||||||
|
sys_role r
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in new issue