边带设备属性配置

This commit is contained in:
cwchen 2024-04-03 15:38:34 +08:00
parent 4549c553e1
commit 06c42e5df8
3 changed files with 7 additions and 3 deletions

View File

@ -167,7 +167,7 @@ public interface IDeviceOfBdMapper {
List<DeviceBdDetailVo> getDeviceBdChildDetailList(DeviceBdDto dto); List<DeviceBdDetailVo> getDeviceBdChildDetailList(DeviceBdDto dto);
/** /**
* 设备级联编码 是否存在 * 检测名称 是否存在
* *
* @param vo * @param vo
* @return int * @return int

View File

@ -216,6 +216,10 @@ public class DeviceOfBdServiceImpl implements IDeviceOfBdService {
if (StringUtils.isNotBlank(validResult)) { if (StringUtils.isNotBlank(validResult)) {
return AjaxResult.error(validResult); return AjaxResult.error(validResult);
} }
int result = mapper.isBdDeviceDetailExist(vo);
if (result > 0) {
return AjaxResult.error("检测不能重复");
}
if (StringUtils.isEmpty(vo.getId())) { if (StringUtils.isEmpty(vo.getId())) {
String id = IdUtils.getUUId(); String id = IdUtils.getUUId();
vo.setId(id); vo.setId(id);

View File

@ -321,10 +321,10 @@
<!--设备级联编码 是否存在--> <!--设备级联编码 是否存在-->
<select id="isBdDeviceDetailExist" resultType="java.lang.Integer"> <select id="isBdDeviceDetailExist" resultType="java.lang.Integer">
<if test="id == null or id == ''"> <if test="id == null or id == ''">
SELECT COUNT(*) FROM tb_device_detail tdd WHERE device_id = #{deviceId} AND device_code = #{deviceCode} AND del_flag = 0 SELECT COUNT(*) FROM tb_device_detail tdd WHERE device_id = #{deviceId} AND mode_name = #{modeName} AND del_flag = 0
</if> </if>
<if test="id != null and id != ''"> <if test="id != null and id != ''">
SELECT COUNT(*) FROM tb_device_detail tdd WHERE device_id = #{deviceId} AND device_code = #{deviceCode} AND id != #{id} AND del_flag = 0 SELECT COUNT(*) FROM tb_device_detail tdd WHERE device_id = #{deviceId} AND mode_name = #{modeName} AND id != #{id} AND del_flag = 0
</if> </if>
</select> </select>
<!--边带子设备详情数据--> <!--边带子设备详情数据-->