| | |
| | | @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) { |
| | |
| | | @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) { |
| | |
| | | @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) { |
| | |
| | | @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) { |
| | |
| | | return fail("每页页数或分页数小于1", null); |
| | | } |
| | | |
| | | int count = roleService.selectCount(name); |
| | | int count = roleService.selectCount(name, depName); |
| | | if (count == 0) { |
| | | return success(0, null); |
| | | } |
| | |
| | | /** |
| | | * 查询记录数 |
| | | * |
| | | * @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); |
| | | |
| | | /** |
| | | * 查询所有 |
| | |
| | | * 根据表名查询记录数 |
| | | * |
| | | * @param name 名称 |
| | | * @param depName 名称 |
| | | * @return 记录数 |
| | | */ |
| | | public Integer selectCount(String name); |
| | | public Integer selectCount(String name, String depName); |
| | | |
| | | /** |
| | | * 根据表名分页查询 |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | <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> |
| | |
| | | <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 |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <if test="name != null"> |
| | | and a.name = #{name} |
| | | </if> |
| | | |
| | | <if test="depName != null"> |
| | | and b.name = #{depName} |
| | | </if> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <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> |