修改购买mixin

This commit is contained in:
dzc committed 2025-03-17 12:29:50 +08:00
1 parent d648272f0e
commit 321ae3378a
11 files changed
+113 -32

No files matched your search

+57 -7
View File
@@ -74,7 +74,11 @@ class _$AppDatabase extends AppDatabase {
OrderDao? _getOrderDaoInstance;
ProductDao? _getProductDaoInstance;
CanteenSpuDao? _getCanteenSpuDaoInstance;
SupermarketSkuDao? _getSupermarketSkuDaoInstance;
SupermarketSpuDao? _getSupermarketSpuDaoInstance;
ShopCardDao? _getShopCardDaoInstance;
@@ -142,8 +146,21 @@ class _$AppDatabase extends AppDatabase {
}
@override
ProductDao get getProductDao {
return _getProductDaoInstance ??= _$ProductDao(database, changeListener);
CanteenSpuDao get getCanteenSpuDao {
return _getCanteenSpuDaoInstance ??=
_$CanteenSpuDao(database, changeListener);
}
@override
SupermarketSkuDao get getSupermarketSkuDao {
return _getSupermarketSkuDaoInstance ??=
_$SupermarketSkuDao(database, changeListener);
}
@override
SupermarketSpuDao get getSupermarketSpuDao {
return _getSupermarketSpuDaoInstance ??=
_$SupermarketSpuDao(database, changeListener);
}
@override
@@ -442,8 +459,8 @@ class _$OrderDao extends OrderDao {
}
}
class _$ProductDao extends ProductDao {
_$ProductDao(
class _$CanteenSpuDao extends CanteenSpuDao {
_$CanteenSpuDao(
this.database,
this.changeListener,
) : _queryAdapter = QueryAdapter(database),
@@ -557,7 +574,7 @@ class _$ProductDao extends ProductDao {
String hourType,
) async {
return _queryAdapter.queryList(
'SELECT canteen_spu.* FROM canteen_spu LEFT JOIN classify ON canteen_spu.classifyServiceUniqueCode = classify.serviceUniqueCode WHERE canteen_spu.delFlag = 0 AND (?1 = \'-1\' OR canteen_spu.classifyServiceUniqueCode = ?1) AND (?2 = \'-1\' OR INSTR(\',\' || hourType || \',\', \',\' || ?2 || \',\') > 0) AND ORDER BY classify.sort, canteen_spu.price',
'SELECT canteen_spu.* FROM canteen_spu LEFT JOIN classify ON canteen_spu.classifyServiceUniqueCode = classify.serviceUniqueCode WHERE canteen_spu.delFlag = 0 AND (?1 = \'-1\' OR canteen_spu.classifyServiceUniqueCode = ?1) AND (?2 = \'-1\' OR INSTR(\',\' || hourType || \',\', \',\' || ?2 || \',\') > 0) ORDER BY classify.sort, canteen_spu.price',
mapper: (Map<String, Object?> row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeEmptyConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)),
arguments: [classifyServiceUniqueCode, hourType]);
}
@@ -570,7 +587,7 @@ class _$ProductDao extends ProductDao {
int offset,
) async {
return _queryAdapter.queryList(
'SELECT canteen_spu.* FROM canteen_spu LEFT JOIN classify ON canteen_spu.classifyServiceUniqueCode = classify.serviceUniqueCode WHERE canteen_spu.delFlag = 0 AND AND (?1 = \'-1\' OR canteen_spu.classifyServiceUniqueCode = ?1) AND (?2 = \'-1\' OR INSTR(\',\' || canteen_spu.hourType || \',\', \',\' || ?2 || \',\') > 0) AND strftime(\'%Y-%m-%d\', saleDate) = strftime(\'%Y-%m-%d\', \'now\', \'localtime\') ORDER BY classify.sort, classify.id, canteen_spu.price LIMIT ?3 OFFSET ?4',
'SELECT canteen_spu.* FROM canteen_spu LEFT JOIN classify ON canteen_spu.classifyServiceUniqueCode = classify.serviceUniqueCode WHERE canteen_spu.delFlag = 0 AND (?1 = \'-1\' OR canteen_spu.classifyServiceUniqueCode = ?1) AND (?2 = \'-1\' OR INSTR(\',\' || canteen_spu.hourType || \',\', \',\' || ?2 || \',\') > 0) AND strftime(\'%Y-%m-%d\', saleDate) = strftime(\'%Y-%m-%d\', \'now\', \'localtime\') ORDER BY classify.sort, classify.id, canteen_spu.price LIMIT ?3 OFFSET ?4',
mapper: (Map<String, Object?> row) => CanteenSpuEntity(id: row['id'] as int?, serviceUniqueCode: row['serviceUniqueCode'] as String, classifyServiceUniqueCode: row['classifyServiceUniqueCode'] as String, hourType: row['hourType'] == null ? null : ProductHourType.values[row['hourType'] as int], saleDate: _dateTimeEmptyConverter.decode(row['saleDate'] as String), name: row['name'] as String, price: row['price'] as int, image: row['image'] as String?, isDefault: _boolConverter.decode(row['isDefault'] as int), status: row['status'] as int, sort: row['sort'] as int, createTime: _dateTimeConverter.decode(row['createTime'] as String), updateTime: _dateTimeConverter.decode(row['updateTime'] as String), delFlag: _boolConverter.decode(row['delFlag'] as int)),
arguments: [classifyServiceUniqueCode, hourType, pageSize, offset]);
}
@@ -607,6 +624,39 @@ class _$ProductDao extends ProductDao {
}
}
class _$SupermarketSkuDao extends SupermarketSkuDao {
_$SupermarketSkuDao(
this.database,
this.changeListener,
);
final sqflite.DatabaseExecutor database;
final StreamController<String> changeListener;
}
class _$SupermarketSpuDao extends SupermarketSpuDao {
_$SupermarketSpuDao(
this.database,
this.changeListener,
) : _queryAdapter = QueryAdapter(database);
final sqflite.DatabaseExecutor database;
final StreamController<String> changeListener;
final QueryAdapter _queryAdapter;
@override
Future<List<SupermarketSpuEntity>> getAll(
String classifyServiceUniqueCode) async {
return _queryAdapter.queryList(
'SELECT supermarket_spu.* FROM supermarket_spu LEFT JOIN classify ON supermarket_spu.classifyServiceUniqueCode = classify.serviceUniqueCode WHERE supermarket_spu.delFlag = 0 AND (?1 = \'-1\' OR supermarket_spu.classifyServiceUniqueCode = ?1) ORDER BY classify.sort, supermarket_spu.price',
mapper: (Map<String, Object?> row) => SupermarketSpuEntity(id: row['id'] as int?),
arguments: [classifyServiceUniqueCode]);
}
}
class _$ShopCardDao extends ShopCardDao {
_$ShopCardDao(
this.database,