标签查询

This commit is contained in:
mashuai 2025-03-05 14:32:17 +08:00
parent 5e2309f412
commit 43c2c01c7b
4 changed files with 47 additions and 3 deletions

View File

@ -179,6 +179,6 @@ public class Machine extends BaseEntity
@ApiModelProperty("检测报告地址")
private String exUrl;
@ApiModelProperty("是否为机具")
@ApiModelProperty("是否为机具 (0 代表机具)")
private Integer isJj;
}

View File

@ -120,4 +120,11 @@ public interface MachineMapper
* @return
*/
Long selectMaId(LeaseApplyInfo leaseApplyInfo);
/**
* 查询机具信息
* @param dto
* @return
*/
Machine selectHouse(Machine dto);
}

View File

@ -195,9 +195,28 @@ public class MachineServiceImpl implements IMachineService
return AjaxResult.success(typeList);
}
/**
* 查询电子标签信息
* @param machine
* @return
*/
@Override
public List<Machine> getElectronicLabel(Machine machine) {
return machineMapper.getElectronicLabel(machine);
List<Machine> list = machineMapper.getElectronicLabel(machine);
if (CollectionUtils.isNotEmpty(list)) {
for (Machine dto : list) {
// 根据typeId查询信息
Machine info = machineMapper.selectHouse(dto);
if (info != null) {
if ("机具库".equals(info.getOwnHouse())) {
dto.setIsJj(0);
} else {
dto.setIsJj(1);
}
}
}
}
return list;
}
/**

View File

@ -425,7 +425,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mm.ma_vender as maVender,
mm.ex_code as exCode,
mm.ex_url as exUrl,
mm.is_jj as isJj
mm.is_jj as isJj,
mm.type_id as typeId
FROM
ma_machine mm
LEFT JOIN ma_type mt on mt.type_id=mm.type_id
@ -441,6 +442,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE ma_code = #{maCode}
</select>
<select id="selectHouse" resultType="com.bonus.material.ma.domain.Machine">
SELECT
whi.house_name as ownHouse
FROM
ma_type mt
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
AND mt3.del_flag = '0'
LEFT JOIN wh_house_set whs ON mt3.type_id = whs.type_id
LEFT JOIN wh_house_info whi ON whs.house_id = whi.house_id
WHERE
mt.type_id = #{typeId}
</select>
<delete id="deleteMachineByMaCodeAndTypeId">
delete from ma_machine where ma_code = #{maCode} and type_id = #{typeId}
and ma_status = '0'