| | |
| | | * @return |
| | | */ |
| | | List<SysUser> findList(Page<SysUser> page, @Param("u") Map<String, Object> params); |
| | | |
| | | Integer selectCountByMap(@Param("u")Map<String, Object> map); |
| | | } |
| | |
| | | ResultBody findAll(Map<String, Object> map); |
| | | |
| | | ResultBody getThisUserOrganizationUser(HttpServletRequest request); |
| | | |
| | | ResultBody findCountByMap(Map<String, Object> map); |
| | | } |
| | |
| | | } |
| | | return ResultBody.ok().data(sysUsers); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody findCountByMap(Map<String, Object> map) { |
| | | Integer integer = baseMapper.selectCountByMap(map); |
| | | return ResultBody.ok().data(integer); |
| | | } |
| | | } |
| | |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | <sql id="where_map"> |
| | | <where> |
| | | <if test="u.id != null and u.id != ''"> |
| | | and t.id like concat('%', #{u.id}, '%') |
| | | </if> |
| | | <if test="u.username != null and u.username != ''"> |
| | | and t.username = #{u.username} |
| | | </if> |
| | | <if test="u.nickname != null and u.nickname != ''"> |
| | | and t.nickname like concat('%', #{u.nickname}, '%') |
| | | </if> |
| | | <if test="u.enabled != null and u.enabled != ''"> |
| | | and t.enabled = #{u.enabled} |
| | | </if> |
| | | <if test="u.type != null and u.type != ''"> |
| | | and t.type = #{u.type} |
| | | </if> |
| | | <if test="u.searchKey != null and u.searchKey != '' and u.searchKey=='user_id'"> |
| | | and t.id like concat('%', #{u.searchValue}, '%') |
| | | </if> |
| | | <if test="u.searchKey != null and u.searchKey != '' and u.searchKey=='username'"> |
| | | and t.username like concat('%', #{u.searchValue}, '%') |
| | | </if> |
| | | <if test="u.searchKey != null and u.searchKey != '' and u.searchKey=='nick_name'"> |
| | | and t.nickname like concat('%', #{u.searchValue}, '%') |
| | | </if> |
| | | <if test="u.searchKey != null and u.searchKey != '' and u.searchKey=='mobile'"> |
| | | and t.mobile like concat('%', #{u.searchValue}, '%') |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | | <select id="findList" resultType="com.kidgrow.common.model.SysUser"> |
| | | select * from sys_user t |
| | | <include refid="where" /> |
| | | order by t.id desc |
| | | </select> |
| | | <select id="selectCountByMap" parameterType="map" resultType="integer"> |
| | | select count(*) from sys_user t <include refid="where_map" /> |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | /** |
| | | * 是否超级管理员 |
| | | * 根据map查询 |
| | | */ |
| | | private boolean checkAdmin(long id) { |
| | | return id == 1L; |
| | | } |
| | | @PostMapping("/users/findAll") |
| | | public ResultBody findAll(@RequestParam Map<String,Object> map) { |
| | | public ResultBody findAll( @RequestBody Map<String,Object> map) { |
| | | return appUserService.findAll(map); |
| | | } |
| | | |
| | | /** |
| | | * 根据map查询 总个数 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @PostMapping("/users/findCountByMap") |
| | | public ResultBody findCountByMap( @RequestBody Map<String,Object> map) { |
| | | return appUserService.findCountByMap(map); |
| | | } |
| | | /** |
| | | * 获取当前用的 组织下的所有人员 |
| | | */ |
| | |
| | | <option value="false">试用</option> |
| | | </select>  |
| | | <input name="hospitalName-seach" id="hospitalName-seach" placeholder="请输入医院名称" type="text" |
| | | class="layui-input search-input" maxlength="50" autocomplete="off" />  |
| | | class="layui-input search-input" maxlength="50" autocomplete="off" />  |
| | | </div> |
| | | <button id="app-btn-search" class="layui-btn icon-btn permissions" layt="abc" |
| | | permissions="sysdoctor-list"><i class="layui-icon"></i>搜索</button> |
| | | <button id="doctor-btn-add" class="layui-btn icon-btn permissions" permissions="sysdoctor-edit"><i |
| | | class="layui-icon"></i>添加</button> |
| | | <!-- 数据表格 --> |
| | | <table class="layui-table" id="app-table" lay-filter="app-table"></table> |
| | | <!-- 数据表格 --> |
| | | <table class="layui-table" id="app-table" lay-filter="app-table"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >登录帐号</label> |
| | | <div class="layui-input-block"> |
| | | <input name="username" type="text" class="layui-input" maxlength="15" lay-verify="required" required/> |
| | | <input name="username" id="username" type="text" class="layui-input" maxlength="15" lay-verify="required" required/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'hospitalName', width: 260, title: '医院名称' }, |
| | | { field: 'hospitalName', width: 180, title: '医院名称' }, |
| | | { field: 'doctorName', width: 120, title: '医生姓名' }, |
| | | { field: 'doctorRank', width: 180, title: '职称' }, |
| | | { field: 'doctorRank', width: 100, title: '职称' }, |
| | | { field: 'username', width: 150, title: '登录帐号' }, |
| | | { field: 'doctorTel', width: 150, title: '联系方式' }, |
| | | { |
| | |
| | | }, |
| | | { field: 'enabled', width: 100, align: 'center', templet: '#doctor-tpl-state', title: '状态' }, |
| | | // { field: 'createTime', width: 150, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm')}}</div>" }, |
| | | { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, |
| | | { field: 'createTime', width: 100, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, |
| | | { field: 'serverUserName', width: 100, title: '销售代表' }, |
| | | { width: 200,align: 'center', toolbar: '#doctor-table-bar', title: '操作' }, |
| | | { width: 300, align: 'center', toolbar: '#doctor-table-bar', title: '操作' }, |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | permissionsInput(); |
| | |
| | | |
| | | // 搜索按钮点击事件 |
| | | $('#app-btn-search').click(function () { |
| | | if(strUtil.isEmpty($("#hospitalName-seach").val())) |
| | | { |
| | | if (strUtil.isEmpty($("#hospitalName-seach").val())) { |
| | | $("#hospitalId").val(""); |
| | | } |
| | | var doctorState = $('#doctorState').val(); |
| | |
| | | $('#hospitalName-add').append(new Option(item.hospitalName, item.id, false, selected)); |
| | | }) |
| | | form.render(); |
| | | $("#username").blur(function () { |
| | | username_is_usered("username"); |
| | | }) |
| | | } |
| | | }); |
| | | }; |
| | | //判断用户名是否被使用 |
| | | var username_is_usered=function(username_id){ |
| | | var username=$("#"+username_id).val() |
| | | admin.req('api-user/users/findCountByMap',JSON.stringify({username:username}), function (data) { |
| | | if (data.code == 0) { |
| | | if(data.data>0){ |
| | | $("#"+username_id).val("") |
| | | layer.msg("该登录帐号已经使用",{ icon: 2, time: 500 }) |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'post'); |
| | | } |
| | | // 显示编辑弹窗 |
| | | var showEditModel = function (data, flag) { |
| | | var title = ""; |
| | |
| | | { field: 'name', sort: true, title: '角色名' }, |
| | | { field: 'code', sort: true, title: 'Code' }, |
| | | { field: 'tenantId', sort: true, title: '应用标识' }, |
| | | { |
| | | field: 'createTime', sort: true, templet: function (d) { |
| | | return util.toDateString(d.createTime); |
| | | }, title: '创建时间' |
| | | }, |
| | | // { |
| | | // field: 'createTime', sort: true, templet: function (d) { |
| | | // return util.toDateString(d.createTime); |
| | | // }, title: '创建时间' |
| | | // }, |
| | | { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, |
| | | { field: 'enabled', width: 100, sort: true, templet: '#role-tpl-state', title: '状态' }, |
| | | { align: 'center', toolbar: '#role-table-bar', title: '操作', width: 320 } |
| | | ]], |