stringdataQuery=$@"SELECT * FROM {tableName} WHERE AllotId = @AllotId and AccountingUnit = @accountingUnit and UnitType in @unitType order by UnitType,AccountingUnit LIMIT {(pageIndex-1)*pageSize},{pageSize} ";
stringcountQuery=$@"SELECT COUNT(*) FROM {tableName} WHERE AllotId = @AllotId and AccountingUnit = @accountingUnit and UnitType in @unitType ";
stringdataQuery;
stringcountQuery;
if(isView)
{
dataQuery=$@"SELECT * FROM {tableName} WHERE AllotId = @AllotId and `核算单元` = @accountingUnit and `核算单元类型` in @unitType order by `核算单元类型`,`核算单元` LIMIT {(pageIndex-1)*pageSize},{pageSize} ";
countQuery=$@"SELECT COUNT(*) FROM {tableName} WHERE AllotId = @AllotId and `核算单元` = @accountingUnit and `核算单元类型` in @unitType ";
}
else
{
dataQuery=$@"SELECT * FROM {tableName} WHERE AllotId = @AllotId and AccountingUnit = @accountingUnit and UnitType in @unitType order by UnitType,AccountingUnit LIMIT {(pageIndex-1)*pageSize},{pageSize} ";
countQuery=$@"SELECT COUNT(*) FROM {tableName} WHERE AllotId = @AllotId and AccountingUnit = @accountingUnit and UnitType in @unitType ";
sql=$@"SELECT * FROM {request.TableName} WHERE AllotId = @AllotId ";
else
sql=$@"SELECT * FROM {request.TableName} WHERE AllotId = @AllotId {Query} order by UnitType,AccountingUnit LIMIT {(request.PageIndex-1)*request.PageSize},{request.PageSize} ";
sql=$@"SELECT * FROM {request.TableName} WHERE AllotId = @AllotId {Query} order by {order} LIMIT {(request.PageIndex-1)*request.PageSize},{request.PageSize} ";
varsql=$@"SELECT column_name as Name,ifnull(column_comment,column_name) as comment FROM information_schema.`COLUMNS` WHERE table_schema = @table_schema AND table_name = @table_name AND COLUMN_KEY <> 'PRI' ";
varsql=$@"SELECT column_name AS NAME, IF(ifnull(column_comment, '')<> '', column_comment, column_name) AS COMMENT, TABLE_TYPE AS TABLETYPE FROM information_schema.`COLUMNS` t1 JOIN information_schema.`TABLES` t2 ON t1.table_schema = t2.table_schema AND t1.table_name = t2.table_name WHERE t1.table_schema = @table_schema AND t1.table_name = @table_name AND COLUMN_KEY <> 'PRI' ";