etrade_shop_1.0.18_data_kangtian.sql
1.54 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
UPDATE `dili_etrade`.`shop`
SET `selected_district_id` =
CASE
WHEN `sub_district_id` IS NOT NULL THEN
`sub_district_id` ELSE `district_id`
END,
`selected_district_name` =
CASE
WHEN `sub_district_id` IS NOT NULL THEN
`sub_district_name` ELSE `district_name`
END,
`district_path` =
CASE
WHEN `sub_district_id` IS NOT NULL THEN
CONCAT( `district_id`, ',', `sub_district_id` ) ELSE `district_id`
END,
`district_path_name` =
CASE
WHEN `sub_district_id` IS NOT NULL THEN
CONCAT( `district_name`, ',', `sub_district_name` ) ELSE `district_name` END
WHERE selected_district_id IS NULL;
UPDATE `dili_etrade`.`shop_approve`
SET `selected_district_id` =
CASE
WHEN `sub_district_id` IS NOT NULL THEN
`sub_district_id` ELSE `district_id`
END,
`selected_district_name` =
CASE
WHEN `sub_district_id` IS NOT NULL THEN
`sub_district_name` ELSE `district_name`
END,
`district_path` =
CASE
WHEN `sub_district_id` IS NOT NULL THEN
CONCAT( `district_id`, ',', `sub_district_id` ) ELSE `district_id`
END,
`district_path_name` =
CASE
WHEN `sub_district_id` IS NOT NULL THEN
CONCAT( `district_name`, ',', `sub_district_name` ) ELSE `district_name`
END
WHERE selected_district_id IS NULL;