Commit 9d293256 by 墨竹

fix:员工查询判断空

parent b431904b
......@@ -120,12 +120,14 @@ public class AuditApiServiceImpl implements AuditApiService {
}
if (CollectionUtil.isNotEmpty(page.getResult())) {
List<String> commitStaffIds = page.getResult().stream().map(s -> s.getCommitStaffId()).collect(Collectors.toList());
List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds);
Map<String, TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId");
for (TabHaobanAudit tab : page.getResult()) {
String commitStaffId = tab.getCommitStaffId();
tab.setCommitStaffName(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getStaffName());
tab.setCommitStaffImg(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getHeadImg());
if (CollectionUtil.isNotEmpty(commitStaffIds)) {
List<TabHaobanStaff> staffList = staffMapper.listByIds(commitStaffIds);
Map<String, TabHaobanStaff> map = com.gic.commons.util.CollectionUtil.toMap(staffList, "staffId");
for (TabHaobanAudit tab : page.getResult()) {
String commitStaffId = tab.getCommitStaffId();
tab.setCommitStaffName(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getStaffName());
tab.setCommitStaffImg(map.get(commitStaffId) == null ? "" : map.get(commitStaffId).getHeadImg());
}
}
}
return PageUtil.changePageHelperToCurrentPage(page, AuditDTO.class);
......
......@@ -45,7 +45,8 @@
<update id="delOtherStaffByWxUserId">
update tab_haoban_staff
set status_flag = 0,update_time = now()
set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId}
and status_flag = 1
......@@ -295,12 +296,10 @@
<include refid="Base_Column_List"/>
from tab_haoban_staff
where status_flag = 1
<if test="staffIds != null and staffIds.size() > 0">
and staff_id IN
<foreach collection="staffIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
and staff_id IN
<foreach collection="staffIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</select>
<select id="listByWxUserId" resultMap="BaseResultMap">
select
......@@ -344,12 +343,10 @@
from tab_haoban_staff
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
<if test="userIds != null and userIds.size() > 0">
and wx_user_id IN
<foreach collection="userIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
and wx_user_id IN
<foreach collection="userIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</select>
<update id="cleanStaff" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
......@@ -473,7 +470,8 @@
<update id="delStaffByWxUserId">
update tab_haoban_staff
set status_flag = 0,update_time = now()
set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId}
and status_flag = 1
......@@ -482,7 +480,8 @@
<update id="delStaffByPhoneNumber">
update tab_haoban_staff
set status_flag = 0,update_time = now()
set status_flag = 0,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
and phone_number = #{phoneNumber}
and status_flag = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment