dcs 1 年之前
父節點
當前提交
1ccb852454

+ 15 - 16
virgo.core/src/main/java/com/bosshand/virgo/core/model/MgrRole.java

@@ -6,11 +6,11 @@ public class MgrRole {
 
     private long id;
 
-    private String code;
-
     private String name;
 
-    private String memo;
+    private String responsible;
+
+    private String responsibility;
 
     private long organizationId;
 
@@ -30,14 +30,6 @@ public class MgrRole {
         this.id = id;
     }
 
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-
     public String getName() {
         return name;
     }
@@ -46,12 +38,20 @@ public class MgrRole {
         this.name = name;
     }
 
-    public String getMemo() {
-        return memo;
+    public String getResponsible() {
+        return responsible;
     }
 
-    public void setMemo(String memo) {
-        this.memo = memo;
+    public void setResponsible(String responsible) {
+        this.responsible = responsible;
+    }
+
+    public String getResponsibility() {
+        return responsibility;
+    }
+
+    public void setResponsibility(String responsibility) {
+        this.responsibility = responsibility;
     }
 
     public long getOrganizationId() {
@@ -93,5 +93,4 @@ public class MgrRole {
     public void setUsers(List<MgrUser> users) {
         this.users = users;
     }
-
 }

+ 10 - 4
virgo.core/src/main/resources/mapper/MgrRoleMapper.xml

@@ -4,9 +4,9 @@
 
     <resultMap type="com.bosshand.virgo.core.model.MgrRole" id="mgrRoleResult">
         <id column="id" property="id"/>
-        <result column="code" property="code"/>
         <result column="name" property="name"/>
-        <result column="memo" property="memo"/>
+        <result column="responsible" property="responsible"/>
+        <result column="responsibility" property="responsibility"/>
         <result column="projectId" property="projectId"/>
         <result column="organizationId" property="organizationId"/>
         <result column="parentId" property="parentId"/>
@@ -21,7 +21,7 @@
     </select>
 
     <insert id="insert" parameterType="com.bosshand.virgo.core.model.MgrRole" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO mgr_role(code, name, memo, projectId, organizationId, parentId) VALUES (#{code}, #{name}, #{memo}, #{projectId}, #{organizationId}, #{parentId})
+        INSERT INTO mgr_role(responsible, name, responsibility, projectId, organizationId, parentId) VALUES (#{responsible}, #{name}, #{responsibility}, #{projectId}, #{organizationId}, #{parentId})
     </insert>
 
     <delete id="delete">
@@ -29,7 +29,13 @@
     </delete>
 
     <update id="update" parameterType="com.bosshand.virgo.core.model.MgrRole">
-        UPDATE mgr_role SET name = #{name} WHERE id = #{id}
+        UPDATE mgr_role
+        <trim prefix="set" suffixOverrides=",">
+            <if test="name!=null">name=#{name},</if>
+            <if test="responsible!=null">responsible=#{responsible},</if>
+            <if test="responsibility!=null">responsibility=#{responsibility},</if>
+        </trim>
+        WHERE id = #{id}
     </update>
 
 </mapper>