Commit 1517c70a by 陶光胜

门店查询支持多个门店控件id聚合

parent 5a7a7329
......@@ -2,6 +2,7 @@ package com.gic.store.service;
import java.util.List;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.dto.StoreGroupDTO;
......@@ -164,4 +165,14 @@ public interface StoreGroupApiService {
* @return
*/
ServiceResponse<List<StoreGroupDTO>> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId, Integer level);
/** @Description: 分页查询分组
* @author taogs
* @Date 10:31 2020/7/15
* @Param
* @return
*/
ServiceResponse<Page<StoreGroupDTO>> pageStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId,
Integer level, Integer pageSize, Integer pageNum);
}
package com.gic.store.dao.mapper;
import com.gic.store.entity.TabStoreGroup;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -130,4 +131,8 @@ public interface TabStoreGroupMapper {
List<TabStoreGroup> listStoreGroupByIds(@Param("storeGroupIdList") List<Integer> storeGroupIdList,
@Param("enterpriseId") Integer enterpriseId,
@Param("level") Integer level);
Page<TabStoreGroup> pageStoreGroupByIds(@Param("storeGroupIdList") List<Integer> storeGroupIdList,
@Param("enterpriseId") Integer enterpriseId,
@Param("level") Integer level);
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import java.util.List;
import com.gic.store.dto.StoreGroupDTO;
import com.gic.store.entity.TabStoreGroup;
import com.github.pagehelper.Page;
/**
* 门店分组
......@@ -194,4 +195,6 @@ public interface StoreGroupService {
TabStoreGroup selectAllStoreGroup(Integer enterpriseId);
List<TabStoreGroup> listStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId, Integer level);
Page<TabStoreGroup> pageStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId, Integer level);
}
......@@ -6,6 +6,7 @@ import com.gic.store.dao.mapper.TabStoreGroupMapper;
import com.gic.store.dto.StoreGroupDTO;
import com.gic.store.entity.TabStoreGroup;
import com.gic.store.service.StoreGroupService;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -163,4 +164,9 @@ public class StoreGroupServiceImpl implements StoreGroupService{
return this.tabStoreGroupMapper.listStoreGroupByIds(storeGroupIdList, enterpriseId, level);
}
@Override
public Page<TabStoreGroup> pageStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId, Integer level){
return this.tabStoreGroupMapper.pageStoreGroupByIds(storeGroupIdList, enterpriseId, level);
}
}
......@@ -7,7 +7,10 @@ import java.util.Stack;
import java.util.concurrent.TimeUnit;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.PageHelperUtils;
import com.gic.store.service.StoreApiService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -361,6 +364,15 @@ public class StoreGroupApiServiceImpl implements StoreGroupApiService {
return ServiceResponse.success(EntityUtil.changeEntityListByJSON(StoreGroupDTO.class, list));
}
@Override
public ServiceResponse<Page<StoreGroupDTO>> pageStoreGroupByIds(List<Integer> storeGroupIdList, Integer enterpriseId,
Integer level, Integer pageSize, Integer pageNum) {
PageHelper.startPage(pageNum, pageSize);
com.github.pagehelper.Page<TabStoreGroup> tabStoreGroups = this.storeGroupService.pageStoreGroupByIds(storeGroupIdList, enterpriseId, level);
Page<StoreGroupDTO> storeGroupDTOPage = PageHelperUtils.changePageHelperToCurrentPage(tabStoreGroups, StoreGroupDTO.class);
return ServiceResponse.success(storeGroupDTOPage);
}
/**
* 刷新缓存,删除缓存
* @param storeGroupId
......
......@@ -276,4 +276,19 @@
and group_level = #{level}
</if>
</select>
<select id="pageStoreGroupByIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from
tab_store_group where status = 1 and enterprise_id = #{enterpriseId}
<if test="null != storeGroupIdList and storeGroupIdList.size() > 0">
and store_group_id in
<foreach collection="storeGroupIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="level != null">
and group_level = #{level}
</if>
</select>
</mapper>
\ No newline at end of file
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