a
554325746@qq.com
2020-01-13 7171bbcdb2859ea93f3af69d817243752b08314a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-module(sql_cache_device).
-compile(export_all).
 
downloadSqlCache(LocalDeviceId, FromDeviceId) ->
  table_manager:createCacheTables(),
  Sql = "SELECT DISTINCT     a.uuid,     a.func,     a.sql,     a.create_time,     a.create_by
            FROM     SqlCache a LEFT JOIN sql_cache_device b ON a.uuid = b.sql_cache_id
            WHERE     1 = 1 AND a.create_by LIKE '"++LocalDeviceId++"@%'
            AND (     b.receive_device_id NOT LIKE '"++FromDeviceId++"@%'     OR b.receive_device_id IS NULL ) ORDER BY     a.create_time",
  {ok, DB} = esqlite3:open(database_name:getCacheDatabaseName()),
  Maps = syncToolEsql:selectInfoFromCache(DB, Sql),
  esqlite3:close(DB),
  Maps.
 
downloadSqlCacheConfirm(ConfirmSql)->
  table_manager:createCacheTables(),
  {ok, DB} = esqlite3:open(database_name:getCacheDatabaseName()),
  ok = esqlite3:exec(ConfirmSql, DB),
  esqlite3:close(DB),
  ok.