机构
This commit is contained in:
parent
263279e66d
commit
404010c33d
@ -21,14 +21,6 @@ public interface AgencyCategoryMapper {
|
||||
*/
|
||||
AgencyCategory selectAgencyCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询机构类别
|
||||
*
|
||||
* @param parentCategoryId 机构类别主键
|
||||
* @return 机构类别
|
||||
*/
|
||||
AgencyCategory selectAgencyCategoryByParentCategoryId(Long parentCategoryId);
|
||||
|
||||
/**
|
||||
* 查询机构类别列表
|
||||
*
|
||||
|
||||
@ -60,7 +60,7 @@ public class AgencyCategoryServiceImpl implements IAgencyCategoryService {
|
||||
@Override
|
||||
public int insertAgencyCategory(AgencyCategory agencyCategory) {
|
||||
if (Objects.nonNull(agencyCategory.getParentCategoryId())) {
|
||||
AgencyCategory parentAgencyCategory = agencyCategoryMapper.selectAgencyCategoryByParentCategoryId(agencyCategory.getParentCategoryId());
|
||||
AgencyCategory parentAgencyCategory = agencyCategoryMapper.selectAgencyCategoryById(agencyCategory.getParentCategoryId());
|
||||
agencyCategory.setCategoryLevel((parentAgencyCategory.getCategoryLevel() == null ? 0 : parentAgencyCategory.getCategoryLevel()) + 1);
|
||||
}
|
||||
agencyCategory.setCreateTime(LocalDateTime.now());
|
||||
|
||||
@ -67,12 +67,6 @@
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAgencyCategoryByParentCategoryId"
|
||||
resultType="com.xinelu.manage.domain.agencycategory.AgencyCategory">
|
||||
<include refid="selectAgencyCategoryVo"/>
|
||||
where id = #{parentCategoryId}
|
||||
</select>
|
||||
|
||||
<insert id="insertAgencyCategory" parameterType="AgencyCategory" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into agency_category
|
||||
|
||||
Loading…
Reference in New Issue
Block a user