feat:取餐、订餐、广播
This commit is contained in:
1 parent
d5bfd91bc1
commit
e5100b46b1
10 files changed
+313
-4
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:floor/floor.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -18,12 +19,36 @@ abstract class BroadcastDao {
|
||||
return await database.rawUpdate(sql, []);
|
||||
}
|
||||
|
||||
Future<int> delByServiceCodes(
|
||||
List<String> codes,
|
||||
) async {
|
||||
if (ObjectUtil.isEmptyList(codes)) return 0;
|
||||
final appC = Get.find<AppControl>();
|
||||
final database = appC.dataBase.database;
|
||||
final placeholders = List.generate(codes.length, (index) => '?').join(', ');
|
||||
final sql = '''
|
||||
DELETE FROM broadcast
|
||||
WHERE
|
||||
serviceCode IN ($placeholders)
|
||||
AND strftime('%Y-%m-%d', saleDate) = strftime('%Y-%m-%d', 'now', 'localtime')
|
||||
''';
|
||||
return await database.rawDelete(sql, [...codes]);
|
||||
}
|
||||
|
||||
@insert
|
||||
Future<void> save(BroadcastEntity entity);
|
||||
|
||||
@insert
|
||||
Future<void> batchSave(List<BroadcastEntity> entitys);
|
||||
|
||||
@Query("""
|
||||
DELETE FROM broadcast
|
||||
WHERE
|
||||
isDone = 1
|
||||
AND (:serviceCode = '-1' OR serviceCode = :serviceCode)
|
||||
""")
|
||||
Future<void> del(String serviceCode);
|
||||
|
||||
@update
|
||||
Future<void> edit(BroadcastEntity entity);
|
||||
|
||||
|
||||
Reference in new issue
Block a user