提交 7e3a2a0e 作者: 恶龙咆哮

飞手列表添加字段属于哪个飞手团队

上级 0122da71
......@@ -109,4 +109,6 @@ public class PilotCertificationDTO {
private String userImg;
@ApiModelProperty(value = "关注状态")
private Boolean status;
@ApiModelProperty(value = "飞手团队名称")
private String flyingTeam;
}
......@@ -39,6 +39,21 @@ public interface PilotCertificationDao {
List<PilotCertificationDO> pilotList(PilotCertificationQO param);
/**
* 查询这个用户是否绑定飞手团队
* @param userId 飞手id
* @return int 1 说明绑定了 0 表示没有绑定
*/
int selectCompanyByUserId(Integer userId);
/**
* 根据飞手id查询飞手团队名称
* @param userId 飞手id
* @return {@link String}
*/
String selectCompanyNameByFlyingUserId(Integer userId);
Integer getPilotAuditSum(Integer status);
List<PilotAbilityVO> selectAbilityList(Integer pilotCertificationId);
......
......@@ -239,6 +239,15 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
pilotList = pilotList.stream().filter(t -> t.getPilotAbility() != null).collect(Collectors.toList());
}
List<PilotCertificationDTO> collect = pilotList.stream().map(PilotCertificationDO::buildPilotCertificationDTO).collect(Collectors.toList());
for (PilotCertificationDTO certificationDTO:collect) {
Integer userAccountId = certificationDTO.getUserAccountId();
if (certificationDao.selectCompanyByUserId(userAccountId) < 1) {
continue;
}else {
String flyingTeamName = certificationDao.selectCompanyNameByFlyingUserId(userAccountId);
certificationDTO.setFlyingTeam(flyingTeamName);
}
}
collect = collect.stream().skip((pageNo - 1) * param.getPageSize()).limit(param.getPageSize()).
collect(Collectors.toList());
PageResult pageResult = PageResult.buildPage(pageNo, param.getPageSize(), pilotList.size(), collect);
......
......@@ -492,4 +492,13 @@
INNER JOIN pilot_join_team pjt on pjt.back_user_id = cbu.back_user_account_id
WHERE pjt.pilot_user_id = #{pilotId} and ci.is_deleted = 0 and pjt.pilot_status = #{pilotStatus}
</select>
<select id="selectCompanyByUserId" resultType="java.lang.Integer">
select count(id) from pilot_join_team where pilot_user_id = #{userId}
</select>
<select id="selectCompanyNameByFlyingUserId" resultType="java.lang.String">
select company_name from company_info ci
inner join company_back_user cbu on ci.id = cbu.company_info_id
inner join pilot_join_team pjt on cbu.back_user_account_id = pjt.back_user_id
where pjt.pilot_user_id = #{userId}
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论