bug修改优化

This commit is contained in:
mashuai 2024-10-10 09:12:51 +08:00
parent 130d6e926d
commit 014c2cbff9
3 changed files with 27 additions and 2 deletions

View File

@ -152,5 +152,12 @@ public interface TbTeamMapper {
* @return * @return
*/ */
int editPeople(TbPeople tbPeople); int editPeople(TbPeople tbPeople);
/**
* 根据id查询集合班组信息
* @param id
* @return
*/
List<TbTeam> selectListById(Long id);
} }

View File

@ -170,8 +170,8 @@ public class TbPeopleServiceImpl implements TbPeopleService {
tbPeople.setRelPhone(Sm4Utils.encode(tbPeople.getRelPhone())); tbPeople.setRelPhone(Sm4Utils.encode(tbPeople.getRelPhone()));
int result = tbPeopleDao.update(tbPeople); int result = tbPeopleDao.update(tbPeople);
//根据人员id去班组表中修改人员信息先根据人员id去班组表中查询 //根据人员id去班组表中修改人员信息先根据人员id去班组表中查询
TbTeam tbTeam = tbTeamDao.selectById(tbPeople.getId()); List<TbTeam> tbTeamList = tbTeamDao.selectListById(tbPeople.getId());
if (tbTeam != null) { if (CollectionUtils.isNotEmpty(tbTeamList)) {
result += tbTeamDao.editPeople(tbPeople); result += tbTeamDao.editPeople(tbPeople);
} }
if (result > 0) { if (result > 0) {

View File

@ -304,5 +304,23 @@
AND rel_id = #{id} AND rel_id = #{id}
</select> </select>
<select id="selectListById" resultType="com.bonus.base.domain.TbTeam">
select id as id,
team_name as teamName,
rel_id as relId,
rel_name as relName,
rel_phone as relPhone,
pro_id as proId,
pro_name as proName,
create_time as createTime,
create_user as createUser,
update_time as updateTime,
js_time as jsTime,
update_user as updateUser,
del_flag as delFlag
from tb_team
where rel_id = #{id}
</select>
</mapper> </mapper>