Sfoglia il codice sorgente

管理员列表修改

anderx 3 anni fa
parent
commit
cbe1588dcf

+ 5 - 2
src/main/java/com/goafanti/ambSystem/service/Impl/AmbServiceImpl.java

@@ -104,11 +104,14 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
                 userRole.setRid(roleId);
                 userRoleMapper.insert(userRole);
             }
+            int ambManage=0;
             for (AmbSystem ambSystem : list) {
                 str.append(ambSystem.getLvl()).append(",");
-
+                if(ambSystem.getLvl()==5||ambSystem.getLvl()==6){
+                    ambManage=1;
+                }
             }
-
+            a.setAmbManage(ambManage);
         }
         a.setId(leader);
         if (StringUtils.isNotBlank(str)) a.setAmbRole(str.substring(0,str.length()-1));

+ 22 - 6
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -26,11 +26,12 @@
     <result column="reviewer" jdbcType="VARCHAR" property="reviewer" />
     <result column="amb_id" jdbcType="VARCHAR" property="ambId" />
     <result column="amb_role" jdbcType="VARCHAR" property="ambRole" />
+    <result column="amb_manage" jdbcType="INTEGER" property="ambManage" />
   </resultMap>
   <sql id="Base_Column_List">
     id, mobile, `name`, `password`, email, create_time, `number`, province, `position`,
     superior_id, city, department_id, `status`, user_no, duty, district, head_portrait_url,
-    contact_mobile, last_login_time, open_id, `type`, reviewer, amb_id, amb_role
+    contact_mobile, last_login_time, open_id, `type`, reviewer, amb_id, amb_role, amb_manage
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     select
@@ -50,7 +51,8 @@
       user_no, duty, district,
       head_portrait_url, contact_mobile, last_login_time,
       open_id, `type`, reviewer,
-      amb_id, amb_role)
+      amb_id, amb_role, amb_manage
+      )
     values (#{mobile,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
       #{email,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{number,jdbcType=INTEGER},
       #{province,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, #{superiorId,jdbcType=VARCHAR},
@@ -58,7 +60,8 @@
       #{userNo,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR}, #{district,jdbcType=VARCHAR},
       #{headPortraitUrl,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP},
       #{openId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{reviewer,jdbcType=VARCHAR},
-      #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR})
+      #{ambId,jdbcType=VARCHAR}, #{ambRole,jdbcType=VARCHAR}, #{ambManage,jdbcType=INTEGER}
+      )
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.Admin" useGeneratedKeys="true">
     insert into admin
@@ -132,6 +135,9 @@
       <if test="ambRole != null">
         amb_role,
       </if>
+      <if test="ambManage != null">
+        amb_manage,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="mobile != null">
@@ -203,6 +209,9 @@
       <if test="ambRole != null">
         #{ambRole,jdbcType=VARCHAR},
       </if>
+      <if test="ambManage != null">
+        #{ambManage,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Admin">
@@ -277,6 +286,9 @@
       <if test="ambRole != null">
         amb_role = #{ambRole,jdbcType=VARCHAR},
       </if>
+      <if test="ambManage != null">
+        amb_manage = #{ambManage,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -304,11 +316,15 @@
       `type` = #{type,jdbcType=INTEGER},
       reviewer = #{reviewer,jdbcType=VARCHAR},
       amb_id = #{ambId,jdbcType=VARCHAR},
-      amb_role = #{ambRole,jdbcType=VARCHAR}
+      amb_role = #{ambRole,jdbcType=VARCHAR},
+      amb_manage = #{ambManage,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
 
 
+
+
+
   <select id="selectAllAdmin" resultMap="BaseResultMap">
     select
     <include refid="Base_Column_List" />
@@ -579,7 +595,7 @@
       and (ambs.id=#{ancestors} or find_in_set( #{ancestors} ,ambs.ancestors))
     </if>
     <if test="ambManage !=null">
-      and a.ts= #{ambManage}
+      and a.amb_manage= #{ambManage}
     </if>
     order by a.last_login_time desc
     <if test="page_sql!=null">
@@ -629,7 +645,7 @@
       and (ambs.id=#{ancestors} or find_in_set( #{ancestors} ,ambs.ancestors))
     </if>
     <if test="ambManage !=null">
-      and a.ts= #{ambManage}
+      and a.amb_manage= #{ambManage}
     </if>
   </select>
   <insert id="insertn" parameterType="com.goafanti.common.model.Admin">

+ 13 - 0
src/main/java/com/goafanti/common/model/Admin.java

@@ -125,6 +125,11 @@ public class Admin extends BaseModel implements AftUser {
      */
     private String ambRole;
 
+    /**
+     * 阿米巴管理者 0巴员 1巴主
+     */
+    private Integer ambManage;
+
     private static final long serialVersionUID = 1L;
 
 
@@ -357,4 +362,12 @@ public class Admin extends BaseModel implements AftUser {
     public void setAmbRole(String ambRole) {
         this.ambRole = ambRole;
     }
+
+    public Integer getAmbManage() {
+        return ambManage;
+    }
+
+    public void setAmbManage(Integer ambManage) {
+        this.ambManage = ambManage;
+    }
 }