Merge branch 'dev' of http://192.168.0.56:3000/bonus/Zlpt-Cloud into dev
This commit is contained in:
commit
4f3c6084a4
|
|
@ -106,6 +106,15 @@ public class TypeInfoController extends BaseController
|
||||||
return toAjax(typeInfoService.deleteTypeInfoByTypeIds(typeIds));
|
return toAjax(typeInfoService.deleteTypeInfoByTypeIds(typeIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备类型
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/remove/{typeId}")
|
||||||
|
public AjaxResult remove(@PathVariable Long typeId)
|
||||||
|
{
|
||||||
|
return toAjax(typeInfoService.deleteTypeInfoByTypeId(typeId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取设备类型树结构
|
* 获取设备类型树结构
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -58,4 +58,6 @@ public interface TypeInfoMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteTypeInfoByTypeIds(Long[] typeIds);
|
public int deleteTypeInfoByTypeIds(Long[] typeIds);
|
||||||
|
|
||||||
|
int selectCountByTypeId(Long typeId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,9 @@ public class TypeInfoServiceImpl implements ITypeInfoService
|
||||||
@Override
|
@Override
|
||||||
public int deleteTypeInfoByTypeId(Long typeId)
|
public int deleteTypeInfoByTypeId(Long typeId)
|
||||||
{
|
{
|
||||||
|
if(typeInfoMapper.selectCountByTypeId(typeId)>0){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return typeInfoMapper.deleteTypeInfoByTypeId(typeId);
|
return typeInfoMapper.deleteTypeInfoByTypeId(typeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<include refid="selectTypeInfoVo"/>
|
<include refid="selectTypeInfoVo"/>
|
||||||
where type_id = #{typeId}
|
where type_id = #{typeId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectCountByTypeId" resultType="java.lang.Integer">
|
||||||
|
select COUNT(*) from ma_type_info where parent_id = #{typeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertTypeInfo" parameterType="com.bonus.zlpt.common.core.domain.equip.TypeInfo">
|
<insert id="insertTypeInfo" parameterType="com.bonus.zlpt.common.core.domain.equip.TypeInfo">
|
||||||
insert into ma_type_info
|
insert into ma_type_info
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue