<?xml version="1.0" encoding="UTF-8" ?>
<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://192.168.0.00:3306/xfs_search_test"
user="root"
password="root"/>
<document>
<!--spu-->
<!--
deltaQuery:增量索引查询主键ID 注意这个只能返回ID字段
deltaImportQuery 次查询是获取以上两步的ID,然后把其全部数据获取,根据获取的数据 对索引库进行更新操作,可能是添加 修改 (此查询只对增量导入起作用)
-->
<entity name="sku"
pk="sku_id"
query="select *,date_add(last_shelf_time,interval 8 hour) as sku_shelf_time from sku where status=1"
deltaQuery="select sku_id from sku where last_modified_date > '${dataimporter.last_index_time}'"
deltaImportQuery="select *,date_add(last_shelf_time,interval 8 hour) as sku_shelf_time from sku where sku_id='${dih.delta.sku_id}' and status=1"
>
<field column="sku_id" name="id"/>
<field column="spu_id" name="sku_spu_id"/>
<field column="sku_name" name="pro_sku_name"/>
<field column="sku_shelf_time" name="sku_shelf_time" />
<field column="last_modified_date" name="last_modified_date" />
<!--spu-->
<entity name="spu"
pk="ID"
query="select * from spu where spu_id='${sku.spu_id}'">
<field column="spu_id" name="spu_id"/>
<field column="name" name="spu_name"/>
<!--spu_img -->
<entity name="spu_img"
pk="ID"
query="select * from spu_img where spu_id ='${spu.spu_id}' ORDER BY img_sort ">
<field column="img_url" name="spu_img_urls"/>
</entity>
<!--category-->
<entity name="category"
pk="ID"
query="select * from category where category_id='${spu.category_id}'">
<field column="category_name" name="category_name"/>
<field column="category_id" name="category_id"/>
</entity>
</entity>
<!--price -->
<entity name="shop_sku_price"
pk="ID"
query="select * from shop_sku_price where sku_id='${sku.sku_id}'
">
<field column="price" name="sku_price"/>
<field column="cost_price" name="cost_price"/>
</entity>
</entity>
</document>
</dataConfig>
<dataConfig>
<dataSource type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://192.168.0.00:3306/xfs_search_test"
user="root"
password="root"/>
<document>
<!--spu-->
<!--
deltaQuery:增量索引查询主键ID 注意这个只能返回ID字段
deltaImportQuery 次查询是获取以上两步的ID,然后把其全部数据获取,根据获取的数据 对索引库进行更新操作,可能是添加 修改 (此查询只对增量导入起作用)
-->
<entity name="sku"
pk="sku_id"
query="select *,date_add(last_shelf_time,interval 8 hour) as sku_shelf_time from sku where status=1"
deltaQuery="select sku_id from sku where last_modified_date > '${dataimporter.last_index_time}'"
deltaImportQuery="select *,date_add(last_shelf_time,interval 8 hour) as sku_shelf_time from sku where sku_id='${dih.delta.sku_id}' and status=1"
>
<field column="sku_id" name="id"/>
<field column="spu_id" name="sku_spu_id"/>
<field column="sku_name" name="pro_sku_name"/>
<field column="sku_shelf_time" name="sku_shelf_time" />
<field column="last_modified_date" name="last_modified_date" />
<!--spu-->
<entity name="spu"
pk="ID"
query="select * from spu where spu_id='${sku.spu_id}'">
<field column="spu_id" name="spu_id"/>
<field column="name" name="spu_name"/>
<!--spu_img -->
<entity name="spu_img"
pk="ID"
query="select * from spu_img where spu_id ='${spu.spu_id}' ORDER BY img_sort ">
<field column="img_url" name="spu_img_urls"/>
</entity>
<!--category-->
<entity name="category"
pk="ID"
query="select * from category where category_id='${spu.category_id}'">
<field column="category_name" name="category_name"/>
<field column="category_id" name="category_id"/>
</entity>
</entity>
<!--price -->
<entity name="shop_sku_price"
pk="ID"
query="select * from shop_sku_price where sku_id='${sku.sku_id}'
">
<field column="price" name="sku_price"/>
<field column="cost_price" name="cost_price"/>
</entity>
</entity>
</document>
</dataConfig>