Selaa lähdekoodia

Merge branch 'feature/1.0.0' of github.com:ab-inbev-apac/abi-cloud-qr-platform into feature/1.0.0

tanzhongran 4 vuotta sitten
vanhempi
commit
a863894015

+ 5 - 5
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/entity/UserInfo.java

@@ -47,18 +47,18 @@ public class UserInfo {
     private Integer isAbi;
 
     @ApiModelProperty(value = "部门id")
-    private Long departmentId;
+    private Long deptId;
 
     @ApiModelProperty(value = "供应商id")
     private Long factoryId;
 
-    @ApiModelProperty(value = "角色id")
-    private Long roleId;
-
     @ApiModelProperty(value = "角色code")
     private String roleCode;
 
-	@ApiModelProperty(value = "创建时间")
+    @ApiModelProperty(value = "是否启用")
+    private Integer isEnable;
+
+    @ApiModelProperty(value = "创建时间")
     private LocalDateTime createTime;
 
 	@ApiModelProperty(value = "创建人id")

+ 46 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/entity/UserInfoResp.java

@@ -0,0 +1,46 @@
+package com.abi.qms.platform.dto.res.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author Eurus
+ * @date 2021/4/19 16:44
+ */
+@Data
+@ApiModel
+public class UserInfoResp implements Serializable {
+    @ApiModelProperty(value = "用户id")
+    private Long id;
+
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+
+    @ApiModelProperty(value = "工号")
+    private String employeeNo;
+
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+
+    @ApiModelProperty(value = "部门")
+    private String deptName;
+
+    @ApiModelProperty(value = "供应商")
+    private String factoryName;
+
+    @ApiModelProperty(value = "角色code")
+    private String roleCode;
+
+    @ApiModelProperty(value = "是否启用")
+    private Integer isEnable;
+
+    @ApiModelProperty(value = "修改时间")
+    private LocalDateTime updateTime;
+}

+ 40 - 3
abi-cloud-qr-platform-server/src/main/resources/dao/mapper/UserInfoMapper.xml

@@ -12,9 +12,9 @@
         <result column="LOGIN_NAME" property="loginName" />
         <result column="PASSWORD" property="password" />
         <result column="is_abi" property="isAbi" />
-        <result column="department_id" property="departmentId" />
+        <result column="dept_id" property="deptId" />
         <result column="factory_id" property="factoryId" />
-        <result column="role_id" property="roleId" />
+        <result column="is_enable" property="isEnable" />
         <result column="role_code" property="roleCode" />
         <result column="CREATE_TIME" property="createTime" />
         <result column="CREATE_BY" property="createBy" />
@@ -24,7 +24,44 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        ID, USER_NAME, EMPLOYEE_NO, PHONE, EMAIL, LOGIN_NAME, PASSWORD, is_abi, department_id, factory_id, role_id, role_code, CREATE_TIME, CREATE_BY, UPDATE_TIME, IS_DELETE
+        ID, USER_NAME, EMPLOYEE_NO, PHONE, EMAIL, LOGIN_NAME, PASSWORD, is_abi, dept_id, factory_id, role_code, is_enable, CREATE_TIME, CREATE_BY, UPDATE_TIME, IS_DELETE
     </sql>
 
+    <!--列表查询列-->
+    <sql id="Base_Column_List_Page">
+        u.ID, u.USER_NAME, u.EMPLOYEE_NO, u.PHONE, u.EMAIL, d.dept_name, f.factory_name, r.role_name, u.is_enable,
+    </sql>
+
+    <select id="selectUserInfoPage" resultType="com.abi.qms.platform.dto.res.entity.UserInfoResp">
+        SELECT  <include refid="Base_Column_List_Page"/>
+        FROM  user_info u
+        LEFT JOIN base_department d ON u.dept_id = d.id
+        LEFT JOIN base_factory f ON u.factory_id = f.id
+        LEFT JOIN user_role r ON u.role_code = r.role_code
+        WHERE 1=1
+        <if test="req.userName != null and req.userName != ''">
+            AND u.USER_NAME LIKE CONCAT('%',#{req.userName},'%')
+        </if>
+        <if test="req.employeeNo != null and req.employeeNo != ''">
+            AND u.EMPLOYEE_NO LIKE CONCAT('%',#{req.employeeNo},'%')
+        </if>
+        <if test="req.roleCode != null">
+            AND r.role_code = #{req.roleCode}
+        </if>
+        <if test="req.isEnable != null">
+            AND u.is_enable = #{req.isEnable}
+        </if>
+        and is_delete = 0
+        order by u.UPDATE_TIME desc
+    </select>
+
+    <!--批量启用/停用用户-->
+    <update id="batchEnableUser">
+        update user_info set is_enable =#{isEnable}
+        where id in
+        <foreach collection="ids" open="(" close=")" separator="," item="id" >
+            #{id}
+        </foreach>
+        and is_delete = 0
+    </update>
 </mapper>