Commit 88afc3cf by qwmqiuwenmin

Merge branch 'developer' of http://115.159.76.241/haoban3.0/haoban-manage3.0.git into developer

parents 032b4a6f de431103
......@@ -39,6 +39,8 @@ public interface DepartmentMapper {
TabHaobanDepartment getRootByEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId);
Page<TabHaobanDepartment> pageFullStoreByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId,@Param("search")String search,@Param("storeIds")List<String> storeIds,@Param("minCount")int minCount);
Page<TabHaobanDepartment> pageFullStoreByWxEnterpriseId2(@Param("wxEnterpriseId")String wxEnterpriseId,@Param("search")String search,@Param("storeIds")List<String> storeIds,@Param("minCount")int minCount);
TabHaobanDepartment getByRelatedId(@Param("relatedId")String relatedId);
......
......@@ -5,7 +5,10 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import cn.hutool.core.collection.CollectionUtil;
import com.gic.haoban.base.api.common.Constant;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -241,6 +244,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
public Page<DepartmentDTO> pageFullStoreByWxEnterpriseId(
String wxEnterpriseId,String search,List<String> storeIds, int count,BasePageInfo pageInfo) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
if(CollectionUtil.isNotEmpty(storeIds)&&StringUtils.isNotEmpty(search)){
return PageUtil.changePageHelperToCurrentPage( departmentMapper.pageFullStoreByWxEnterpriseId2(wxEnterpriseId,search, storeIds,count),DepartmentDTO.class);
}
return PageUtil.changePageHelperToCurrentPage( departmentMapper.pageFullStoreByWxEnterpriseId(wxEnterpriseId,search, storeIds,count),DepartmentDTO.class);
}
......
......@@ -313,6 +313,28 @@
order by create_time
) t WHERE t.rownum > #{minCount}
</select>
<select id="pageFullStoreByWxEnterpriseId2" resultMap="BaseResultMap" >
SELECT
t.*
FROM
(
select
@rownum := @rownum + 1 AS rownum,
<include refid="Base_Column_List" />
from tab_haoban_department,
(SELECT(@rowNum := 0)) b
where status_flag = 1
and is_store = 1
and wx_enterprise_id = #{wxEnterpriseId}
and ( wx_department_id like CONCAT('%',#{search},'%')
or related_id IN
<foreach collection="storeIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
)
order by create_time
) t WHERE t.rownum > #{minCount}
</select>
<select id="getByRelatedId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
......
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