2 Commits 601d72236f ... 4ee6795927

Author SHA1 Message Date
  zwj 4ee6795927 Merge remote-tracking branch 'origin/master' 10 months ago
  zwj 3061ed4cc6 添加字段 10 months ago

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java

@@ -96,4 +96,11 @@ public interface SysPostMapper
96
      * @return 结果
96
      * @return 结果
97
      */
97
      */
98
     public SysPost checkPostCodeUnique(String postCode);
98
     public SysPost checkPostCodeUnique(String postCode);
99
+
100
+    /**
101
+     * 根据部门查询岗位
102
+     * @param deptId
103
+     * @return
104
+     */
105
+    public SysPost selectPostByDeptId(Long deptId);
99
 }
106
 }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java

@@ -121,4 +121,5 @@ public interface ISysDeptService
121
      * @return 结果
121
      * @return 结果
122
      */
122
      */
123
     public int deleteDeptById(Long deptId);
123
     public int deleteDeptById(Long deptId);
124
+
124
 }
125
 }

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java

@@ -1,6 +1,7 @@
1
 package com.ruoyi.system.service;
1
 package com.ruoyi.system.service;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
+
4
 import com.ruoyi.system.domain.SysPost;
5
 import com.ruoyi.system.domain.SysPost;
5
 
6
 
6
 /**
7
 /**
@@ -96,4 +97,11 @@ public interface ISysPostService
96
      * @return 结果
97
      * @return 结果
97
      */
98
      */
98
     public int updatePost(SysPost post);
99
     public int updatePost(SysPost post);
100
+
101
+    /**
102
+     * 根据部门查询岗位
103
+     * @param deptId
104
+     * @return
105
+     */
106
+    public SysPost selectPostByDeptId(Long deptId);
99
 }
107
 }

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java

@@ -175,4 +175,14 @@ public class SysPostServiceImpl implements ISysPostService
175
     {
175
     {
176
         return postMapper.updatePost(post);
176
         return postMapper.updatePost(post);
177
     }
177
     }
178
+
179
+    /**
180
+     * 根据部门查询岗位
181
+     * @param deptId
182
+     * @return
183
+     */
184
+    @Override
185
+    public SysPost selectPostByDeptId(Long deptId) {
186
+        return postMapper.selectPostByDeptId(deptId);
187
+    }
178
 }
188
 }

+ 9 - 1
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -20,10 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
20
 		<result property="createTime" column="create_time" />
20
 		<result property="createTime" column="create_time" />
21
 		<result property="updateBy"   column="update_by"   />
21
 		<result property="updateBy"   column="update_by"   />
22
 		<result property="updateTime" column="update_time" />
22
 		<result property="updateTime" column="update_time" />
23
+		<result property="deptCode"   column="dept_code"   />
24
+		<result property="type"       column="type"        />
23
 	</resultMap>
25
 	</resultMap>
24
 
26
 
25
 	<sql id="selectDeptVo">
27
 	<sql id="selectDeptVo">
26
-        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
28
+        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time, d.dept_code, d.type
27
         from sys_dept d
29
         from sys_dept d
28
     </sql>
30
     </sql>
29
 
31
 
@@ -99,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
99
  			<if test="email != null and email != ''">email,</if>
101
  			<if test="email != null and email != ''">email,</if>
100
  			<if test="status != null">status,</if>
102
  			<if test="status != null">status,</if>
101
  			<if test="createBy != null and createBy != ''">create_by,</if>
103
  			<if test="createBy != null and createBy != ''">create_by,</if>
104
+			<if test="deptCode != null and deptCode != ''">dept_code,</if>
105
+			<if test="type != null and type != ''">type,</if>
102
  			create_time
106
  			create_time
103
  		)values(
107
  		)values(
104
  			<if test="deptId != null and deptId != 0">#{deptId},</if>
108
  			<if test="deptId != null and deptId != 0">#{deptId},</if>
@@ -111,6 +115,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
111
  			<if test="email != null and email != ''">#{email},</if>
115
  			<if test="email != null and email != ''">#{email},</if>
112
  			<if test="status != null">#{status},</if>
116
  			<if test="status != null">#{status},</if>
113
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
117
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
118
+			<if test="deptCode != null and deptCode != ''">#{deptCode},</if>
119
+			<if test="type != null and type != ''">#{type},</if>
114
 		<!-- sysdate() -->
120
 		<!-- sysdate() -->
115
 		CURRENT_TIMESTAMP
121
 		CURRENT_TIMESTAMP
116
  		)
122
  		)
@@ -128,6 +134,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
128
  			<if test="email != null">email = #{email},</if>
134
  			<if test="email != null">email = #{email},</if>
129
  			<if test="status != null and status != ''">status = #{status},</if>
135
  			<if test="status != null and status != ''">status = #{status},</if>
130
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
136
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
137
+			<if test="deptCode != null and deptCode != ''">dept_code = #{deptCode},</if>
138
+			<if test="type != null and type != ''">type = #{type},</if>
131
  			update_time =
139
  			update_time =
132
 			<!-- sysdate() -->
140
 			<!-- sysdate() -->
133
 			CURRENT_TIMESTAMP
141
 			CURRENT_TIMESTAMP

+ 15 - 1
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml

@@ -15,10 +15,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
15
 		<result property="updateBy"      column="update_by"     />
15
 		<result property="updateBy"      column="update_by"     />
16
 		<result property="updateTime"    column="update_time"   />
16
 		<result property="updateTime"    column="update_time"   />
17
 		<result property="remark"        column="remark"        />
17
 		<result property="remark"        column="remark"        />
18
+		<result property="deptId"        column="dept_id"       />
19
+		<result property="postLevel"     column="post_level"    />
18
 	</resultMap>
20
 	</resultMap>
19
 
21
 
20
 	<sql id="selectPostVo">
22
 	<sql id="selectPostVo">
21
-        select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
23
+        select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark, dept_id, post_level
22
 		from sys_post
24
 		from sys_post
23
     </sql>
25
     </sql>
24
 
26
 
@@ -81,6 +83,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
81
  			<if test="status != null and status != ''">status = #{status},</if>
83
  			<if test="status != null and status != ''">status = #{status},</if>
82
  			<if test="remark != null">remark = #{remark},</if>
84
  			<if test="remark != null">remark = #{remark},</if>
83
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
85
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
86
+			<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
87
+			<if test="postLevel != null and postLevel != ''">post_level = #{postLevel},</if>
84
  			update_time =
88
  			update_time =
85
 			<!-- sysdate() -->
89
 			<!-- sysdate() -->
86
 			CURRENT_TIMESTAMP
90
 			CURRENT_TIMESTAMP
@@ -97,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
97
  			<if test="status != null and status != ''">status,</if>
101
  			<if test="status != null and status != ''">status,</if>
98
  			<if test="remark != null and remark != ''">remark,</if>
102
  			<if test="remark != null and remark != ''">remark,</if>
99
  			<if test="createBy != null and createBy != ''">create_by,</if>
103
  			<if test="createBy != null and createBy != ''">create_by,</if>
104
+			<if test="deptId != null and deptId != ''">dept_id,</if>
105
+			<if test="postLevel != null and postLevel != ''">post_level,</if>
100
  			create_time
106
  			create_time
101
  		)values(
107
  		)values(
102
  			<if test="postId != null and postId != 0">#{postId},</if>
108
  			<if test="postId != null and postId != 0">#{postId},</if>
@@ -106,6 +112,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
106
  			<if test="status != null and status != ''">#{status},</if>
112
  			<if test="status != null and status != ''">#{status},</if>
107
  			<if test="remark != null and remark != ''">#{remark},</if>
113
  			<if test="remark != null and remark != ''">#{remark},</if>
108
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
114
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
115
+			<if test="deptId != null and deptId != ''">#{deptId},</if>
116
+			<if test="postLevel != null and postLevel != ''">#{postLevel},</if>
109
 		<!-- sysdate() -->
117
 		<!-- sysdate() -->
110
 		CURRENT_TIMESTAMP
118
 		CURRENT_TIMESTAMP
111
  		)
119
  		)
@@ -122,4 +130,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
122
         </foreach>
130
         </foreach>
123
  	</delete>
131
  	</delete>
124
 
132
 
133
+
134
+	<select id="selectPostByDeptId" parameterType="Long" resultMap="SysPostResult">
135
+		<include refid="selectPostVo"/>
136
+		where p.dept_id = #{deptId}
137
+	</select>
138
+
125
 </mapper>
139
 </mapper>