@@ -119,4 +119,11 @@ public interface SysDeptMapper extends JoinBaseMapper<SysDept> {
* @return 结果
*/
public int deleteDeptById(Long deptId);
+
+ /**
+ * 根据部门名称查询信息
+ * @param deptName
+ * @return
+ */
+ SysDept selectDeptByDeptName(String deptName);
}
@@ -61,6 +61,14 @@ public interface ISysDeptService extends JoinIService<SysDept> {
public SysDept selectDeptById(Long deptId);
+ *
+ * @param deptName 部门名称
+ * @return 部门信息
+ public SysDept selectDeptByDeptName(String deptName);
/**
* 根据ID查询所有子部门(正常状态)
*
@@ -121,6 +121,11 @@ public class SysDeptServiceImpl extends JoinServiceImpl<SysDeptMapper, SysDept>
return deptMapper.selectDeptById(deptId);
+ @Override
+ public SysDept selectDeptByDeptName(String deptName) {
+ return deptMapper.selectDeptByDeptName(deptName);
+ }
@@ -65,6 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where d.dept_id = #{deptId}
</select>
+ <select id="selectDeptByDeptName" parameterType="string" resultMap="SysDeptResult">
+ select * from sys_dept where dept_name = #{deptName}
+ </select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'