`
陈谏辉
  • 浏览: 48417 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

搜索数据插入

SQL 
阅读更多

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);
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics