领料模块优化

This commit is contained in:
sxu 2024-11-19 13:50:48 +08:00
parent cdc46024fe
commit c7b3e2f7f8
4 changed files with 33 additions and 1 deletions

View File

@ -186,6 +186,12 @@ public class LeaseApplyInfo extends BaseEntity {
@Excel(name = "领料工程", sort = 3)
private String projectName;
/**
* 领料物资名称汇总
*/
@ApiModelProperty(value = "领料物资名称汇总")
private String maTypeNames;
/**
* 预领料合计数
*/

View File

@ -76,4 +76,6 @@ public interface LeaseApplyDetailsMapper {
int updateLeaseApplyDetailsByLeaseOutRecord(@Param("record") LeaseOutDetails record);
LeaseApplyDetails getOutboundNum(LeaseOutDetails record);
String selectMaTypeNameByParentId(Long parentId);
}

View File

@ -92,7 +92,11 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
*/
@Override
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
return leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
for (LeaseApplyInfo applyInfo : list) {
applyInfo.setMaTypeNames(leaseApplyDetailsMapper.selectMaTypeNameByParentId(applyInfo.getId()));
}
return list;
}
/**

View File

@ -194,4 +194,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM lease_apply_details
WHERE id = #{id} AND (pre_num - IFNULL(al_num, 0)) > 0
</select>
<select id="selectMaTypeNameByParentId" resultType="java.lang.String">
select
GROUP_CONCAT(type_name) typeName
from
(
select
distinct lad.parent_id, mt1.type_name
from
lease_apply_details lad
left join ma_type mt on lad.type_id = mt.type_id
left join ma_type mt1 on mt.parent_id = mt1.type_id
where
1=1
<if test="parentId != null">
and lad.parent_id = #{parentId}
</if>
) t
GROUP BY parent_id
</select>
</mapper>