Pārlūkot izejas kodu

更改删除标志

hym 4 gadi atpakaļ
vecāks
revīzija
a438d68485

+ 2 - 2
user_auth/src/main/resources/mapper/UserMapper.xml

@@ -239,7 +239,7 @@
         select  c.PERMISSION_TYPE ,c.id roleId,c.ROLE_STATE roleState
           from uims_user a join uims_user_role b on a.id=b.USER_ID
         join uims_role c on b.ROLE_ID= c.ID
-        where a.STATUS !=-1 and b.status!=-1 and c.status!=-1
+        where a.STATUS !=0 and b.status!=0 and c.status!=0
         and a.id=#{id}
     </select>
     <select id="findOrgRole" resultType="com.huaxu.model.ProgramItem">
@@ -261,7 +261,7 @@
              </if>
 
             and TENANT_ID=#{tenantId}
-            and status!=-1
+            and status!=0
          </where>
 
     </select>

+ 2 - 2
user_center/src/main/java/com/huaxu/service/impl/OrgServiceImpl.java

@@ -73,7 +73,7 @@ public class OrgServiceImpl implements OrgService {
         org.setTenantId(currentUser.getTenantId());
         org.setCreateBy(currentUser.getUsername());
         org.setDateCreate(new Date());
-        org.setStatus(0);
+        org.setStatus(1);
         if(org.getParentOrgId()==null){
             org.setParentOrgId(0);
         }
@@ -136,7 +136,7 @@ public class OrgServiceImpl implements OrgService {
                         org.setId(id);
                         Org orgUser = orgMapper.findOrgUser(org);
                         if(orgUser==null){
-                            org.setStatus(-1);
+                            org.setStatus(0);
                             orgMapper.update(org);
                         }else {
                             fail.add(orgUser.getOrgName());

+ 2 - 2
user_center/src/main/java/com/huaxu/service/impl/RoleServiceImpl.java

@@ -88,7 +88,7 @@ public class RoleServiceImpl implements RoleService {
         role.setTenantId(currentUser.getTenantId());
         role.setCreateBy(currentUser.getUsername());
         role.setDateCreate(new Date());
-        role.setStatus(0);
+        role.setStatus(1);
         int insert = this.roleMapper.insert(role);
         roleRequestDto.getRole().setId(role.getId());
         configDataPermission(roleRequestDto);
@@ -169,7 +169,7 @@ public class RoleServiceImpl implements RoleService {
             role.setId(id);
                 Role roleUser = roleMapper.findRoleUser(role);
                 if (roleUser==null){
-                    role.setStatus(-1);
+                    role.setStatus(0);
                     roleMapper.update(role);
                 }else {
                     fail.add(roleUser.getRoleName());

+ 4 - 4
user_center/src/main/java/com/huaxu/service/impl/UserGroupServiceImpl.java

@@ -76,7 +76,7 @@ public class UserGroupServiceImpl implements UserGroupService {
         userGroup.setTenantId(currentUser.getTenantId());
         userGroup.setCreateBy(currentUser.getUsername());
         userGroup.setDateCreate(new Date());
-        userGroup.setStatus(0);
+        userGroup.setStatus(1);
         return this.userGroupMapper.insert(userGroup);
     }
 
@@ -123,7 +123,7 @@ public class UserGroupServiceImpl implements UserGroupService {
         ids.forEach(id->{
             UserGroup userGroup=new UserGroup();
             userGroup.setId(id);
-            userGroup.setStatus(-1);
+            userGroup.setStatus(0);
             userGroupMapper.update(userGroup);
 
 
@@ -179,9 +179,9 @@ public class UserGroupServiceImpl implements UserGroupService {
             UserRoleEntity userRoleEntity=new UserRoleEntity();
             userRoleEntity.setRoleId(userGroupDto.getRoleId());
             userRoleEntity.setUserId(id);
-            userRoleEntity.setStatus(0);
+            userRoleEntity.setStatus(1);
             groupUsers.add(user);
-            user.setStatus(0);
+            user.setStatus(1);
             userRoleEntities.add(userRoleEntity);
         });
         userGroupMapper.deleteUserRoles(userGroupDto);

+ 3 - 3
user_center/src/main/resources/mapper/OrgMapper.xml

@@ -199,7 +199,7 @@
         <include refid="Base_Column_List"/>
         from uims_org
         <where>
-            status!=-1
+            status!=0
             <if test="org.id != null">
                 and ID = #{org.id}
             </if>
@@ -256,14 +256,14 @@
     <select id="findOrgUser" resultType="com.huaxu.entity.Org">
         select a.ID,a.ORG_NAME orgName from uims_org a join uims_user b on
          (a.ID=b.DEPT_ORG_ID or a.ID=b.COMPANY_ORG_ID)
-         where a.id=#{id} and b.status!=-1
+         where a.id=#{id} and b.status!=0
          limit 1
     </select>
     <select id="selectTrees" resultType="com.huaxu.dto.OrgTree">
           select ID, TENANT_ID, ORG_TYPE, PARENT_ORG_ID, ORG_AREA_ID, ORG_NAME, ORG_STATE, REMARK, ORG_LEADER_NAME, ORG_LEADER_PHONE, ORG_LEADER_EMAIL, ORG_LEADER_SEX, STATUS, DATE_CREATE, CREATE_BY, DATE_UPDATE, UPDATE_BY
            from uims_org
            <where>
-              and status!=-1
+              and status!=0
                <if test="tenantId!=null ">
                   and TENANT_ID=#{tenantId}
                </if>

+ 7 - 7
user_center/src/main/resources/mapper/RoleMapper.xml

@@ -51,7 +51,7 @@
         <include refid="Base_Column_List"/>
         from uims_role
         <where>
-            and status!=-1
+            and status!=0
             <if test="id != null">
                 and ID = #{id}
             </if>
@@ -168,12 +168,12 @@
         from uims_role a left join
         (select count(*) users ,ROLE_ID from uims_user_role b
         <where>
-            and status!=-1
+            and status!=0
        </where>
        group by b.ROLE_ID ) b
         ON a.id=b.ROLE_ID
         <where>
-            and status!=-1
+            and status!=0
             <if test="role.id != null">
                 and ID = #{role.id}
             </if>
@@ -214,7 +214,7 @@
     </select>
     <select id="findRoleUser" resultType="com.huaxu.entity.Role">
         select a.id,b.ROLE_NAME  from uims_user_role a join uims_role b on a.ROLE_ID=b.ID
-         where a.ROLE_ID=#{id} and a.status!=-1 limit 1
+         where a.ROLE_ID=#{id} and a.status!=0 limit 1
     </select>
     <sql id="sysAreaJoins">
           left join uims_org com ON com.id = a.company_org_id
@@ -246,12 +246,12 @@
         select 	<include refid="userColumns"/>
          from uims_user_role b join uims_user a on b.USER_ID=a.ID
         <include refid="sysAreaJoins"/>
-        where b.ROLE_ID=#{id} and b.status!=-1
+        where b.ROLE_ID=#{id} and b.status!=0
     </select>
     <update id="deleteRoleUser">
-        update uims_user_role set status=-1 where ROLE_ID=#{id}
+        update uims_user_role set status=0 where ROLE_ID=#{id}
     </update>
     <update id="deleteRoleMenu">
-        update uims_role_menu set status=-1 where ROLE_ID=#{id}
+        update uims_role_menu set status=0 where ROLE_ID=#{id}
     </update>
 </mapper>

+ 2 - 2
user_center/src/main/resources/mapper/RoleOrgMapper.xml

@@ -39,7 +39,7 @@
         <include refid="Base_Column_List"/>
         from uims_role_org
         <where>
-            and status != -1
+            and status != 0
             <if test="id != null">
                 and ID = #{id}
             </if>
@@ -153,7 +153,7 @@
         </where>
     </select>
     <update id="deleteOrgRole">
-        update uims_role_org set STATUS=-1 where
+        update uims_role_org set STATUS=0 where
         ROLE_ID=#{id}
     </update>
 </mapper>

+ 8 - 8
user_center/src/main/resources/mapper/UserGroupMapper.xml

@@ -149,7 +149,7 @@
         <include refid="Base_Column_List"/>
         from uims_user_group
         <where>
-             STATUS!=-1
+             STATUS!=0
             <if test="userGroup.id != null">
                 and ID = #{userGroup.id}
             </if>
@@ -187,7 +187,7 @@
     </select>
     <select id="findHasUserGroupUsers" resultType="com.huaxu.entity.UserGroup">
         select  a.id,b.GROUP_NAME groupName from uims_group_user a join uims_user_group b on a.GROUP_ID=b.ID
-        where a.GROUP_ID=#{id} and a.status!=-1 limit 1
+        where a.GROUP_ID=#{id} and a.status!=0 limit 1
     </select>
     <sql id="userColumns">
          a.id as "id" ,
@@ -219,11 +219,11 @@
         select 	<include refid="userColumns"/>,b.id userGroupId
          from uims_user a left join uims_group_user b on a.id=b.USER_ID
         <include refid="sysAreaJoins"/>
-        where  a.status!=-1
-        <if test="id != -1 ">
-           and  b.GROUP_ID=#{id} and b.status!=-1 and userrole.status!=-1
+        where  a.status!=0
+        <if test="id != 0 ">
+           and  b.GROUP_ID=#{id} and b.status!=0 and userrole.status!=0
         </if>
-        <if test="id == -1 ">
+        <if test="id == 0 ">
           and  b.GROUP_ID is null
         </if>
         <if test="tenantId != null and tenantId != ''">
@@ -231,10 +231,10 @@
         </if>
     </select>
     <update id="deleteUserGroupRelations">
-        update uims_group_user set STATUS=-1 where STATUS !=-1 and GROUP_ID=#{id}
+        update uims_group_user set STATUS=0 where STATUS !=0 and GROUP_ID=#{id}
     </update>
     <update id="deleteUserRoles">
-       update uims_user_role set STATUS=-1 where STATUS!=-1 and USER_ID in
+       update uims_user_role set STATUS=0 where STATUS!=0 and USER_ID in
         <foreach collection="userGroupDto.userIds" item="id" index="index" open="(" close=")" separator=",">
             #{id}
         </foreach>