管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-10 bd85162c5b94b47b73717f454cf3f3c88c3ccc55
1
已修改12个文件
100 ■■■■■ 文件已修改
src/main/java/com/lf/server/controller/sys/BlacklistController.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/sys/RoleController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/sys/BlacklistMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/mapper/sys/RoleMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/BlacklistService.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/RoleService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/BlacklistMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/MenuAuthMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/RoleMapper.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/RoleMenuMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/RoleResMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/sys/RoleUserMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/controller/sys/BlacklistController.java
@@ -28,12 +28,13 @@
    @SysLog()
    @ApiOperation(value = "查询记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ip", value = "IP地址", dataType = "String", paramType = "query", required = false, example = "")
            @ApiImplicitParam(name = "ip", value = "IP地址", dataType = "String", paramType = "query", required = false, example = "192."),
            @ApiImplicitParam(name = "type", value = "类别", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping({"/selectCount"})
    public ResponseMsg<Integer> selectCount(String ip) {
    public ResponseMsg<Integer> selectCount(String ip, Integer type) {
        try {
            int count = blacklistService.selectCount(ip);
            int count = blacklistService.selectCount(ip, type);
            return success(count);
        } catch (Exception ex) {
@@ -44,18 +45,19 @@
    @SysLog()
    @ApiOperation(value = "分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ip", value = "IP地址", dataType = "String", paramType = "query", example = ""),
            @ApiImplicitParam(name = "ip", value = "IP地址", dataType = "String", paramType = "query", example = "192."),
            @ApiImplicitParam(name = "type", value = "类别", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPage")
    public ResponseMsg<List<BlacklistEntity>> selectByPage(String ip, Integer pageSize, Integer pageIndex) {
    public ResponseMsg<List<BlacklistEntity>> selectByPage(String ip, Integer type, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
            List<BlacklistEntity> rs = blacklistService.selectByPage(ip, pageSize, pageSize * (pageIndex - 1));
            List<BlacklistEntity> rs = blacklistService.selectByPage(ip, type, pageSize, pageSize * (pageIndex - 1));
            return success(rs);
        } catch (Exception ex) {
@@ -66,21 +68,22 @@
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ip", value = "IP地址", dataType = "String", paramType = "query", example = ""),
            @ApiImplicitParam(name = "ip", value = "IP地址", dataType = "String", paramType = "query", required = false, example = "192."),
            @ApiImplicitParam(name = "type", value = "类别", dataType = "Integer", paramType = "query", example = "1"),
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPageAndCount")
    public ResponseMsg<List<BlacklistEntity>> selectByPageAndCount(String ip, Integer pageSize, Integer pageIndex) {
    public ResponseMsg<List<BlacklistEntity>> selectByPageAndCount(String ip, Integer type, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
            int count = blacklistService.selectCount(ip);
            int count = blacklistService.selectCount(ip, type);
            if (count == 0) {
                return success(0, null);
            }
            List<BlacklistEntity> rs = blacklistService.selectByPage(ip, pageSize, pageSize * (pageIndex - 1));
            List<BlacklistEntity> rs = blacklistService.selectByPage(ip, type, pageSize, pageSize * (pageIndex - 1));
            return success(count, rs);
        } catch (Exception ex) {
src/main/java/com/lf/server/controller/sys/RoleController.java
@@ -29,12 +29,13 @@
    @SysLog()
    @ApiOperation(value = "查询记录数")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", required = false, example = "sys_role")
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", required = false, example = "sys_role"),
            @ApiImplicitParam(name = "depName", value = "名称", dataType = "String", paramType = "query", example = "sys_role")
    })
    @GetMapping({"/selectCount"})
    public ResponseMsg<Integer> selectCount(String name) {
    public ResponseMsg<Integer> selectCount(String name, String depName) {
        try {
            int count = roleService.selectCount(name);
            int count = roleService.selectCount(name, depName);
            return success(count);
        } catch (Exception ex) {
@@ -78,7 +79,7 @@
                return fail("每页页数或分页数小于1", null);
            }
            int count = roleService.selectCount(name);
            int count = roleService.selectCount(name, depName);
            if (count == 0) {
                return success(0, null);
            }
src/main/java/com/lf/server/mapper/sys/BlacklistMapper.java
@@ -16,20 +16,22 @@
    /**
     * 查询记录数
     *
     * @param ip IP地址
     * @param ip   IP地址
     * @param type 类别
     * @return 记录数
     */
    public Integer selectCount(String ip);
    public Integer selectCount(String ip, Integer type);
    /**
     * 分页查询
     *
     * @param ip   IP地址
     * @param ip     IP地址
     * @param type   类别
     * @param limit  记录表
     * @param offset 偏移量
     * @return 列表
     */
    public List<BlacklistEntity> selectByPage(String ip, Integer limit, Integer offset);
    public List<BlacklistEntity> selectByPage(String ip, Integer type, Integer limit, Integer offset);
    /**
     * 查询所有
src/main/java/com/lf/server/mapper/sys/RoleMapper.java
@@ -18,9 +18,10 @@
     * 根据表名查询记录数
     *
     * @param name 名称
     * @param depName 名称
     * @return 记录数
     */
    public Integer selectCount(String name);
    public Integer selectCount(String name, String depName);
    /**
     * 根据表名分页查询
src/main/java/com/lf/server/service/sys/BlacklistService.java
@@ -18,17 +18,17 @@
    BlacklistMapper blacklistMapper;
    @Override
    public Integer selectCount(String ip) {
        ip = "%" + (StringHelper.isNull(ip) ? "" : ip.trim()) + "%";
    public Integer selectCount(String ip, Integer type) {
        ip = StringHelper.isNull(ip) ? null : "%" + ip.trim() + "%";
        return blacklistMapper.selectCount(ip);
        return blacklistMapper.selectCount(ip, type);
    }
    @Override
    public List<BlacklistEntity> selectByPage(String ip, Integer limit, Integer offset) {
        ip = "%" + (StringHelper.isNull(ip) ? "" : ip.trim()) + "%";
    public List<BlacklistEntity> selectByPage(String ip, Integer type, Integer limit, Integer offset) {
        ip = StringHelper.isNull(ip) ? null : "%" + ip.trim() + "%";
        return blacklistMapper.selectByPage(ip, limit, offset);
        return blacklistMapper.selectByPage(ip, type, limit, offset);
    }
    @Override
src/main/java/com/lf/server/service/sys/RoleService.java
@@ -18,13 +18,13 @@
    RoleMapper roleMapper;
    @Override
    public Integer selectCount(String name) {
        return roleMapper.selectCount(name);
    public Integer selectCount(String name, String depName) {
        return roleMapper.selectCount(name, depName);
    }
    @Override
    public List<RoleEntity> selectByPage(String name,String depName, Integer limit, Integer offset) {
        return roleMapper.selectByPage(name,depName, limit, offset);
    public List<RoleEntity> selectByPage(String name, String depName, Integer limit, Integer offset) {
        return roleMapper.selectByPage(name, depName, limit, offset);
    }
    @Override
src/main/resources/mapper/sys/BlacklistMapper.xml
@@ -4,8 +4,12 @@
    <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String">
        select count(*) from lf.sys_blacklist
        <where>
            1 = 1
            <if test="ip != null">
                ip like #{ip}
                and ip like #{ip}
            </if>
            <if test="type != null">
                and type = #{type}
            </if>
        </where>
    </select>
@@ -13,8 +17,12 @@
    <select id="selectByPage" resultType="com.lf.server.entity.sys.BlacklistEntity">
        select * from lf.sys_blacklist
        <where>
            1 = 1
            <if test="ip != null">
                ip like #{ip}
                and ip like #{ip}
            </if>
            <if test="type != null">
                and type = #{type}
            </if>
        </where>
        order by id
src/main/resources/mapper/sys/MenuAuthMapper.xml
@@ -4,7 +4,7 @@
    <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String">
        select count(*) from lf.sys_menu_auth
        <where>
            <if test="menuid != 0">
            <if test="menuid != null">
                menuid = #{menuid}
            </if>
        </where>
@@ -13,7 +13,7 @@
    <select id="selectByPage" resultType="com.lf.server.entity.sys.MenuAuthEntity">
        select * from lf.sys_menu_auth
        <where>
            <if test="menuid != 0">
            <if test="menuid != null">
                menuid = #{menuid}
            </if>
        </where>
src/main/resources/mapper/sys/RoleMapper.xml
@@ -6,8 +6,12 @@
    <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String">
        select count(*) from lf.sys_role
        <where>
            1=1
            <if test="name != null">
                name = #{name}
                and a.name = #{name}
            </if>
            <if test="depName != null">
                and b.name = #{depName}
            </if>
        </where>
    </select>
@@ -22,7 +26,6 @@
            <if test="name != null">
                and a.name = #{name}
            </if>
            <if test="depName != null">
                and b.name = #{depName}
            </if>
src/main/resources/mapper/sys/RoleMenuMapper.xml
@@ -4,7 +4,7 @@
    <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String">
        select count(*) from lf.sys_role_menu
        <where>
            <if test="roleid != 0">
            <if test="roleid != null">
                roleid = #{roleid}
            </if>
        </where>
@@ -13,7 +13,7 @@
    <select id="selectByPage" resultType="com.lf.server.entity.sys.RoleMenuEntity">
        select * from lf.sys_role_menu
        <where>
            <if test="roleid != 0">
            <if test="roleid != null">
                roleid = #{roleid}
            </if>
        </where>
src/main/resources/mapper/sys/RoleResMapper.xml
@@ -4,7 +4,7 @@
    <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String">
        select count(*) from lf.sys_role_res
        <where>
            <if test="roleid != 0">
            <if test="roleid != null">
                roleid = #{roleid}
            </if>
        </where>
@@ -13,7 +13,7 @@
    <select id="selectByPage" resultType="com.lf.server.entity.sys.RoleResEntity">
        select * from lf.sys_role_res
        <where>
            <if test="roleid != 0">
            <if test="roleid != null">
                roleid = #{roleid}
            </if>
        </where>
src/main/resources/mapper/sys/RoleUserMapper.xml
@@ -4,7 +4,7 @@
    <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String">
        select count(*) from lf.sys_role_user
        <where>
            <if test="roleid != 0">
            <if test="roleid != null">
                roleid = #{roleid}
            </if>
        </where>
@@ -13,7 +13,7 @@
    <select id="selectByPage" resultType="com.lf.server.entity.sys.RoleUserEntity">
        select * from lf.sys_role_user
        <where>
            <if test="roleid != 0">
            <if test="roleid != null">
                roleid = #{roleid}
            </if>
        </where>