| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询管理员用户") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "管理员类别", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectAdminUsers") |
| | | public ResponseMsg<Object> selectAdminUsers(Integer type) { |
| | | try { |
| | | if (null == type || type < 1) { |
| | | return fail("管理员类别不能为空或小于1", false); |
| | | } |
| | | |
| | | List<UserEntity> rs = userService.selectAdminUsers(type); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), false); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "com.lf.server.entity.data.UserEntity", paramType = "body", example = "") |
| | |
| | | public Integer selectForIsAdmin(Integer id); |
| | | |
| | | /** |
| | | * 查询管理员用户 |
| | | * |
| | | * @param type 管理员类别 |
| | | * @return |
| | | */ |
| | | public List<UserEntity> selectAdminUsers(Integer type); |
| | | |
| | | /** |
| | | * 插入一条 |
| | | * |
| | | * @param userEntity |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<UserEntity> selectAdminUsers(Integer type) { |
| | | return userMapper.selectAdminUsers(type); |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertUser(UserEntity userEntity) { |
| | | return userMapper.insertUser(userEntity); |
| | | } |
| | |
| | | where c.is_admin = 1 and a.id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectAdminUsers" resultType="com.lf.server.entity.sys.UserEntity"> |
| | | select c.*, fn_rec_query(c.depid, 'dep') depName |
| | | from lf.sys_role_user a inner join lf.sys_user b on a.userid = b.id |
| | | inner join lf.sys_role c on a.roleid = a.id |
| | | where c.is_admin = #{type} |
| | | </select> |
| | | |
| | | <insert id="insertUser" parameterType="com.lf.server.entity.sys.UserEntity"> |
| | | insert into lf.sys_user |
| | | (depid,uid,uname,salt,sex,native,contact,job,email,addr,edu,idcard,status,create_user,create_time,bak) |