fix:车间对象增加负责人id属性。系统部门编码做唯一校验
This commit is contained in:
@@ -121,4 +121,11 @@ public interface SysDeptMapper
|
||||
* @return
|
||||
*/
|
||||
List<SysDept> selectAllDeptList();
|
||||
|
||||
/**
|
||||
* 校验部门编码是否唯一
|
||||
* @param deptCode
|
||||
* @return
|
||||
*/
|
||||
SysDept checkDeptCodeUnique(@Param("deptCode") String deptCode);
|
||||
}
|
||||
|
||||
@@ -119,4 +119,11 @@ public interface ISysDeptService
|
||||
* @return
|
||||
*/
|
||||
List<SysDept> selectAllDeptList();
|
||||
|
||||
/**
|
||||
* 校验部门编码是否唯一
|
||||
* @param dept
|
||||
* @return
|
||||
*/
|
||||
String checkDeptCodeUnique(SysDept dept);
|
||||
}
|
||||
|
||||
@@ -289,6 +289,17 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||
return deptMapper.selectAllDeptList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkDeptCodeUnique(SysDept dept) {
|
||||
Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
|
||||
SysDept info = deptMapper.checkDeptCodeUnique(dept.getDeptCode());
|
||||
if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
|
||||
@@ -88,6 +88,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectAllDeptList" resultType="com.ktg.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
</select>
|
||||
<select id="checkDeptCodeUnique" resultType="com.ktg.common.core.domain.entity.SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where dept_code = #{deptCode}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
insert into sys_dept(
|
||||
|
||||
Reference in New Issue
Block a user