搜索数据插入

public void synchronizeDate(){
String sql = "delete from product_view_entity";
this.executeNativeSQL(sql);
sql = "insert into product_view_entity(productId,departmentId,manufacturerId,productCode,productName,customerRating,merchantRating,listPrice,price,costPrice,minOrderQuantity,weight,shortDescription,fullDescription,manufacturerProductCode,status,membershipId,productTypeId,providerId,metaKeyword,metaDescription,templatePath,productKind,createBy,updateBy,createTime,updateTime,stockQty,stockMinQuantity,buyCount,categoryPath,"+
"departmentName,manufacturerName,thumbnailImageUrl,normalImageUrl,isMultipleImage,weightUnitCode,weightUnitName,isMultipleMedia,isMultipleAttachment,mediaEffect,defaultTab,planStartTime,planEndTime,publishTime,rateItemCount,deleted,version,saleStatus,uid,pinyin,quantityUnit,pav_inputValue,pav_attributePath,attributePath_inputValue,a_attributeCode,attCode_value,pc_categoryPath,sortOrder,ma_manufacturerCode,ma_manufacturerName)"+
"SELECT p.productId,p.departmentId,p.manufacturerId,p.productCode,p.productName,p.customerRating,p.merchantRating,p.listPrice,p.price,p.costPrice,p.minOrderQuantity,p.weight,p.shortDescription,p.fullDescription,p.manufacturerProductCode,p.status,p.membershipId,p.productTypeId,p.providerId,p.metaKeyword,p.metaDescription,p.templatePath,p.productKind,p.createBy,p.updateBy,p.createTime,p.updateTime,p.stockQty,p.stockMinQuantity,p.buyCount,p.categoryPath,p.departmentName,p.manufacturerName,p.thumbnailImageUrl,p.normalImageUrl,p.isMultipleImage,p.weightUnitCode,p.weightUnitName,p.isMultipleMedia,p.isMultipleAttachment,p.mediaEffect,p.defaultTab,p.planStartTime,p.planEndTime,p.publishTime,p.rateItemCount,p.deleted,p.version,p.saleStatus,p.uid,p.pinyin,p.quantityUnit,"+
"concat('#',group_concat(distinct pav.inputValue separator '#'),'#') AS pav_inputValue," +
"concat('#',group_concat(distinct pav.attributePath separator '.#'),'.#') AS pav_attributePath," +
"concat('#',group_concat(distinct concat(pav.attributePath,'^',pav.inputValue) separator '#'),'#') AS attributePath_inputValue," +
"concat('#',group_concat(distinct a.attributeCode separator '#'),'#') AS a_attributeCode," +
"concat('#',group_concat(distinct concat(a.attributeCode,'^',pav.inputValue) separator '#'),'#') AS attCode_value," +
"concat('#',group_concat(distinct pc.categoryPath separator '.#'),'.#') AS pc_categoryPath,"+
"pc.sortOrder,ma.manufacturerCode AS ma_manufacturerCode,ma.manufacturerName AS ma_manufacturerName " +
"from product p left join product_attribute_value pav on p.productId = pav.productId " +
"left join attribute a on pav.attributeId = a.attributeId " +
"left join product_category pc on p.productId = pc.productId " +
"left join manufacturer ma on p.manufacturerId = ma.manufacturerId "+
"where p.deleted <> 1 and p.productKind <> 2 group by p.productId ;";
this.executeNativeSQL(sql);
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值