lihang
2023-04-25 3fade6d3b27f5666672bb3af610020367f790bda
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
package com.vci.ubcs.ddl.mapper;
 
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
 
/**
 * Description:sqlLite的数据库操作类
 *
 * @author LiHang
 * @date 2023/4/24
 */
@Repository
public interface DllSqlLiteMapper extends DllMapper {
    @Update({"${viewCreateSql}"})
    @ResultType(Integer.class)
    @Override
    int createViewBySql(@Param("viewCreateSql") String viewCreateSql);
 
    @Update({"create table ${tableName} ( ${attributeSql} )"})
    @ResultType(Integer.class)
    @Override
    int createTableBySql(@Param("tableName") String tableName, @Param("attributeSql") String attributeSql);
 
    @Select({"select count(name) from sqlite_master where upper(name) = upper(#{tableName,jdbcType=VARCHAR})"})
    @ResultType(Integer.class)
    @Override
    int checkTableExist(@Param("tableName") String tableName);
 
    @Select({"select count(*) from ${tableName}"})
    @ResultType(Integer.class)
    @Override
    int countAll(@Param("tableName") String tableName);
 
    @Select({"drop table ${tableName}"})
    @ResultType(Integer.class)
    @Override
    int dropTable(String tableName);
}