P15GEN2\59518
2024-05-29 d4210c7c4b04abde20037ea8aa0f54ef8a2649aa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8" ?>
    
<sqls>
    <dataSpace name="policy">
 
        <sql name="policyGetProduct">
            select md_bu.id as bu_id, md_bu.name as bu_name, 
                md_prod_sku.product_id, md_prod_sku.product_name, 
                md_prod_sku.id, md_prod_sku.spec
            from md_prod_sku left join md_bu_product on md_prod_sku.product_id = md_bu_product.product_id
            left join md_bu on md_bu.id = md_bu_product.bu_id
        </sql>
        
        <sql name="getUpdatedPrice">
            select * from md_prod_price_detail
            where last_update_time >= @{loadTime}
                and (type_code = 'Standard' or type_code = 'Customer')
        </sql>
        
        <sql name="getUpdatedQtyOnsiteDiscount">
            select * from agm_record
            where last_update_time >= @{loadTime}
                and type_code = 'gift' and category_code = 'Onsite'
        </sql>        
        
        
        <sql name="refreshStateBySuspendDate">
            update @{tableName}
            set state_code = 'Close', state_name = '失效'
            where suspend_date is not null and @{currentDate} >= suspend_date
        </sql>    
                    
    </dataSpace>        
</sqls>