This commit is contained in:
zhangheng 2024-04-09 14:10:48 +08:00
parent 263279e66d
commit 404010c33d
3 changed files with 1 additions and 15 deletions

View File

@ -21,14 +21,6 @@ public interface AgencyCategoryMapper {
*/
AgencyCategory selectAgencyCategoryById(Long id);
/**
* 查询机构类别
*
* @param parentCategoryId 机构类别主键
* @return 机构类别
*/
AgencyCategory selectAgencyCategoryByParentCategoryId(Long parentCategoryId);
/**
* 查询机构类别列表
*

View File

@ -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());

View File

@ -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