Browse Source

项目详情

5 years ago
parent
commit
bad65b4c0e

+ 0 - 2
cloud-model/src/main/java/com/hssx/cloudmodel/controller/CompanyController.java

@@ -1,9 +1,7 @@
 package com.hssx.cloudmodel.controller;
 
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.hssx.cloudmodel.entity.Company;
-import com.hssx.cloudmodel.entity.Role;
 import com.hssx.cloudmodel.service.CompanyService;
 import com.hssx.cloudmodel.util.HttpRespMsg;
 import com.hssx.cloudmodel.util.PageUtil;

+ 0 - 78
cloud-model/src/main/java/com/hssx/cloudmodel/controller/RoleController.java

@@ -1,78 +0,0 @@
-package com.hssx.cloudmodel.controller;
-
-
-import com.hssx.cloudmodel.entity.Role;
-import com.hssx.cloudmodel.service.RoleService;
-import com.hssx.cloudmodel.util.HttpRespMsg;
-import com.hssx.cloudmodel.util.PageUtil;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author 吴涛涛
- * @since 2019-07-26
- */
-@Controller
-@RequestMapping("/role")
-public class RoleController {
-
-    @Autowired
-    private RoleService roleService;
-
-    /**
-     * 添加/修改角色
-     * 参数:roleName 角色名 dowloadPower 下载权限 0-无,1-有
-     * uploadPower 上传权限 0-无,1-有 viewPower 浏览权限 0-无,1-有
-     * approvalPower 审批权限 0-无,1-有
-     * @param flag 0-添加,1-修改
-     * @return
-     */
-    @ApiOperation("添加/修改角色")
-    @RequestMapping("/add")
-    @ResponseBody
-    public HttpRespMsg addAndUpdateRole(Role role, HttpServletRequest request,Integer flag,
-                               HttpServletResponse response) {
-        HttpRespMsg msg = new HttpRespMsg();
-        msg = roleService.addAndUpdateRole(role,flag);
-        return msg;
-    }
-
-    /**
-     * 删除角色
-     * 参数 id 角色id
-     * @return
-     */
-    @ApiOperation("删除角色")
-    @RequestMapping("/delete")
-    @ResponseBody
-    public HttpRespMsg deleteRole(Role role, HttpServletRequest request,
-                               HttpServletResponse response) {
-        HttpRespMsg msg = new HttpRespMsg();
-        msg = roleService.deleteById(role.getId());
-        return msg;
-    }
-
-    /**
-     * 角色列表
-     * 参数:pageNum 当前页码,pageSize 每页条数 keyName 关键字查询
-     * @return
-     */
-    @ApiOperation("角色列表")
-    @RequestMapping("/list")
-    @ResponseBody
-    public HttpRespMsg deleteRole(@RequestParam(required = false) String keyName, HttpServletRequest request,
-                                  HttpServletResponse response, PageUtil page) {
-        HttpRespMsg msg = new HttpRespMsg();
-        msg = roleService.pageList(page,keyName);
-        return msg;
-    }
-}
-

+ 0 - 17
cloud-model/src/main/java/com/hssx/cloudmodel/controller/UserController.java

@@ -2,10 +2,8 @@ package com.hssx.cloudmodel.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.hssx.cloudmodel.entity.Company;
-import com.hssx.cloudmodel.entity.Role;
 import com.hssx.cloudmodel.entity.User;
 import com.hssx.cloudmodel.service.CompanyService;
-import com.hssx.cloudmodel.service.RoleService;
 import com.hssx.cloudmodel.service.UserService;
 import com.hssx.cloudmodel.util.HttpRespMsg;
 import com.hssx.cloudmodel.util.MD5Util;
@@ -35,8 +33,6 @@ public class UserController {
     private UserService userService;
     @Autowired
     private CompanyService companyService;
-    @Autowired
-    private RoleService roleService;
 
     /**
      *
@@ -68,19 +64,6 @@ public class UserController {
         return msg;
     }
 
-    /**
-     * 创建账号是所获取的角色列表
-     * @return
-     */
-    @ApiOperation(value = "获取角色列表")
-    @RequestMapping("/getRoleList")
-    @ResponseBody
-    public HttpRespMsg getRoleList(){
-        HttpRespMsg msg = new HttpRespMsg();
-        List<Role> list = roleService.getIdAndNamelist();
-        msg.data = list;
-        return msg;
-    }
     /**
      * 添加/修改用户
      *

+ 0 - 155
cloud-model/src/main/java/com/hssx/cloudmodel/entity/Role.java

@@ -1,155 +0,0 @@
-package com.hssx.cloudmodel.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
-import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author 吴涛涛
- * @since 2019-07-29
- */
-@TableName("tb_role")
-public class Role extends Model<Role> {
-
-    private static final long serialVersionUID=1L;
-
-    /**
-     * 角色表主键
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 角色名称
-     */
-    @TableField("role_name")
-    private String roleName;
-
-    /**
-     * 下载权限
-     */
-    @TableField("dowload_power")
-    private Integer dowloadPower;
-
-    /**
-     * 上传权限
-     */
-    @TableField("upload_power")
-    private Integer uploadPower;
-
-    /**
-     * 浏览权限
-     */
-    @TableField("view_power")
-    private Integer viewPower;
-
-    /**
-     * 审批权限
-     */
-    @TableField("approval_power")
-    private Integer approvalPower;
-
-    /**
-     * 创建时间
-     */
-    @TableField("indate")
-    private LocalDateTime indate;
-
-    /**
-     * 所属方
-     */
-    @TableField("subordinate")
-    private String subordinate;
-
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getRoleName() {
-        return roleName;
-    }
-
-    public void setRoleName(String roleName) {
-        this.roleName = roleName;
-    }
-
-    public Integer getDowloadPower() {
-        return dowloadPower;
-    }
-
-    public void setDowloadPower(Integer dowloadPower) {
-        this.dowloadPower = dowloadPower;
-    }
-
-    public Integer getUploadPower() {
-        return uploadPower;
-    }
-
-    public void setUploadPower(Integer uploadPower) {
-        this.uploadPower = uploadPower;
-    }
-
-    public Integer getViewPower() {
-        return viewPower;
-    }
-
-    public void setViewPower(Integer viewPower) {
-        this.viewPower = viewPower;
-    }
-
-    public Integer getApprovalPower() {
-        return approvalPower;
-    }
-
-    public void setApprovalPower(Integer approvalPower) {
-        this.approvalPower = approvalPower;
-    }
-
-    public LocalDateTime getIndate() {
-        return indate;
-    }
-
-    public void setIndate(LocalDateTime indate) {
-        this.indate = indate;
-    }
-
-    public String getSubordinate() {
-        return subordinate;
-    }
-
-    public void setSubordinate(String subordinate) {
-        this.subordinate = subordinate;
-    }
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-    @Override
-    public String toString() {
-        return "Role{" +
-        "id=" + id +
-        ", roleName=" + roleName +
-        ", dowloadPower=" + dowloadPower +
-        ", uploadPower=" + uploadPower +
-        ", viewPower=" + viewPower +
-        ", approvalPower=" + approvalPower +
-        ", indate=" + indate +
-        ", subordinate=" + subordinate +
-        "}";
-    }
-}

+ 11 - 11
cloud-model/src/main/java/com/hssx/cloudmodel/entity/User.java

@@ -14,7 +14,7 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-07-27
+ * @since 2019-07-31
  */
 @TableName("tb_user")
 public class User extends Model<User> {
@@ -52,7 +52,7 @@ public class User extends Model<User> {
     private String mobile;
 
     /**
-     * (供应商)角色类型,-1-超级管理员 0-项目经理 1-普通用户。(客户方)5-客服方领导,6-客户方普通人员
+     * 角色类型,-1-超级管理员 0-项目经理 1-普通用户。5-客服方领导,6-客户方普通人员
      */
     @TableField("role_type")
     private Integer roleType;
@@ -76,10 +76,10 @@ public class User extends Model<User> {
     private Integer sex;
 
     /**
-     * 部门编号
+     * 角色名(用户填写)
      */
-    @TableField("dep_no")
-    private String depNo;
+    @TableField("role_name")
+    private String roleName;
 
     /**
      * 工作状态
@@ -112,7 +112,7 @@ public class User extends Model<User> {
     private String teamName;
 
     /**
-     * 所属方,0-供应商 1-客户方
+     * 所属方,-1-超级管理员,0-供应商 1-客户方
      */
     @TableField("subordinate_type")
     private Integer subordinateType;
@@ -190,12 +190,12 @@ public class User extends Model<User> {
         this.sex = sex;
     }
 
-    public String getDepNo() {
-        return depNo;
+    public String getRoleName() {
+        return roleName;
     }
 
-    public void setDepNo(String depNo) {
-        this.depNo = depNo;
+    public void setRoleName(String roleName) {
+        this.roleName = roleName;
     }
 
     public Integer getWorkState() {
@@ -263,7 +263,7 @@ public class User extends Model<User> {
         ", companyId=" + companyId +
         ", parentId=" + parentId +
         ", sex=" + sex +
-        ", depNo=" + depNo +
+        ", roleName=" + roleName +
         ", workState=" + workState +
         ", isDisable=" + isDisable +
         ", indate=" + indate +

+ 0 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/mapper/CompanyMapper.java

@@ -2,7 +2,6 @@ package com.hssx.cloudmodel.mapper;
 
 import com.hssx.cloudmodel.entity.Company;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.hssx.cloudmodel.entity.Role;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;

+ 0 - 22
cloud-model/src/main/java/com/hssx/cloudmodel/mapper/RoleMapper.java

@@ -1,22 +0,0 @@
-package com.hssx.cloudmodel.mapper;
-
-import com.hssx.cloudmodel.entity.Role;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 吴涛涛
- * @since 2019-07-26
- */
-public interface RoleMapper extends BaseMapper<Role> {
-
-    List<Role> getListByKeyName(@Param("keyName") String keyName,@Param("start")Integer start,@Param("pageSize") Integer pageSize);
-
-    List<Role> selectIdAndNamelist();
-}

+ 0 - 28
cloud-model/src/main/java/com/hssx/cloudmodel/service/RoleService.java

@@ -1,28 +0,0 @@
-package com.hssx.cloudmodel.service;
-
-import com.hssx.cloudmodel.entity.Company;
-import com.hssx.cloudmodel.entity.Role;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.hssx.cloudmodel.util.HttpRespMsg;
-import com.hssx.cloudmodel.util.PageUtil;
-
-import java.util.List;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 吴涛涛
- * @since 2019-07-26
- */
-public interface RoleService extends IService<Role> {
-
-    HttpRespMsg addAndUpdateRole(Role role, Integer flag);
-
-    HttpRespMsg pageList(PageUtil page, String keyName);
-
-    List<Role> getIdAndNamelist();
-
-    HttpRespMsg deleteById(Integer id);
-}

+ 0 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/CompanyServiceImpl.java

@@ -2,7 +2,6 @@ package com.hssx.cloudmodel.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.hssx.cloudmodel.entity.Company;
-import com.hssx.cloudmodel.entity.Role;
 import com.hssx.cloudmodel.entity.User;
 import com.hssx.cloudmodel.mapper.CompanyMapper;
 import com.hssx.cloudmodel.mapper.UserMapper;

+ 0 - 86
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/RoleServiceImpl.java

@@ -1,86 +0,0 @@
-package com.hssx.cloudmodel.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.hssx.cloudmodel.entity.Role;
-import com.hssx.cloudmodel.entity.User;
-import com.hssx.cloudmodel.mapper.RoleMapper;
-import com.hssx.cloudmodel.mapper.UserMapper;
-import com.hssx.cloudmodel.service.RoleService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.hssx.cloudmodel.util.HttpRespMsg;
-import com.hssx.cloudmodel.util.PageUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author 吴涛涛
- * @since 2019-07-26
- */
-@Service
-public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
-    @Autowired
-    RoleMapper roleMapper;
-    @Autowired
-    UserMapper userMapper;
-
-    @Override
-    public HttpRespMsg addAndUpdateRole(Role role, Integer flag) {
-        HttpRespMsg msg = new HttpRespMsg();
-        if (flag == 0) {
-            //添加角色
-            QueryWrapper<Role> qw = new QueryWrapper<>();
-            qw.eq("role_name", role.getRoleName());
-            int count = roleMapper.selectCount(qw);
-            if (count > 0) {
-                msg.setError("角色已存在,请勿重复添加");
-            } else {
-                roleMapper.insert(role);
-            }
-        } else if (flag == 1) {
-            //更新角色信息
-            roleMapper.updateById(role);
-        }
-        return msg;
-
-    }
-
-    @Override
-    public HttpRespMsg pageList(PageUtil page, String keyName) {
-        HttpRespMsg msg = new HttpRespMsg();
-        QueryWrapper<Role> qw = new QueryWrapper<>();
-        Integer start = (page.getPageNum() - 1) * page.getPageSize();
-        if (keyName != null && !"".equals(keyName)) {
-            qw.like("role_name", keyName);
-        }
-        Integer count = roleMapper.selectCount(qw);
-        page.setTotal(count);
-        page.setPages(page.getTotal());
-        List<Role> list = roleMapper.getListByKeyName(keyName, start, page.getPageSize());
-        page.setList(list);
-        msg.data = page;
-        return msg;
-    }
-
-    @Override
-    public List<Role> getIdAndNamelist() {
-        return roleMapper.selectIdAndNamelist();
-    }
-
-    @Override
-    public HttpRespMsg deleteById(Integer id) {
-        HttpRespMsg msg = new HttpRespMsg();
-        Integer count = userMapper.selectCount(new QueryWrapper<User>().eq("role_type", id));
-        if (count > 0) {
-            msg.setError("该角色已被应用到用户中,暂不提供删除操作");
-        } else {
-            roleMapper.deleteById(id);
-        }
-        return msg;
-    }
-}

+ 7 - 12
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/UserServiceImpl.java

@@ -3,11 +3,8 @@ package com.hssx.cloudmodel.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.hssx.cloudmodel.constant.Constant;
-import com.hssx.cloudmodel.entity.Role;
 import com.hssx.cloudmodel.entity.User;
 import com.hssx.cloudmodel.entity.vo.UserVO;
-import com.hssx.cloudmodel.mapper.RoleMapper;
 import com.hssx.cloudmodel.mapper.UserMapper;
 import com.hssx.cloudmodel.service.UserService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -33,8 +30,6 @@ import java.util.UUID;
 public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
     @Autowired
     UserMapper userMapper;
-    @Autowired
-    RoleMapper roleMapper;
 
     @Override
     public HttpRespMsg login(User user, HttpServletRequest request) {
@@ -85,13 +80,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 user.setPassword(MD5Util.getPassword("000000"));
                 user.setHeadImgurl(UUID.randomUUID().toString().replaceAll("-", ""));
                 //获取角色所属的团体
-                Role role = roleMapper.selectById(user.getRoleType());
-                if("客户".equals(role.getSubordinate())){
-                    user.setSubordinateType(1);
-                }else if("供应商".equals(role.getSubordinate())){
-                    user.setSubordinateType(0);
-                }
-                user.setTeamName(role.getSubordinate());
+//                Role role = roleMapper.selectById(user.getRoleType());
+//                if("客户".equals(role.getSubordinate())){
+//                    user.setSubordinateType(1);
+//                }else if("供应商".equals(role.getSubordinate())){
+//                    user.setSubordinateType(0);
+//                }
+//                user.setTeamName(role.getSubordinate());
                 userMapper.insert(user);
             }
         } else if (flag == 1) {

+ 1 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/util/CodeGenerator.java

@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("tb_mould");
+        strategy.setInclude("tb_user");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);

+ 0 - 42
cloud-model/src/main/resources/mapper/RoleMapper.xml

@@ -1,42 +0,0 @@
-<?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.hssx.cloudmodel.mapper.RoleMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.hssx.cloudmodel.entity.Role">
-        <id column="id" property="id" />
-        <result column="role_name" property="roleName" />
-        <result column="dowload_power" property="dowloadPower" />
-        <result column="upload_power" property="uploadPower" />
-        <result column="view_power" property="viewPower" />
-        <result column="approval_power" property="approvalPower" />
-        <result column="indate" property="indate" />
-        <result column="subordinate" property="subordinate" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, role_name, dowload_power, upload_power, view_power, approval_power, indate, subordinate
-    </sql>
-
-    <select id="getListByKeyName" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from
-        tb_role
-        <where>
-            <if test="keyName != null and keyName != ''">
-                role_name like concat('%',#{keyName},'%')
-            </if>
-        </where>
-        Limit #{start},#{pageSize}
-    </select>
-
-    <select id="selectIdAndNamelist" resultMap="BaseResultMap">
-        select
-          id, role_name,subordinate
-        from
-          tb_role
-    </select>
-
-</mapper>

+ 17 - 17
cloud-model/src/main/resources/mapper/UserMapper.xml

@@ -13,7 +13,7 @@
         <result column="company_id" property="companyId" />
         <result column="parent_id" property="parentId" />
         <result column="sex" property="sex" />
-        <result column="dep_no" property="depNo" />
+        <result column="role_name" property="roleName" />
         <result column="work_state" property="workState" />
         <result column="is_disable" property="isDisable" />
         <result column="indate" property="indate" />
@@ -21,6 +21,12 @@
         <result column="team_name" property="teamName" />
         <result column="subordinate_type" property="subordinateType" />
     </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, account, username, password, mobile, role_type, company_id, parent_id, sex, role_name, work_state, is_disable, indate, head_imgurl, team_name, subordinate_type
+    </sql>
+
     <resultMap id="BaseResultMapVO" type="com.hssx.cloudmodel.entity.vo.UserVO">
         <id column="id" property="id" />
         <result column="account" property="account" />
@@ -33,7 +39,7 @@
         <result column="company_name" property="companyName"/>
         <result column="parent_id" property="parentId" />
         <result column="sex" property="sex" />
-        <result column="dep_no" property="depNo" />
+        <result column="role_name" property="roleName" />
         <result column="work_state" property="workState" />
         <result column="is_disable" property="isDisable" />
         <result column="indate" property="indate" />
@@ -42,19 +48,14 @@
         <result column="subordinate_type" property="subordinateType" />
     </resultMap>
 
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, account, username, password, mobile, role_type, company_id, parent_id, sex, dep_no, work_state, is_disable, indate, head_imgurl, team_name, subordinate_type
-    </sql>
-
     <select id="selectListByCondition" resultMap="BaseResultMapVO">
         SELECT
-          u.id id, u.account account, u.username username, u.password password, u.mobile mobile, u.role_type role_type, u.company_id company_id, c.`company_name` company_name,
-           r.role_name role_name,u.parent_id parent_id, u.sex sex, u.dep_no dep_no, u.work_state work_state, u.is_disable is_disable,
-           u.indate indate, u.head_imgurl head_imgurl, u.team_name team_name, u.subordinate_type subordinate_type
+        u.id id, u.account account, u.username username, u.password password, u.mobile mobile, u.role_type role_type, u.company_id company_id, c.`company_name` company_name,
+        r.role_name role_name,u.parent_id parent_id, u.sex sex,u.work_state work_state, u.is_disable is_disable,
+        u.indate indate, u.head_imgurl head_imgurl, u.team_name team_name, u.role_name role_name,u.subordinate_type subordinate_type
         FROM
-          tb_user AS u
-          LEFT JOIN tb_company c
+        tb_user AS u
+        LEFT JOIN tb_company c
         ON u.company_id = c.`id`
         LEFT JOIN tb_role r
         ON r.`id` = u.`role_type`
@@ -64,19 +65,18 @@
                 AND u.parent_id = #{user.id}
             </if>
             <if test="flag==0 and keyName != '' and keyName !=null">
-               AND u.username like concat('%',#{keyName},'%')
+                AND u.username like concat('%',#{keyName},'%')
             </if>
             <if test="flag==1 and keyName != '' and keyName !=null">
-              AND u.account like concat('%',#{keyName},'%')
+                AND u.account like concat('%',#{keyName},'%')
             </if>
             <if test="roleType != -2">
-              AND  u.role_type = #{roleType}
+                AND  u.role_type = #{roleType}
             </if>
             <if test="companyId != -1">
-              AND  u.company_id = #{companyId}
+                AND  u.company_id = #{companyId}
             </if>
         </where>
         Order by u.id desc
     </select>
-
 </mapper>

+ 10 - 12
cloud-model/src/test/java/com/hssx/cloudmodel/CloudModelApplicationTests.java

@@ -1,8 +1,6 @@
 package com.hssx.cloudmodel;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.hssx.cloudmodel.entity.Role;
-import com.hssx.cloudmodel.service.RoleService;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,15 +12,15 @@ import java.util.List;
 @RunWith(SpringRunner.class)
 @SpringBootTest
 public class CloudModelApplicationTests {
-    @Autowired
-    private RoleService roleService;
-    @Test
-    public void contextLoads() {
-        //mybatis-plus只查询特定字段的测试
-        QueryWrapper<Role> queryWrapper = new QueryWrapper<>();
-        queryWrapper.select("id", "role_name");
-        List<Role> list = roleService.list(queryWrapper);
-        System.out.println(list);
-    }
+//    @Autowired
+//    private RoleService roleService;
+//    @Test
+//    public void contextLoads() {
+//        //mybatis-plus只查询特定字段的测试
+//        QueryWrapper<Role> queryWrapper = new QueryWrapper<>();
+//        queryWrapper.select("id", "role_name");
+//        List<Role> list = roleService.list(queryWrapper);
+//        System.out.println(list);
+//    }
 
 }