Commit cb5084db authored by chenyuefang's avatar chenyuefang

update

parent 3ff79dda
......@@ -17,10 +17,7 @@ import com.dsk.cscec.domain.DCustomer;
import com.dsk.cscec.domain.bo.AdvisoryBodyBo;
import com.dsk.cscec.domain.bo.CustomerCooperationBo;
import com.dsk.cscec.domain.bo.CustomerInfoBo;
import com.dsk.cscec.domain.vo.AdvisoryBodyVo;
import com.dsk.cscec.domain.vo.CustomerApproveVo;
import com.dsk.cscec.domain.vo.CustomerCooperationVo;
import com.dsk.cscec.domain.vo.CustomerInfoVo;
import com.dsk.cscec.domain.vo.*;
import com.dsk.cscec.mapper.AdvisoryBodyMapper;
import com.dsk.cscec.mapper.DCustomerMapper;
import com.dsk.cscec.mapper.DSubcontractMapper;
......@@ -66,10 +63,11 @@ public class CustomerInfoServiceImpl extends ServiceImpl<DCustomerMapper, DCusto
Page<CustomerInfoVo> page = baseMapper.queryListByType(query.build(), bo);
if (CollectionUtils.isNotEmpty(page.getRecords())) {
page.getRecords().parallelStream().forEach(item->{
DCustomerListVo vo = subcontractMapper.selectStatisticByCustomerId(item.getCustomerId());
//企业合作数量
item.setEnterpriseCooperationCount(subcontractMapper.selectEnterpriseCountByCustomerId(item.getCustomerId()));
item.setEnterpriseCooperationCount(vo.getEnterpriseCooperationCount());
//项目合作数量
item.setProjectCooperationCount(subcontractMapper.selectProjectCountByCustomerId(item.getCustomerId()));
item.setProjectCooperationCount(vo.getProjectCooperationCount());
//关键字标红
if(!ObjectUtils.isEmpty(bo.getCustomerName())){
item.setCustomerName(StringUtils.markInRed(item.getCustomerName(), bo.getCustomerName()));
......
......@@ -114,29 +114,28 @@
<if test="bo.customerName != null and bo.customerName != '' ">
and customer_name like concat('%',#{bo.customerName},'%')
</if>
<if test="bo.registerProvince != null and bo.registerCity == null">
and register_province in
<foreach collection="bo.registerProvince" item="registerProvince" separator="," open="(" close=")">
<if test="bo.registerRegion != null and bo.registerRegion.size > 0 or (bo.registerProvince != null and bo.registerProvince.size > 0) or (bo.registerCity != null and bo.registerCity.size > 0)">
and
<trim prefix="(" suffix=")" prefixOverrides="or">
<if test="bo.registerRegion != null and bo.registerRegion.size > 0 ">
or register_region in
<foreach collection="bo.registerRegion" item="registerRegion" open="(" close=")" separator=",">
#{registerRegion}
</foreach>
</if>
<if test="bo.registerProvince != null and bo.registerProvince.size > 0 ">
or register_province in
<foreach collection="bo.registerProvince" item="registerProvince" open="(" close=")" separator=",">
#{registerProvince}
</foreach>
</if>
<if test="bo.registerProvince == null and bo.registerCity != null ">
and register_city in
<foreach collection="bo.registerCity" item="registerCity" separator="," open="(" close=")">
#{registerCity}
</foreach>
</if>
<if test="bo.registerProvince != null and bo.registerCity != null ">
and (
register_province in
<foreach collection="bo.registerProvince" item="registerProvince" separator="," open="(" close=")">
#{registerProvince}
</foreach>
<if test="bo.registerCity != null and bo.registerCity.size > 0 ">
or register_city in
<foreach collection="bo.registerCity" item="registerCity" separator="," open="(" close=")">
<foreach collection="bo.registerCity" item="registerCity" open="(" close=")" separator=",">
#{registerCity}
</foreach>
)
</if>
</trim>
</if>
<if test="bo.groupSpecialtyId != null ">
<foreach collection="bo.groupSpecialtyId" item="groupSpecialtyId">
......
......@@ -19,8 +19,8 @@
<select id="selectStatisticByCustomerId" resultType="com.dsk.cscec.domain.vo.DCustomerListVo">
select
count(DISTINCT org.customer_id) enterpriseCooperationCount,
count(DISTINCT project.customer_id) projectCooperationCount
count(DISTINCT org.sign_org_id) enterpriseCooperationCount,
count(DISTINCT project.project_id) projectCooperationCount
from d_customer dc
left join d_subcontract org on org.customer_id = dc.customer_id
left join d_subcontract project on project.customer_id = dc.customer_id
......
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