개정판 cf60792a
issue #000 : 도면 삭제 시 Points 테이블 데이터도 삭제
Change-Id: I1e0761e43e0751abe100150728f6e956e9950e28
HYTOS/HYTOS/AppDocData.py | ||
---|---|---|
1454 | 1454 |
# Get a cursor object |
1455 | 1455 |
cursor = conn.cursor() |
1456 | 1456 |
|
1457 |
# 0. Delete Points |
|
1458 |
sql = "delete from Points where Components_UID in (select UID from Components where Drawings_UID = '{}')".format(uid) |
|
1459 |
cursor.execute(sql) |
|
1457 | 1460 |
# 1. Delete Components |
1458 | 1461 |
sql = "delete from Components where Drawings_UID='{}'".format(uid) |
1459 | 1462 |
cursor.execute(sql) |
... | ... | |
3233 | 3236 |
, c.Y |
3234 | 3237 |
, c.Rotation |
3235 | 3238 |
, c.Scale |
3239 |
, p.uid |
|
3236 | 3240 |
, p.[Index] |
3237 | 3241 |
, p.x |
3238 | 3242 |
, p.y |
3243 |
, p.ConnectedItem_UID |
|
3239 | 3244 |
from points p |
3240 | 3245 |
left join components c |
3241 | 3246 |
on p.components_uid = c.uid |
... | ... | |
3277 | 3282 |
|
3278 | 3283 |
conn = sqlite3.connect(dbPath) |
3279 | 3284 |
cursor = conn.cursor() |
3280 |
sql = 'select UID from Components where Drawings_UID = "' + uid + '"'
|
|
3285 |
sql = 'select UID from Components where Drawings_UID = ? order by x desc'
|
|
3281 | 3286 |
try: |
3282 |
cursor.execute(sql) |
|
3287 |
param = (uid, ) |
|
3288 |
cursor.execute(sql, param) |
|
3283 | 3289 |
rows = cursor.fetchall() |
3284 | 3290 |
for row in rows: |
3285 | 3291 |
ComponentList.append((row[0])) # Components_UID |
내보내기 Unified diff