change - 员工关联多班组

main
yinq 5 months ago
parent 8967584402
commit 629c9f18d2

@ -5,6 +5,9 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import com.os.common.utils.DateUtils; import com.os.common.utils.DateUtils;
import com.os.common.utils.StringUtils;
import com.os.mes.base.domain.BaseTeamMembers;
import com.os.mes.base.mapper.BaseTeamMembersMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.os.mes.base.mapper.BaseStaffInfoMapper; import com.os.mes.base.mapper.BaseStaffInfoMapper;
@ -22,6 +25,9 @@ public class BaseStaffInfoServiceImpl implements IBaseStaffInfoService {
@Autowired @Autowired
private BaseStaffInfoMapper baseStaffInfoMapper; private BaseStaffInfoMapper baseStaffInfoMapper;
@Autowired
private BaseTeamMembersMapper baseTeamMembersMapper;
/** /**
* *
* *
@ -41,7 +47,22 @@ public class BaseStaffInfoServiceImpl implements IBaseStaffInfoService {
*/ */
@Override @Override
public List<BaseStaffInfo> selectBaseStaffInfoList(BaseStaffInfo baseStaffInfo) { public List<BaseStaffInfo> selectBaseStaffInfoList(BaseStaffInfo baseStaffInfo) {
return baseStaffInfoMapper.selectBaseStaffInfoList(baseStaffInfo); List<BaseStaffInfo> baseStaffInfos = baseStaffInfoMapper.selectBaseStaffInfoList(baseStaffInfo);
List<BaseTeamMembers> teamMembers = baseTeamMembersMapper.selectBaseTeamMembersList(new BaseTeamMembers());
for (BaseStaffInfo staffInfo : baseStaffInfos) {
if (StringUtils.isNotEmpty(staffInfo.getTeamCode())){
for (BaseTeamMembers teamMember : teamMembers) {
if (staffInfo.getTeamCode().contains(teamMember.getTeamCode())){
if (StringUtils.isEmpty(staffInfo.getTeamName())){
staffInfo.setTeamName(teamMember.getTeamName());
} else {
staffInfo.setTeamName(staffInfo.getTeamName() + "," + teamMember.getTeamName());
}
}
}
}
}
return baseStaffInfos;
} }
/** /**

@ -33,7 +33,6 @@
bsi.staff_type, bsi.staff_type,
bsi.card_id, bsi.card_id,
bsi.team_code, bsi.team_code,
btm.team_name,
bsi.phone_number, bsi.phone_number,
bsi.sex, bsi.sex,
bsi.pass_word, bsi.pass_word,
@ -47,7 +46,6 @@
bsi.post_code, bsi.post_code,
p.post_name p.post_name
from base_staff_info bsi from base_staff_info bsi
left join base_team_members btm on btm.team_code = bsi.team_code
left join sys_post p on p.post_code = bsi.post_code left join sys_post p on p.post_code = bsi.post_code
</sql> </sql>
@ -58,7 +56,7 @@
<if test="staffName != null and staffName != ''">and bsi.staff_name like concat('%', #{staffName}, '%')</if> <if test="staffName != null and staffName != ''">and bsi.staff_name like concat('%', #{staffName}, '%')</if>
<if test="staffType != null and staffType != ''">and bsi.staff_type = #{staffType}</if> <if test="staffType != null and staffType != ''">and bsi.staff_type = #{staffType}</if>
<if test="cardId != null and cardId != ''">and bsi.card_id = #{cardId}</if> <if test="cardId != null and cardId != ''">and bsi.card_id = #{cardId}</if>
<if test="teamCode != null and teamCode != ''">and bsi.team_code = #{teamCode}</if> <if test="teamCode != null and teamCode != ''">and bsi.team_code like concat('%', #{teamCode}, '%')</if>
<if test="phoneNumber != null and phoneNumber != ''">and bsi.phone_number = #{phoneNumber}</if> <if test="phoneNumber != null and phoneNumber != ''">and bsi.phone_number = #{phoneNumber}</if>
<if test="sex != null and sex != ''">and bsi.sex = #{sex}</if> <if test="sex != null and sex != ''">and bsi.sex = #{sex}</if>
<if test="passWord != null and passWord != ''">and bsi.pass_word = #{passWord}</if> <if test="passWord != null and passWord != ''">and bsi.pass_word = #{passWord}</if>
@ -119,7 +117,7 @@
<if test="staffName != null and staffName != ''">staff_name = #{staffName},</if> <if test="staffName != null and staffName != ''">staff_name = #{staffName},</if>
<if test="staffType != null">staff_type = #{staffType},</if> <if test="staffType != null">staff_type = #{staffType},</if>
<if test="cardId != null">card_id = #{cardId},</if> <if test="cardId != null">card_id = #{cardId},</if>
<if test="teamCode != null and teamCode != ''">team_code = #{teamCode},</if> <if test="teamCode != null">team_code = #{teamCode},</if>
<if test="phoneNumber != null">phone_number = #{phoneNumber},</if> <if test="phoneNumber != null">phone_number = #{phoneNumber},</if>
<if test="sex != null">sex = #{sex},</if> <if test="sex != null">sex = #{sex},</if>
<if test="passWord != null">pass_word = #{passWord},</if> <if test="passWord != null">pass_word = #{passWord},</if>

Loading…
Cancel
Save