Commit cb5084db authored by chenyuefang's avatar chenyuefang

update

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