|
@@ -326,7 +326,7 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
// 查询所有的企业信息
|
|
// 查询所有的企业信息
|
|
|
StringBuffer enterpriseSql = new StringBuffer();
|
|
StringBuffer enterpriseSql = new StringBuffer();
|
|
|
enterpriseSql.append("select en.en_uu, en.en_name, en.en_shortname, en.en_address, en.en_tel, en.en_email, en.en_corporation, en.en_businesscode, en.en_profession, en.en_tags, en.en_contactman, en.en_contacttel from sec$enterprises en right join (" +
|
|
enterpriseSql.append("select en.en_uu, en.en_name, en.en_shortname, en.en_address, en.en_tel, en.en_email, en.en_corporation, en.en_businesscode, en.en_profession, en.en_tags, en.en_contactman, en.en_contacttel from sec$enterprises en right join (" +
|
|
|
- " select en_uu from sec$enterprises left join v$products on en_uu = pr_enuu where ").append(productMatchCondition).append(" and pr_issale = 1 and pr_b2bdisabled <> 1 " +
|
|
|
|
|
|
|
+ " select en_uu from sec$enterprises left join v$products on en_uu = pr_enuu where ").append(productMatchCondition).append(" and pr_b2bdisabled <> 1 " +
|
|
|
" and en_uu <> ").append(enUU).append(" and en_name not like '%测试%' and en_name not like '%test%' and ").append(enterpriseMatchCondition).append(" group by en_uu order by count(1) desc" +
|
|
" and en_uu <> ").append(enUU).append(" and en_name not like '%测试%' and en_name not like '%test%' and ").append(enterpriseMatchCondition).append(" group by en_uu order by count(1) desc" +
|
|
|
" ) a on en.en_uu = a.en_uu order by en.en_weight desc");
|
|
" ) a on en.en_uu = a.en_uu order by en.en_weight desc");
|
|
|
// rownum 控制
|
|
// rownum 控制
|
|
@@ -335,14 +335,14 @@ public class VendorsServiceImpl implements VendorService {
|
|
|
StringBuffer vendorRecommendUusSql = new StringBuffer();
|
|
StringBuffer vendorRecommendUusSql = new StringBuffer();
|
|
|
vendorRecommendUusSql.append("select s.*,( select wm_concat(pr_title || (case when pr_brand is not null then '(' || pr_brand || ')' else ' ' end)) from v$products where pr_enuu=en_uu and ").append(productMatchCondition)
|
|
vendorRecommendUusSql.append("select s.*,( select wm_concat(pr_title || (case when pr_brand is not null then '(' || pr_brand || ')' else ' ' end)) from v$products where pr_enuu=en_uu and ").append(productMatchCondition)
|
|
|
.append(" and exists (select 1 from v$products B where B.pr_cmpcode = pr_cmpcode and B.pr_enuu = ").append(enUU)
|
|
.append(" and exists (select 1 from v$products B where B.pr_cmpcode = pr_cmpcode and B.pr_enuu = ").append(enUU)
|
|
|
- .append(" and B.pr_ispurchase = 1 and nvl(B.pr_issale, 0) <> 1) and rownum<5 ) productInfo, (select 1 from purc$vendors where ve_vendenuu = en_uu and ve_myenuu = ")
|
|
|
|
|
|
|
+ .append(") and rownum<5 ) productInfo, (select 1 from purc$vendors where ve_vendenuu = en_uu and ve_myenuu = ")
|
|
|
.append(enUU).append(") isVendor from (select t.*,rownum as r1 from (").append(enterpriseSql).append(rownumSql);
|
|
.append(enUU).append(") isVendor from (select t.*,rownum as r1 from (").append(enterpriseSql).append(rownumSql);
|
|
|
// 因为需求更改为所有有销售产品的企业都会被返回,所以total直接取除本企业外其他有销售产品的企业数即可,之前的匹配企业数不再返回
|
|
// 因为需求更改为所有有销售产品的企业都会被返回,所以total直接取除本企业外其他有销售产品的企业数即可,之前的匹配企业数不再返回
|
|
|
StringBuffer totalSql = new StringBuffer().append(" select count(1) from (select en_uu from sec$enterprises left join " +
|
|
StringBuffer totalSql = new StringBuffer().append(" select count(1) from (select en_uu from sec$enterprises left join " +
|
|
|
- " v$products on en_uu = pr_enuu where pr_issale = 1 and pr_b2bdisabled <> 1 and en_uu <> ")
|
|
|
|
|
|
|
+ " v$products on en_uu = pr_enuu where pr_b2bdisabled <> 1 and en_uu <> ")
|
|
|
.append(enUU).append(" group by en_uu)");
|
|
.append(enUU).append(" group by en_uu)");
|
|
|
- System.out.println("SQL:" + vendorRecommendUusSql.toString());
|
|
|
|
|
- System.out.println("NUM_SQL:" + totalSql.toString());
|
|
|
|
|
|
|
+// System.out.println("SQL:" + vendorRecommendUusSql.toString());
|
|
|
|
|
+// System.out.println("NUM_SQL:" + totalSql.toString());
|
|
|
Integer total = commonDao.queryForObject(totalSql.toString(), Integer.class);
|
|
Integer total = commonDao.queryForObject(totalSql.toString(), Integer.class);
|
|
|
List<VendorRecommend> vendorRecommends = commonDao.query(vendorRecommendUusSql.toString(), VendorRecommend.class);
|
|
List<VendorRecommend> vendorRecommends = commonDao.query(vendorRecommendUusSql.toString(), VendorRecommend.class);
|
|
|
System.out.println("查找完企业UU" + (System.currentTimeMillis() - start));
|
|
System.out.println("查找完企业UU" + (System.currentTimeMillis() - start));
|