Commit 41d25d0f by 徐高华

查询关联表

parent 08e44e11
......@@ -64,8 +64,7 @@ public interface TabHaobanStaffClerkRelationMapper {
* @author mozhu
* @date 2022-01-13 11:36:11
*/
List<TabHaobanStaffClerkRelation> listByClerkIds(@Param("clerkIds") List<String> clerkIds,
@Param("wxEnterpriseId") String wxEnterpriseId);
List<StaffClerkRelationDTO> listByClerkIds(@Param("clerkIds") List<String> clerkIds, @Param("wxEnterpriseId") String wxEnterpriseId);
List<TabHaobanStaffClerkRelation> listByStoreId(@Param("storeId") String storeId);
......
......@@ -273,7 +273,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
if (CollectionUtils.isEmpty(clerkList)) {
return Collections.EMPTY_LIST;
}
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class,mapper.listByClerkIds(clerkList, null));
return mapper.listByClerkIds(clerkList, null);
}
@Override
......
......@@ -233,10 +233,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public List<StaffClerkRelationDTO> listByClerkIds(List<String> clerkIds) {
if (CollectionUtil.isEmpty(clerkIds)) {
return Collections.emptyList();
}
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, null));
return this.listByClerkIdsWxEnterpriseId(clerkIds, null) ;
}
@Override
......@@ -244,7 +241,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
if (CollectionUtil.isEmpty(clerkIds)) {
return Collections.emptyList();
}
return EntityUtil.changeEntityListNew(StaffClerkRelationDTO.class, tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, wxEnterpriseId));
return tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds, wxEnterpriseId);
}
@Override
......
......@@ -131,22 +131,29 @@
and store_id = #{storeId,jdbcType=VARCHAR}
and status_flag = 1
</update>
<select id="listByClerkIds" resultMap="BaseResultMap"
parameterType="java.lang.String">
select
<include refid="Base_Column_List"></include>
from tab_haoban_staff_clerk_relation
where status_flag=1
<select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO" parameterType="java.lang.String">
select a.staff_clerk_relation_id staffClerkRelationId,
a.staff_id staffId,
a.wx_enterprise_id wxEnterpriseId,
a.enterprise_id enterpriseId,
a.store_id storeId,
a.clerk_id clerkId,
a.clerk_code clerkCode,
a.status_flag statusFlag,
b.wx_user_id qwUserId,
b.wx_open_user_id openUserId
from tab_haoban_staff_clerk_relation a left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.status_flag=1 and b.status_flag = 1
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
and a.wx_enterprise_id = #{wxEnterpriseId}
</if>
and clerk_id in
and a.clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</select>
<select id="listByStoreId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
......@@ -280,8 +287,7 @@
a.status_flag statusFlag,
b.wx_user_id qwUserId,
b.wx_open_user_id openUserId
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on b.staff_id = a.staff_id
from tab_haoban_staff_clerk_relation a left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and a.store_id = #{storeId}
and a.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